顾绍勇 пре 5 година
родитељ
комит
43eab81709
1 измењених фајлова са 8 додато и 2 уклоњено
  1. 8
    2
      src/main/resources/mapper/TsConsultantKpiMapper.xml

+ 8
- 2
src/main/resources/mapper/TsConsultantKpiMapper.xml Прегледај датотеку

24
                 IFNULL(sum( t.chat_persons ),0) AS chat_persons,
24
                 IFNULL(sum( t.chat_persons ),0) AS chat_persons,
25
                 IFNULL(sum( t.favor_num ),0) AS favor_num,
25
                 IFNULL(sum( t.favor_num ),0) AS favor_num,
26
                 (select count(DISTINCT s.customer_id) from ta_recommend_customer s
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
             FROM
32
             FROM
29
                 ts_consultant_kpi t
33
                 ts_consultant_kpi t
30
             LEFT JOIN ta_person m on m.org_id = #{orgId} and m.user_id = t.user_id
34
             LEFT JOIN ta_person m on m.org_id = #{orgId} and m.user_id = t.user_id
141
         WHERE
145
         WHERE
142
             p.org_id = #{orgId}
146
             p.org_id = #{orgId}
143
             AND p.`status` > 0
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
         <if test="buildingIds != null">
151
         <if test="buildingIds != null">
146
             AND t.building_id in
152
             AND t.building_id in
147
             <foreach item="buildingId" index="index" collection="buildingIds"
153
             <foreach item="buildingId" index="index" collection="buildingIds"