Sfoglia il codice sorgente

线索通过客户级别排序

Guo1B0 11 mesi fa
parent
commit
73ee428afa

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java

@@ -187,7 +187,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
             String executorId = task.getExecutorId();
             List<String> ids1 = new ArrayList<>();
             List<String> userNames = new ArrayList<>();
-            if (!executorId.isEmpty()) {
+            if (executorId != null) {
                 for (String id : executorId.split(",")) {
                     ids1.add(id);
                 }

+ 16 - 17
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueMapper.xml

@@ -178,7 +178,7 @@
     <select id="list2" resultType="com.management.platform.entity.Clue">
         select c.id,
         c.company_id,
-        (select company_name from company where company_id = c.id) companyName,
+        (select company_name from company where c.company_id = c.id) companyName,
         c.clue_name,
         c.clue_source_id,
         c.phone,
@@ -204,7 +204,7 @@
         from clue c
         left join sys_dict sd on c.customer_level_id = sd.id
         where
-        c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
+        c.company_id = #{clue.companyId} and c.is_delete = #{clue.isDelete}
         and (c.incharger_id = #{userId} or c.incharger_id is null)
         <if test="clue.inchargerId != null and clue.inchargerId != ''  ">
           and c.incharger_id =#{clue.inchargerId}
@@ -232,13 +232,13 @@
         </if>
         ORDER BY
         <choose>
-            <when test="isDesc == null or isDesc == ''">
+            <when test="clue.isDesc == null or clue.isDesc == ''">
                 c.id DESC
             </when>
-            <when test="isDesc == 0">
+            <when test="clue.isDesc == 0">
                 sd.seq ASC, c.id DESC
             </when>
-            <when test="isDesc == 1">
+            <when test="clue.isDesc == 1">
                 sd.seq DESC, c.id DESC
             </when>
             <otherwise>
@@ -313,35 +313,34 @@
     </select>
     <select id="getTotal2" resultType="java.lang.Integer">
         select
-        COUNT(c.id)
+            count(c.id)
         from clue c
         where
-        c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
+        c.company_id = #{clue.companyId} and c.is_delete = #{clue.isDelete}
+        and (c.incharger_id = #{userId} or c.incharger_id is null)
         <if test="clue.inchargerId != null and clue.inchargerId != ''  ">
-          and  c.incharger_id =#{clue.inchargerId}
+            and c.incharger_id =#{clue.inchargerId}
         </if>
-        and c.incharger_id = #{userId} and c.incharger_id is null
         <if test="clue.startTime != null and clue.endTime != null ">
-            and c.create_time BETWEEN #{clue.startTime} and #{clue.endTime}
+            and  c.create_time BETWEEN  #{clue.startTime} and #{clue.endTime}
         </if>
         <if test="clue.clueName != null and clue.clueName != '' ">
-            and c.clue_name LIKE CONCAT('%', #{clue.clueName}, '%')
+            and  c.clue_name  LIKE CONCAT('%', #{clue.clueName}, '%')
         </if>
         <if test="clue.phone != null and clue.phone != '' ">
             and  c.phone LIKE CONCAT('%', #{clue.phone}, '%')
         </if>
-        <if test="clue.email != null and clue.email != '' ">
-            and  c.email LIKE CONCAT('%', #{clue.email}, '%')
-        </if>
-
         <if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
             and  c.customer_level_id =  #{clue.customerLevelId}
         </if>
+        <if test="clue.email != null and clue.email != '' ">
+            and  c.email LIKE CONCAT('%', #{clue.email}, '%')
+        </if>
         <if test="clue.clueSourceId != null">
-            and c.clue_source_id = #{clue.clueSourceId}
+            and  c.clue_source_id =  #{clue.clueSourceId}
         </if>
         <if test="clue.customerIndustryId != null">
-            and c.customer_industry_id = #{clue.customerIndustryId}
+            and  c.customer_industry_id =  #{clue.customerIndustryId}
         </if>
     </select>