|
@@ -131,6 +131,12 @@
|
131
|
131
|
<if test="startDate == null or endDate == null">
|
132
|
132
|
AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
133
|
133
|
</if>
|
|
134
|
+ <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
|
|
135
|
+ AND t.building_id in
|
|
136
|
+ <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
|
|
137
|
+ #{taPersonBuilding.buildingId}
|
|
138
|
+ </foreach>
|
|
139
|
+ </if>
|
134
|
140
|
GROUP BY
|
135
|
141
|
DATE_FORMAT(t.visit_time, '%Y-%m-%d'),
|
136
|
142
|
person_id) as visitPersonCount
|
|
@@ -152,6 +158,12 @@
|
152
|
158
|
<if test="endDate != null">
|
153
|
159
|
and t.visit_time <= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S' )
|
154
|
160
|
</if>
|
|
161
|
+ <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
|
|
162
|
+ AND t.building_id in
|
|
163
|
+ <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
|
|
164
|
+ #{taPersonBuilding.buildingId}
|
|
165
|
+ </foreach>
|
|
166
|
+ </if>
|
155
|
167
|
</select>
|
156
|
168
|
|
157
|
169
|
<select id="selectShareCount" resultType="java.util.Map">
|
|
@@ -170,7 +182,7 @@
|
170
|
182
|
sequence a
|
171
|
183
|
<trim prefix="where">
|
172
|
184
|
<if test="startDate != null or endDate != null">
|
173
|
|
- a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
|
|
185
|
+ a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
|
174
|
186
|
</if>
|
175
|
187
|
</trim>
|
176
|
188
|
) AS temp_date
|
|
@@ -248,7 +260,7 @@
|
248
|
260
|
sequence a
|
249
|
261
|
<trim prefix="where">
|
250
|
262
|
<if test="startDate != null or endDate != null">
|
251
|
|
- a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
|
|
263
|
+ a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
|
252
|
264
|
</if>
|
253
|
265
|
</trim>
|
254
|
266
|
) AS temp_date
|
|
@@ -326,7 +338,7 @@
|
326
|
338
|
sequence a
|
327
|
339
|
<trim prefix="where">
|
328
|
340
|
<if test="startDate != null or endDate != null">
|
329
|
|
- a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
|
|
341
|
+ a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
|
330
|
342
|
</if>
|
331
|
343
|
</trim>
|
332
|
344
|
) AS temp_date
|
|
@@ -354,6 +366,12 @@
|
354
|
366
|
<if test="startDate == null or endDate == null ">
|
355
|
367
|
AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
356
|
368
|
</if>
|
|
369
|
+ <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
|
|
370
|
+ AND t.building_id in
|
|
371
|
+ <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
|
|
372
|
+ #{taPersonBuilding.buildingId}
|
|
373
|
+ </foreach>
|
|
374
|
+ </if>
|
357
|
375
|
GROUP BY
|
358
|
376
|
DATE_FORMAT( t.visit_time, '%Y-%m-%d' )
|
359
|
377
|
) AS temp ON temp_date.date = DATE_FORMAT( temp.create_date, '%Y-%m-%d' )
|
|
@@ -376,7 +394,7 @@
|
376
|
394
|
sequence a
|
377
|
395
|
<trim prefix="where">
|
378
|
396
|
<if test="startDate != null or endDate != null">
|
379
|
|
- a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
|
|
397
|
+ a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
|
380
|
398
|
</if>
|
381
|
399
|
</trim>
|
382
|
400
|
) AS temp_date
|
|
@@ -405,6 +423,12 @@
|
405
|
423
|
<if test="startDate == null or endDate == null">
|
406
|
424
|
AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
407
|
425
|
</if>
|
|
426
|
+ <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
|
|
427
|
+ AND t.building_id in
|
|
428
|
+ <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
|
|
429
|
+ #{taPersonBuilding.buildingId}
|
|
430
|
+ </foreach>
|
|
431
|
+ </if>
|
408
|
432
|
GROUP BY
|
409
|
433
|
DATE_FORMAT(t.visit_time, '%Y-%m-%d'),
|
410
|
434
|
person_id) as visitPersonCount GROUP BY DATE_FORMAT(visitPersonCount.create_date, '%Y-%m-%d')
|
|
@@ -425,7 +449,7 @@
|
425
|
449
|
sequence a
|
426
|
450
|
<trim prefix="where">
|
427
|
451
|
<if test="startDate != null or endDate != null">
|
428
|
|
- a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
|
|
452
|
+ a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
|
429
|
453
|
</if>
|
430
|
454
|
</trim>
|
431
|
455
|
) AS temp_date
|
|
@@ -460,6 +484,12 @@
|
460
|
484
|
<if test="startDate == null or endDate == null">
|
461
|
485
|
AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
462
|
486
|
</if>
|
|
487
|
+ <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
|
|
488
|
+ AND t.building_id in
|
|
489
|
+ <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
|
|
490
|
+ #{taPersonBuilding.buildingId}
|
|
491
|
+ </foreach>
|
|
492
|
+ </if>
|
463
|
493
|
) AS temp4
|
464
|
494
|
GROUP BY
|
465
|
495
|
DATE_FORMAT( temp4.create_date, '%Y-%m-%d' )
|
|
@@ -481,7 +511,7 @@
|
481
|
511
|
sequence a
|
482
|
512
|
<trim prefix="where">
|
483
|
513
|
<if test="startDate != null or endDate != null">
|
484
|
|
- a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
|
|
514
|
+ a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
|
485
|
515
|
</if>
|
486
|
516
|
</trim>
|
487
|
517
|
) AS temp_date
|
|
@@ -614,6 +644,12 @@
|
614
|
644
|
<if test="startDate == null or endDate == null ">
|
615
|
645
|
AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
616
|
646
|
</if>
|
|
647
|
+ <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
|
|
648
|
+ AND t.building_id in
|
|
649
|
+ <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
|
|
650
|
+ #{taPersonBuilding.buildingId}
|
|
651
|
+ </foreach>
|
|
652
|
+ </if>
|
617
|
653
|
GROUP BY
|
618
|
654
|
DATE_FORMAT( t.visit_time, '%Y-%m-%d' )
|
619
|
655
|
) AS temp2 ON temp_date.date = DATE_FORMAT( temp2.create_date, '%Y-%m-%d' )
|
|
@@ -642,6 +678,12 @@
|
642
|
678
|
<if test="startDate == null or endDate == null">
|
643
|
679
|
AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
644
|
680
|
</if>
|
|
681
|
+ <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
|
|
682
|
+ AND t.building_id in
|
|
683
|
+ <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
|
|
684
|
+ #{taPersonBuilding.buildingId}
|
|
685
|
+ </foreach>
|
|
686
|
+ </if>
|
645
|
687
|
GROUP BY
|
646
|
688
|
DATE_FORMAT(t.visit_time, '%Y-%m-%d'),
|
647
|
689
|
person_id) as visitPersonCount GROUP BY DATE_FORMAT(visitPersonCount.create_date, '%Y-%m-%d')
|
|
@@ -694,7 +736,7 @@
|
694
|
736
|
sequence a
|
695
|
737
|
<trim prefix="where">
|
696
|
738
|
<if test="startDate != null or endDate != null">
|
697
|
|
- a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
|
|
739
|
+ a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
|
698
|
740
|
</if>
|
699
|
741
|
</trim>
|
700
|
742
|
) AS temp_date
|
|
@@ -826,6 +868,12 @@
|
826
|
868
|
<if test="startDate == null or endDate == null ">
|
827
|
869
|
AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
828
|
870
|
</if>
|
|
871
|
+ <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
|
|
872
|
+ AND t.building_id in
|
|
873
|
+ <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
|
|
874
|
+ #{taPersonBuilding.buildingId}
|
|
875
|
+ </foreach>
|
|
876
|
+ </if>
|
829
|
877
|
GROUP BY
|
830
|
878
|
DATE_FORMAT( t.visit_time, '%Y-%m-%d' )
|
831
|
879
|
) AS temp2 ON temp_date.date = DATE_FORMAT( temp2.create_date, '%Y-%m-%d' )
|
|
@@ -853,6 +901,12 @@
|
853
|
901
|
<if test="startDate == null or endDate == null">
|
854
|
902
|
AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
855
|
903
|
</if>
|
|
904
|
+ <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
|
|
905
|
+ AND t.building_id in
|
|
906
|
+ <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
|
|
907
|
+ #{taPersonBuilding.buildingId}
|
|
908
|
+ </foreach>
|
|
909
|
+ </if>
|
856
|
910
|
GROUP BY
|
857
|
911
|
DATE_FORMAT(t.visit_time, '%Y-%m-%d'),
|
858
|
912
|
person_id) as visitPersonCount GROUP BY DATE_FORMAT(visitPersonCount.create_date, '%Y-%m-%d')
|
|
@@ -1027,7 +1081,8 @@
|
1027
|
1081
|
<if test="startDate == null or endDate == null ">
|
1028
|
1082
|
AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
1029
|
1083
|
</if>
|
1030
|
|
- group by a.person_id, be_share, tagert_type
|
|
1084
|
+ group by a.person_id
|
|
1085
|
+<!-- , be_share, tagert_type-->
|
1031
|
1086
|
) as sharePersonNum group by sharePersonNum.be_share, sharePersonNum.tagert_type
|
1032
|
1087
|
) as sharePersonNum on sharePersonNum.be_share = activity.activityId and sharePersonNum.tagert_type =
|
1033
|
1088
|
activity.activityType
|
|
@@ -1372,7 +1427,8 @@
|
1372
|
1427
|
and t.be_share = #{activityId}
|
1373
|
1428
|
</if>
|
1374
|
1429
|
<if test="activityType != null and activityType != ''">
|
1375
|
|
- and t.tagert_type = #{activityType}
|
|
1430
|
+ and (case when #{activityType} = 'live' then t.tagert_type in ('liveApp', 'livePost') else t.tagert_type = #{activityType}
|
|
1431
|
+ end)
|
1376
|
1432
|
</if>
|
1377
|
1433
|
<if test="sharePersonType != null and sharePersonType != ''">
|
1378
|
1434
|
and f.person_type = #{sharePersonType}
|
|
@@ -1404,7 +1460,8 @@
|
1404
|
1460
|
and t.be_share = #{activityId}
|
1405
|
1461
|
</if>
|
1406
|
1462
|
<if test="activityType != null and activityType != ''">
|
1407
|
|
- and t.tagert_type = #{activityType}
|
|
1463
|
+ and (case when #{activityType} = 'live' then t.tagert_type in ('liveApp', 'livePost') else t.tagert_type = #{activityType}
|
|
1464
|
+ end)
|
1408
|
1465
|
</if>
|
1409
|
1466
|
group by person_id
|
1410
|
1467
|
) as temp
|
|
@@ -1444,7 +1501,9 @@
|
1444
|
1501
|
and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
|
1445
|
1502
|
</if>
|
1446
|
1503
|
and t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share')
|
1447
|
|
- and t.org_id = #{orgId} group by t.share_person ) t
|
|
1504
|
+ and t.org_id = #{orgId}
|
|
1505
|
+<!-- group by t.share_person -->
|
|
1506
|
+ ) t
|
1448
|
1507
|
left join ta_person a on t.share_person = a.person_id
|
1449
|
1508
|
left join ta_person b on t.share_person = b.user_id
|
1450
|
1509
|
) as visitPersonNum on visitPersonNum.person_id = person.person_id
|
|
@@ -1512,7 +1571,8 @@
|
1512
|
1571
|
and t.be_share = #{activityId}
|
1513
|
1572
|
</if>
|
1514
|
1573
|
<if test="activityType != null and activityType != ''">
|
1515
|
|
- and t.tagert_type = #{activityType}
|
|
1574
|
+ and (case when #{activityType} = 'live' then t.tagert_type in ('liveApp', 'livePost') else t.tagert_type = #{activityType}
|
|
1575
|
+ end)
|
1516
|
1576
|
</if>
|
1517
|
1577
|
<if test="sharePersonType != null and sharePersonType != ''">
|
1518
|
1578
|
and f.person_type = #{sharePersonType}
|
|
@@ -1544,7 +1604,8 @@
|
1544
|
1604
|
and t.be_share = #{activityId}
|
1545
|
1605
|
</if>
|
1546
|
1606
|
<if test="activityType != null and activityType != ''">
|
1547
|
|
- and t.tagert_type = #{activityType}
|
|
1607
|
+ and (case when #{activityType} = 'live' then t.tagert_type in ('liveApp', 'livePost') else t.tagert_type = #{activityType}
|
|
1608
|
+ end)
|
1548
|
1609
|
</if>
|
1549
|
1610
|
group by person_id
|
1550
|
1611
|
) as temp
|
|
@@ -1618,7 +1679,8 @@
|
1618
|
1679
|
and t.be_share = #{activityId}
|
1619
|
1680
|
</if>
|
1620
|
1681
|
<if test="activityType != null and activityType != ''">
|
1621
|
|
- and t.tagert_type = #{activityType}
|
|
1682
|
+ and (case when #{activityType} = 'live' then t.tagert_type in ('liveApp', 'livePost') else t.tagert_type = #{activityType}
|
|
1683
|
+ end)
|
1622
|
1684
|
</if>
|
1623
|
1685
|
<if test="buildingId != null and buildingId != ''">
|
1624
|
1686
|
and (
|