傅行帆 5 lat temu
rodzic
commit
379879a47b

+ 2
- 0
src/main/java/com/huiju/estateagents/statistic/entity/GenderStatistic.java Wyświetl plik

@@ -24,4 +24,6 @@ public class GenderStatistic {
24 24
 	private Integer unknownSum;
25 25
 	
26 26
 	private BigDecimal unknownPct;
27
+	
28
+	private String realtyConsultant;
27 29
 }

+ 5
- 0
src/main/java/com/huiju/estateagents/statistic/entity/TsCustomerGenderStatistic.java Wyświetl plik

@@ -65,4 +65,9 @@ public class TsCustomerGenderStatistic implements Serializable {
65 65
      * 客户类型 visite 到访客户, new 新增客户 ,follow跟进客户
66 66
      */
67 67
     private String customerType;
68
+    
69
+    /**
70
+     * 置业顾问ID
71
+     */
72
+    private String realtyConsultant;
68 73
 }

+ 5
- 2
src/main/java/com/huiju/estateagents/statistic/entity/TsCustomerStatisticDaily.java Wyświetl plik

@@ -56,6 +56,9 @@ public class TsCustomerStatisticDaily implements Serializable {
56 56
      * 日期 格式yyyymmdd例20191111
57 57
      */
58 58
     private String day;
59
-
60
-
59
+    
60
+    /**
61
+     * 置业顾问ID
62
+     */
63
+    private String realtyConsultant;
61 64
 }

+ 5
- 2
src/main/java/com/huiju/estateagents/statistic/entity/TsCustomerStatisticMonthly.java Wyświetl plik

@@ -61,6 +61,9 @@ public class TsCustomerStatisticMonthly implements Serializable {
61 61
      * 更新时间
62 62
      */
63 63
     private LocalDateTime updateDate;
64
-
65
-
64
+    
65
+    /**
66
+     * 置业顾问ID
67
+     */
68
+    private String realtyConsultant;
66 69
 }

+ 3
- 0
src/main/java/com/huiju/estateagents/statistic/service/impl/TsCustomerGenderStatisticServiceImpl.java Wyświetl plik

@@ -94,6 +94,7 @@ public class TsCustomerGenderStatisticServiceImpl extends ServiceImpl<TsCustomer
94 94
 			maleCustomer.setCustomerNum(e.getManSum());
95 95
 			maleCustomer.setPercentage(e.getManPct());
96 96
 			maleCustomer.setOrgId(e.getOrgId());
97
+			maleCustomer.setRealtyConsultant(e.getRealtyConsultant());
97 98
 			list.add(maleCustomer);
98 99
 			
99 100
 			TsCustomerGenderStatistic femaleCustomer = new TsCustomerGenderStatistic();
@@ -103,6 +104,7 @@ public class TsCustomerGenderStatisticServiceImpl extends ServiceImpl<TsCustomer
103 104
 			femaleCustomer.setCustomerNum(e.getWomanSum());
104 105
 			femaleCustomer.setPercentage(e.getWomanPct());
105 106
 			femaleCustomer.setOrgId(e.getOrgId());
107
+			femaleCustomer.setRealtyConsultant(e.getRealtyConsultant());
106 108
 			list.add(femaleCustomer);
107 109
 			
108 110
 			TsCustomerGenderStatistic unknownCustomer = new TsCustomerGenderStatistic();
@@ -112,6 +114,7 @@ public class TsCustomerGenderStatisticServiceImpl extends ServiceImpl<TsCustomer
112 114
 			unknownCustomer.setCustomerNum(e.getUnknownSum());
113 115
 			unknownCustomer.setPercentage(e.getUnknownPct());
114 116
 			unknownCustomer.setOrgId(e.getOrgId());
117
+			unknownCustomer.setRealtyConsultant(e.getRealtyConsultant());
115 118
 			list.add(unknownCustomer);
116 119
 		});
117 120
 		//批量插入

+ 6
- 4
src/main/resources/mapper/statistic/TsCustomerGenderStatisticMapper.xml Wyświetl plik

@@ -4,7 +4,7 @@
4 4
 
5 5
     <select id="getNewCustomerSexCount" resultType="com.huiju.estateagents.statistic.entity.GenderStatistic">
6 6
         SELECT
7
-            org_id,
7
+            org_id,realty_consultant,
8 8
             sum(if(sex = 1,1,0)) as man_sum,
9 9
             sum(if(sex = 1,1,0))/count(*) as man_pct,
10 10
             sum(if(sex = 2,1,0)) as woman_sum,
@@ -15,11 +15,12 @@
15 15
             ta_recommend_customer
16 16
         WHERE
17 17
             `STATUS` = 1
18
-            GROUP BY org_id
18
+            GROUP BY org_id,realty_consultant
19 19
     </select>
20 20
     <select id="getFollowUpSexCount" resultType="com.huiju.estateagents.statistic.entity.GenderStatistic">
21 21
         SELECT
22 22
             t.org_id,
23
+            t.follower_id as realty_consultant,
23 24
             sum( IF ( t.customer_sex = 1, 1, 0 ) ) AS manSum,
24 25
             sum( IF ( t.customer_sex = 1, 1, 0 ) ) / count( * ) AS manPct,
25 26
             sum( IF ( t.customer_sex = 2, 1, 0 ) ) AS womanSum,
@@ -29,11 +30,12 @@
29 30
         FROM
30 31
             ( SELECT * FROM ta_customer_follow_up_record GROUP BY customer_id ) t
31 32
         GROUP BY
32
-            t.org_id
33
+            t.org_id,t.follower_id
33 34
     </select>
34 35
     <select id="getVisiteSexCount" resultType="com.huiju.estateagents.statistic.entity.GenderStatistic">
35 36
         SELECT
36 37
             d.org_id,
38
+            d.realty_consultant,
37 39
             sum( IF ( d.sex = 1, 1, 0 ) ) AS manSum,
38 40
             sum( IF ( d.sex = 1, 1, 0 ) ) / count( * ) AS manPct,
39 41
             sum( IF ( d.sex = 2, 1, 0 ) ) AS womanSum,
@@ -56,6 +58,6 @@
56 58
                     c.customer_id
57 59
             ) d
58 60
         GROUP BY
59
-            d.org_id
61
+            d.org_id,d.realty_consultant
60 62
     </select>
61 63
 </mapper>

+ 9
- 6
src/main/resources/mapper/statistic/TsCustomerStatisticDailyMapper.xml Wyświetl plik

@@ -11,31 +11,34 @@
11 11
     <select id="getFollowUpData" resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily">
12 12
         SELECT
13 13
             org_id,
14
-            count( DISTINCT ( customer_id ) ) as customer_num
14
+            count( DISTINCT ( customer_id ) ) as customer_num,
15
+            follower_id AS realty_consultant
15 16
         FROM
16 17
             ta_customer_follow_up_record
17 18
         WHERE
18 19
             date_format( create_date, '%Y-%m-%d' ) = date_format( #{nowDate}, '%Y-%m-%d' )
19 20
         GROUP BY
20
-            org_id
21
+            org_id,follower_id
21 22
     </select>
22 23
 
23 24
     <select id="getNewCustomerData" resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily">
24 25
         SELECT
25 26
             org_id,
26
-            count( customer_id ) as customer_num
27
+            count( customer_id ) as customer_num,
28
+			realty_consultant
27 29
         FROM
28 30
             ta_recommend_customer
29 31
         WHERE
30 32
             `STATUS` = #{status}
31 33
             AND date_format( create_date, '%Y-%m-%d' ) = date_format( #{nowDate}, '%Y-%m-%d' )
32 34
         GROUP BY
33
-            org_id
35
+            org_id,realty_consultant
34 36
     </select>
35 37
     <select id="getVisiteCustomerData" resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily">
36 38
         SELECT
37 39
             count( DISTINCT ( c.customer_id ) ) as customer_num,
38
-            c.org_id
40
+            c.org_id,
41
+			c.realty_consultant
39 42
         FROM
40 43
             ta_activity_dynamic_enlist t
41 44
             LEFT JOIN ta_recommend_customer c ON t.person_id = c.person_id
@@ -45,7 +48,7 @@
45 48
             t.is_checkin = #{checkin}
46 49
             AND date_format( t.create_date, '%Y-%m-%d' ) = date_format( #{nowDate}, '%Y-%m-%d' )
47 50
         GROUP BY
48
-            c.org_id
51
+            c.org_id,c.realty_consultant
49 52
     </select>
50 53
 
51 54
     <select id="getDailyList" resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticDaily">

+ 9
- 6
src/main/resources/mapper/statistic/TsCustomerStatisticMonthlyMapper.xml Wyświetl plik

@@ -6,33 +6,36 @@
6 6
             resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
7 7
         SELECT
8 8
             org_id,
9
-            count( customer_id ) as customer_num
9
+            count( customer_id ) as customer_num,
10
+            realty_consultant
10 11
         FROM
11 12
             ta_recommend_customer
12 13
         WHERE
13 14
             `STATUS` = #{status}
14 15
             AND date_format( create_date, '%Y-%m' ) = date_format( #{nowDate}, '%Y-%m' )
15 16
         GROUP BY
16
-            org_id
17
+            org_id,realty_consultant
17 18
     </select>
18 19
 
19 20
     <select id="getFollowUpStatisticMonthly"
20 21
             resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
21 22
         SELECT
22 23
             org_id,
23
-            count( DISTINCT ( customer_id ) ) as customer_num
24
+            count( DISTINCT ( customer_id ) ) as customer_num,
25
+            follower_id AS realty_consultant
24 26
         FROM
25 27
             ta_customer_follow_up_record
26 28
         WHERE
27 29
             date_format( create_date, '%Y-%m' ) = date_format( #{nowDate}, '%Y-%m' )
28 30
         GROUP BY
29
-            org_id
31
+            org_id,follower_id
30 32
     </select>
31 33
     <select id="getVisiteStatisticMonthly"
32 34
             resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
33 35
         SELECT
34 36
             count( DISTINCT ( c.customer_id ) ) as customer_num,
35
-            c.org_id
37
+            c.org_id,
38
+            c.realty_consultant
36 39
         FROM
37 40
             ta_activity_dynamic_enlist t
38 41
             LEFT JOIN ta_recommend_customer c ON t.person_id = c.person_id
@@ -42,7 +45,7 @@
42 45
             t.is_checkin = #{checkin}
43 46
             AND date_format( t.create_date, '%Y-%m' ) = date_format( #{nowDate}, '%Y-%m' )
44 47
         GROUP BY
45
-            c.org_id
48
+            c.org_id,c.realty_consultant
46 49
     </select>
47 50
     <select id="getMonthlyList" resultType="com.huiju.estateagents.statistic.entity.TsCustomerStatisticMonthly">
48 51
         SELECT