|
|
@@ -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 > 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 > 0) > 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 > 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>"+
|