|
@@ -1105,7 +1105,7 @@
|
1105
|
1105
|
) as activity
|
1106
|
1106
|
|
1107
|
1107
|
left join (
|
1108
|
|
- SELECT count(1) as shareNum, 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
|
|
1108
|
+ SELECT count(1) as shareNum, 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
|
1109
|
1109
|
FROM ta_share_count a where a.tagert_type in (
|
1110
|
1110
|
'activity', 'group','h5','help','liveApp','livePost')
|
1111
|
1111
|
and a.org_id = #{orgId}
|
|
@@ -1122,7 +1122,7 @@
|
1122
|
1122
|
<if test="startDate == null or endDate == null ">
|
1123
|
1123
|
AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
1124
|
1124
|
</if>
|
1125
|
|
- group by a.be_share,a.tagert_type
|
|
1125
|
+ group by a.be_share,a.tagert_type order by a.create_date desc limit 9999999
|
1126
|
1126
|
) as shareNum on shareNum.be_share = activity.activityId and shareNum.tagert_type = activity.activityType
|
1127
|
1127
|
|
1128
|
1128
|
left join (
|
|
@@ -1317,7 +1317,7 @@
|
1317
|
1317
|
) as activity
|
1318
|
1318
|
|
1319
|
1319
|
left join (
|
1320
|
|
- SELECT count(1) as shareNum, 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
|
|
1320
|
+ SELECT count(1) as shareNum, 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
|
1321
|
FROM ta_share_count a where a.tagert_type in (
|
1322
|
1322
|
'activity', 'group','h5','help','liveApp','livePost')
|
1323
|
1323
|
and a.org_id = #{orgId}
|
|
@@ -1334,7 +1334,7 @@
|
1334
|
1334
|
<if test="startDate == null or endDate == null ">
|
1335
|
1335
|
AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
1336
|
1336
|
</if>
|
1337
|
|
- group by a.be_share,a.tagert_type
|
|
1337
|
+ group by a.be_share,a.tagert_type order by a.create_date desc limit 9999999
|
1338
|
1338
|
) as shareNum on shareNum.be_share = activity.activityId and shareNum.tagert_type = activity.activityType
|
1339
|
1339
|
|
1340
|
1340
|
left join (
|
|
@@ -2002,7 +2002,7 @@
|
2002
|
2002
|
<if test="buildingId != null and buildingId != ''">
|
2003
|
2003
|
and c.building_id = #{buildingId}
|
2004
|
2004
|
</if>
|
2005
|
|
- group by t.person_id
|
|
2005
|
+ group by t.person_id order by t.create_date desc
|
2006
|
2006
|
</select>
|
2007
|
2007
|
|
2008
|
2008
|
<select id="selectActivityAddRegistNumExport"
|
|
@@ -2012,18 +2012,18 @@
|
2012
|
2012
|
if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
|
2013
|
2013
|
a.province,
|
2014
|
2014
|
b1.scene_alias as personFrom,
|
2015
|
|
- GROUP_CONCAT(c.name) as realtyConsultant,
|
2016
|
|
- ifnull(d.phone, d.tel) as realtyConsultantPhone,
|
2017
|
|
- ifnull(e.nickname, f.user_name) as sharePersonName,
|
2018
|
|
- ifnull(e.phone, e.tel) as sharePersonPhone
|
|
2015
|
+ GROUP_CONCAT(d.user_name) as realtyConsultant,
|
|
2016
|
+ d.phone as realtyConsultantPhone,
|
|
2017
|
+ ifnull(e.nickname, f.name) as sharePersonName,
|
|
2018
|
+ ifnull(e.phone, f.phone) as sharePersonPhone
|
2019
|
2019
|
FROM ta_share_person_from t
|
2020
|
2020
|
left join ta_person a on t.person_id = a.person_id
|
2021
|
2021
|
left join ta_person_from_record b on a.person_id = b.person_id and b.org_id = #{orgId} and b.is_first_time =1
|
2022
|
2022
|
left join td_wx_dict b1 on b.scene_id = b1.scene_id
|
2023
|
2023
|
left join ta_recommend_customer c on c.person_id = t.person_id
|
2024
|
|
- left join ta_person d on c.recommend_person = d.person_id
|
2025
|
|
- left join ta_person e on t.share_person = e.person_id
|
2026
|
|
- left join ta_user f on t.share_person = f.user_id
|
|
2024
|
+ LEFT JOIN ta_user d ON c.realty_consultant = d.user_id
|
|
2025
|
+ LEFT JOIN ta_person e ON t.share_person = e.person_id
|
|
2026
|
+ LEFT JOIN ta_person f ON t.share_person = f.user_id
|
2027
|
2027
|
WHERE t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share') and t.org_id =
|
2028
|
2028
|
#{orgId} and t.status = 1
|
2029
|
2029
|
and t.is_first_time = 1
|
|
@@ -2044,7 +2044,7 @@
|
2044
|
2044
|
<if test="buildingId != null and buildingId != ''">
|
2045
|
2045
|
and c.building_id = #{buildingId}
|
2046
|
2046
|
</if>
|
2047
|
|
- group by t.person_id
|
|
2047
|
+ group by t.person_id order by t.create_date desc
|
2048
|
2048
|
</select>
|
2049
|
2049
|
|
2050
|
2050
|
<select id="selectActivityVisitNum" resultType="com.huiju.estateagents.excel.ActivityStatistics.VisitNum">
|