weichaochao 5 년 전
부모
커밋
f68cfd50be

+ 6
- 3
src/main/resources/mapper/TaPreselectionRecordMapper.xml 파일 보기

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

+ 3
- 1
src/main/resources/mapper/TaShareCountMapper.xml 파일 보기

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

+ 8
- 1
src/main/resources/mapper/TaSharePersonFromMapper.xml 파일 보기

39
             and c.person_Type = #{personType}
39
             and c.person_Type = #{personType}
40
         </if>
40
         </if>
41
         <if test="sceneType != null and sceneType != ''">
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
         </if>
50
         </if>
44
         <if test="phone != null and phone != ''">
51
         <if test="phone != null and phone != ''">
45
             and c.phone = #{phone}
52
             and c.phone = #{phone}