|
@@ -24,7 +24,11 @@
|
24
|
24
|
IFNULL(sum( t.chat_persons ),0) AS chat_persons,
|
25
|
25
|
IFNULL(sum( t.favor_num ),0) AS favor_num,
|
26
|
26
|
(select count(DISTINCT s.customer_id) from ta_recommend_customer s
|
27
|
|
- where s.org_id = t.org_id and (s.realty_consultant = t.user_id or s.realty_consultant = m.person_id) and (s.building_id = t.building_id or IFNULL(t.building_id, '') = '') and s.status > 0) as total_persons
|
|
27
|
+ where s.org_id = t.org_id and (s.realty_consultant = t.user_id or s.realty_consultant = m.person_id)
|
|
28
|
+ and (s.building_id = t.building_id or IFNULL(t.building_id, '') = '')
|
|
29
|
+ and s.status > 0
|
|
30
|
+ AND s.create_date BETWEEN STR_TO_DATE( #{startDate}, '%Y%m%d' )
|
|
31
|
+ AND STR_TO_DATE(concat(#{endDate}, '235959'), '%Y%m%d%H%i%s')) as total_persons
|
28
|
32
|
FROM
|
29
|
33
|
ts_consultant_kpi t
|
30
|
34
|
LEFT JOIN ta_person m on m.org_id = #{orgId} and m.user_id = t.user_id
|
|
@@ -141,7 +145,9 @@
|
141
|
145
|
WHERE
|
142
|
146
|
p.org_id = #{orgId}
|
143
|
147
|
AND p.`status` > 0
|
144
|
|
- AND t.statis_date BETWEEN #{startDate} AND #{endDate}
|
|
148
|
+
|
|
149
|
+ AND p.create_date BETWEEN STR_TO_DATE( #{startDate}, '%Y%m%d')
|
|
150
|
+ AND STR_TO_DATE(concat(#{endDate}, '235959'), '%Y%m%d%H%i%s')
|
145
|
151
|
<if test="buildingIds != null">
|
146
|
152
|
AND t.building_id in
|
147
|
153
|
<foreach item="buildingId" index="index" collection="buildingIds"
|