魏超 hace 5 años
padre
commit
d78f0472fb

+ 3
- 0
src/main/java/com/huiju/estateagents/entity/TaPerson.java Ver fichero

@@ -316,15 +316,18 @@ public class TaPerson implements Serializable {
316 316
     /**
317 317
      * 访问内容类型
318 318
      */
319
+    @TableField(exist = false)
319 320
     private String targetType;
320 321
 
321 322
     /**
322 323
      * 访问内容ID
323 324
      */
325
+    @TableField(exist = false)
324 326
     private String targetId;
325 327
 
326 328
     /**
327 329
      * 访问内容名称
328 330
      */
331
+    @TableField(exist = false)
329 332
     private String targetName;
330 333
 }

+ 2
- 0
src/main/java/com/huiju/estateagents/excel/ActivityStatistics/ActivityDetailShareRecord.java Ver fichero

@@ -1,5 +1,6 @@
1 1
 package com.huiju.estateagents.excel.ActivityStatistics;
2 2
 
3
+import com.alibaba.excel.annotation.ExcelIgnore;
3 4
 import com.alibaba.excel.annotation.ExcelProperty;
4 5
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
5 6
 import lombok.Data;
@@ -7,6 +8,7 @@ import lombok.Data;
7 8
 @Data
8 9
 public class ActivityDetailShareRecord {
9 10
 
11
+    @ExcelIgnore
10 12
     private String activityId;
11 13
 
12 14
     /**

+ 2
- 0
src/main/java/com/huiju/estateagents/excel/ActivityStatistics/ShareNum.java Ver fichero

@@ -1,5 +1,6 @@
1 1
 package com.huiju.estateagents.excel.ActivityStatistics;
2 2
 
3
+import com.alibaba.excel.annotation.ExcelIgnore;
3 4
 import com.alibaba.excel.annotation.ExcelProperty;
4 5
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
5 6
 import lombok.Data;
@@ -43,5 +44,6 @@ public class ShareNum {
43 44
     @ExcelProperty(value = "访问人数", index = 4)
44 45
     private Integer visitPersonNum;
45 46
 
47
+    @ExcelIgnore
46 48
     private String sharePersonId;
47 49
 }

+ 2
- 0
src/main/java/com/huiju/estateagents/excel/ActivityStatistics/SharePersonNum.java Ver fichero

@@ -1,5 +1,6 @@
1 1
 package com.huiju.estateagents.excel.ActivityStatistics;
2 2
 
3
+import com.alibaba.excel.annotation.ExcelIgnore;
3 4
 import com.alibaba.excel.annotation.ExcelProperty;
4 5
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
5 6
 import lombok.Data;
@@ -48,5 +49,6 @@ public class SharePersonNum {
48 49
     @ExcelProperty(value = "访问次数", index = 5)
49 50
     private Integer visitNum;
50 51
 
52
+    @ExcelIgnore
51 53
     private String personId;
52 54
 }

+ 0
- 1
src/main/java/com/huiju/estateagents/service/impl/TaShareServiceImpl.java Ver fichero

@@ -71,7 +71,6 @@ public class TaShareServiceImpl extends ServiceImpl<TaShareMapper, TaShare> impl
71 71
             taBuildingDynamicQuery.eq("dynamic_id",id);
72 72
             TaBuildingDynamic taBuildingDynamic = taBuildingDynamicMapper.selectOne(taBuildingDynamicQuery);
73 73
             taBuildingDynamicMapper.updateById( taBuildingDynamic.setShareNum(taBuildingDynamic.getShareNum() == null ? 1:taBuildingDynamic.getShareNum()+1));
74
-//            return ResponseBean.success("成功");
75 74
         }
76 75
 
77 76
         TaShareCount taShareCount = new TaShareCount();

+ 129
- 87
src/main/resources/mapper/statistic/TaActivityStaticMapper.xml Ver fichero

@@ -163,36 +163,43 @@
163 163
             </trim>
164 164
         ) AS temp_date
165 165
         LEFT JOIN (
166
-                select temp1.user_count, temp1.create_date from (
167
-                SELECT COUNT( 1 ) AS user_count, t.create_date AS create_date, t.person_id
168
-                FROM
169
-                ta_share_count t
170
-                left join ta_help_activity a on t.be_share = a.help_activity_id
171
-                left join ta_share_activity b on t.be_share = b.share_id
172
-                left join ta_live_activity c on t.be_share = c.live_activity_id
173
-                left join ta_drainage d on t.be_share = d.drainage_id
174
-                left join ta_building_dynamic e on t.be_share = e.dynamic_id
175
-                left join ta_person f on t.person_id = f.person_id
176
-                WHERE
177
-                t.tagert_type in ('activity','group','h5','help','liveApp','livePost') and t.org_id = #{orgId}
178
-                <if test="buildingId != null and buildingId != ''">
179
-                    and (a.building_id = #{buildingId} or b.building_id = #{buildingId} or c.building_id = #{buildingId} or d.building_id = #{buildingId} or e.building_id = #{buildingId})
180
-                </if>
181
-                <if test="targetType != null and targetType != ''">
182
-                    and t.tagert_type = #{targetType}
183
-                </if>
184
-                <if test="startDate != null ">
185
-                    and t.create_date &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
186
-                </if>
187
-                <if test="endDate != null ">
188
-                    and t.create_date &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S' )
189
-                </if>
190
-                <if test="startDate == null or endDate == null ">
191
-                    AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
192
-                </if>
193
-                GROUP BY t.person_id
194
-                ) as temp1
195
-            ) AS temp ON temp_date.date = DATE_FORMAT( temp.create_date, '%Y-%m-%d' )
166
+            SELECT count(1) as user_count , temp1.*
167
+            FROM (
168
+            SELECT DISTINCT(t.person_id),t.create_date
169
+            FROM ta_share_count t
170
+            LEFT JOIN ta_help_activity a
171
+            ON t.be_share = a.help_activity_id
172
+            LEFT JOIN ta_share_activity b
173
+            ON t.be_share = b.share_id
174
+            LEFT JOIN ta_live_activity c
175
+            ON t.be_share = c.live_activity_id
176
+            LEFT JOIN ta_drainage d
177
+            ON t.be_share = d.drainage_id
178
+            LEFT JOIN ta_building_dynamic e
179
+            ON t.be_share = e.dynamic_id
180
+            LEFT JOIN ta_person f
181
+            ON t.person_id = f.person_id
182
+            WHERE
183
+            t.tagert_type in ('activity','group','h5','help','liveApp','livePost') and t.org_id = #{orgId}
184
+            <if test="buildingId != null and buildingId != ''">
185
+                and (a.building_id = #{buildingId} or b.building_id = #{buildingId} or c.building_id = #{buildingId} or d.building_id = #{buildingId} or e.building_id = #{buildingId})
186
+            </if>
187
+            <if test="targetType != null and targetType != ''">
188
+                and t.tagert_type = #{targetType}
189
+            </if>
190
+            <if test="startDate != null ">
191
+                and t.create_date &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
192
+            </if>
193
+            <if test="endDate != null ">
194
+                and t.create_date &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S' )
195
+            </if>
196
+            <if test="startDate == null or endDate == null ">
197
+                AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
198
+            </if>
199
+            GROUP BY DATE_FORMAT( t.create_date, '%Y-%m-%d' ) ,t.person_id
200
+            ) as temp1  GROUP BY DATE_FORMAT( temp1.create_date, '%Y-%m-%d' )
201
+        ) AS temp1 ON temp_date.date = DATE_FORMAT( temp1.create_date, '%Y-%m-%d' )
202
+
196 203
         ) AS share_person_count_table
197 204
 
198 205
         group by date order by date
@@ -229,7 +236,7 @@
229 236
             and t.building_id =  #{buildingId}
230 237
         </if>
231 238
         <if test="targetType != null and targetType != ''">
232
-            and t.target_type =  #{targetType}
239
+            and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{targetType} end)
233 240
         </if>
234 241
         <if test="startDate != null">
235 242
             and t.visit_time &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
@@ -279,7 +286,7 @@
279 286
                 and t.building_id =  #{buildingId}
280 287
             </if>
281 288
             <if test="targetType != null and targetType != ''">
282
-                and t.target_type =  #{targetType}
289
+                and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{targetType} end)
283 290
             </if>
284 291
             <if test="startDate != null">
285 292
                 and t.visit_time &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
@@ -300,11 +307,8 @@
300 307
 
301 308
     <select id="selectAddRegistCount" resultType="java.util.Map">
302 309
         SELECT
303
-        addRegist_count_table.date AS date,
304
-        ifnull( addRegist_count_table.user_count, 0 ) AS addRegist_count
305
-        FROM (
306
-        SELECT
307
-        *
310
+        date,
311
+        ifnull( addRegistNum, 0 ) AS addRegist_count
308 312
         FROM
309 313
         (
310 314
         SELECT
@@ -319,16 +323,24 @@
319 323
         ) AS temp_date
320 324
         LEFT JOIN (
321 325
         SELECT
322
-        COUNT( 1 ) AS user_count,
323
-        t.create_date AS create_date
326
+        count( * ) AS addRegistNum,
327
+        temp4.*
328
+        FROM
329
+        (
330
+        SELECT
331
+        t.create_date AS create_date,
332
+        t.person_id
324 333
         FROM
325 334
         ta_share_person_from t
326 335
         WHERE
327
-        t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share') and t.org_id = #{orgId}
336
+        t.target_type IN ( 'dynamic_share', 'h5_share', 'help_share', 'live_share', 'group_share' )
337
+        AND t.org_id = #{orgId}
338
+        AND t.STATUS = 1
339
+        and t.is_first_time = 1
328 340
         <if test="buildingId != null and buildingId != ''">
329 341
             and t.building_id =  #{buildingId}
330 342
         </if>
331
-        and t.status = 1
343
+        and t.status = 1 and t.is_first_time = 1
332 344
         <if test="targetType != null and targetType != ''">
333 345
             and t.target_type =  #{targetType}
334 346
         </if>
@@ -342,11 +354,16 @@
342 354
             AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
343 355
         </if>
344 356
         GROUP BY
345
-        DATE_FORMAT( t.create_date, '%Y-%m-%d' ) ,t.person_id, t.target_type
346
-        ) AS temp ON temp_date.date = DATE_FORMAT( temp.create_date, '%Y-%m-%d' )
347
-        ) AS addRegist_count_table
348
-
349
-        group by date order by date
357
+        t.person_id,
358
+        t.target_type
359
+        ) AS temp4
360
+        GROUP BY
361
+        DATE_FORMAT( temp4.create_date, '%Y-%m-%d' )
362
+        ) AS temp4 ON temp_date.date = DATE_FORMAT( temp4.create_date, '%Y-%m-%d' )
363
+        GROUP BY
364
+        date
365
+        ORDER BY
366
+        date DESC
350 367
     </select>
351 368
 
352 369
     <select id="selectTableData" resultType="com.huiju.estateagents.excel.ActivityStatistics.StatisicAttractUser">
@@ -396,16 +413,22 @@
396 413
         DATE_FORMAT( t.create_date, '%Y-%m-%d' )
397 414
         ) AS temp ON temp_date.date = DATE_FORMAT( temp.create_date, '%Y-%m-%d' )
398 415
         LEFT JOIN (
399
-            select temp1.sharePersonNum, temp1.create_date from (
400
-                SELECT COUNT( 1 ) AS sharePersonNum, t.create_date AS create_date, t.person_id
401
-                FROM
402
-                ta_share_count t
403
-                left join ta_help_activity a on t.be_share = a.help_activity_id
404
-                left join ta_share_activity b on t.be_share = b.share_id
405
-                left join ta_live_activity c on t.be_share = c.live_activity_id
406
-                left join ta_drainage d on t.be_share = d.drainage_id
407
-                left join ta_building_dynamic e on t.be_share = e.dynamic_id
408
-                left join ta_person f on t.person_id = f.person_id
416
+            SELECT count(1) as sharePersonNum , temp1.*
417
+            FROM (
418
+                SELECT DISTINCT(t.person_id),t.create_date
419
+                FROM ta_share_count t
420
+                LEFT JOIN ta_help_activity a
421
+                ON t.be_share = a.help_activity_id
422
+                LEFT JOIN ta_share_activity b
423
+                ON t.be_share = b.share_id
424
+                LEFT JOIN ta_live_activity c
425
+                ON t.be_share = c.live_activity_id
426
+                LEFT JOIN ta_drainage d
427
+                ON t.be_share = d.drainage_id
428
+                LEFT JOIN ta_building_dynamic e
429
+                ON t.be_share = e.dynamic_id
430
+                LEFT JOIN ta_person f
431
+                ON t.person_id = f.person_id
409 432
                 WHERE
410 433
                 t.tagert_type in ('activity','group','h5','help','liveApp','livePost') and t.org_id = #{orgId}
411 434
                 <if test="buildingId != null and buildingId != ''">
@@ -423,8 +446,8 @@
423 446
                 <if test="startDate == null or endDate == null ">
424 447
                     AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
425 448
                 </if>
426
-                GROUP BY t.person_id, DATE_FORMAT( t.create_date, '%Y-%m-%d' )
427
-            ) as temp1
449
+                GROUP BY DATE_FORMAT( t.create_date, '%Y-%m-%d' ) ,t.person_id
450
+                ) as temp1  GROUP BY DATE_FORMAT( temp1.create_date, '%Y-%m-%d' )
428 451
         ) AS temp1 ON temp_date.date = DATE_FORMAT( temp1.create_date, '%Y-%m-%d' )
429 452
         LEFT JOIN (
430 453
         SELECT
@@ -438,7 +461,7 @@
438 461
             and t.building_id =  #{buildingId}
439 462
         </if>
440 463
         <if test="targetType != null and targetType != ''">
441
-            and t.target_type =  #{targetType}
464
+            and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{targetType} end)
442 465
         </if>
443 466
         <if test="startDate != null">
444 467
             and t.visit_time &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
@@ -465,7 +488,7 @@
465 488
                 and t.building_id =  #{buildingId}
466 489
             </if>
467 490
             <if test="targetType != null and targetType != ''">
468
-                and t.target_type =  #{targetType}
491
+                and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{targetType} end)
469 492
             </if>
470 493
             <if test="startDate != null">
471 494
                 and t.visit_time &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
@@ -493,6 +516,7 @@
493 516
                 and t.building_id =  #{buildingId}
494 517
             </if>
495 518
             and t.status = 1
519
+            and t.is_first_time = 1
496 520
             <if test="targetType != null and targetType != ''">
497 521
                 and t.target_type =  #{targetType}
498 522
             </if>
@@ -563,16 +587,22 @@
563 587
         DATE_FORMAT( t.create_date, '%Y-%m-%d' )
564 588
         ) AS temp ON temp_date.date = DATE_FORMAT( temp.create_date, '%Y-%m-%d' )
565 589
         LEFT JOIN (
566
-        select temp1.sharePersonNum, temp1.create_date from (
567
-        SELECT COUNT( 1 ) AS sharePersonNum, t.create_date AS create_date, t.person_id
568
-        FROM
569
-        ta_share_count t
570
-        left join ta_help_activity a on t.be_share = a.help_activity_id
571
-        left join ta_share_activity b on t.be_share = b.share_id
572
-        left join ta_live_activity c on t.be_share = c.live_activity_id
573
-        left join ta_drainage d on t.be_share = d.drainage_id
574
-        left join ta_building_dynamic e on t.be_share = e.dynamic_id
575
-        left join ta_person f on t.person_id = f.person_id
590
+        SELECT count(1) as sharePersonNum , temp1.*
591
+        FROM (
592
+        SELECT DISTINCT(t.person_id),t.create_date
593
+        FROM ta_share_count t
594
+        LEFT JOIN ta_help_activity a
595
+        ON t.be_share = a.help_activity_id
596
+        LEFT JOIN ta_share_activity b
597
+        ON t.be_share = b.share_id
598
+        LEFT JOIN ta_live_activity c
599
+        ON t.be_share = c.live_activity_id
600
+        LEFT JOIN ta_drainage d
601
+        ON t.be_share = d.drainage_id
602
+        LEFT JOIN ta_building_dynamic e
603
+        ON t.be_share = e.dynamic_id
604
+        LEFT JOIN ta_person f
605
+        ON t.person_id = f.person_id
576 606
         WHERE
577 607
         t.tagert_type in ('activity','group','h5','help','liveApp','livePost') and t.org_id = #{orgId}
578 608
         <if test="buildingId != null and buildingId != ''">
@@ -590,8 +620,8 @@
590 620
         <if test="startDate == null or endDate == null ">
591 621
             AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
592 622
         </if>
593
-        GROUP BY t.person_id, DATE_FORMAT( t.create_date, '%Y-%m-%d' )
594
-        ) as temp1
623
+        GROUP BY DATE_FORMAT( t.create_date, '%Y-%m-%d' ) ,t.person_id
624
+        ) as temp1  GROUP BY DATE_FORMAT( temp1.create_date, '%Y-%m-%d' )
595 625
         ) AS temp1 ON temp_date.date = DATE_FORMAT( temp1.create_date, '%Y-%m-%d' )
596 626
         LEFT JOIN (
597 627
         SELECT
@@ -660,6 +690,7 @@
660 690
             and t.building_id =  #{buildingId}
661 691
         </if>
662 692
         and t.status = 1
693
+        and t.is_first_time = 1
663 694
         <if test="targetType != null and targetType != ''">
664 695
             and t.target_type =  #{targetType}
665 696
         </if>
@@ -849,7 +880,13 @@
849 880
 
850 881
     <select id="selectActivityStatisDetailExport" resultType="com.huiju.estateagents.excel.ActivityStatistics.ActivityDetailShareRecord">
851 882
         select
852
-        activity.*,
883
+        activity.activityId, activity.activityName,
884
+        case when activity.activityType = 'activity' then '报名活动'
885
+        when activity.activityType = 'help' then '助力活动'
886
+        when activity.activityType = 'group' then '拼团活动'
887
+        when activity.activityType = 'h5' then 'H5活动'
888
+        when activity.activityType = 'live' then '直播活动'
889
+        end as activityType,
853 890
         ifnull(shareNum.shareNum, 0) as shareNum,
854 891
         ifnull(sharePersonNum.sharePersonNum, 0) as sharePersonNum,
855 892
         ifnull(visitNum.visitNum, 0) as visitNum,
@@ -997,14 +1034,14 @@
997 1034
 
998 1035
     <select id="selectActivitySharePersonNum" resultType="com.huiju.estateagents.excel.ActivityStatistics.SharePersonNum">
999 1036
         select person.nickname as sharePersonName,
1000
-               ifnull(person.tel, '空') as sharePersonPhone ,
1037
+               ifnull(person.phone, '空') as sharePersonPhone ,
1001 1038
                ifnull(shareNum, 0) as shareNum,
1002 1039
                ifnull(visitNum, 0) as visitNum,
1003 1040
                ifnull(visitPersonNum, 0) as visitPersonNum,
1004 1041
             person.person_type as sharePersonType,
1005 1042
             person.person_id
1006 1043
             from (
1007
-            SELECT t.*, f.nickname, f.tel, f.person_type
1044
+            SELECT t.*, f.nickname, f.phone, f.person_type
1008 1045
             FROM ta_share_count t
1009 1046
             LEFT JOIN ta_help_activity a
1010 1047
             ON t.be_share = a.help_activity_id
@@ -1033,7 +1070,7 @@
1033 1070
                 and f.nickname = #{sharePersonName}
1034 1071
             </if>
1035 1072
             <if test="sharePhone != null and sharePhone != ''">
1036
-                and f.tel = #{sharePhone}
1073
+                and f.phone = #{sharePhone}
1037 1074
             </if>
1038 1075
             GROUP BY t.person_id
1039 1076
         ) as person
@@ -1092,12 +1129,16 @@
1092 1129
     </select>
1093 1130
     <select id="selectActivitySharePersonNumExport" resultType="com.huiju.estateagents.excel.ActivityStatistics.SharePersonNum">
1094 1131
         select person.nickname as sharePersonName,
1095
-        ifnull(person.tel, '空') as sharePersonPhone ,
1132
+        ifnull(person.phone, '空') as sharePersonPhone ,
1096 1133
         ifnull(shareNum, 0) as shareNum,
1097 1134
         ifnull(visitNum, 0) as visitNum,
1098 1135
         ifnull(visitPersonNum, 0) as visitPersonNum,
1099
-        person.person_type as sharePersonType from (
1100
-        SELECT t.*, f.nickname, f.tel, f.person_type
1136
+        case
1137
+        when person.person_type = 'customer' then '客户'
1138
+        when person.person_type = 'drift' then '游客'
1139
+        when person.person_type = 'Realty Consultant' then '置业顾问'
1140
+        end as sharePersonType from (
1141
+        SELECT t.*, f.nickname, f.phone, f.person_type
1101 1142
         FROM ta_share_count t
1102 1143
         LEFT JOIN ta_help_activity a
1103 1144
         ON t.be_share = a.help_activity_id
@@ -1120,7 +1161,7 @@
1120 1161
             and f.nickname = #{sharePersonName}
1121 1162
         </if>
1122 1163
         <if test="sharePhone != null and sharePhone != ''">
1123
-            and f.tel = #{sharePhone}
1164
+            and f.phone = #{sharePhone}
1124 1165
         </if>
1125 1166
         GROUP BY t.person_id, t.person_id
1126 1167
         ) as person
@@ -1179,12 +1220,12 @@
1179 1220
 
1180 1221
     <select id="selectActivityShareNum" resultType="com.huiju.estateagents.excel.ActivityStatistics.ShareNum">
1181 1222
         select person.nickname as sharePersonName,
1182
-        ifnull(person.tel, '空') as sharePersonPhone ,
1223
+        ifnull(person.phone, '空') as sharePersonPhone ,
1183 1224
         person.create_date as shareTime,
1184 1225
         ifnull(visitPersonNum.visitPersonNum, 0) as visitPersonNum,
1185 1226
         person.person_type as sharePersonType
1186 1227
         FROM (
1187
-            SELECT t.*, f.nickname, f.tel, f.person_type
1228
+            SELECT t.*, f.nickname, f.phone, f.person_type
1188 1229
             FROM ta_share_count t
1189 1230
             LEFT JOIN ta_help_activity a
1190 1231
             ON t.be_share = a.help_activity_id
@@ -1231,7 +1272,7 @@
1231 1272
 
1232 1273
     <select id="selectActivityShareNumExport" resultType="com.huiju.estateagents.excel.ActivityStatistics.ShareNum">
1233 1274
         select person.nickname as sharePersonName,
1234
-        ifnull(person.tel, '空') as sharePersonPhone ,
1275
+        ifnull(person.phone, '空') as sharePersonPhone ,
1235 1276
         person.create_date as shareTime,
1236 1277
         ifnull(visitPersonNum.visitPersonNum, 0) as visitPersonNum,
1237 1278
         CASE
@@ -1243,7 +1284,7 @@
1243 1284
         "置业顾问"
1244 1285
         END `sharePersonType`
1245 1286
         FROM (
1246
-        SELECT t.*, f.nickname, f.tel, f.person_type
1287
+        SELECT t.*, f.nickname, f.phone, f.person_type
1247 1288
         FROM ta_share_count t
1248 1289
         LEFT JOIN ta_help_activity a
1249 1290
         ON t.be_share = a.help_activity_id
@@ -1276,10 +1317,10 @@
1276 1317
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
1277 1318
         a.province,
1278 1319
         b1.scene_name as personFrom,
1279
-        d.name as realtyConsultant,
1280
-        d.phone as realtyConsultantPhone,
1320
+        GROUP_CONCAT(c.name) as realtyConsultant,
1321
+        ifnull(d.phone, d.tel) as realtyConsultantPhone,
1281 1322
         ifnull(e.nickname, f.user_name) as sharePersonName,
1282
-        e.phone as sharePersonPhone
1323
+        ifnull(e.phone, e.tel) as sharePersonPhone
1283 1324
         FROM ta_share_person_from t
1284 1325
         left join ta_person a on t.person_id = a.person_id
1285 1326
         left join ta_person_from_record b on a.person_id = b.person_id and b.org_id = 84 and b.is_first_time =1
@@ -1300,6 +1341,7 @@
1300 1341
         <if test="personFrom != null and personFrom != ''">
1301 1342
             and b.scene_id = #{personFrom}
1302 1343
         </if>
1344
+        group by t.person_id
1303 1345
     </select>
1304 1346
 
1305 1347
     <select id="selectActivityAddRegistNumExport" resultType="com.huiju.estateagents.excel.ActivityStatistics.AddRegistNum">