From 1300cd0e47d9f0890d972bafeba888d10395ed38 Mon Sep 17 00:00:00 2001
From: luo <2855143437@qq.com>
Date: 星期五, 08 十二月 2023 09:08:25 +0800
Subject: [PATCH] 12.8

---
 guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml |   89 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 89 insertions(+), 0 deletions(-)

diff --git a/guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml b/guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml
index e872552..717199a 100644
--- a/guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml
+++ b/guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml
@@ -323,6 +323,95 @@
             </foreach>
         </if>
     </select>
+    <select id="list" resultType="com.stylefeng.guns.modular.system.dto.THouseResource">
+        select * from (
+        SELECT hs.insert_time as insertTime, hs.id, hs.cell_name as cellName, hs.house_address as houseAddress,
+        hs.data_type as dataType,
+        CASE
+        WHEN hs.is_manage IS NULL AND ap.user_type = 2 THEN 2
+        WHEN hs.is_manage IS NULL AND ap.user_type = 3 THEN 3
+        ELSE hs.is_manage
+        END AS isManage,
+        IFNULL(ap.nickname,su.`name`) as name, IFNULL(ap.phone,su.phone) as phone,
+        hs.house_model as houseModel, hs.building_orientation as buildingOrientation, hs.sale_amount as saleAmount,
+        hs.house_area as houseArea , hs.status
+        FROM t_house_resource hs
+        LEFT JOIN t_app_user ap ON hs.insert_user_id = ap.id
+        LEFT JOIN sys_user su ON hs.insert_user_id = su.id AND hs.is_manage = 1
+        where     hs.is_delete = 0 and hs.auth_status = 2
+
+        ) a
+        <where>
+            <if test="null != cellName and '' != cellName">
+                and a.cell_name like CONCAT('%', #{cellName}, '%')
+            </if>
+            <if test="null != dataType">
+                and a.dataType = #{dataType}
+            </if>
+            <if test="null != isManage">
+                and a.isManage = #{isManage}
+            </if>
+            <if test="null != name and '' != name">
+                and a.name like CONCAT('%', #{name}, '%')
+            </if>
+            <if test="null != min and '' != min">
+                and a.saleAmount between #{min} and #{max}
+            </if>
+
+            <if test="null != status">
+                and a.status = #{status}
+            </if>
+        </where>
+
+    </select>
+
+
+    <select id="aulist" resultType="com.stylefeng.guns.modular.system.dto.THouseResource">
+        select * from (
+        SELECT hs.insert_time as insertTime, hs.id, hs.cell_name as cellName, hs.house_address as houseAddress,
+        hs.data_type as dataType,
+        CASE
+        WHEN hs.is_manage IS NULL AND ap.user_type = 2 THEN 2
+        WHEN hs.is_manage IS NULL AND ap.user_type = 3 THEN 3
+        ELSE hs.is_manage
+        END AS isManage,
+        IFNULL(ap.nickname,su.`name`) as name, IFNULL(ap.phone,su.phone) as phone,
+        hs.house_model as houseModel, hs.building_orientation as buildingOrientation, hs.sale_amount as saleAmount,
+        hs.house_area as houseArea , hs.status,hs.auth_status AS authStatus
+        FROM t_house_resource hs
+        LEFT JOIN t_app_user ap ON hs.insert_user_id = ap.id
+        LEFT JOIN sys_user su ON hs.insert_user_id = su.id AND hs.is_manage = 1
+        where     hs.is_delete = 0
+
+        ) a
+        <where>
+
+            <if test="null != id">
+                and a.id = #{id}
+            </if>
+
+            <if test="null != cellName and '' != cellName">
+                and a.cellName like CONCAT('%', #{cellName}, '%')
+            </if>
+            <if test="null != dataType">
+                and a.dataType = #{dataType}
+            </if>
+            <if test="null != isManage">
+                and a.isManage = #{isManage}
+            </if>
+            <if test="null != name and '' != name">
+                and a.name like CONCAT('%', #{name}, '%')
+            </if>
+            <if test="null != min and '' != min">
+                and a.saleAmount between #{min} and #{max}
+            </if>
+            <if test="null != size and '' != size">
+                and a.houseArea = #{size}
+            </if>
+
+        </where>
+
+    </select>
 
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.7.1