From 0d92e6ae6c44d79632ea7d79e193dd169f0fe1b3 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 04 三月 2022 18:05:40 +0800
Subject: [PATCH] 优化单元查询功能

---
 java110-db/src/main/resources/mapper/community/UnitServiceDaoImplMapper.xml |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/community/UnitServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/community/UnitServiceDaoImplMapper.xml
index d8dfd0a..c34fcb1 100755
--- a/java110-db/src/main/resources/mapper/community/UnitServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/community/UnitServiceDaoImplMapper.xml
@@ -93,16 +93,12 @@
     <select id="getUnitInfo" parameterType="Map" resultType="Map">
         select t.floor_id,t.floor_id floorId,t.layer_count,t.layer_count layerCount,t.unit_id,t.unit_id
         unitId,t.unit_num,t.unit_num unitNum,t.lift,t.status_cd,t.status_cd statusCd,t.remark,t.b_id,t.b_id
-        bId,t.user_id,t.user_id userId,t.unit_area,t.unit_area unitArea
+        bId,t.user_id,t.user_id userId,t.unit_area,t.unit_area unitArea,ff.floor_num floorNum
         from building_unit t
-        <if test="communityId!=null and communityId != ''">
-            ,f_floor ff
-        </if>
+        left join f_floor ff on t.`floor_id` = ff.`floor_id` and ff.status_cd = '0'
         where 1 =1
         <if test="communityId!=null and communityId != ''">
-            and t.`floor_id` = ff.`floor_id`
             AND ff.community_id = #{communityId}
-            and ff.status_cd = '0'
         </if>
         <if test="floorId !=null and floorId != ''">
             and t.floor_id= #{floorId}

--
Gitblit v1.8.0