瀏覽代碼

报表bug 修复

傅行帆 3 年之前
父節點
當前提交
53350e5272
共有 1 個文件被更改,包括 40 次插入42 次删除
  1. 40
    42
      src/main/resources/mapper/statistic/TaActivityStaticMapper.xml

+ 40
- 42
src/main/resources/mapper/statistic/TaActivityStaticMapper.xml 查看文件

@@ -139,7 +139,7 @@
139 139
             and t.building_id = #{buildingId}
140 140
         </if>
141 141
         <if test="targetType != null and targetType != ''">
142
-            and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{targetType}
142
+            and (case when #{targetType} = 'activity' then t.target_type = 'dymic' else t.target_type = #{targetType}
143 143
             end)
144 144
         </if>
145 145
         <if test="startDate != null">
@@ -169,7 +169,7 @@
169 169
             and t.building_id = #{buildingId}
170 170
         </if>
171 171
         <if test="targetType != null and targetType != ''">
172
-            and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{targetType}
172
+            and (case when #{targetType} = 'activity' then t.target_type = 'dymic' else t.target_type = #{targetType}
173 173
             end)
174 174
         </if>
175 175
         <if test="startDate != null">
@@ -394,7 +394,7 @@
394 394
             and t.building_id = #{buildingId}
395 395
         </if>
396 396
         <if test="targetType != null and targetType != ''">
397
-            and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{targetType}
397
+            and (case when #{targetType} = 'activity' then t.target_type = 'dymic' else t.target_type = #{targetType}
398 398
             end)
399 399
         </if>
400 400
         <if test="startDate != null">
@@ -451,7 +451,7 @@
451 451
             and t.building_id = #{buildingId}
452 452
         </if>
453 453
         <if test="targetType != null and targetType != ''">
454
-            and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{targetType}
454
+            and (case when #{targetType} = 'activity' then t.target_type = 'dymic' else t.target_type = #{targetType}
455 455
             end)
456 456
         </if>
457 457
         <if test="startDate != null">
@@ -505,7 +505,7 @@
505 505
         FROM
506 506
         ta_customer_from t
507 507
         WHERE
508
-        t.target_type IN ( 'dynamic', 'h5', 'help', 'live', 'group', 'activity' )
508
+        t.target_type IN ( 'dymic', 'h5', 'help', 'live', 'group', 'activity' )
509 509
         AND t.org_id = #{orgId}
510 510
         and t.is_org_first = 1
511 511
         <if test="buildingId != null and buildingId != ''">
@@ -682,7 +682,7 @@
682 682
             and t.building_id = #{buildingId}
683 683
         </if>
684 684
         <if test="targetType != null and targetType != ''">
685
-            and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' when #{targetType} = 'h5' then t.event_type = 'h5' else t.target_type = #{targetType}
685
+            and (case when #{targetType} = 'activity' then t.target_type = 'dymic' when #{targetType} = 'h5' then t.event_type = 'h5' else t.target_type = #{targetType}
686 686
             end)
687 687
         </if>
688 688
         <if test="startDate != null">
@@ -716,7 +716,7 @@
716 716
             and t.building_id = #{buildingId}
717 717
         </if>
718 718
         <if test="targetType != null and targetType != ''">
719
-            and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' when #{targetType} = 'h5' then t.event_type = 'h5' else t.target_type = #{targetType}
719
+            and (case when #{targetType} = 'activity' then t.target_type = 'dymic' when #{targetType} = 'h5' then t.event_type = 'h5' else t.target_type = #{targetType}
720 720
             end)
721 721
         </if>
722 722
         <if test="startDate != null">
@@ -746,7 +746,7 @@
746 746
         FROM
747 747
         ta_customer_from t
748 748
         WHERE
749
-        t.target_type in ('dynamic','h5','help','live', 'group', 'activity') and t.org_id = #{orgId}
749
+        t.target_type in ('dymic','h5','help','live', 'group', 'activity') and t.org_id = #{orgId}
750 750
         <if test="buildingId != null and buildingId != ''">
751 751
             and t.building_id = #{buildingId}
752 752
         </if>
@@ -916,7 +916,7 @@
916 916
             and t.building_id = #{buildingId}
917 917
         </if>
918 918
         <if test="targetType != null and targetType != ''">
919
-            and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{targetType}
919
+            and (case when #{targetType} = 'activity' then t.target_type = 'dymic' else t.target_type = #{targetType}
920 920
             end)
921 921
         </if>
922 922
         <if test="startDate != null">
@@ -950,7 +950,7 @@
950 950
             and t.building_id = #{buildingId}
951 951
         </if>
952 952
         <if test="targetType != null and targetType != ''">
953
-            and (case when #{targetType} = 'activity' then t.target_type = 'dynamic' else t.target_type = #{targetType}
953
+            and (case when #{targetType} = 'activity' then t.target_type = 'dymic' else t.target_type = #{targetType}
954 954
             end)
955 955
         </if>
956 956
         <if test="startDate != null">
@@ -980,7 +980,7 @@
980 980
         FROM
981 981
         ta_customer_from t
982 982
         WHERE
983
-        t.target_type in ('dynamic','h5','help','live', 'group', 'activity') and t.org_id = #{orgId}
983
+        t.target_type in ('dymic','h5','help','live', 'group', 'activity') and t.org_id = #{orgId}
984 984
         <if test="buildingId != null and buildingId != ''">
985 985
             and t.building_id = #{buildingId}
986 986
         </if>
@@ -1105,8 +1105,7 @@
1105 1105
         left join (
1106 1106
             select count(1) as shareNum, a.* from (
1107 1107
             SELECT a.be_share, case when a.tagert_type = 'liveApp' then 'live' when a.tagert_type = 'livePost' then 'live' else a.tagert_type end as tagert_type, a.create_date
1108
-            FROM ta_share_count a where a.tagert_type in (
1109
-            'activity', 'group','h5','help','liveApp','livePost')
1108
+            FROM ta_share_count a where a.tagert_type in ('dymic','house','look','live','liveApp','livePost')
1110 1109
             and a.org_id = #{orgId}
1111 1110
             <if test="targetType != null and targetType != ''">
1112 1111
                 and (case when #{targetType} = 'live' then a.tagert_type in ('liveApp', 'livePost') else a.tagert_type = #{targetType}
@@ -1127,7 +1126,7 @@
1127 1126
         left join (
1128 1127
         SELECT count(*) as sharePersonNum ,sharePersonNum.be_share, sharePersonNum.tagert_type, sharePersonNum.create_date from (
1129 1128
         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
1130
-        From ta_share_count a where a.tagert_type in ( 'activity', 'group','h5','help','liveApp','livePost')
1129
+        From ta_share_count a where a.tagert_type in ('dymic','house','look','live','liveApp','livePost')
1131 1130
         and a.org_id = #{orgId}
1132 1131
         <if test="targetType != null and targetType != ''">
1133 1132
             and (case when #{targetType} = 'live' then a.tagert_type in ('liveApp', 'livePost') else a.tagert_type = #{targetType}
@@ -1149,11 +1148,11 @@
1149 1148
         activity.activityType
1150 1149
 
1151 1150
         left join (
1152
-            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
1151
+            select count(*) as visitNum, a.target_id, case when a.target_type = 'dymic' then 'activity' when a.target_type is null then 'h5' else a.target_type end as target_type
1153 1152
             From ta_person_visit_record a where a.event_type in
1154 1153
             ('dymic','house','look','live')  and a.`event` = 'detail' and a.org_id = #{orgId}
1155 1154
             <if test="targetType != null and targetType != '' and targetType != 'h5'">
1156
-                and (case when #{targetType} = 'activity' then a.target_type = 'dynamic' else a.target_type = #{targetType}
1155
+                and (case when #{targetType} = 'activity' then a.target_type = 'dymic' else a.target_type = #{targetType}
1157 1156
                 end)
1158 1157
             </if>
1159 1158
             <if test="startDate != null">
@@ -1169,11 +1168,11 @@
1169 1168
         ) as visitNum on visitNum.target_id = activity.activityId and visitNum.target_type = activity.activityType
1170 1169
 
1171 1170
         left join (
1172
-            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
1171
+            SELECT count(DISTINCT(a.person_id)) as visitPersonNum , a.target_id, case when a.target_type = 'dymic' then 'activity' when a.target_type is null then 'h5' else a.target_type end as event_type
1173 1172
             From ta_person_visit_record a where a.event_type in ('dymic','house','look','live')  and a.`event` =
1174 1173
             'detail' and a.org_id = #{orgId}
1175 1174
             <if test="targetType != null and targetType != '' and targetType != 'h5'">
1176
-                and (case when #{targetType} = 'activity' then a.target_type = 'dynamic' else a.target_type = #{targetType}
1175
+                and (case when #{targetType} = 'activity' then a.target_type = 'dymic' else a.target_type = #{targetType}
1177 1176
                 end)
1178 1177
             </if>
1179 1178
             <if test="startDate != null">
@@ -1191,7 +1190,7 @@
1191 1190
 
1192 1191
         left join (
1193 1192
         select count(*) as addRegistNum ,addRegistNum.target_id, addRegistNum.target_type From (
1194
-        select count(*), a.* From ta_customer_from a where a.target_type IN ( 'dynamic', 'h5',
1193
+        select count(*), a.* From ta_customer_from a where a.target_type IN ( 'dymic', 'h5',
1195 1194
         'help', 'live', 'group', 'activity' ) and a.org_id = #{orgId}
1196 1195
         and a.is_org_first = 1
1197 1196
         <if test="targetType != null and targetType != '' and targetType != 'h5'">
@@ -1318,8 +1317,7 @@
1318 1317
         select count(1) as shareNum, a.* from (
1319 1318
 
1320 1319
         SELECT a.be_share, case when a.tagert_type = 'liveApp' then 'live' when a.tagert_type = 'livePost' then 'live' else a.tagert_type end as tagert_type, a.create_date
1321
-        FROM ta_share_count a where a.tagert_type in (
1322
-        'activity', 'group','h5','help','liveApp','livePost')
1320
+        FROM ta_share_count a where a.tagert_type in ('dymic','house','look','live','liveApp','livePost')
1323 1321
         and a.org_id = #{orgId}
1324 1322
         <if test="targetType != null and targetType != ''">
1325 1323
             and (case when #{targetType} = 'live' then a.tagert_type in ('liveApp', 'livePost') else a.tagert_type = #{targetType}
@@ -1340,7 +1338,7 @@
1340 1338
         left join (
1341 1339
         SELECT count(*) as sharePersonNum ,sharePersonNum.be_share, sharePersonNum.tagert_type, sharePersonNum.create_date from (
1342 1340
         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
1343
-        From ta_share_count a where a.tagert_type in ( 'activity', 'group','h5','help','liveApp','livePost')
1341
+        From ta_share_count a where a.tagert_type in ('dymic','house','look','live','liveApp','livePost')
1344 1342
         and a.org_id = #{orgId}
1345 1343
         <if test="targetType != null and targetType != ''">
1346 1344
             and (case when #{targetType} = 'live' then a.tagert_type in ('liveApp', 'livePost') else a.tagert_type = #{targetType}
@@ -1362,11 +1360,11 @@
1362 1360
         activity.activityType
1363 1361
 
1364 1362
         left join (
1365
-        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
1363
+        select count(*) as visitNum, a.target_id, case when a.target_type = 'dymic' then 'activity' when a.target_type is null then 'h5' else a.target_type end as target_type
1366 1364
         From ta_person_visit_record a where a.event_type in
1367 1365
         ('dymic','house','look','live')  and a.`event` = 'detail' and a.org_id = #{orgId}
1368 1366
         <if test="targetType != null and targetType != '' and targetType != 'h5'">
1369
-            and (case when #{targetType} = 'activity' then a.target_type = 'dynamic' else a.target_type = #{targetType}
1367
+            and (case when #{targetType} = 'activity' then a.target_type = 'dymic' else a.target_type = #{targetType}
1370 1368
             end)
1371 1369
         </if>
1372 1370
         <if test="startDate != null">
@@ -1382,11 +1380,11 @@
1382 1380
         ) as visitNum on visitNum.target_id = activity.activityId and visitNum.target_type = activity.activityType
1383 1381
 
1384 1382
         left join (
1385
-        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
1383
+        SELECT count(DISTINCT(a.person_id)) as visitPersonNum , a.target_id, case when a.target_type = 'dymic' then 'activity' when a.target_type is null then 'h5' else a.target_type end as event_type
1386 1384
         From ta_person_visit_record a where a.event_type in ('dymic','house','look','live')  and a.`event` =
1387 1385
         'detail' and a.org_id = #{orgId}
1388 1386
         <if test="targetType != null and targetType != '' and targetType != 'h5'">
1389
-            and (case when #{targetType} = 'activity' then a.target_type = 'dynamic' else a.target_type = #{targetType}
1387
+            and (case when #{targetType} = 'activity' then a.target_type = 'dymic' else a.target_type = #{targetType}
1390 1388
             end)
1391 1389
         </if>
1392 1390
         <if test="startDate != null">
@@ -1404,11 +1402,11 @@
1404 1402
 
1405 1403
         left join (
1406 1404
         select count(*) as addRegistNum ,addRegistNum.target_id, addRegistNum.target_type From (
1407
-        select count(*), a.* From ta_customer_from a where a.target_type IN ( 'dynamic', 'h5',
1405
+        select count(*), a.* From ta_customer_from a where a.target_type IN ( 'dymic', 'h5',
1408 1406
         'help', 'live', 'group', 'activity') and a.org_id = #{orgId}
1409 1407
         and a.is_org_first = 1
1410 1408
         <if test="targetType != null and targetType != '' and targetType != 'h5'">
1411
-            and a.target_type = concat(REPLACE(#{targetType}, 'activity', 'dynamic'), '_share')
1409
+            and a.target_type = concat(REPLACE(#{targetType}, 'activity', 'dymic'), '_share')
1412 1410
         </if>
1413 1411
         <if test="startDate != null ">
1414 1412
             and a.create_date &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
@@ -1554,7 +1552,7 @@
1554 1552
             and t.target_id = #{activityId}
1555 1553
         </if>
1556 1554
         <if test="activityType != null and activityType != ''">
1557
-            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
1555
+            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dymic'), '_share')
1558 1556
         </if>
1559 1557
         and t.org_id = #{orgId} group by t.share_person) t
1560 1558
         left join ta_person a on t.share_person = a.person_id
@@ -1573,7 +1571,7 @@
1573 1571
             and t.target_id = #{activityId}
1574 1572
         </if>
1575 1573
         <if test="activityType != null and activityType != ''">
1576
-            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
1574
+            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dymic'), '_share')
1577 1575
         </if>
1578 1576
         and t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share')
1579 1577
         and t.org_id = #{orgId}
@@ -1715,7 +1713,7 @@
1715 1713
             and t.target_id = #{activityId}
1716 1714
         </if>
1717 1715
         <if test="activityType != null and activityType != ''">
1718
-            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
1716
+            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dymic'), '_share')
1719 1717
         </if>
1720 1718
         and t.org_id = #{orgId} ) t
1721 1719
         left join ta_person a on t.share_person = a.person_id
@@ -1734,7 +1732,7 @@
1734 1732
             and t.target_id = #{activityId}
1735 1733
         </if>
1736 1734
         <if test="activityType != null and activityType != ''">
1737
-            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
1735
+            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dymic'), '_share')
1738 1736
         </if>
1739 1737
         and t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share')
1740 1738
         and t.org_id = #{orgId}
@@ -1983,7 +1981,7 @@
1983 1981
         left join ta_recommend_customer c on c.person_id = t.person_id and c.realty_consultant is not null
1984 1982
         LEFT JOIN ta_user d ON c.realty_consultant = d.user_id
1985 1983
         LEFT JOIN ta_person e ON t.share_person_id = e.person_id
1986
-        WHERE t.target_type in ('dynamic','h5','help','live', 'group','activity') and t.org_id =
1984
+        WHERE t.target_type in ('dymic','h5','help','live', 'group','activity') and t.org_id =
1987 1985
         #{orgId}
1988 1986
         and t.is_org_first = 1
1989 1987
         and t.create_date >= DATE_FORMAT(#{startDate}, '%Y-%m-%d' ) and t.create_date &lt;= DATE_FORMAT(#{endDate},
@@ -2024,7 +2022,7 @@
2024 2022
         left join ta_recommend_customer c on c.person_id = t.person_id
2025 2023
         LEFT JOIN ta_user d ON c.realty_consultant = d.user_id
2026 2024
         LEFT JOIN ta_person e ON t.share_person_id = e.person_id
2027
-        WHERE t.target_type in ('dynamic','h5','help','live', 'group','activity') and t.org_id =
2025
+        WHERE t.target_type in ('dymic','h5','help','live', 'group','activity') and t.org_id =
2028 2026
         #{orgId}
2029 2027
         and t.is_org_first = 1
2030 2028
         and t.create_date >= DATE_FORMAT(#{startDate}, '%Y-%m-%d' ) and t.create_date &lt;= DATE_FORMAT(#{endDate},
@@ -2070,7 +2068,7 @@
2070 2068
             and t.target_id = #{activityId}
2071 2069
         </if>
2072 2070
         <if test="activityType != null and activityType != ''">
2073
-            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
2071
+            and (case when #{activityType} = 'activity' then t.target_type = 'dymic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
2074 2072
             end)
2075 2073
         </if>
2076 2074
         <if test="buildingId != null and buildingId != ''">
@@ -2133,7 +2131,7 @@
2133 2131
             and t.target_id = #{activityId}
2134 2132
         </if>
2135 2133
         <if test="activityType != null and activityType != ''">
2136
-            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
2134
+            and (case when #{activityType} = 'activity' then t.target_type = 'dymic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
2137 2135
             end)
2138 2136
         </if>
2139 2137
         <if test="buildingId != null and buildingId != ''">
@@ -2202,7 +2200,7 @@
2202 2200
             and t.target_id = #{activityId}
2203 2201
         </if>
2204 2202
         <if test="activityType != null and activityType != ''">
2205
-            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
2203
+            and (case when #{activityType} = 'activity' then t.target_type = 'dymic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
2206 2204
             end)
2207 2205
         </if>
2208 2206
         <if test="buildingId != null and buildingId != ''">
@@ -2269,7 +2267,7 @@
2269 2267
             and t.target_id = #{activityId}
2270 2268
         </if>
2271 2269
         <if test="activityType != null and activityType != ''">
2272
-            and (case when #{activityType} = 'activity' then t.target_type = 'dynamic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
2270
+            and (case when #{activityType} = 'activity' then t.target_type = 'dymic' when #{activityType} = 'h5' then t.event_type = 'h5' else t.target_type = #{activityType}
2273 2271
             end)
2274 2272
         </if>
2275 2273
         <if test="buildingId != null and buildingId != ''">
@@ -2322,7 +2320,7 @@
2322 2320
             and t.target_id = #{activityId}
2323 2321
         </if>
2324 2322
         <if test="activityType != null and activityType != ''">
2325
-            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
2323
+            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dymic'), '_share')
2326 2324
         </if>
2327 2325
         and t.target_type in
2328 2326
         ('dynamic_share','h5_share','help_share','live_share', 'group_share')
@@ -2368,7 +2366,7 @@
2368 2366
             and t.target_id = #{activityId}
2369 2367
         </if>
2370 2368
         <if test="activityType != null and activityType != ''">
2371
-            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
2369
+            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dymic'), '_share')
2372 2370
         </if>
2373 2371
         and
2374 2372
         (t.share_person = (select b.user_id from ta_person t left join ta_user b on t.user_id = b.user_id where t.person_id = #{personId})
@@ -2406,7 +2404,7 @@
2406 2404
             and t.target_id = #{activityId}
2407 2405
         </if>
2408 2406
         <if test="activityType != null and activityType != ''">
2409
-            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
2407
+            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dymic'), '_share')
2410 2408
         </if>
2411 2409
         and t.target_type in
2412 2410
         ('dynamic_share','h5_share','help_share','live_share', 'group_share')
@@ -2453,7 +2451,7 @@
2453 2451
             and t.target_id = #{activityId}
2454 2452
         </if>
2455 2453
         <if test="activityType != null and activityType != ''">
2456
-            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
2454
+            and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dymic'), '_share')
2457 2455
         </if>
2458 2456
         and
2459 2457
         (t.share_person = (select b.user_id from ta_person t left join ta_user b on t.user_id = b.user_id where t.person_id = #{personId})