Procházet zdrojové kódy

Merge commit '4f47b86599f4e6aad3b91ff7608d2aa2c8944825' into dev

# Conflicts:
#	src/main/resources/mapper/TaActivityDynamicEnlistMapper.xml
#	src/main/resources/mapper/TaPersonMapper.xml
#	src/main/resources/mapper/TaRecommendCustomerMapper.xml
weichaochao před 5 roky
rodič
revize
7e76a3c3a9

+ 2
- 1
src/main/resources/mapper/TaActivityDynamicEnlistMapper.xml Zobrazit soubor

@@ -29,7 +29,7 @@
29 29
                         and tade.phone like CONCAT('%',#{phone}, '%')
30 30
                     </if>
31 31
                 </where>
32
-            GROUP BY tade.person_id
32
+            group by tade.person_id
33 33
 
34 34
         </select>
35 35
 
@@ -63,6 +63,7 @@
63 63
                 and tade.phone like CONCAT('%',#{phone}, '%')
64 64
             </if>
65 65
         </where>
66
+        group by tade.person_id
66 67
         limit #{pageCode}, #{pageSize}
67 68
     </select>
68 69
 </mapper>

+ 1
- 0
src/main/resources/mapper/TaPersonMapper.xml Zobrazit soubor

@@ -258,6 +258,7 @@ FROM
258 258
                ta_person tp
259 259
              LEFT JOIN
260 260
             ( SELECT *, MAX(visit_time) as max_visit_time FROM ta_person_visit_record where org_id = #{org} GROUP BY  person_id  ) as tpvr
261
+                ( SELECT *, MAX(visit_time) as max_visit_time FROM ta_person_visit_record where org_id = #{org} GROUP BY  person_id  ) as tpvr
261 262
             ON tp.person_id = tpvr.person_id
262 263
              where tp.org_id = #{org} AND tp.person_type IN ('customer','drift','estate agent')
263 264
              GROUP BY DATE_FORMAT( tpvr.max_visit_time , '%Y-%m-%d' )

+ 6
- 3
src/main/resources/mapper/TaRecommendCustomerMapper.xml Zobrazit soubor

@@ -111,12 +111,13 @@ FROM
111 111
         SELECT
112 112
         a.*,
113 113
         a.customer_id AS customerId,
114
-        b.NAME AS consultantName,
115
-        b.tel AS consultTel,
114
+        if(b.NAME  = null, d.name, b.name) as consultantName,
115
+        if(b.tel  = null, d.tel, b.tel) AS consultTel,
116 116
         c.building_name as intentionName
117 117
         FROM
118 118
         ta_recommend_customer a
119
-        LEFT JOIN ta_person b ON (a.realty_consultant = b.person_id or a.realty_consultant = b.user_id)
119
+        LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
120
+        LEFT JOIN ta_person d on a.realty_consultant = d.user_id
120 121
         LEFT JOIN ta_building c ON a.building_id = c.building_id
121 122
         <where>
122 123
             a.status > 0
@@ -553,6 +554,7 @@ FROM
553 554
         order by b.create_date desc
554 555
     </select>
555 556
 <!--    limit #{pageCode}, #{pageSize}-->
557
+
556 558
     <select id="getCustomerExportListCount" resultType="Integer" >
557 559
         SELECT
558 560
             count(1)
@@ -672,6 +674,7 @@ FROM
672 674
         order by a.create_date desc
673 675
     </select>
674 676
 <!--    limit #{pageCode}, #{pageSize}-->
677
+
675 678
     <select id="getMyCustStatistics" resultType="java.util.Map">
676 679
         SELECT
677 680
             sum( IF ( STATUS = 4 AND verify_status = 1, 1, 0 ) ) AS clinchSum,