瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

顾绍勇 5 年之前
父節點
當前提交
eb5177a37c

+ 53
- 28
src/main/resources/mapper/TsActivityDailyMapper.xml 查看文件

4
 
4
 
5
     <select id="getActivityDetail" resultType="com.huiju.estateagents.entity.TsActivityDaily">
5
     <select id="getActivityDetail" resultType="com.huiju.estateagents.entity.TsActivityDaily">
6
         SELECT
6
         SELECT
7
-            t.statis_date,
8
-            SUM(t.share_num) as share_num,
9
-            SUM(t.share_persons) as share_persons,
10
-            SUM(t.visit_num) as visit_num,
11
-            SUM(t.visit_persons) as visit_persons,
12
-            SUM(t.new_persons) as new_persons,
13
-            SUM(t.new_customers) as new_customers
7
+            a.statis_date,
8
+            IFNULL(b.share_num, 0) as share_num,
9
+            IFNULL(b.share_persons, 0) as share_persons,
10
+            IFNULL(b.visit_num, 0) as visit_num,
11
+            IFNULL(b.visit_persons, 0) as visit_persons,
12
+            IFNULL(b.new_persons, 0) as new_persons,
13
+            IFNULL(b.new_customers, 0) as new_customers
14
         FROM
14
         FROM
15
-            ts_activity_daily t
16
-        WHERE
17
-            t.org_id = #{orgId}
18
-            AND t.statis_date BETWEEN #{startDate} AND #{endDate}
15
+        (
16
+            SELECT
17
+                DATE_FORMAT(
18
+                    DATE_ADD( STR_TO_DATE( '2020-04-18', '%Y-%m-%d' ), INTERVAL rownum DAY ), '%Y-%m-%d' ) AS statis_date
19
+            FROM sequence
20
+            WHERE rownum &lt; DATEDIFF(STR_TO_DATE( #{endDate}, '%Y-%m-%d' ), STR_TO_DATE( #{startDate}, '%Y-%m-%d' ))
21
+        ) a
22
+        LEFT JOIN (
23
+            SELECT
24
+                t.statis_date,
25
+                SUM(t.share_num) as share_num,
26
+                SUM(t.share_persons) as share_persons,
27
+                SUM(t.visit_num) as visit_num,
28
+                SUM(t.visit_persons) as visit_persons,
29
+                SUM(t.new_persons) as new_persons,
30
+                SUM(t.new_customers) as new_customers
31
+            FROM
32
+                ts_activity_daily t
33
+            WHERE
34
+                t.org_id = #{orgId}
35
+                AND t.statis_date BETWEEN #{startDate} AND #{endDate}
19
 
36
 
20
-        <if test="buildingId != null and buildingId != ''">
21
-            AND t.building_id = #{buildingId}
22
-        </if>
37
+            <if test="buildingId != null and buildingId != ''">
38
+                AND t.building_id = #{buildingId}
39
+            </if>
23
 
40
 
24
-        <if test="targetType != null and targetType != ''">
25
-            AND t.target_type = #{targetType}
26
-        </if>
41
+            <if test="targetType != null and targetType != ''">
42
+                AND t.target_type = #{targetType}
43
+            </if>
27
 
44
 
28
-        <if test="targetId != null and targetId != ''">
29
-            AND t.target_id = #{targetId}
30
-        </if>
45
+            <if test="targetId != null and targetId != ''">
46
+                AND t.target_id = #{targetId}
47
+            </if>
31
 
48
 
32
-        <if test="targetName != null and targetName != ''">
33
-            AND t.target_name like CONCAT('%', #{targetName}, '%')
34
-        </if>
49
+            <if test="targetName != null and targetName != ''">
50
+                AND t.target_name like CONCAT('%', #{targetName}, '%')
51
+            </if>
52
+
53
+            GROUP BY t.statis_date
54
+        ) b ON a.statis_date = b.statis_date
35
 
55
 
36
-        GROUP BY t.statis_date
56
+        <if test="asc != null and asc == 'statis_date'">
57
+            ORDER BY a.statis_date ASC
58
+        </if>
59
+        <if test="desc != null and desc == 'statis_date'">
60
+            ORDER BY a.statis_date DESC
61
+        </if>
37
 
62
 
38
-        <if test="asc != null and asc != ''">
39
-            ORDER BY ${asc} ASC
63
+        <if test="asc != null and asc != '' and asc != 'statis_date'">
64
+            ORDER BY b.${asc} ASC
40
         </if>
65
         </if>
41
-        <if test="desc != null and desc != ''">
42
-            ORDER BY ${desc} DESC
66
+        <if test="desc != null and desc != '' and desc != 'statis_date'">
67
+            ORDER BY b.${desc} DESC
43
         </if>
68
         </if>
44
     </select>
69
     </select>
45
 
70
 

+ 62
- 53
src/main/resources/mapper/statistic/TaActivityStaticMapper.xml 查看文件

912
             and a.building_id = #{buildingId}
912
             and a.building_id = #{buildingId}
913
         </if>
913
         </if>
914
         <if test="activityName != null and activityName != '' ">
914
         <if test="activityName != null and activityName != '' ">
915
-            and a.title = #{activityName}
915
+            and a.title like concat('%', #{activityName}, '%')
916
         </if>
916
         </if>
917
         <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
917
         <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
918
             and a.building_id in
918
             and a.building_id in
927
             and b.building_id = #{buildingId}
927
             and b.building_id = #{buildingId}
928
         </if>
928
         </if>
929
         <if test="activityName != null and activityName != '' ">
929
         <if test="activityName != null and activityName != '' ">
930
-            and b.title = #{activityName}
930
+            and b.title like concat('%', #{activityName}, '%')
931
         </if>
931
         </if>
932
         <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
932
         <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
933
             and b.building_id in
933
             and b.building_id in
943
             and c.building_id = #{buildingId}
943
             and c.building_id = #{buildingId}
944
         </if>
944
         </if>
945
         <if test="activityName != null and activityName != '' ">
945
         <if test="activityName != null and activityName != '' ">
946
-            and c.activity_name = #{activityName}
946
+            and c.activity_name like concat('%', #{activityName}, '%')
947
         </if>
947
         </if>
948
         <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
948
         <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
949
             and c.building_id in
949
             and c.building_id in
958
             and d.building_id = #{buildingId}
958
             and d.building_id = #{buildingId}
959
         </if>
959
         </if>
960
         <if test="activityName != null and activityName != '' ">
960
         <if test="activityName != null and activityName != '' ">
961
-            and d.name = #{activityName}
961
+            and d.name like concat('%', #{activityName}, '%')
962
         </if>
962
         </if>
963
         <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
963
         <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
964
-            and c.building_id in
964
+            and d.building_id in
965
             <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
965
             <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
966
                 #{taPersonBuilding.buildingId}
966
                 #{taPersonBuilding.buildingId}
967
             </foreach>
967
             </foreach>
974
             and e.building_id = #{buildingId}
974
             and e.building_id = #{buildingId}
975
         </if>
975
         </if>
976
         <if test="activityName != null and activityName != '' ">
976
         <if test="activityName != null and activityName != '' ">
977
-            and e.live_activity_title = #{activityName}
977
+            and e.live_activity_title like concat('%', #{activityName}, '%')
978
         </if>
978
         </if>
979
         <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
979
         <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
980
             and e.building_id in
980
             and e.building_id in
1001
             <if test="startDate == null or endDate == null ">
1001
             <if test="startDate == null or endDate == null ">
1002
                 AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1002
                 AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1003
             </if>
1003
             </if>
1004
-            group by a.be_share
1004
+            group by a.be_share,a.tagert_type
1005
         ) as shareNum on shareNum.be_share = activity.activityId and shareNum.tagert_type = activity.activityType
1005
         ) as shareNum on shareNum.be_share = activity.activityId and shareNum.tagert_type = activity.activityType
1006
 
1006
 
1007
         left join (
1007
         left join (
1027
         activity.activityType
1027
         activity.activityType
1028
 
1028
 
1029
         left join (
1029
         left join (
1030
-            select count(*) as visitNum, a.target_id, case when a.target_type = 'dynamic' then 'activity' else a.target_type end as target_type
1030
+            select count(*) as visitNum, a.target_id, case when a.target_type = 'dynamic' then 'activity' when a.target_type is null then 'h5' else a.target_type end as target_type
1031
             From ta_person_visit_record a where a.event_type in
1031
             From ta_person_visit_record a where a.event_type in
1032
             ('activity','group','h5','help') and a.`event` = 'detail' and a.org_id = #{orgId}
1032
             ('activity','group','h5','help') and a.`event` = 'detail' and a.org_id = #{orgId}
1033
-            <if test="targetType != null and targetType != ''">
1033
+            <if test="targetType != null and targetType != '' and targetType != 'h5'">
1034
                 and (case when #{targetType} = 'activity' then a.target_type = 'dynamic' else a.target_type = #{targetType}
1034
                 and (case when #{targetType} = 'activity' then a.target_type = 'dynamic' else a.target_type = #{targetType}
1035
                 end)
1035
                 end)
1036
             </if>
1036
             </if>
1043
             <if test="startDate == null or endDate == null ">
1043
             <if test="startDate == null or endDate == null ">
1044
                 AND a.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1044
                 AND a.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1045
             </if>
1045
             </if>
1046
-            group by a.target_id, a.event_type
1046
+            group by a.target_id, a.target_type
1047
         ) as visitNum on visitNum.target_id = activity.activityId and visitNum.target_type = activity.activityType
1047
         ) as visitNum on visitNum.target_id = activity.activityId and visitNum.target_type = activity.activityType
1048
 
1048
 
1049
         left join (
1049
         left join (
1050
-            SELECT count(DISTINCT(a.person_id)) as visitPersonNum , a.target_id, case when a.target_type = 'dynamic' then 'activity' else a.target_type end as event_type
1050
+            SELECT count(DISTINCT(a.person_id)) as visitPersonNum , a.target_id, case when a.target_type = 'dynamic' then 'activity' when a.target_type is null then 'h5' else a.target_type end as event_type
1051
             From ta_person_visit_record a where a.event_type in ('activity','group','h5','help') and a.`event` =
1051
             From ta_person_visit_record a where a.event_type in ('activity','group','h5','help') and a.`event` =
1052
             'detail' and a.org_id = #{orgId}
1052
             'detail' and a.org_id = #{orgId}
1053
-            <if test="targetType != null and targetType != ''">
1053
+            <if test="targetType != null and targetType != '' and targetType != 'h5'">
1054
                 and (case when #{targetType} = 'activity' then a.target_type = 'dynamic' else a.target_type = #{targetType}
1054
                 and (case when #{targetType} = 'activity' then a.target_type = 'dynamic' else a.target_type = #{targetType}
1055
                 end)
1055
                 end)
1056
             </if>
1056
             </if>
1063
             <if test="startDate == null or endDate == null ">
1063
             <if test="startDate == null or endDate == null ">
1064
                 AND a.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1064
                 AND a.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1065
             </if>
1065
             </if>
1066
-            group by a.target_id, a.event_type
1066
+            group by a.target_id, a.target_type
1067
         ) as visitPersonNum on visitPersonNum.target_id = activity.activityId and visitPersonNum.event_type =
1067
         ) as visitPersonNum on visitPersonNum.target_id = activity.activityId and visitPersonNum.event_type =
1068
         activity.activityType
1068
         activity.activityType
1069
 
1069
 
1073
         'help_share', 'live_share', 'group_share' ) and a.org_id = #{orgId}
1073
         'help_share', 'live_share', 'group_share' ) and a.org_id = #{orgId}
1074
         and a.status = 1
1074
         and a.status = 1
1075
         and a.is_first_time = 1
1075
         and a.is_first_time = 1
1076
-        <if test="targetType != null and targetType != ''">
1076
+        <if test="targetType != null and targetType != '' and targetType != 'h5'">
1077
             and a.target_type = #{targetType}
1077
             and a.target_type = #{targetType}
1078
         </if>
1078
         </if>
1079
         <if test="startDate != null ">
1079
         <if test="startDate != null ">
1104
     <select id="selectActivityStatisDetailExport"
1104
     <select id="selectActivityStatisDetailExport"
1105
             resultType="com.huiju.estateagents.excel.ActivityStatistics.ActivityDetailShareRecord">
1105
             resultType="com.huiju.estateagents.excel.ActivityStatistics.ActivityDetailShareRecord">
1106
         select
1106
         select
1107
-        activity.activityId, activity.activityName,
1108
-        case when activity.activityType = 'activity' then '报名活动'
1109
-        when activity.activityType = 'help' then '助力活动'
1110
-        when activity.activityType = 'group' then '拼团活动'
1111
-        when activity.activityType = 'h5' then 'H5活动'
1112
-        when activity.activityType = 'live' then '直播活动'
1113
-        end as activityType,
1107
+        activity.*,
1114
         ifnull(shareNum.shareNum, 0) as shareNum,
1108
         ifnull(shareNum.shareNum, 0) as shareNum,
1115
         ifnull(sharePersonNum.sharePersonNum, 0) as sharePersonNum,
1109
         ifnull(sharePersonNum.sharePersonNum, 0) as sharePersonNum,
1116
         ifnull(visitNum.visitNum, 0) as visitNum,
1110
         ifnull(visitNum.visitNum, 0) as visitNum,
1201
         FROM ta_share_count a where a.tagert_type in (
1195
         FROM ta_share_count a where a.tagert_type in (
1202
         'activity', 'group','h5','help','liveApp','livePost')
1196
         'activity', 'group','h5','help','liveApp','livePost')
1203
         and a.org_id = #{orgId}
1197
         and a.org_id = #{orgId}
1198
+        <if test="targetType != null and targetType != ''">
1199
+            and a.tagert_type = #{targetType}
1200
+        </if>
1204
         <if test="startDate != null ">
1201
         <if test="startDate != null ">
1205
-            and a.create_date &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d' )
1202
+            and a.create_date &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
1206
         </if>
1203
         </if>
1207
         <if test="endDate != null ">
1204
         <if test="endDate != null ">
1208
-            and a.create_date &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d' )
1205
+            and a.create_date &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S' )
1209
         </if>
1206
         </if>
1210
         <if test="startDate == null or endDate == null ">
1207
         <if test="startDate == null or endDate == null ">
1211
             AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1208
             AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1212
         </if>
1209
         </if>
1213
-        group by a.be_share
1210
+        group by a.be_share,a.tagert_type
1214
         ) as shareNum on shareNum.be_share = activity.activityId and shareNum.tagert_type = activity.activityType
1211
         ) as shareNum on shareNum.be_share = activity.activityId and shareNum.tagert_type = activity.activityType
1215
 
1212
 
1216
         left join (
1213
         left join (
1217
-        select count(*) as sharePersonNum ,sharePersonNum.be_share, sharePersonNum.tagert_type,
1218
-        sharePersonNum.create_date from (
1219
-        SELECT a.be_share, a.create_date ,case when a.tagert_type = 'liveApp' then 'live' when a.tagert_type = 'livePost' then 'live' else a.tagert_type end   as tagert_type From ta_share_count a where a.tagert_type in ( 'activity', 'group','h5','help','liveApp','livePost')
1214
+        SELECT count(*) as sharePersonNum ,sharePersonNum.be_share, sharePersonNum.tagert_type, sharePersonNum.create_date from (
1215
+        SELECT a.be_share, a.create_date ,case when a.tagert_type = 'liveApp' then 'live' when a.tagert_type = 'livePost' then 'live' else a.tagert_type end   as tagert_type
1216
+        From ta_share_count a where a.tagert_type in ( 'activity', 'group','h5','help','liveApp','livePost')
1220
         and a.org_id = #{orgId}
1217
         and a.org_id = #{orgId}
1218
+        <if test="targetType != null and targetType != ''">
1219
+            and a.tagert_type = #{targetType}
1220
+        </if>
1221
         <if test="startDate != null ">
1221
         <if test="startDate != null ">
1222
-            and a.create_date &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d' )
1222
+            and a.create_date &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
1223
         </if>
1223
         </if>
1224
         <if test="endDate != null ">
1224
         <if test="endDate != null ">
1225
-            and a.create_date &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d' )
1225
+            and a.create_date &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S' )
1226
         </if>
1226
         </if>
1227
         <if test="startDate == null or endDate == null ">
1227
         <if test="startDate == null or endDate == null ">
1228
             AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1228
             AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1233
         activity.activityType
1233
         activity.activityType
1234
 
1234
 
1235
         left join (
1235
         left join (
1236
-        select * from (
1237
-        select count(*) as visitNum, a.target_id, a.event_type From ta_person_visit_record a where a.event_type in
1236
+        select count(*) as visitNum, a.target_id, case when a.target_type = 'dynamic' then 'activity' when a.target_type is null then 'h5' else a.target_type end as target_type
1237
+        From ta_person_visit_record a where a.event_type in
1238
         ('activity','group','h5','help') and a.`event` = 'detail' and a.org_id = #{orgId}
1238
         ('activity','group','h5','help') and a.`event` = 'detail' and a.org_id = #{orgId}
1239
+        <if test="targetType != null and targetType != '' and targetType != 'h5'">
1240
+            and (case when #{targetType} = 'activity' then a.target_type = 'dynamic' else a.target_type = #{targetType}
1241
+            end)
1242
+        </if>
1239
         <if test="startDate != null">
1243
         <if test="startDate != null">
1240
-            and a.visit_time &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d' )
1244
+            and a.visit_time &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
1241
         </if>
1245
         </if>
1242
         <if test="endDate != null">
1246
         <if test="endDate != null">
1243
-            and a.visit_time &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d' )
1247
+            and a.visit_time &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S' )
1244
         </if>
1248
         </if>
1245
         <if test="startDate == null or endDate == null ">
1249
         <if test="startDate == null or endDate == null ">
1246
             AND a.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1250
             AND a.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1247
         </if>
1251
         </if>
1248
-        group by a.target_id, a.event_type
1249
-        ) as a
1250
-        ) as visitNum on visitNum.target_id = activity.activityId and visitNum.event_type = activity.activityType
1252
+        group by a.target_id, a.target_type
1253
+        ) as visitNum on visitNum.target_id = activity.activityId and visitNum.target_type = activity.activityType
1251
 
1254
 
1252
         left join (
1255
         left join (
1253
-        select count(*) as visitPersonNum ,visitPersonNum.target_id, visitPersonNum.event_type from (
1254
-        select a.* From ta_person_visit_record a where a.event_type in ('activity','group','h5','help') and a.`event` =
1256
+        SELECT count(DISTINCT(a.person_id)) as visitPersonNum , a.target_id, case when a.target_type = 'dynamic' then 'activity' when a.target_type is null then 'h5' else a.target_type end as event_type
1257
+        From ta_person_visit_record a where a.event_type in ('activity','group','h5','help') and a.`event` =
1255
         'detail' and a.org_id = #{orgId}
1258
         'detail' and a.org_id = #{orgId}
1259
+        <if test="targetType != null and targetType != '' and targetType != 'h5'">
1260
+            and (case when #{targetType} = 'activity' then a.target_type = 'dynamic' else a.target_type = #{targetType}
1261
+            end)
1262
+        </if>
1256
         <if test="startDate != null">
1263
         <if test="startDate != null">
1257
-            and a.visit_time &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d' )
1264
+            and a.visit_time &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
1258
         </if>
1265
         </if>
1259
         <if test="endDate != null">
1266
         <if test="endDate != null">
1260
-            and a.visit_time &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d' )
1267
+            and a.visit_time &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S' )
1261
         </if>
1268
         </if>
1262
         <if test="startDate == null or endDate == null ">
1269
         <if test="startDate == null or endDate == null ">
1263
             AND a.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1270
             AND a.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1264
         </if>
1271
         </if>
1265
-        group by a.person_id, a.target_id, a.event_type
1266
-        ) as visitPersonNum group by visitPersonNum.target_id, visitPersonNum.event_type
1272
+        group by a.target_id, a.target_type
1267
         ) as visitPersonNum on visitPersonNum.target_id = activity.activityId and visitPersonNum.event_type =
1273
         ) as visitPersonNum on visitPersonNum.target_id = activity.activityId and visitPersonNum.event_type =
1268
         activity.activityType
1274
         activity.activityType
1269
 
1275
 
1273
         'help_share', 'live_share', 'group_share' ) and a.org_id = #{orgId}
1279
         'help_share', 'live_share', 'group_share' ) and a.org_id = #{orgId}
1274
         and a.status = 1
1280
         and a.status = 1
1275
         and a.is_first_time = 1
1281
         and a.is_first_time = 1
1282
+        <if test="targetType != null and targetType != '' and targetType != 'h5'">
1283
+            and a.target_type = #{targetType}
1284
+        </if>
1276
         <if test="startDate != null ">
1285
         <if test="startDate != null ">
1277
-            and a.create_date &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d' )
1286
+            and a.create_date &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
1278
         </if>
1287
         </if>
1279
         <if test="endDate != null ">
1288
         <if test="endDate != null ">
1280
-            and a.create_date &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d' )
1289
+            and a.create_date &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S' )
1281
         </if>
1290
         </if>
1282
         <if test="startDate == null or endDate == null">
1291
         <if test="startDate == null or endDate == null">
1283
             AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1292
             AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1294
             order by sharePersonNum.create_date desc
1303
             order by sharePersonNum.create_date desc
1295
         </if>
1304
         </if>
1296
         <if test="colKey != null and colKey != ''">
1305
         <if test="colKey != null and colKey != ''">
1297
-            ORDER BY ${colKey} ${sort}
1306
+            ORDER BY ${colKey} ${sortType}
1298
         </if>
1307
         </if>
1299
     </select>
1308
     </select>
1300
 
1309
 
1863
             and t.target_id = #{activityId}
1872
             and t.target_id = #{activityId}
1864
         </if>
1873
         </if>
1865
         <if test="activityType != null and activityType != ''">
1874
         <if test="activityType != null and activityType != ''">
1866
-            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{activityType}
1875
+            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
1867
             end)
1876
             end)
1868
         </if>
1877
         </if>
1869
         <if test="buildingId != null and buildingId != ''">
1878
         <if test="buildingId != null and buildingId != ''">
1925
             and t.target_id = #{activityId}
1934
             and t.target_id = #{activityId}
1926
         </if>
1935
         </if>
1927
         <if test="activityType != null and activityType != ''">
1936
         <if test="activityType != null and activityType != ''">
1928
-            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{activityType}
1937
+            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
1929
             end)
1938
             end)
1930
         </if>
1939
         </if>
1931
         <if test="buildingId != null and buildingId != ''">
1940
         <if test="buildingId != null and buildingId != ''">
1993
             and t.target_id = #{activityId}
2002
             and t.target_id = #{activityId}
1994
         </if>
2003
         </if>
1995
         <if test="activityType != null and activityType != ''">
2004
         <if test="activityType != null and activityType != ''">
1996
-            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{activityType}
2005
+            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
1997
             end)
2006
             end)
1998
         </if>
2007
         </if>
1999
         <if test="buildingId != null and buildingId != ''">
2008
         <if test="buildingId != null and buildingId != ''">
2060
             and t.target_id = #{activityId}
2069
             and t.target_id = #{activityId}
2061
         </if>
2070
         </if>
2062
         <if test="activityType != null and activityType != ''">
2071
         <if test="activityType != null and activityType != ''">
2063
-            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{activityType}
2072
+            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
2064
             end)
2073
             end)
2065
         </if>
2074
         </if>
2066
         <if test="buildingId != null and buildingId != ''">
2075
         <if test="buildingId != null and buildingId != ''">
2140
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
2149
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
2141
         a.province,
2150
         a.province,
2142
         b1.scene_alias as personFrom,
2151
         b1.scene_alias as personFrom,
2143
-        d.user_name as realtyConsultant,
2144
-        d.phone as realtyConsultantPhone,
2152
+        GROUP_CONCAT(d.user_name) as realtyConsultant,
2153
+        GROUP_CONCAT(d.phone) as realtyConsultantPhone,
2145
         t.create_date as visitDate,
2154
         t.create_date as visitDate,
2146
         ifnull(e.nickname, f.user_name) as sharePersonName,
2155
         ifnull(e.nickname, f.user_name) as sharePersonName,
2147
         ifnull(e.phone, f.phone) as sharePersonPhone
2156
         ifnull(e.phone, f.phone) as sharePersonPhone
2225
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
2234
         if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
2226
         a.province,
2235
         a.province,
2227
         b1.scene_alias as personFrom,
2236
         b1.scene_alias as personFrom,
2228
-        d.user_name as realtyConsultant,
2229
-        d.phone as realtyConsultantPhone,
2237
+        GROUP_CONCAT(d.user_name) as realtyConsultant,
2238
+        GROUP_CONCAT(d.phone) as realtyConsultantPhone,
2230
         t.create_date as visitDate,
2239
         t.create_date as visitDate,
2231
         ifnull(e.nickname, f.user_name) as sharePersonName,
2240
         ifnull(e.nickname, f.user_name) as sharePersonName,
2232
         ifnull(e.phone, f.phone) as sharePersonPhone
2241
         ifnull(e.phone, f.phone) as sharePersonPhone