weichaochao 5 years ago
parent
commit
f68cfd50be

+ 6
- 3
src/main/resources/mapper/TaPreselectionRecordMapper.xml View File

@@ -52,6 +52,7 @@
52 52
     </select>
53 53
 
54 54
     <select id="selectPreSelectRecordList" resultType="com.huiju.estateagents.po.TaPreselectionRecordPO">
55
+        select * from (
55 56
         select t.house_id,
56 57
         a.block_name,
57 58
         a.unit_name,
@@ -68,17 +69,18 @@
68 69
         t.building_id,
69 70
         t.sales_batch_id,
70 71
         e.apartment_name,
72
+        b.person_id,
71 73
         (select name from ta_person t where (t.user_id = t.update_user || t.person_id = t.update_user)) as updateName
72 74
         from ta_preselection_record t
73 75
         left join ta_housing_resources a on t.house_id = a.house_id
74 76
         left join ta_person b on t.person_id = b.person_id
75 77
         LEFT JOIN ta_building_apartment e ON a.apartment_id = e.apartment_id
76 78
         where b.org_id = #{orgId} and a.sales_batch_id = #{salesBatchId}
77
-        <if test="houseId != null and houseId !=''">
78
-          and t.house_id = #{houseId}
79
+        <if test="houseId != null and houseId !=''">and t.house_id = #{houseId}
79 80
         </if>
80 81
         <if test="phone != null and phone != ''">
81
-          and b.phone = #{phone}
82
+            and b.
83
+            phone = #{phone}
82 84
         </if>
83 85
         <if test="apartmentId != null and apartmentId != ''">
84 86
           and a.apartment_id = #{apartmentId}
@@ -86,6 +88,7 @@
86 88
         <if test="status != null">
87 89
           and t.status = #{status}
88 90
         </if>
91
+        order by t.create_date desc) t group by t.house_id, t.person_id
89 92
     </select>
90 93
 
91 94
 </mapper>

+ 3
- 1
src/main/resources/mapper/TaShareCountMapper.xml View File

@@ -66,6 +66,7 @@
66 66
                 when d.`name` != null || d.name != '' then d.`name`
67 67
                 when e.building_name != null || e.building_name != '' then e.building_name
68 68
                 when f.news_name != null || f.news_name != '' then f.news_name
69
+                when h.sales_batch_name != null || h.sales_batch_name !='' then h.sales_batch_name
69 70
                 when a.`name` != null || a.`name` != '' then a.`name`
70 71
                 else '空'
71 72
                 end as shareTitle,
@@ -82,7 +83,7 @@
82 83
                 LEFT JOIN ta_drainage d on t.target_id = d.drainage_id and t.target_type = 'h5_share'
83 84
                 left join ta_building e on t.target_id = e.building_id and t.target_type = 'building_share'
84 85
                 LEFT JOIN ta_news f on t.target_id = f.news_id and t.target_type = 'news_share'
85
-
86
+                left join ta_sales_batch h on t.target_id = h.sales_batch_id and t.target_type = 'house_share'
86 87
         LEFT JOIN ta_person a ON t.share_person = a.person_id
87 88
         LEFT JOIN ta_person y on t.share_person = y.user_id
88 89
         LEFT JOIN ta_person z ON t.person_id = z.person_id
@@ -104,6 +105,7 @@
104 105
             e.building_name like CONCAT('%', #{shareTitle} , '%') or
105 106
             f.news_name like CONCAT('%', #{shareTitle} , '%') or
106 107
             a.`name` like CONCAT('%', #{shareTitle} , '%')
108
+            h.sales_batch_name like like CONCAT('%', #{shareTitle} , '%')
107 109
             )
108 110
         </if>
109 111
         GROUP BY

+ 8
- 1
src/main/resources/mapper/TaSharePersonFromMapper.xml View File

@@ -39,7 +39,14 @@
39 39
             and c.person_Type = #{personType}
40 40
         </if>
41 41
         <if test="sceneType != null and sceneType != ''">
42
-            and b.scene_type = #{sceneType}
42
+            <choose>
43
+                <when test="sceneType == 'share'">
44
+                    and b.scene_type like CONCAT('%', #{sceneType})
45
+                </when>
46
+                <otherwise>
47
+                    and b.scene_type = #{sceneType}
48
+                </otherwise>
49
+            </choose>
43 50
         </if>
44 51
         <if test="phone != null and phone != ''">
45 52
             and c.phone = #{phone}