Skip to content

Commit 4298412

Browse files
committed
优化代码
1 parent 0ac5016 commit 4298412

File tree

1 file changed

+2
-90
lines changed

1 file changed

+2
-90
lines changed

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

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -520,73 +520,7 @@
520520
) b
521521
where b.fee_type_cd = a.status_cd
522522
) feeRoomCount,
523-
(
524-
select ifnull(sum(t.received_amount),0.0) receivedFee
525-
from pay_fee_detail t
526-
INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
527-
<if test="floorId != null and floorId != ''">
528-
LEFT JOIN building_room br on pf.payer_obj_id = br.room_id and br.status_cd = '0'
529-
left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
530-
</if>
531-
where
532-
1=1
533-
<if test="floorId != null and floorId != ''">
534-
and bu.floor_id = #{floorId}
535-
</if>
536-
and t.status_cd = '0'
537-
and t.community_id= #{communityId}
538-
and t.create_time &gt; #{startDate}
539-
and t.create_time &lt; #{endDate}
540-
<if test="configIds !=null ">
541-
and pf.config_id in
542-
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
543-
#{item}
544-
</foreach>
545-
</if>
546-
and pf.fee_type_cd = a.status_cd
547-
) receivedFee,
548-
(
549-
select ifnull(sum(t.received_amount),0.0) preReceivedFee
550-
from pay_fee_detail_month t
551-
where
552-
1=1
553-
<if test="floorId != null and floorId != ''">
554-
and t.obj_fpc_id = #{floorId}
555-
</if>
556-
and t.status_cd = '0'
557-
and t.community_id= #{communityId}
558-
and t.pay_fee_time &gt; #{startDate}
559-
and t.pay_fee_time &lt; #{endDate}
560-
and t.cur_month_time &gt;= #{endDate}
561-
and t.detail_id != '-1'
562-
<if test="configIds !=null ">
563-
and t.config_id in
564-
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
565-
#{item}
566-
</foreach>
567-
</if>
568-
and t.fee_type_cd = a.status_cd
569-
) preReceivedFee,
570-
(
571-
select ifnull(sum(t.receivable_amount),0.0) hisOweFee
572-
from pay_fee_detail_month t
573-
where
574-
1=1
575-
<if test="floorId != null and floorId != ''">
576-
and t.obj_fpc_id = #{floorId}
577-
</if>
578-
and t.status_cd = '0'
579-
and t.community_id= #{communityId}
580-
and t.detail_id = '-1'
581-
and t.cur_month_time &lt; #{startDate}
582-
<if test="configIds !=null ">
583-
and t.config_id in
584-
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
585-
#{item}
586-
</foreach>
587-
</if>
588-
and t.fee_type_cd = a.status_cd
589-
) hisOweFee,
523+
590524
(
591525
select ifnull(sum(t.receivable_amount),0.0) curReceivableFee
592526
from pay_fee_detail_month t
@@ -627,29 +561,7 @@
627561
</foreach>
628562
</if>
629563
and t.fee_type_cd = a.status_cd
630-
) curReceivedFee,
631-
(
632-
select ifnull(sum(t.received_amount),0.0) hisReceivedFee
633-
from pay_fee_detail_month t
634-
where
635-
1=1
636-
<if test="floorId != null and floorId != ''">
637-
and t.obj_fpc_id = #{floorId}
638-
</if>
639-
and t.status_cd = '0'
640-
and t.community_id= #{communityId}
641-
and t.pay_fee_time &gt; #{startDate}
642-
and t.pay_fee_time &lt; #{endDate}
643-
and t.cur_month_time &lt; #{startDate}
644-
and t.detail_id != '-1'
645-
<if test="configIds !=null ">
646-
and t.config_id in
647-
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
648-
#{item}
649-
</foreach>
650-
</if>
651-
and t.fee_type_cd = a.status_cd
652-
) hisReceivedFee
564+
) curReceivedFee
653565
from t_dict a
654566
where 1=1
655567
and a.table_name = 'pay_fee_config'

0 commit comments

Comments
 (0)