From 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 19 七月 2022 21:49:55 +0800
Subject: [PATCH] 优化添加设备 功能

---
 java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml |   66 ++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 1 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml
index f7bbc9d..945decd 100755
--- a/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml
@@ -23,7 +23,8 @@
         select t.apartment,t.built_up_area builtUpArea,t.community_id communityId,t.create_time createTime,
         t.fee_coefficient feeCoefficient,t.layer,t.room_id roomId,t.room_num roomNum,t.section,
         t.state,bu.unit_id unitId,bu.unit_num unitNum,ff.floor_id floorId,ff.floor_num floorNum,
-        bo.age,bo.id_card idCard,bo.link,bo.member_id memberId,bo.`name`,bo.`name` ownerName,bo.owner_id ownerId,t.room_type roomType
+        bo.age,bo.id_card idCard,bo.link,bo.member_id memberId,bo.`name`,bo.`name` ownerName,bo.owner_id ownerId,t.room_type roomType,
+        t.room_sub_type roomSubType,t.room_rent roomRent,t.room_area roomArea
         from building_room t
         INNER JOIN building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
         inner join f_floor ff on bu.floor_id = ff.floor_id and ff.status_cd = '0'
@@ -40,6 +41,51 @@
             limit #{page}, #{row}
         </if>
     </select>
+
+    <select id="queryRoomStructures" parameterType="Map" resultType="Map">
+        select t.apartment,t.built_up_area builtUpArea,t.community_id communityId,t.create_time createTime,
+        t.fee_coefficient feeCoefficient,t.layer,t.room_id roomId,t.room_num roomNum,t.section,
+        t.state,bu.unit_id unitId,bu.unit_num unitNum,ff.floor_id floorId,ff.floor_num floorNum,
+        bo.age,bo.id_card idCard,bo.link,bo.member_id memberId,bo.`name`,bo.`name` ownerName,bo.owner_id ownerId,t.room_type roomType,
+        t.room_sub_type roomSubType,t.room_rent roomRent,t.room_area roomArea,td.name stateName,
+        (
+        select if (SUM(rof.amount_owed)!='',SUM(rof.amount_owed),0) from report_owe_fee rof where rof.payer_obj_id = t.room_id and rof.payer_obj_type = '3333'
+        ) oweAmount
+        from building_room t
+        INNER JOIN building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
+        inner join f_floor ff on bu.floor_id = ff.floor_id and ff.status_cd = '0'
+        LEFT JOIN building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
+        left join building_owner bo on borr.owner_id = bo.member_id and bo.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 t.status_cd = '0'
+        and t.community_id = #{communityId}
+        and bu.unit_id = #{unitId}
+        order by t.layer,t.room_num
+    </select>
+
+    <select id="queryCarStructures" parameterType="Map" resultType="Map">
+        select pa.num areaNum,ps.num,t.car_num carNum,br.room_id roomId,br.room_num roomNum,br.section,
+        br.state,bu.unit_id unitId,bu.unit_num unitNum,ff.floor_id floorId,ff.floor_num floorNum,
+        bo.age,bo.id_card idCard,bo.link,bo.member_id memberId,bo.`name`,bo.`name` ownerName,bo.owner_id ownerId,
+        (
+        select if (SUM(rof.amount_owed)!='',SUM(rof.amount_owed),0) from report_owe_fee rof where rof.payer_obj_id = t.car_id and rof.payer_obj_type = '6666'
+        ) oweAmount
+        from owner_car t
+        INNER join building_owner bo on t.owner_id = bo.member_id and bo.status_cd = '0'
+        INNER JOIN building_owner_room_rel borr on bo.owner_id = borr.owner_id and borr.status_cd = '0'
+        INNER join building_room br on borr.room_id = br.room_id and br.status_cd = '0'
+        INNER JOIN building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
+        inner join f_floor ff on bu.floor_id = ff.floor_id and ff.status_cd = '0'
+        LEFT JOIN parking_space ps on t.ps_id = ps.ps_id and ps.status_cd = '0'
+        LEFT JOIN parking_area pa on ps.pa_id = pa.pa_id and pa.status_cd = '0'
+        where t.status_cd = '0'
+        and t.community_id = #{communityId}
+        and bu.unit_id = #{unitId}
+        order by t.car_num
+    </select>
+
+
+
 
 
     <!-- 鏌ヨ鎴垮眿涓暟 add by wuxw 2018-07-03 -->
@@ -133,6 +179,24 @@
 
     </select>
 
+    <!-- 鏌ヨ鏃犳晥璐圭敤 add by wuxw 2018-07-03 -->
+    <select id="queryInvalidFeeMonthStatistics" parameterType="Map" resultType="Map">
+        select t.fee_id feeId from pay_fee t
+        inner join pay_fee_config pfc on t.config_id = pfc.config_id
+        inner join report_fee_year_collection rfyc on t.fee_id = rfyc.fee_id and rfyc.status_cd = '0'
+        where (t.status_cd = '1' or pfc.status_cd = '1')
+        and t.community_id= #{communityId}
+    </select>
+
+    <!--娓呯悊鎶ヨ〃 鏃犳晥鏁版嵁-->
+    <update id="deleteInvalidFee" parameterType="Map">
+        delete from report_fee_year_collection where fee_id  in
+        <foreach collection="feeIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        and community_id = #{communityId}
+    </update>
+
 
 
 

--
Gitblit v1.8.0