From 23c4967b4cb8dbce8277f830f7152d315c5a4a57 Mon Sep 17 00:00:00 2001
From: luo <2855143437@qq.com>
Date: 星期一, 25 十二月 2023 09:25:17 +0800
Subject: [PATCH] 12.25

---
 guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml |   51 +++++++++++++++++++++++++++------------------------
 1 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml
index e872552..60ee480 100644
--- a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml
+++ b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml
@@ -15,6 +15,7 @@
         concat(rp.`name`, rc.`name`) as address,
         hr.longitude,
         hr.latitude,
+        hr.platform,
         hr.sale_amount as saleAmount,
         au.profile_photo as profilePhoto,
         au.nickname,
@@ -22,14 +23,15 @@
         hr.drying_area as dryingArea,
         hr.garden,
         hr.carport,
+        hr.air,
         hr.balcony,
+        hr.leaseTime,
         hr.keep_pet as keepPet
         from t_house_resource hr
         left join t_app_user au on (hr.app_user_id = au.id)
         left join t_region rc on (hr.district_id = rc.id)
         left join t_region rp on (rp.id = rc.parent_id)
-        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
-        and hr.type=2
+        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2 and hr.type=2
         <if test="null != req.type">
             and hr.data_type = #{req.type}
         </if>
@@ -40,16 +42,16 @@
             and hr.firm_house = 1
         </if>
         <if test="null != req.content and '' != req.content">
-            and hr.title = CONCAT('%', #{req.content}, '%')
+            and hr.title like CONCAT('%', #{req.content}, '%')
         </if>
         <if test="null != cityIds and cityIds.size()>0" >
-            and hr.city_id in
+            and hr.district_id in
             <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")">
                 #{item}
             </foreach>
         </if>
         <if test="null != districtIds and districtIds.size()>0">
-            and hr.district_id in
+            and hr.city_id in
             <foreach collection="districtIds" item="item" index="index" separator="," open="(" close=")">
                 #{item}
             </foreach>
@@ -114,6 +116,7 @@
         <if test="null != req.sort and req.sort == 4">
             order by hr.sale_amount desc
         </if>
+        order by au.user_type desc, hr.insert_time desc
         limit #{req.pageNum}, #{req.pageSize}
     </select>
 
@@ -218,8 +221,11 @@
             left join t_app_user au on (hr.app_user_id = au.id)
             where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
         and hr.type=2
-            <if test="null != userType and 4 != userType">
-                and au.user_type = #{userType} and au.status = 1 and au.audit_status = 2
+            <if test="null != userType and 2 == userType">
+                and au.user_type = 2
+            </if>
+        <if test="null != userType and 3 == userType">
+                and au.user_type = 3
             </if>
             <if test="null != userType and 4 == userType">
                 and hr.firm_house = 1
@@ -263,11 +269,13 @@
         hr.id,
         hr.title,
         hr.sale_amount as saleAmount,
-        hr.elevator,
+        hr.elevator as elevator,
+        hr.house_model as houseModel,
         hr.drying_area as dryingArea,
-        hr.garden,
-        hr.carport,
-        hr.balcony,
+        hr.garden as garden,
+        hr.carport as carport,
+        hr.balcony as balcony,
+        hr.app_user_id as appuserId,
         hr.city_id as cityId,
         hr.district_id as districtId,
         hr.keep_pet as keepPet,
@@ -275,17 +283,14 @@
         hr.code as code,
         hr.leaseTime as leaseTime,
         hr.data_type as dataType,
-        hr.insert_time as insertTime,hr.type as `type`,
+        hr.insert_time as insertTime,
+        hr.type as `type`,
+        hr.upTime as upTime,
+        2 as `data`,
         hr.status as status
         from t_house_resource hr
-        left join t_collection_house_resource t1 on hr.id = t1.house_resource_id
-        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
-        <if test="null != ids and ids.size()>0">
-            and hr.id in
-            <foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-        </if>
+        where hr.is_delete = 0
+        and hr.app_user_id = #{id}
     </select>
     <select id="release" resultType="com.stylefeng.guns.modular.system.warpper.res.CollectListRes">
         select
@@ -309,13 +314,13 @@
         hr.house_video as houseVideo,
         hr.insert_time as insertTime,hr.type as `type`,
         hr.status as status,
+        2 as `data`,
         au.profile_photo as profilePhoto,
         au.nickname as nickname,
         au.user_type as userType
         from t_house_resource hr
-        left join t_collection_house_resource t1 on hr.id = t1.house_resource_id
         left join t_app_user au on hr.app_user_id = au.id
-        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
+        where hr.is_delete = 0 and hr.`status` = 1
         <if test="null != ids and ids.size()>0">
             and hr.id in
             <foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
@@ -323,6 +328,4 @@
             </foreach>
         </if>
     </select>
-
-
 </mapper>
\ No newline at end of file

--
Gitblit v1.7.1