Commit c40ea1eaa6ac4eb6d4ca0d4c86492fe205535160

Authored by YunaiV
1 parent bba32c6b

📖 CRM:code review 商业智能的排行版

yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/bi/CrmBiRankingMapper.java
... ... @@ -77,4 +77,5 @@ public interface CrmBiRankingMapper {
77 77 * @return 跟进客户数排行榜
78 78 */
79 79 List<CrmBiRanKRespVO> selectFollowCustomerCountRank(CrmBiRankReqVO rankReqVO);
  80 +
80 81 }
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/bi/CrmBiRankingService.java
... ... @@ -76,4 +76,5 @@ public interface CrmBiRankingService {
76 76 * @return 跟进客户数排行榜
77 77 */
78 78 List<CrmBiRanKRespVO> getFollowCustomerCountRank(CrmBiRankReqVO rankReqVO);
  79 +
79 80 }
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/bi/CrmBiRankingMapper.xml
... ... @@ -13,7 +13,7 @@
13 13 #{userId}
14 14 </foreach>
15 15 AND order_date between #{times[0],javaType=java.time.LocalDateTime} and
16   - #{times[1],javaType=java.time.LocalDateTime}
  16 + #{times[1],javaType=java.time.LocalDateTime}
17 17 GROUP BY owner_user_id
18 18 </select>
19 19  
... ... @@ -28,7 +28,7 @@
28 28 #{userId}
29 29 </foreach>
30 30 AND return_time between #{times[0],javaType=java.time.LocalDateTime} and
31   - #{times[1],javaType=java.time.LocalDateTime}
  31 + #{times[1],javaType=java.time.LocalDateTime}
32 32 GROUP BY owner_user_id
33 33 </select>
34 34  
... ... @@ -43,7 +43,7 @@
43 43 #{userId}
44 44 </foreach>
45 45 AND order_date between #{times[0],javaType=java.time.LocalDateTime} and
46   - #{times[1],javaType=java.time.LocalDateTime}
  46 + #{times[1],javaType=java.time.LocalDateTime}
47 47 GROUP BY owner_user_id
48 48 </select>
49 49  
... ... @@ -59,7 +59,7 @@
59 59 #{userId}
60 60 </foreach>
61 61 AND order_date between #{times[0],javaType=java.time.LocalDateTime} and
62   - #{times[1],javaType=java.time.LocalDateTime}
  62 + #{times[1],javaType=java.time.LocalDateTime}
63 63 GROUP BY owner_user_id
64 64 </select>
65 65  
... ... @@ -73,7 +73,7 @@
73 73 #{userId}
74 74 </foreach>
75 75 AND create_time between #{times[0],javaType=java.time.LocalDateTime} and
76   - #{times[1],javaType=java.time.LocalDateTime}
  76 + #{times[1],javaType=java.time.LocalDateTime}
77 77 GROUP BY owner_user_id
78 78 </select>
79 79  
... ... @@ -87,14 +87,15 @@
87 87 #{userId}
88 88 </foreach>
89 89 AND create_time between #{times[0],javaType=java.time.LocalDateTime} and
90   - #{times[1],javaType=java.time.LocalDateTime}
  90 + #{times[1],javaType=java.time.LocalDateTime}
91 91 GROUP BY owner_user_id
92 92 </select>
93 93  
94 94 <select id="selectFollowCountRank"
95 95 resultType="cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRanKRespVO">
96 96 SELECT COUNT(1) AS count, cc.owner_user_id
97   - FROM crm_follow_up_record AS cfur LEFT JOIN crm_contact AS cc ON FIND_IN_SET(cc.id, cfur.contact_ids)
  97 + FROM crm_follow_up_record AS cfur
  98 + LEFT JOIN crm_contact AS cc ON FIND_IN_SET(cc.id, cfur.contact_ids)
98 99 WHERE cfur.deleted = 0
99 100 AND cc.deleted = 0
100 101 AND cc.owner_user_id in
... ... @@ -102,14 +103,15 @@
102 103 #{userId}
103 104 </foreach>
104 105 AND cfur.create_time between #{times[0],javaType=java.time.LocalDateTime} and
105   - #{times[1],javaType=java.time.LocalDateTime}
  106 + #{times[1],javaType=java.time.LocalDateTime}
106 107 GROUP BY cc.owner_user_id
107 108 </select>
108 109  
109 110 <select id="selectFollowCustomerCountRank"
110 111 resultType="cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRanKRespVO">
111 112 SELECT COUNT(DISTINCT cc.id) AS count, cc.owner_user_id
112   - FROM crm_follow_up_record AS cfur LEFT JOIN crm_contact AS cc ON FIND_IN_SET(cc.id, cfur.contact_ids)
  113 + FROM crm_follow_up_record AS cfur
  114 + LEFT JOIN crm_contact AS cc ON FIND_IN_SET(cc.id, cfur.contact_ids)
113 115 WHERE cfur.deleted = 0
114 116 AND cc.deleted = 0
115 117 AND cc.owner_user_id in
... ... @@ -117,7 +119,7 @@
117 119 #{userId}
118 120 </foreach>
119 121 AND cfur.create_time between #{times[0],javaType=java.time.LocalDateTime} and
120   - #{times[1],javaType=java.time.LocalDateTime}
  122 + #{times[1],javaType=java.time.LocalDateTime}
121 123 GROUP BY cc.owner_user_id
122 124 </select>
123 125  
... ...