|
|
@@ -1043,61 +1043,61 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
- <!-- 已收房屋金额 -->
|
|
|
+ <!-- 已收房屋数 -->
|
|
|
<select id="getReceivedRoomCount" parameterType="Map" resultType="Map">
|
|
|
- select t.payer_obj_id payerObjId, pf.fee_type_cd feeTypeCd,t.fee_name feeName,
|
|
|
- DATE_FORMAT(t.end_time,'%Y-%m-%d') endTime,DATE_FORMAT(t.deadline_time,'%Y-%m-%d') deadlineTime,t.amount_owed amountOwed
|
|
|
- from report_owe_fee t
|
|
|
- left join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
|
|
|
- where t.amount_owed > 0
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
+ select count(DISTINCT pf.payer_obj_id) from pay_fee_detail t
|
|
|
+ inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' and pf.payer_obj_type = '3333'
|
|
|
+ LEFT JOIN building_room br on pf.payer_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
|
|
|
+ bu.floor_id = #{floorId}
|
|
|
and t.community_id = #{communityId}
|
|
|
- and t.payer_obj_id in
|
|
|
- <foreach collection="objIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ and t.create_time > #{startDate}
|
|
|
+ and t.create_time < #{endDate}
|
|
|
</select>
|
|
|
<!-- 已收房屋金额 -->
|
|
|
<select id="getReceivedRoomAmount" parameterType="Map" resultType="Map">
|
|
|
- select t.payer_obj_id payerObjId, pf.fee_type_cd feeTypeCd,t.fee_name feeName,
|
|
|
- DATE_FORMAT(t.end_time,'%Y-%m-%d') endTime,DATE_FORMAT(t.deadline_time,'%Y-%m-%d') deadlineTime,t.amount_owed amountOwed
|
|
|
- from report_owe_fee t
|
|
|
- left join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
|
|
|
- where t.amount_owed > 0
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
+ select ifnull(sum(t.received_amount),0) amount from pay_fee_detail t
|
|
|
+ inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' and pf.payer_obj_type = '3333'
|
|
|
+ LEFT JOIN building_room br on pf.payer_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
|
|
|
+ bu.floor_id = #{floorId}
|
|
|
and t.community_id = #{communityId}
|
|
|
- and t.payer_obj_id in
|
|
|
- <foreach collection="objIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ and t.create_time > #{startDate}
|
|
|
+ and t.create_time < #{endDate}
|
|
|
</select>
|
|
|
<!-- 欠费清缴户 -->
|
|
|
<select id="getHisOweReceivedRoomCount" parameterType="Map" resultType="Map">
|
|
|
- select t.payer_obj_id payerObjId, pf.fee_type_cd feeTypeCd,t.fee_name feeName,
|
|
|
- DATE_FORMAT(t.end_time,'%Y-%m-%d') endTime,DATE_FORMAT(t.deadline_time,'%Y-%m-%d') deadlineTime,t.amount_owed amountOwed
|
|
|
- from report_owe_fee t
|
|
|
- left join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
|
|
|
- where t.amount_owed > 0
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
- and t.community_id = #{communityId}
|
|
|
- and t.payer_obj_id in
|
|
|
- <foreach collection="objIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ select count(DISTINCT t.obj_id) count
|
|
|
+ from pay_fee_detail_month t
|
|
|
+ inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' and pf.payer_obj_type = '3333'
|
|
|
+ LEFT JOIN building_room br on pf.payer_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
|
|
|
+ bu.floor_id = #{floorId}
|
|
|
+ and t.community_id = #{communityId}
|
|
|
+ and t.pay_fee_time > #{startDate}
|
|
|
+ and t.pay_fee_time < #{endDate}
|
|
|
+ and t.cur_month_time < #{hisDate}
|
|
|
+ and t.detail_id != '-1'
|
|
|
+ and t.status_cd = '0'
|
|
|
</select>
|
|
|
<!-- 欠费清缴金额 -->
|
|
|
<select id="getHisOweReceivedRoomAmount" parameterType="Map" resultType="Map">
|
|
|
- select t.payer_obj_id payerObjId, pf.fee_type_cd feeTypeCd,t.fee_name feeName,
|
|
|
- DATE_FORMAT(t.end_time,'%Y-%m-%d') endTime,DATE_FORMAT(t.deadline_time,'%Y-%m-%d') deadlineTime,t.amount_owed amountOwed
|
|
|
- from report_owe_fee t
|
|
|
- left join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
|
|
|
- where t.amount_owed > 0
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
- and t.community_id = #{communityId}
|
|
|
- and t.payer_obj_id in
|
|
|
- <foreach collection="objIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ select ifnull(sum(t.received_amount),0) amount
|
|
|
+ from pay_fee_detail_month t
|
|
|
+ inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' and pf.payer_obj_type = '3333'
|
|
|
+ LEFT JOIN building_room br on pf.payer_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
|
|
|
+ bu.floor_id = #{floorId}
|
|
|
+ and t.community_id = #{communityId}
|
|
|
+ and t.pay_fee_time > #{startDate}
|
|
|
+ and t.pay_fee_time < #{endDate}
|
|
|
+ and t.cur_month_time < #{hisDate}
|
|
|
+ and t.detail_id != '-1'
|
|
|
+ and t.status_cd = '0'
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|