mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-12-02 04:01:52 +08:00
fix: [CRM-客户统计]按客户创建时间筛选,关联合同是否有成交记录,有则视为[成交客户]
This commit is contained in:
parent
1944199f67
commit
e18d26d8a6
@ -18,17 +18,18 @@
|
|||||||
|
|
||||||
<select id="selectCustomerDealCountGroupByDate"
|
<select id="selectCustomerDealCountGroupByDate"
|
||||||
resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.customer.CrmStatisticsCustomerSummaryByDateRespVO">
|
resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.customer.CrmStatisticsCustomerSummaryByDateRespVO">
|
||||||
SELECT DATE_FORMAT(order_date, '%Y-%m-%d') AS time,
|
SELECT DATE_FORMAT(customer.create_time, '%Y-%m-%d') AS time,
|
||||||
COUNT(DISTINCT customer_id) AS customerDealCount
|
COUNT(DISTINCT customer.id) AS customer_deal_count
|
||||||
FROM crm_contract
|
FROM crm_customer AS customer
|
||||||
WHERE deleted = 0
|
LEFT JOIN crm_contract AS contract ON contract.customer_id = customer.id
|
||||||
AND audit_status = ${@cn.iocoder.yudao.module.crm.enums.common.CrmAuditStatusEnum@APPROVE.status}
|
WHERE customer.deleted = 0 AND contract.deleted = 0
|
||||||
AND owner_user_id IN
|
AND contract.audit_status = ${@cn.iocoder.yudao.module.crm.enums.common.CrmAuditStatusEnum@APPROVE.status}
|
||||||
|
AND customer.owner_user_id IN
|
||||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND create_time BETWEEN #{times[0],javaType=java.time.LocalDateTime} AND #{times[1],javaType=java.time.LocalDateTime}
|
AND contract.create_time BETWEEN #{times[0],javaType=java.time.LocalDateTime} AND #{times[1],javaType=java.time.LocalDateTime}
|
||||||
GROUP BY time
|
GROUP BY time
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCustomerCreateCountGroupByUser"
|
<select id="selectCustomerCreateCountGroupByUser"
|
||||||
|
Loading…
Reference in New Issue
Block a user