From 022ffe220344d387380fad4ffe33ebcf318c6eab Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 09 七月 2020 10:42:08 +0800
Subject: [PATCH] 优化错别字

---
 java110-db/src/main/resources/mapper/community/UnitServiceDaoImplMapper.xml |   56 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/community/UnitServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/community/UnitServiceDaoImplMapper.xml
index 427a49c..75a583c 100644
--- a/java110-db/src/main/resources/mapper/community/UnitServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/community/UnitServiceDaoImplMapper.xml
@@ -47,6 +47,7 @@
         <if test="userId !=null and userId != ''">
             and t.user_id= #{userId}
         </if>
+        order by unitNum asc
 
     </select>
 
@@ -93,14 +94,13 @@
         bId,t.user_id,t.user_id userId
         from building_unit t
         <if test="communityId!=null and communityId != ''">
-            ,f_floor ff ,s_community_member cm
+            ,f_floor ff
         </if>
         where 1 =1
         <if test="communityId!=null and communityId != ''">
             and t.`floor_id` = ff.`floor_id`
-            AND ff.`floor_id` = cm.`member_id`
-            AND cm.`member_type_cd` = '390001200004'
-            and cm.community_id = #{communityId}
+            AND ff.community_id = #{communityId}
+            and ff.status_cd = '0'
         </if>
         <if test="floorId !=null and floorId != ''">
             and t.floor_id= #{floorId}
@@ -129,10 +129,11 @@
         <if test="userId !=null and userId != ''">
             and t.user_id= #{userId}
         </if>
+        order by unitNum asc
        <!-- <if test="page != -1 and page != null ">
             limit #{page}, #{row}
-        </if>-->
-            limit 10;
+        </if>limit 10;-->
+
     </select>
 
 
@@ -210,15 +211,10 @@
         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
-        from building_unit t,s_community sc,s_community_member scm,f_floor f
+        from building_unit t,f_floor f
         where 1 =1
         and t.floor_id = f.floor_id
-        and f.floor_id = scm.member_id
-        and scm.community_id = sc.community_id
-        and scm.member_type_cd = '390001200004'
-        and sc.community_id = #{communityId}
-        and sc.status_cd = '0'
-        and scm.status_cd = '0'
+        and f.community_id = #{communityId}
         and f.status_cd = '0'
         <if test="floorId !=null and floorId != ''">
             and t.floor_id= #{floorId}
@@ -250,6 +246,40 @@
         <if test="page != -1 and page != null">
             limit #{page}, #{row}
         </if>
+        order by unitNum asc
+    </select>
+
+    <select id="getFloorAndUnitInfo" parameterType="Map" resultType="Map">
+        SELECT
+          bu.`unit_id` unitId,
+          bu.`unit_num` unitNum,
+          f.`floor_id` floorId,
+          f.`floor_num` floorNum
+        FROM
+          f_floor f,
+          building_unit bu
+        WHERE f.`floor_id` = bu.`floor_id`
+          AND f.`status_cd` = '0'
+          AND bu.`status_cd` = '0'
+          <if test="floorId != null and floorId !=''">
+              and bu.floor_id = #{floorId}
+          </if>
+        <if test="floorNum != null and floorNum !=''">
+            and f.floor_num = #{floorNum}
+        </if>
+        <if test="unitId != null and unitId !=''">
+            and bu.unit_id = #{unitId}
+        </if>
+        <if test="unitIds != null">
+            and bu.unit_id in
+            <foreach collection="unitIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="unitNum != null and unitNum !=''">
+            and bu.unit_num = #{unitNum}
+        </if>
+
     </select>
 
 </mapper>

--
Gitblit v1.8.0