lmx пре 1 месец
родитељ
комит
ce32275e8b

+ 6 - 0
fs-service/src/main/java/com/fs/company/domain/CrmCustomerCallLog.java

@@ -150,4 +150,10 @@ public class CrmCustomerCallLog extends BaseEntity {
      */
     @Excel(name = "外呼类型")
     private Integer callType;
+
+    /**
+     * 查询条件:最小通话时长(秒),仅过滤 call_time > minCallTime 的记录;传 0 即可筛选“已接通”
+     * 非持久化字段,insert SQL 使用显式字段列表,不受影响
+     */
+    private Long minCallTime;
 }

+ 9 - 1
fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerMapper.java

@@ -287,7 +287,9 @@ public interface CrmCustomerMapper extends BaseMapper<CrmCustomer> {
 
 
     @Select({"<script> " +
-            "select cu.*,c.create_time as customer_create_time,c.visit_status,c.remark,c.register_desc,c.register_submit_time,c.customer_code,c.customer_name,c.mobile,c.sex,c.weixin,c.address,c.is_receive,c.customer_type,c.source,c.tags,c.receive_time from crm_customer_user cu inner join crm_customer c on c.customer_user_id=cu.customer_user_id " +
+            "select cu.*,c.create_time as customer_create_time,c.visit_status,c.remark,c.register_desc,c.register_submit_time,c.customer_code,c.customer_name,c.mobile,c.sex,c.weixin,c.address,c.is_receive,c.customer_type,c.source,c.tags,c.receive_time," +
+            "(select ifnull(count(1),0) from crm_customer_call_log ccl where ccl.customer_id=c.customer_id and ccl.call_time &gt; 0) as manual_call_count " +
+            "from crm_customer_user cu inner join crm_customer c on c.customer_user_id=cu.customer_user_id " +
             "where cu.is_pool=0 " +
             "<if test = 'maps.companyId != null     '> " +
             "and cu.company_id =#{maps.companyId} " +
@@ -317,6 +319,12 @@ public interface CrmCustomerMapper extends BaseMapper<CrmCustomer> {
             "<if test = 'maps.isHisOrder != null and maps.isHisOrder==0      '> " +
             "and (select ifnull(count(1),0) from crm_customer_his_order h where h.customer_id=c.customer_id )  = 0 " +
             "</if>" +
+            "<if test = 'maps.isManualCall != null and maps.isManualCall==1      '> " +
+            "and (select ifnull(count(1),0) from crm_customer_call_log ccl where ccl.customer_id=c.customer_id and ccl.call_time &gt; 0)  &gt; 0 " +
+            "</if>" +
+            "<if test = 'maps.isManualCall != null and maps.isManualCall==0      '> " +
+            "and (select ifnull(count(1),0) from crm_customer_call_log ccl where ccl.customer_id=c.customer_id and ccl.call_time &gt; 0)  = 0 " +
+            "</if>" +
             "<if test = 'maps.customerType != null      '> " +
             "and c.customer_type IN " +
             "<foreach collection=\"maps.customerType.split(',')\"  item='item' index='index'  open='(' separator=',' close=')'> #{item} </foreach>"+

+ 3 - 0
fs-service/src/main/java/com/fs/crm/param/CrmMyCustomerListQueryParam.java

@@ -92,6 +92,9 @@ public class CrmMyCustomerListQueryParam extends BaseQueryParam
 
     private Integer isHisOrder;
 
+    /** 是否已手动外呼,1-已外呼,0-未外呼 */
+    private Integer isManualCall;
+
     private String corpId;
     /** 客户级别 */
     private Long customerLevel;

+ 3 - 0
fs-service/src/main/java/com/fs/crm/vo/CrmMyCustomerListQueryVO.java

@@ -138,4 +138,7 @@ public class CrmMyCustomerListQueryVO implements Serializable
 
     @Excel(name = "最新跟进内容")
     private String visitContent;
+
+    /** 手动外呼次数 */
+    private Integer manualCallCount;
 }

+ 1 - 0
fs-service/src/main/resources/mapper/company/CrmCustomerCallLogMapper.xml

@@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyId != null">AND company_id = #{companyId}</if>
             <if test="companyUserId != null">AND company_user_id = #{companyUserId}</if>
             <if test="status != null">AND status = #{status}</if>
+            <if test="minCallTime != null">AND call_time &gt; #{minCallTime}</if>
         </where>
         order by create_time desc
     </select>