魏超 5 년 전
부모
커밋
86d039ee1f
1개의 변경된 파일11개의 추가작업 그리고 4개의 파일을 삭제
  1. 11
    4
      src/main/resources/mapper/statistic/TaActivityStaticMapper.xml

+ 11
- 4
src/main/resources/mapper/statistic/TaActivityStaticMapper.xml 파일 보기

@@ -2040,6 +2040,7 @@
2040 2040
         d.user_name as realtyConsultant,
2041 2041
         d.phone as realtyConsultantPhone,
2042 2042
         t.create_date as visitDate,
2043
+        ifnull(e.nickName, f.user_name) as sharePersonName,
2043 2044
         t.visitNum
2044 2045
         from (
2045 2046
         SELECT
@@ -2075,6 +2076,8 @@
2075 2076
         left join td_wx_dict b1 on b.scene_id = b1.scene_id
2076 2077
         LEFT JOIN ta_recommend_customer c on c.person_id = t.person_id
2077 2078
         left join ta_user d on c.realty_consultant = d.user_id
2079
+        left join ta_person e on e.person_id = c.recommend_person
2080
+        left join ta_user f on f.user_id = c.recommend_person
2078 2081
         <where>
2079 2082
             <if test="personFrom != null and personFrom != ''">
2080 2083
                 and b.scene_id = #{personFrom}
@@ -2083,10 +2086,10 @@
2083 2086
                 and a.province = #{province}
2084 2087
             </if>
2085 2088
             <if test="realtyConsultant != null and realtyConsultant != ''">
2086
-                and d.name = #{realtyConsultant}
2089
+                and d.user_name like concat('%', #{realtyConsultant},'%')
2087 2090
             </if>
2088 2091
             <if test="realtyConsultantPhone != null and realtyConsultantPhone != ''">
2089
-                and d.phone = #{realtyConsultantPhone}
2092
+                and d.phone like concat('%', #{realtyConsultantPhone},'%')
2090 2093
             </if>
2091 2094
         </where>
2092 2095
         order by t.create_date desc
@@ -2102,6 +2105,7 @@
2102 2105
         d.user_name as realtyConsultant,
2103 2106
         d.phone as realtyConsultantPhone,
2104 2107
         t.create_date as visitDate,
2108
+        ifnull(e.nickName, f.user_name) as sharePersonName,
2105 2109
         t.visitNum
2106 2110
         from (
2107 2111
         SELECT
@@ -2137,6 +2141,8 @@
2137 2141
         left join td_wx_dict b1 on b.scene_id = b1.scene_id
2138 2142
         LEFT JOIN ta_recommend_customer c on c.person_id = t.person_id
2139 2143
         left join ta_user d on c.realty_consultant = d.user_id
2144
+        left join ta_person e on e.person_id = c.recommend_person
2145
+        left join ta_user f on f.user_id = c.recommend_person
2140 2146
         <where>
2141 2147
             <if test="personFrom != null and personFrom != ''">
2142 2148
                 and b.scene_id = #{personFrom}
@@ -2145,14 +2151,15 @@
2145 2151
                 and a.province = #{province}
2146 2152
             </if>
2147 2153
             <if test="realtyConsultant != null and realtyConsultant != ''">
2148
-                and d.name = #{realtyConsultant}
2154
+                and d.user_name like concat('%', #{realtyConsultant},'%')
2149 2155
             </if>
2150 2156
             <if test="realtyConsultantPhone != null and realtyConsultantPhone != ''">
2151
-                and d.phone = #{realtyConsultantPhone}
2157
+                and d.phone like concat('%', #{realtyConsultantPhone},'%')
2152 2158
             </if>
2153 2159
         </where>
2154 2160
         order by t.create_date desc
2155 2161
     </select>
2162
+    
2156 2163
     <select id="selectActivityVisitPersonNumByPersonId"
2157 2164
             resultType="com.huiju.estateagents.excel.ActivityStatistics.VisitPersonNum">
2158 2165
         select