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