java110 2 lat temu
rodzic
commit
49b0013bee

+ 58 - 4
java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml

@@ -535,7 +535,32 @@
         <if test="feeTypeCd != null and feeTypeCd != ''">
         <if test="feeTypeCd != null and feeTypeCd != ''">
             and pf.fee_type_cd = #{feeTypeCd}
             and pf.fee_type_cd = #{feeTypeCd}
         </if>
         </if>
-        ) curReceivableFee
+        ) curReceivableFee,
+        (
+        select ifnull(sum(t.received_amount),0.0) hisReceivedFee
+        from pay_fee_detail_month t
+        INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
+        left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
+        where
+        1=1
+        and bu.floor_id = a.floor_id
+        and t.status_cd = '0'
+        and t.community_id= a.community_id
+        and t.pay_fee_time &gt; #{startDate}
+        and t.pay_fee_time &lt; #{endDate}
+        and t.cur_month_time &lt; #{startDate}
+        and t.detail_id != '-1'
+        <if test="configIds !=null ">
+            and t.config_id in
+            <foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="feeTypeCd != null and feeTypeCd != ''">
+            and pf.fee_type_cd = #{feeTypeCd}
+        </if>
+        ) hisReceivedFee
         from f_floor a
         from f_floor a
         where 1=1
         where 1=1
         and a.status_cd = '0'
         and a.status_cd = '0'
@@ -613,8 +638,9 @@
         </if>
         </if>
         and t.status_cd = '0'
         and t.status_cd = '0'
         and t.community_id= #{communityId}
         and t.community_id= #{communityId}
-        and t.create_time &gt; #{startDate}
-        and t.create_time &lt; #{endDate}
+        and t.pay_fee_time &gt; #{startDate}
+        and t.pay_fee_time &lt; #{endDate}
+        and t.detail_id != '-1'
         <if test="configIds !=null ">
         <if test="configIds !=null ">
             and pf.config_id in
             and pf.config_id in
             <foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
             <foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
@@ -641,6 +667,7 @@
         and t.pay_fee_time &gt; #{startDate}
         and t.pay_fee_time &gt; #{startDate}
         and t.pay_fee_time &lt; #{endDate}
         and t.pay_fee_time &lt; #{endDate}
         and t.cur_month_time &gt; #{endDate}
         and t.cur_month_time &gt; #{endDate}
+        and t.detail_id != '-1'
         <if test="configIds !=null ">
         <if test="configIds !=null ">
             and t.config_id in
             and t.config_id in
             <foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
             <foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
@@ -698,7 +725,34 @@
             </foreach>
             </foreach>
         </if>
         </if>
         and pf.fee_type_cd = a.status_cd
         and pf.fee_type_cd = a.status_cd
-        ) curReceivableFee
+        ) curReceivableFee,
+        (
+        select ifnull(sum(t.received_amount),0.0) hisReceivedFee
+        from pay_fee_detail_month t
+        INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        <if test="floorId != null and floorId != ''">
+            LEFT JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
+            left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
+        </if>
+        where
+        1=1
+        <if test="floorId != null and floorId != ''">
+            and bu.floor_id = #{floorId}
+        </if>
+        and t.status_cd = '0'
+        and t.community_id= #{communityId}
+        and t.pay_fee_time &gt; #{startDate}
+        and t.pay_fee_time &lt; #{endDate}
+        and t.cur_month_time &lt; #{startDate}
+        and t.detail_id != '-1'
+        <if test="configIds !=null ">
+            and t.config_id in
+            <foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        and pf.fee_type_cd = a.status_cd
+        ) hisReceivedFee
         from t_dict a
         from t_dict a
         where 1=1
         where 1=1
         and a.table_name = 'pay_fee_config'
         and a.table_name = 'pay_fee_config'

+ 3 - 1
service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportConfigFeeSummaryCmd.java

@@ -55,6 +55,7 @@ public class QueryReportConfigFeeSummaryCmd extends Cmd {
         BigDecimal feeRoomRate = null;
         BigDecimal feeRoomRate = null;
         BigDecimal hisOweFee = null;
         BigDecimal hisOweFee = null;
         BigDecimal curReceivableFee = null;
         BigDecimal curReceivableFee = null;
+        BigDecimal hisReceivedFee = null;
         BigDecimal receivedFee = null;
         BigDecimal receivedFee = null;
         BigDecimal preReceivedFee = null;
         BigDecimal preReceivedFee = null;
         for (Map data : datas) {
         for (Map data : datas) {
@@ -71,7 +72,8 @@ public class QueryReportConfigFeeSummaryCmd extends Cmd {
             //todo 计算 收费率
             //todo 计算 收费率
             hisOweFee = new BigDecimal(Double.parseDouble(data.get("hisOweFee").toString()));
             hisOweFee = new BigDecimal(Double.parseDouble(data.get("hisOweFee").toString()));
             curReceivableFee = new BigDecimal(Double.parseDouble(data.get("curReceivableFee").toString()));
             curReceivableFee = new BigDecimal(Double.parseDouble(data.get("curReceivableFee").toString()));
-            hisOweFee = curReceivableFee.add(hisOweFee);
+            hisReceivedFee = new BigDecimal(Double.parseDouble(data.get("hisReceivedFee").toString()));
+            hisOweFee = curReceivableFee.add(hisOweFee).add(hisReceivedFee);
 
 
             if (hisOweFee.doubleValue() > 0) {
             if (hisOweFee.doubleValue() > 0) {
                 receivedFee = new BigDecimal(Double.parseDouble(data.get("receivedFee").toString()));
                 receivedFee = new BigDecimal(Double.parseDouble(data.get("receivedFee").toString()));

+ 3 - 1
service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFloorFeeSummaryCmd.java

@@ -55,6 +55,7 @@ public class QueryReportFloorFeeSummaryCmd extends Cmd {
         BigDecimal feeRoomRate = null;
         BigDecimal feeRoomRate = null;
         BigDecimal hisOweFee = null;
         BigDecimal hisOweFee = null;
         BigDecimal curReceivableFee = null;
         BigDecimal curReceivableFee = null;
+        BigDecimal hisReceivedFee = null;
         BigDecimal receivedFee = null;
         BigDecimal receivedFee = null;
         BigDecimal preReceivedFee = null;
         BigDecimal preReceivedFee = null;
         for(Map data:datas){
         for(Map data:datas){
@@ -71,7 +72,8 @@ public class QueryReportFloorFeeSummaryCmd extends Cmd {
             //todo 计算 收费率
             //todo 计算 收费率
             hisOweFee = new BigDecimal(Double.parseDouble(data.get("hisOweFee").toString()));
             hisOweFee = new BigDecimal(Double.parseDouble(data.get("hisOweFee").toString()));
             curReceivableFee = new BigDecimal(Double.parseDouble(data.get("curReceivableFee").toString()));
             curReceivableFee = new BigDecimal(Double.parseDouble(data.get("curReceivableFee").toString()));
-            hisOweFee = curReceivableFee.add(hisOweFee);
+            hisReceivedFee = new BigDecimal(Double.parseDouble(data.get("hisReceivedFee").toString()));
+            hisOweFee = curReceivableFee.add(hisOweFee).add(hisReceivedFee);
 
 
             if(hisOweFee.doubleValue()> 0){
             if(hisOweFee.doubleValue()> 0){
                 receivedFee = new BigDecimal(Double.parseDouble(data.get("receivedFee").toString()));
                 receivedFee = new BigDecimal(Double.parseDouble(data.get("receivedFee").toString()));