From 65763d38cf9b6b8067a293d9c99297efea0de3e3 Mon Sep 17 00:00:00 2001
From: 928255095 <928255095@qq.com>
Date: 星期二, 07 九月 2021 22:04:15 +0800
Subject: [PATCH] Merge branch 'xinghong-dev' into 'master'
---
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml | 635 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 588 insertions(+), 47 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
index 763ac14..dfcab70 100755
--- a/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
@@ -145,9 +145,7 @@
<if test="oweAmount !=null and oweAmount != ''">
, t.owe_amount= #{oweAmount}
</if>
- <if test="communityId !=null and communityId != ''">
- , t.community_id= #{communityId}
- </if>
+
<if test="feeCreateTime !=null and feeCreateTime != ''">
, t.fee_create_time= #{feeCreateTime}
</if>
@@ -155,9 +153,11 @@
, t.obj_type= #{objType}
</if>
where 1=1
- <if test="statisticsId !=null and statisticsId != ''">
- and t.statistics_id= #{statisticsId}
+ and t.statistics_id= #{statisticsId}
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
</if>
+
</update>
<!-- 鏌ヨ璐圭敤鏈堢粺璁℃暟閲� add by wuxw 2018-07-03 -->
@@ -329,6 +329,58 @@
</if>
</select>
+ <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� 澶ц add by wuxw 2018-07-03 -->
+ <select id="queryReportFeeSummaryMajor" parameterType="Map" resultType="Map">
+ select SUM(t.receivable_amount)
+ allReceivableAmount,SUM(t.received_amount)
+ allReceivedAmount,SUM(t.owe_amount) allOweAmount
+ from report_fee_month_statistics t
+ 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'
+ 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 t.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="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="startTime !=null">
+ and t.create_time >= #{startTime}
+ </if>
+ <if test="endTime !=null">
+ and t.create_time <= #{endTime}
+ </if>
+ </select>
+
<select id="queryReportFloorUnitFeeSummaryCount" parameterType="Map" resultType="Map">
select count(1) count
from (
@@ -436,6 +488,59 @@
GROUP BY t.fee_year,t.fee_month,f.floor_num,bu.unit_id,bu.unit_num
<if test="page != -1 and page != null ">
limit #{page}, #{row}
+ </if>
+ </select>
+
+ <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 -->
+ <select id="queryReportFloorUnitFeeSummaryMajor" parameterType="Map" resultType="Map">
+ select
+ SUM(t.receivable_amount)
+ allReceivableAmount,SUM(t.received_amount)
+ allReceivedAmount,SUM(t.owe_amount) allOweAmount
+ from report_fee_month_statistics t
+ INNER JOIN building_room br on t.obj_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 f on bu.floor_id = f.floor_id and f.status_cd = '0'
+ 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 t.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="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="startTime !=null">
+ and t.create_time >= #{startTime}
+ </if>
+ <if test="endTime !=null">
+ and t.create_time <= #{endTime}
</if>
</select>
@@ -561,6 +666,64 @@
<if test="page != -1 and page != null ">
limit #{page}, #{row}
</if>
+ </select>
+ <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 -->
+ <select id="queryFeeBreakdownMajor" parameterType="Map" resultType="Map">
+ select SUM(t.receivable_amount)
+ allReceivableAmount,SUM(t.received_amount)
+ allReceivedAmount,SUM(t.owe_amount) allOweAmount
+ 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' and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 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 pfc.start_time >= #{startTime}
+ </if>
+ <if test="endTime !=null">
+ and pfc.start_time <= #{endTime}
+ </if>
+ order by t.create_time desc
</select>
<select id="queryFeeDetailCount" parameterType="Map" resultType="Map">
@@ -728,14 +891,15 @@
<select id="queryOweFeeDetailCount" parameterType="Map" resultType="Map">
select count(1) count
from (
- select t.obj_name objName,t.fee_name feeName,pfc.start_time,SUM(t.owe_amount) oweAmount
- from report_fee_month_statistics t
+ select t.payer_obj_name objName,t.fee_name feeName,pf.end_time feeCreateTime,t.create_time
+ createTime,SUM(t.amount_owed) oweAmount,max(t.deadline_time) deadlineTime
+ from report_owe_fee 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_room br on t.payer_obj_id = br.room_id and t.payer_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'
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'
+ where 1=1
<if test="roomNum !=null and roomNum != ''">
and br.room_num= #{roomNum}
</if>
@@ -746,13 +910,7 @@
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}
+ and t.payer_obj_name= #{objName}
</if>
<if test="feeId !=null and feeId != ''">
and t.fee_id= #{feeId}
@@ -761,7 +919,7 @@
and t.config_id= #{configId}
</if>
<if test="objId !=null and objId != ''">
- and t.obj_id= #{objId}
+ and t.payer_obj_id= #{objId}
</if>
<if test="feeName !=null and feeName != ''">
and t.fee_name= #{feeName}
@@ -775,23 +933,22 @@
<if test="endTime !=null">
and t.create_time <= #{endTime}
</if>
- group by t.config_id,t.fee_name,pfc.start_time,t.obj_id,t.obj_name
+ group by t.fee_name,t.payer_obj_id,t.payer_obj_name
HAVING oweAmount > 0
) t
</select>
<!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 -->
<select id="queryOweFeeDetail" parameterType="Map" resultType="Map">
- select t.obj_name objName,t.fee_name feeName,t.fee_create_time feeCreateTime,t.create_time
- createTime,SUM(t.receivable_amount)
- receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
- from report_fee_month_statistics t
+ select t.payer_obj_name objName,t.fee_name feeName,pf.end_time feeCreateTime,t.create_time
+ createTime,SUM(t.amount_owed) oweAmount,max(t.deadline_time) deadlineTime
+ from report_owe_fee 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_room br on t.payer_obj_id = br.room_id and t.payer_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'
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'
+ where 1=1
<if test="roomNum !=null and roomNum != ''">
and br.room_num= #{roomNum}
</if>
@@ -802,13 +959,7 @@
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}
+ and t.payer_obj_name= #{objName}
</if>
<if test="feeId !=null and feeId != ''">
and t.fee_id= #{feeId}
@@ -817,7 +968,7 @@
and t.config_id= #{configId}
</if>
<if test="objId !=null and objId != ''">
- and t.obj_id= #{objId}
+ and t.payer_obj_id= #{objId}
</if>
<if test="feeName !=null and feeName != ''">
and t.fee_name= #{feeName}
@@ -831,10 +982,54 @@
<if test="endTime !=null">
and t.create_time <= #{endTime}
</if>
- group by t.config_id,t.fee_name,pfc.start_time,t.obj_id,t.obj_name
+ group by t.fee_name,t.payer_obj_id,t.payer_obj_name
HAVING oweAmount > 0
<if test="page != -1 and page != null ">
limit #{page}, #{row}
+ </if>
+ </select>
+ <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 -->
+ <select id="queryOweFeeDetailMajor" parameterType="Map" resultType="Map">
+ select SUM(t.amount_owed) oweAmount
+ from report_owe_fee 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.payer_obj_id = br.room_id and t.payer_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'
+ 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 1=1
+ <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.payer_obj_name= #{objName}
+ </if>
+ <if test="feeId !=null and feeId != ''">
+ and t.fee_id= #{feeId}
+ </if>
+ <if test="configId !=null and configId != ''">
+ and t.config_id= #{configId}
+ </if>
+ <if test="objId !=null and objId != ''">
+ and t.payer_obj_id= #{objId}
+ </if>
+ <if test="feeName !=null and feeName != ''">
+ and t.fee_name= #{feeName}
+ </if>
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="startTime !=null">
+ and t.create_time >= #{startTime}
+ </if>
+ <if test="endTime !=null">
+ and t.create_time <= #{endTime}
</if>
</select>
@@ -888,7 +1083,7 @@
and pfc.config_id= #{configId}
</if>
<if test="objId !=null and objId != ''">
- and t.obj_id= #{objId}
+ and pf.payer_obj_id= #{objId}
</if>
<if test="feeName !=null and feeName != ''">
and t.fee_name= #{feeName}
@@ -969,7 +1164,7 @@
and pfc.config_id= #{configId}
</if>
<if test="objId !=null and objId != ''">
- and t.obj_id= #{objId}
+ and pf.payer_obj_id = #{objId}
</if>
<if test="feeName !=null and feeName != ''">
and t.fee_name= #{feeName}
@@ -1034,7 +1229,7 @@
and pfc.config_id= #{configId}
</if>
<if test="objId !=null and objId != ''">
- and t.obj_id= #{objId}
+ and pf.payer_obj_id= #{objId}
</if>
<if test="feeName !=null and feeName != ''">
and t.fee_name= #{feeName}
@@ -1099,7 +1294,7 @@
and pfc.config_id= #{configId}
</if>
<if test="objId !=null and objId != ''">
- and t.obj_id= #{objId}
+ and pf.payer_obj_id= #{objId}
</if>
<if test="feeName !=null and feeName != ''">
and t.fee_name= #{feeName}
@@ -1570,10 +1765,12 @@
</select>
<select id="getFloorReceivableInformation" parameterType="Map" resultType="Map">
- select f.floor_num floorNum,f.`name`,sum(t.receivable_amount) receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
+ select f.floor_num floorNum,f.`name`,sum(t.receivable_amount) receivableAmount,SUM(t.received_amount)
+ receivedAmount,SUM(t.owe_amount) oweAmount
from report_fee_month_statistics t
inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
- inner join building_room br on br.room_id = t.obj_id and t.obj_type = '3333' and br.community_id = t.community_id and br.status_cd = '0'
+ inner join building_room br on br.room_id = t.obj_id and t.obj_type = '3333' and br.community_id =
+ t.community_id and br.status_cd = '0'
inner join building_unit bu on bu.unit_id = br.unit_id and bu.status_cd = '0'
inner join f_floor f on f.floor_id = bu.floor_id and f.status_cd = '0'
where t.community_id = #{communityId}
@@ -1581,10 +1778,11 @@
</select>
<select id="getFeeConfigReceivableInformation" parameterType="Map" resultType="Map">
- select t.fee_name feeName,sum(t.receivable_amount) receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
+ select t.fee_name feeName,sum(t.receivable_amount) receivableAmount,SUM(t.received_amount)
+ receivedAmount,SUM(t.owe_amount) oweAmount
from report_fee_month_statistics t
inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
- where t.community_id = #{communityId}
+ where t.community_id = #{communityId}
group by t.fee_name
</select>
@@ -1593,12 +1791,12 @@
<select id="queryNoFeeRoomsCount" parameterType="Map" resultType="Map">
select count(1) count
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 f on bu.floor_id = f.floor_id and f.status_cd = '0'
- where t.status_cd = '0'
- and not exists(
- select 1 from pay_fee pf where t.room_id = pf.payer_obj_id and pf.status_cd = '0' and pf.state = '2008001'
- )
+ inner join building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
+ inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
+ where t.status_cd = '0'
+ and not exists(
+ select 1 from pay_fee pf where t.room_id = pf.payer_obj_id and pf.status_cd = '0' and pf.state = '2008001'
+ )
and t.community_id = #{communityId}
</select>
@@ -1878,4 +2076,347 @@
group by pfd.state
</select>
+
+ <select id="queryHuaningOweFeeCount" parameterType="Map" resultType="Map">
+ select count(1) count
+ from (
+ select a.floorNum,a.oweAmount,b.curOweAmount
+ from
+ (select t.floor_num floorNum,SUM(rfms.owe_amount) oweAmount
+ from f_floor t
+ left join building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ left join building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ LEFT JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.obj_type = '3333' and rfms.status_cd = '0'
+ where t.status_cd = '0'
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="roomNum !=null and roomNum != ''">
+ and br.room_num= #{roomNum}
+ </if>
+ <if test="objName !=null and objName != ''">
+ and rfms.obj_name= #{objName}
+ </if>
+ GROUP BY t.floor_num
+ ) a,
+ (select t.floor_num floorNum,SUM(curT.owe_amount) curOweAmount
+ from f_floor t
+ left join building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ left join building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner join report_fee_month_statistics curT on curT.obj_id = br.room_id and curT.obj_type = '3333' and curT.status_cd = '0' and curT.community_id = t.community_id
+ where t.status_cd = '0'
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="roomNum !=null and roomNum != ''">
+ and br.room_num= #{roomNum}
+ </if>
+ <if test="feeYear !=null and feeYear != ''">
+ and curT.fee_year= #{feeYear}
+ </if>
+ GROUP BY t.floor_num
+ ) b
+ where a.floorNum = b.floorNum
+ <if test="floorId !=null and floorId != ''">
+ and a.floor_id = #{floorId}
+ </if>
+ ) t
+ </select>
+
+ <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 -->
+ <select id="queryHuaningOweFee" parameterType="Map" resultType="Map">
+ select a.floorNum,a.oweAmount,b.curOweAmount
+ from
+ (select t.floor_num floorNum,SUM(rfms.owe_amount) oweAmount
+ from f_floor t
+ left join building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ left join building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ LEFT JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.obj_type = '3333' and rfms.status_cd = '0'
+ where t.status_cd = '0'
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="roomNum !=null and roomNum != ''">
+ and br.room_num= #{roomNum}
+ </if>
+ <if test="objName !=null and objName != ''">
+ and rfms.obj_name= #{objName}
+ </if>
+ GROUP BY t.floor_num
+ ) a,
+ (select t.floor_num floorNum,SUM(curT.owe_amount) curOweAmount
+ from f_floor t
+ left join building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ left join building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner join report_fee_month_statistics curT on curT.obj_id = br.room_id and curT.obj_type = '3333' and curT.status_cd = '0' and curT.community_id = t.community_id
+ where t.status_cd = '0'
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="roomNum !=null and roomNum != ''">
+ and br.room_num= #{roomNum}
+ </if>
+ <if test="feeYear !=null and feeYear != ''">
+ and curT.fee_year= #{feeYear}
+ </if>
+ GROUP BY t.floor_num
+ ) b
+ where a.floorNum = b.floorNum
+ <if test="floorId !=null and floorId != ''">
+ and a.floor_id = #{floorId}
+ </if>
+ <if test="page != -1 and page != null ">
+ limit #{page}, #{row}
+ </if>
+ </select>
+
+
+ <select id="queryHuaningPayFeeCount" parameterType="Map" resultType="Map">
+ select count(1) count
+ from (
+ select t.floor_num
+ from f_floor t
+ where 1=1
+ and t.community_id= #{communityId}
+ GROUP BY t.floor_num
+ ) tt
+ </select>
+
+ <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 -->
+ <select id="queryHuaningPayFee" parameterType="Map" resultType="Map">
+ select a.floorNum,f.receivableAmount,a.receivedAmount,b.receivedAmount1,c.receivedAmount2,d.receivedAmount3,e.receivedAmount4
+ from
+ (select t.floor_num floorNum,sum(pfd.received_amount) receivedAmount
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) a,
+ (select t.floor_num floorNum,sum(pfdm1.received_amount ) receivedAmount1
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ LEFT JOIN pay_fee_detail_month pfdm1 on pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and pfdm1.status_cd = '0' and pfdm1.detail_year = #{year} and pfdm1.detail_month < #{month}
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) b,
+ (select t.floor_num floorNum,sum(pfdm2.received_amount ) receivedAmount2
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ LEFT JOIN pay_fee_detail_month pfdm2 on pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and pfdm2.status_cd = '0' and pfdm2.detail_year = #{year} and pfdm2.detail_month = #{month}
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) c,
+ (select t.floor_num floorNum,sum(pfdm3.received_amount ) receivedAmount3
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ LEFT JOIN pay_fee_detail_month pfdm3 on pf.fee_id = pfdm3.fee_id and pfd.detail_id = pfdm3.detail_id and pfdm3.status_cd = '0' and pfdm3.detail_year = #{nextYear} and pfdm3.detail_month = #{nextMonth}
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) d,
+ (select t.floor_num floorNum,sum(pfdm4.received_amount ) receivedAmount4
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ LEFT JOIN pay_fee_detail_month pfdm4 on pf.fee_id = pfdm4.fee_id and pfd.detail_id = pfdm4.detail_id and pfdm4.status_cd = '0' and pfdm4.detail_year < #{year}
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) e,
+ (select t.floor_num floorNum,SUM(rfms.receivable_amount) receivableAmount
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.status_cd = '0'
+ where t.community_id = #{communityId}
+ and rfms.fee_year = #{year}
+ and rfms.fee_month = #{month}
+ group by t.floor_num
+ ) f
+ where a.floorNum = b.floorNum
+ and b.floorNum = c.floorNum
+ and c.floorNum = d.floorNum
+ and d.floorNum = e.floorNum
+ and e.floorNum = f.floorNum
+ <if test="page != -1 and page != null ">
+ limit #{page}, #{row}
+ </if>
+ </select>
+ <select id="queryHuaningPayFeeTwoCount" parameterType="Map" resultType="Map">
+ select count(1) count
+ from (
+ select a.floorNum,d.receivableAmount ,
+ a.receivedAmount,b.receivedAmount1,
+ c.receivedAmount2
+ from
+ (select t.floor_num floorNum,sum(pfd.received_amount) receivedAmount
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) a,
+ (select t.floor_num floorNum,SUM(pfdm1.discount_amount) receivedAmount1
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ LEFT JOIN pay_fee_detail_month pfdm1 on pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and pfdm1.status_cd = '0' and pfdm1.detail_year = #{year} and pfdm1.detail_month < #{month}
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) b,
+ (select t.floor_num floorNum,SUM(pfdm2.received_amount) receivedAmount2
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ LEFT JOIN pay_fee_detail_month pfdm2 on pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and pfdm2.status_cd = '0' and pfdm2.detail_year = #{year} and pfdm2.detail_month > #{month}
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) c,
+ (select t.floor_num floorNum,SUM(rfms.owe_amount) receivableAmount
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.status_cd = '0'
+ where t.community_id= #{communityId}
+ group by t.floor_num
+ ) d
+ where a.floorNum = b.floorNum
+ and b.floorNum = c.floorNum
+ and c.floorNum = d.floorNum
+ ) tt
+ </select>
+
+ <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 -->
+ <select id="queryHuaningPayFeeTwo" parameterType="Map" resultType="Map">
+ select a.floorNum,d.receivableAmount ,
+ a.receivedAmount,b.receivedAmount1,
+ c.receivedAmount2
+ from
+ (select t.floor_num floorNum,sum(pfd.received_amount) receivedAmount
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) a,
+ (select t.floor_num floorNum,SUM(pfdm1.discount_amount) receivedAmount1
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ LEFT JOIN pay_fee_detail_month pfdm1 on pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and pfdm1.status_cd = '0' and pfdm1.detail_year = #{year} and pfdm1.detail_month < #{month}
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) b,
+ (select t.floor_num floorNum,SUM(pfdm2.received_amount) receivedAmount2
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+ inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+ LEFT JOIN pay_fee_detail_month pfdm2 on pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and pfdm2.status_cd = '0' and pfdm2.detail_year = #{year} and pfdm2.detail_month > #{month}
+ where 1=1
+ and t.status_cd = '0'
+ and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
+ and t.community_id= #{communityId}
+ GROUP BY floor_num
+ ) c,
+ (select t.floor_num floorNum,SUM(rfms.owe_amount) receivableAmount
+ from f_floor t
+ inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
+ inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
+ inner JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.status_cd = '0'
+ where t.community_id= #{communityId}
+ group by t.floor_num
+ ) d
+ where a.floorNum = b.floorNum
+ and b.floorNum = c.floorNum
+ and c.floorNum = d.floorNum
+ <if test="page != -1 and page != null ">
+ limit #{page}, #{row}
+ </if>
+ </select>
+ <select id="queryHuaningOweFeeDetailCount" parameterType="Map" resultType="Map">
+ select count(1) count
+ from (
+ select t.payer_obj_name payerObjName,br.built_up_area builtUpArea,pfc.square_price squarePrice, t.fee_id
+ feeId,t.end_time startTime,t.deadline_time endTime,t.amount_owed oweAmount
+ from report_owe_fee t
+ left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+ left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
+ where t.amount_owed > 0
+ and pfc.fee_type_cd = '888800010001'
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ ) tt
+ </select>
+
+ <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 -->
+ <select id="queryHuaningOweFeeDetail" parameterType="Map" resultType="Map">
+ select t.payer_obj_name payerObjName,br.built_up_area builtUpArea,pfc.square_price squarePrice, t.fee_id
+ feeId,t.end_time startTime,t.deadline_time endTime,t.amount_owed oweAmount
+ from report_owe_fee t
+ left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+ left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
+ where t.amount_owed > 0
+ and pfc.fee_type_cd = '888800010001'
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="page != -1 and page != null ">
+ limit #{page}, #{row}
+ </if>
+ </select>
</mapper>
--
Gitblit v1.8.0