From 372713d9d50c73871d51fd98b655d8bd9e24df46 Mon Sep 17 00:00:00 2001
From: luo <2855143437@qq.com>
Date: 星期二, 02 一月 2024 10:56:13 +0800
Subject: [PATCH] 1.2

---
 guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml |   48 ++++++++++++++++++++++++++++++------------------
 1 files changed, 30 insertions(+), 18 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 17d6f57..aeab6fa 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
@@ -338,7 +338,7 @@
         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  and hs.type = 2
-
+        order by hs.insert_time desc
         ) a
         <where>
             <if test="null != cellName and '' != cellName">
@@ -366,25 +366,37 @@
 
 
     <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(su.`name`,ap.nickname) 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
+        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,
+        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,
+        ap.user_type as isManage,
+        ap.nickname as name,
+        ifnull(ap.phone1,ap.phone) as phone
+        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.type = 2
-        order by hs.insert_time desc
+        WHERE
+        hs.is_delete = 0
+        AND hs.type = 2 and  ISNULL(hs.is_manage)
+        ORDER BY
+        hs.insert_time DESC
         ) a
-        <where>
 
+
+        <where>
             <if test="null != id">
                 and a.id = #{id}
             </if>
@@ -427,7 +439,7 @@
         LEFT JOIN t_house_resource hs on hr.house_resource_id = hs.id
         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
+        where      hs.auth_status = 2
 
         ) a
         <where>

--
Gitblit v1.7.1