From cdd0abecb96bb1b6dfa32e8a9cbb406ce3b4ed7d Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 26 八月 2021 17:02:08 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

---
 java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml |  129 +++++++++++++++++++++++++++++++++---------
 1 files changed, 100 insertions(+), 29 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
index d43e9b7..a8de264 100755
--- a/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
@@ -1136,7 +1136,7 @@
         t.receivable_amount receivableAmount,t.received_amount receivedAmount,pfa.`value`
         importFeeName,t.prime_rate,d.name primeRate,fdr.discount_small_type discountSmallType,fdr.rule_name
         ruleName,pfdd.discount_price discountPrice,co.contract_code contractCode,pfo.`value` ownerName,cb.o_id oId,
-        d2.name feeTypeCdName,pfc.fee_type_cd feeTypeCd,t.state,d3.name stateName
+        d2.name feeTypeCdName,pfc.fee_type_cd feeTypeCd,t.state,d3.name stateName,t.fee_id feeId,pft.`value` repairId
         from pay_fee_detail t
         INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
         inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0'
@@ -1146,6 +1146,7 @@
         left join owner_car oc on pf.payer_obj_id = oc.car_id and oc.status_cd = '0' and oc.car_type_cd='1001'
         left join pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002'
         left join pay_fee_attrs pfo on t.fee_id = pfo.fee_id and pfo.spec_cd = '390008'
+        left join pay_fee_attrs pft on t.fee_id = pft.fee_id and pft.spec_cd = '390001'
         left join pay_fee_detail_discount pfdd on t.detail_id = pfdd.detail_id and pfdd.status_cd = '0'
         left join fee_discount fd on pfdd.discount_id = fd.discount_id and fd.status_cd = '0'
         left join fee_discount_rule fdr on fd.rule_id = fdr.rule_id and fdr.status_cd = '0'
@@ -2099,24 +2100,21 @@
     <select id="queryHuaningOweFeeCount" parameterType="Map" resultType="Map">
         select count(1) count
         from (
-        select f.floor_num floorNum,SUM(t.owe_amount) oweAmount,SUM(curT.owe_amount) curOweAmount
-        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 building_unit curBu on curBu.floor_id = f.floor_id and bu.status_cd = '0'
-        left join building_room curBr on curBr.unit_id = curBu.unit_id and br.status_cd = '0'
-        inner join report_fee_month_statistics curT on curT.obj_id = curBr.room_id
+        select t.floor_num floorNum,SUM(rfms.owe_amount) oweAmount,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'
+        LEFT JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.obj_type = '3333' and rfms.status_cd = '0'
+        inner join report_fee_month_statistics curT on curT.obj_id = br.room_id and curT.community_id = t.community_id
         where t.status_cd = '0'
         <if test="roomNum !=null and roomNum != ''">
             and br.room_num= #{roomNum}
         </if>
         <if test="floorId !=null and floorId != ''">
-            and f.floor_id = #{floorId}
+            and t.floor_id = #{floorId}
         </if>
         <if test="objName !=null and objName != ''">
-            and t.obj_name= #{objName}
+            and rfms.obj_name= #{objName}
         </if>
         <if test="feeYear !=null and feeYear != ''">
             and curT.fee_year= #{feeYear}
@@ -2125,35 +2123,32 @@
             and t.community_id= #{communityId}
         </if>
         <if test="startTime !=null">
-            and t.create_time &gt;= #{startTime}
+            and rfms.create_time &gt;= #{startTime}
         </if>
         <if test="endTime !=null">
-            and t.create_time &lt;= #{endTime}
+            and rfms.create_time &lt;= #{endTime}
         </if>
-        GROUP BY f.floor_num
+        GROUP BY t.floor_num
         ) t
     </select>
 
     <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 -->
     <select id="queryHuaningOweFee" parameterType="Map" resultType="Map">
-        select f.floor_num floorNum,SUM(t.owe_amount) oweAmount,SUM(curT.owe_amount) curOweAmount
-        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 building_unit curBu on curBu.floor_id = f.floor_id and bu.status_cd = '0'
-        left join building_room curBr on curBr.unit_id = curBu.unit_id and br.status_cd = '0'
-        inner join report_fee_month_statistics curT on curT.obj_id = curBr.room_id
+        select t.floor_num floorNum,SUM(rfms.owe_amount) oweAmount,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'
+        LEFT JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.obj_type = '3333' and rfms.status_cd = '0'
+        inner join report_fee_month_statistics curT on curT.obj_id = br.room_id and curT.community_id = t.community_id
         where t.status_cd = '0'
         <if test="roomNum !=null and roomNum != ''">
             and br.room_num= #{roomNum}
         </if>
         <if test="floorId !=null and floorId != ''">
-            and f.floor_id = #{floorId}
+            and t.floor_id = #{floorId}
         </if>
         <if test="objName !=null and objName != ''">
-            and t.obj_name= #{objName}
+            and rfms.obj_name= #{objName}
         </if>
         <if test="feeYear !=null and feeYear != ''">
             and curT.fee_year= #{feeYear}
@@ -2162,12 +2157,12 @@
             and t.community_id= #{communityId}
         </if>
         <if test="startTime !=null">
-            and t.create_time &gt;= #{startTime}
+            and rfms.create_time &gt;= #{startTime}
         </if>
         <if test="endTime !=null">
-            and t.create_time &lt;= #{endTime}
+            and rfms.create_time &lt;= #{endTime}
         </if>
-        GROUP BY f.floor_num
+        GROUP BY t.floor_num
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>
@@ -2226,4 +2221,80 @@
             limit #{page}, #{row}
         </if>
     </select>
+    <select id="queryHuaningPayFeeTwoCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from (
+        select t.floor_num floorNum,sum(pfdm.receivable_amount) receivableAmount ,
+        sum(pfdm.received_amount) receivedAmount,SUM(pfdm1.discount_amount) receivedAmount1,
+        SUM(pfdm2.received_amount) receivedAmount2
+        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 pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+        LEFT join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+        LEFT JOIN pay_fee_detail_month pfdm on  pf.fee_id = pfdm.fee_id and pfd.detail_id = pfdm.detail_id and pfdm.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 &lt; #{month}
+        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 &gt; #{month}
+        where 1=1
+        and DATE_FORMAT(pfd.create_time,'%Y-%m') =  #{yearMonth}
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        GROUP BY t.floor_num
+        ) tt
+    </select>
+
+    <!-- 鏌ヨ璐圭敤鏈堢粺璁′俊鎭� add by wuxw 2018-07-03 -->
+    <select id="queryHuaningPayFeeTwo" parameterType="Map" resultType="Map">
+        select t.floor_num floorNum,sum(pfdm.receivable_amount) receivableAmount ,
+        sum(pfdm.received_amount) receivedAmount,SUM(pfdm1.discount_amount) receivedAmount1,
+        SUM(pfdm2.received_amount) receivedAmount2
+        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 pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
+        LEFT join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
+        LEFT JOIN pay_fee_detail_month pfdm on  pf.fee_id = pfdm.fee_id and pfd.detail_id = pfdm.detail_id and pfdm.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 &lt; #{month}
+        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 &gt; #{month}
+        where 1=1
+        and DATE_FORMAT(pfd.create_time,'%Y-%m') =  #{yearMonth}
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        GROUP BY t.floor_num
+        <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