From 0b3ff378a9faaf9d7a4831b7f0de67378fe0dfea Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 30 五月 2023 12:20:15 +0800
Subject: [PATCH] optimize 统计
---
java110-db/src/main/resources/mapper/community/RoomV1ServiceDaoImplMapper.xml | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/community/RoomV1ServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/community/RoomV1ServiceDaoImplMapper.xml
index d8f4261..4075e62 100644
--- a/java110-db/src/main/resources/mapper/community/RoomV1ServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/community/RoomV1ServiceDaoImplMapper.xml
@@ -20,11 +20,12 @@
select t.section,t.remark,t.status_cd,t.status_cd statusCd,t.room_sub_type,t.room_sub_type
roomSubType,t.room_area,t.room_area roomArea,t.user_id,t.user_id userId,t.room_id,t.room_id
roomId,t.layer,t.fee_coefficient,t.fee_coefficient feeCoefficient,t.built_up_area,t.built_up_area
- builtUpArea,t.room_num,t.room_num roomNum,t.unit_id,t.unit_id unitId,t.state,t.community_id,t.community_id
+ builtUpArea,t.room_num,t.room_num roomNum,t.unit_id,t.unit_id unitId,t.state,td.name stateName,t.community_id,t.community_id
communityId,t.apartment,t.room_type,t.room_type roomType,t.room_rent,t.room_rent roomRent,f.floor_num floorNum,bu.unit_num unitNum
from building_room t
left join building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
+ left join t_dict td on t.state = td.status_cd and td.table_name = 'building_room' and td.table_columns = 'state'
where 1 =1
<if test="section !=null and section != ''">
and t.section= #{section}
@@ -37,6 +38,12 @@
</if>
<if test="floorId !=null and floorId != ''">
and f.floor_id= #{floorId}
+ </if>
+ <if test="floorNum !=null and floorNum != ''">
+ and f.`floor_num`= #{floorNum}
+ </if>
+ <if test="unitNum !=null and unitNum != ''">
+ and u.unit_num= #{unitNum}
</if>
<if test="floorIds !=null ">
and f.floor_id in
@@ -70,6 +77,9 @@
</if>
<if test="roomNum !=null and roomNum != ''">
and t.room_num= #{roomNum}
+ </if>
+ <if test="roomNumLike !=null and roomNumLike != ''">
+ and t.room_num like concat('%',#{roomNumLike},'%')
</if>
<if test="unitId !=null and unitId != ''">
and t.unit_id= #{unitId}
@@ -159,7 +169,6 @@
<select id="queryRoomsCount" parameterType="Map" resultType="Map">
select count(1) count
from building_room t
- from building_room t
left join building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
where 1 =1
@@ -168,6 +177,12 @@
</if>
<if test="floorId !=null and floorId != ''">
and f.floor_id= #{floorId}
+ </if>
+ <if test="floorNum !=null and floorNum != ''">
+ and f.`floor_num`= #{floorNum}
+ </if>
+ <if test="unitNum !=null and unitNum != ''">
+ and u.unit_num= #{unitNum}
</if>
<if test="floorIds !=null ">
and f.floor_id in
@@ -208,6 +223,9 @@
<if test="roomNum !=null and roomNum != ''">
and t.room_num= #{roomNum}
</if>
+ <if test="roomNumLike !=null and roomNumLike != ''">
+ and t.room_num like concat('%',#{roomNumLike},'%')
+ </if>
<if test="unitId !=null and unitId != ''">
and t.unit_id= #{unitId}
</if>
--
Gitblit v1.8.0