|
|
@@ -346,7 +346,7 @@
|
|
|
|
|
|
<select id="getFloorFeeSummary" parameterType="Map" resultType="Map">
|
|
|
|
|
|
- select a.floor_id floorId,a.floor_num floorNum,
|
|
|
+ select a.floor_id floorId,a.floor_num floorNum,a.name floorName
|
|
|
(
|
|
|
select count(1) from (
|
|
|
select t.obj_id from pay_fee_detail_month t
|
|
|
@@ -496,5 +496,167 @@
|
|
|
order by a.seq
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getConfigFeeSummary" parameterType="Map" resultType="Map">
|
|
|
+ select a.name,
|
|
|
+ (
|
|
|
+ select count(1) from (
|
|
|
+ select t.obj_id 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 = a.floor_id
|
|
|
+ </if>
|
|
|
+ and t.status_cd = '0'
|
|
|
+ and pf.payer_obj_type = '3333'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and t.cur_month_time < #{endDate}
|
|
|
+ and (t.receivable_amount - t.received_amount - t.discount_amount) > 0
|
|
|
+ <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
|
|
|
+ group by t.obj_id) b
|
|
|
+ ) oweRoomCount,-- 欠费户
|
|
|
+ (
|
|
|
+ select count(1) from (
|
|
|
+ select t.obj_id
|
|
|
+ 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 = a.floor_id
|
|
|
+ </if>
|
|
|
+ and t.status_cd = '0'
|
|
|
+ and pf.payer_obj_type = '3333'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and t.cur_month_time < #{endDate}
|
|
|
+ <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
|
|
|
+ group by t.obj_id) b
|
|
|
+ ) feeRoomCount, -- 收费户
|
|
|
+ (
|
|
|
+ select ifnull(sum(t.received_amount),0.0) receivedFee
|
|
|
+ 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 = a.floor_id
|
|
|
+ </if>
|
|
|
+ and t.status_cd = '0'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and t.pay_fee_time > #{startDate}
|
|
|
+ and t.pay_fee_time < #{endDate}
|
|
|
+ <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
|
|
|
+ ) receivedFee, -- 实收
|
|
|
+ (
|
|
|
+ select ifnull(sum(t.received_amount),0.0) preReceivedFee
|
|
|
+ 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 = a.floor_id
|
|
|
+ </if>
|
|
|
+ and t.status_cd = '0'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and t.pay_fee_time > #{startDate}
|
|
|
+ and t.pay_fee_time < #{endDate}
|
|
|
+ and t.cur_month_time > #{endDate}
|
|
|
+ <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
|
|
|
+ ) preReceivedFee, -- 预收
|
|
|
+ (
|
|
|
+ select ifnull(sum(t.receivable_amount - t.received_amount - t.discount_amount),0.0) hisOweFee
|
|
|
+ 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 = a.floor_id
|
|
|
+ </if>
|
|
|
+ and t.status_cd = '0'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and t.cur_month_time < #{startDate}
|
|
|
+ <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
|
|
|
+ ) hisOweFee, -- 历史欠费
|
|
|
+ (
|
|
|
+ select ifnull(sum(t.receivable_amount),0.0) curReceivableFee
|
|
|
+ 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 = a.floor_id
|
|
|
+ </if>
|
|
|
+ and t.status_cd = '0'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and t.cur_month_time > #{startDate}
|
|
|
+ and t.cur_month_time < #{endDate}
|
|
|
+ <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
|
|
|
+ ) curReceivableFee -- 当期应收
|
|
|
+ from t_dict a
|
|
|
+ where 1=1
|
|
|
+ and a.table_name = 'pay_fee_config'
|
|
|
+ and a.table_columns = 'fee_type_cd'
|
|
|
+ </select>
|
|
|
+
|
|
|
|
|
|
</mapper>
|