From d9fe7216968856545904ea298cc5e77a153ac76a Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 08 七月 2022 11:06:06 +0800
Subject: [PATCH] 优化 代码
---
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml | 131 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 131 insertions(+), 0 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
index 87fe987..d1c40f9 100755
--- a/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
@@ -1023,6 +1023,137 @@
limit #{page}, #{row}
</if>
</select>
+
+ <select id="queryFeeBreakdownDetailCount" parameterType="Map" resultType="Map">
+ select count(1) count
+ from report_fee_month_statistics t
+ inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
+ left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
+ left join building_unit bu on br.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 pfc.fee_type_cd = td.status_cd and td.table_name='pay_fee_config' and
+ td.table_columns='fee_type_cd'
+ inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
+ where t.status_cd = '0'
+ <if test="roomNum !=null and roomNum != ''">
+ and br.room_num= #{roomNum}
+ </if>
+ <if test="unitId !=null and unitId != ''">
+ and bu.unit_id= #{unitId}
+ </if>
+ <if test="floorId !=null and floorId != ''">
+ and f.floor_id = #{floorId}
+ </if>
+ <if test="objName !=null and objName != ''">
+ and t.obj_name= #{objName}
+ </if>
+ <if test="feeYear !=null and feeYear != ''">
+ and t.fee_year= #{feeYear}
+ </if>
+ <if test="feeMonth !=null and feeMonth != ''">
+ and t.fee_month= #{feeMonth}
+ </if>
+ <if test="feeId !=null and feeId != ''">
+ and t.fee_id= #{feeId}
+ </if>
+ <if test="configId !=null and configId != ''">
+ and pfc.config_id= #{configId}
+ </if>
+ <if test="objId !=null and objId != ''">
+ and t.obj_id= #{objId}
+ </if>
+ <if test="feeName !=null and feeName != ''">
+ and t.fee_name= #{feeName}
+ </if>
+ <if test="feeTypeCd != null and feeTypeCd != ''">
+ and pfc.fee_type_cd = #{feeTypeCd}
+ </if>
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="startTime !=null and startTime != ''">
+ and pfc.start_time >= #{startTime}
+ </if>
+ <if test="endTime !=null and endTime != ''">
+ and pfc.start_time <= #{endTime}
+ </if>
+ <if test="yearMonth !=null and yearMonth != ''">
+ and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth}
+ </if>
+ </select>
+
+ <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03
+ and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
+ -->
+ <select id="queryFeeBreakdownDetail" parameterType="Map" resultType="Map">
+ select t.obj_name objName,t.fee_name feeName,t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime
+ ,t.config_id configId,t.his_owe_amount
+ hisOweAmount,t.cur_receivable_amount curReceivableAmount,
+ t.cur_received_amount curReceivedAmount,t.his_owe_received_amount
+ hisOweReceivedAmount,t.pre_received_amount preReceivedAmount,
+ t.update_time updateTime,t.his_owe_amount+t.cur_receivable_amount receivableAmount,
+ t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount receivedAmount,t.update_time
+ updateTime
+ from report_fee_month_statistics t
+ inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
+ left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
+ left join building_unit bu on br.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 pfc.fee_type_cd = td.status_cd and td.table_name='pay_fee_config' and
+ td.table_columns='fee_type_cd'
+ inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
+ where t.status_cd = '0'
+ <if test="roomNum !=null and roomNum != ''">
+ and br.room_num= #{roomNum}
+ </if>
+ <if test="unitId !=null and unitId != ''">
+ and bu.unit_id= #{unitId}
+ </if>
+ <if test="floorId !=null and floorId != ''">
+ and f.floor_id = #{floorId}
+ </if>
+ <if test="objName !=null and objName != ''">
+ and t.obj_name= #{objName}
+ </if>
+ <if test="feeYear !=null and feeYear != ''">
+ and t.fee_year= #{feeYear}
+ </if>
+ <if test="feeMonth !=null and feeMonth != ''">
+ and t.fee_month= #{feeMonth}
+ </if>
+ <if test="feeId !=null and feeId != ''">
+ and t.fee_id= #{feeId}
+ </if>
+ <if test="configId !=null and configId != ''">
+ and pfc.config_id= #{configId}
+ </if>
+ <if test="objId !=null and objId != ''">
+ and t.obj_id= #{objId}
+ </if>
+ <if test="feeName !=null and feeName != ''">
+ and t.fee_name= #{feeName}
+ </if>
+ <if test="feeTypeCd != null and feeTypeCd != ''">
+ and pfc.fee_type_cd = #{feeTypeCd}
+ </if>
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="startTime !=null and startTime != ''">
+ and pfc.start_time >= #{startTime}
+ </if>
+ <if test="endTime !=null and endTime != ''">
+ and pfc.start_time <= #{endTime}
+ </if>
+ <if test="yearMonth !=null and yearMonth != ''">
+ and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth}
+ </if>
+ order by t.create_time desc
+ <if test="page != -1 and page != null ">
+ limit #{page}, #{row}
+ </if>
+ </select>
+
<!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0 -->
<select id="queryFeeBreakdownMajor" parameterType="Map" resultType="Map">
select
--
Gitblit v1.8.0