|
|
@@ -318,137 +318,64 @@
|
|
|
<select id="getFeeRoomCount" parameterType="Map" resultType="Map">
|
|
|
select count(1) feeRoomCount
|
|
|
from (
|
|
|
- select t.payer_obj_id
|
|
|
- from report_owe_fee t
|
|
|
- inner join building_room br on t.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'
|
|
|
- <if test="feeTypeCd != null and feeTypeCd != ''">
|
|
|
- left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
- </if>
|
|
|
- where
|
|
|
- 1=1
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
- and t.community_id= #{communityId}
|
|
|
- and t.end_time < #{endDate}
|
|
|
- <if test="floorId != null and floorId != ''">
|
|
|
- and bu.floor_id = #{floorId}
|
|
|
- </if>
|
|
|
- <if test="configId != null and configId != ''">
|
|
|
- and t.config_id = #{configId}
|
|
|
- </if>
|
|
|
- <if test="objName != null and objName != ''">
|
|
|
- and t.payer_obj_name like concat('%',#{objName},'%')
|
|
|
- </if>
|
|
|
- <if test="ownerName != null and ownerName != ''">
|
|
|
- and t.owner_name like concat('%',#{ownerName},'%')
|
|
|
- </if>
|
|
|
- <if test="link != null and link != ''">
|
|
|
- and t.owner_tel = #{link}
|
|
|
- </if>
|
|
|
- <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 pfc.fee_type_cd = #{feeTypeCd}
|
|
|
- </if>
|
|
|
- group by t.payer_obj_id
|
|
|
- ) a
|
|
|
- </select>
|
|
|
-
|
|
|
-
|
|
|
- <select id="getFloorFeeSummary" parameterType="Map" resultType="Map">
|
|
|
- select a.floor_id floorId,a.floor_num floorNum,a.name floorName,
|
|
|
- (
|
|
|
- select count(1) from (
|
|
|
- select bu.floor_id,t.payer_obj_id
|
|
|
- from report_owe_fee t
|
|
|
- inner join building_room br on t.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'
|
|
|
- <if test="feeTypeCd != null and feeTypeCd != ''">
|
|
|
- left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
- </if>
|
|
|
- where
|
|
|
- 1=1
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
- and t.community_id= #{communityId}
|
|
|
- and t.end_time <= #{endDate}
|
|
|
- and t.amount_owed != 0
|
|
|
- <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 pfc.fee_type_cd = #{feeTypeCd}
|
|
|
- </if>
|
|
|
- group by bu.floor_id,t.payer_obj_id
|
|
|
- ) b
|
|
|
- where b.floor_id = a.floor_id
|
|
|
- ) oweRoomCount,
|
|
|
- (
|
|
|
- select count(1) from (
|
|
|
- select bu.floor_id,t.payer_obj_id
|
|
|
- from report_owe_fee t
|
|
|
- inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
|
|
|
+ select t.payer_obj_id
|
|
|
+ from report_owe_fee t
|
|
|
inner join building_room br on t.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
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
- and t.community_id= #{communityId}
|
|
|
- and pf.community_id= #{communityId}
|
|
|
- and t.end_time <= #{endDate}
|
|
|
- <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>
|
|
|
- group by bu.floor_id,t.payer_obj_id
|
|
|
- ) b
|
|
|
- where b.floor_id = a.floor_id
|
|
|
- ) feeRoomCount,
|
|
|
- (
|
|
|
- select ifnull(sum(t.received_amount),0.0) receivedFee
|
|
|
- from pay_fee_detail t
|
|
|
- INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
|
|
|
- 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'
|
|
|
+ <if test="feeTypeCd != null and feeTypeCd != ''">
|
|
|
+ left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
+ </if>
|
|
|
where
|
|
|
1=1
|
|
|
- and bu.floor_id = a.floor_id
|
|
|
- and t.status_cd = '0'
|
|
|
- and t.community_id= a.community_id
|
|
|
- and t.create_time > #{startDate}
|
|
|
- and t.create_time < #{endDate}
|
|
|
+ and t.payer_obj_type = '3333'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and t.end_time < #{endDate}
|
|
|
+ <if test="floorId != null and floorId != ''">
|
|
|
+ and bu.floor_id = #{floorId}
|
|
|
+ </if>
|
|
|
+ <if test="configId != null and configId != ''">
|
|
|
+ and t.config_id = #{configId}
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ and t.payer_obj_name like concat('%',#{objName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="ownerName != null and ownerName != ''">
|
|
|
+ and t.owner_name like concat('%',#{ownerName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="link != null and link != ''">
|
|
|
+ and t.owner_tel = #{link}
|
|
|
+ </if>
|
|
|
<if test="configIds !=null ">
|
|
|
- and pf.config_id in
|
|
|
+ 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}
|
|
|
+ and pfc.fee_type_cd = #{feeTypeCd}
|
|
|
</if>
|
|
|
- ) receivedFee,
|
|
|
+ group by t.payer_obj_id
|
|
|
+ ) a
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getFloorFeeSummary" parameterType="Map" resultType="Map">
|
|
|
+ select a.floor_id floorId,a.floor_num floorNum,a.name floorName,
|
|
|
(
|
|
|
- select ifnull(sum(t.received_amount),0.0) preReceivedFee
|
|
|
- from pay_fee_detail_month t
|
|
|
+ select count(1) from (
|
|
|
+ select bu.floor_id,t.payer_obj_id
|
|
|
+ from report_owe_fee t
|
|
|
+ inner join building_room br on t.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'
|
|
|
+ <if test="feeTypeCd != null and feeTypeCd != ''">
|
|
|
+ left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
+ </if>
|
|
|
where
|
|
|
1=1
|
|
|
- and t.obj_fpc_id = a.floor_id
|
|
|
- and t.status_cd = '0'
|
|
|
- and t.community_id= a.community_id
|
|
|
- and t.pay_fee_time > #{startDate}
|
|
|
- and t.pay_fee_time < #{endDate}
|
|
|
- and t.cur_month_time >= #{endDate}
|
|
|
+ and t.payer_obj_type = '3333'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and t.end_time <= #{endDate}
|
|
|
+ and t.amount_owed != 0
|
|
|
<if test="configIds !=null ">
|
|
|
and t.config_id in
|
|
|
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
@@ -456,19 +383,25 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="feeTypeCd != null and feeTypeCd != ''">
|
|
|
- and t.fee_type_cd = #{feeTypeCd}
|
|
|
+ and pfc.fee_type_cd = #{feeTypeCd}
|
|
|
</if>
|
|
|
- ) preReceivedFee,
|
|
|
+ group by bu.floor_id,t.payer_obj_id
|
|
|
+ ) b
|
|
|
+ where b.floor_id = a.floor_id
|
|
|
+ ) oweRoomCount,
|
|
|
(
|
|
|
- select ifnull(sum(t.receivable_amount),0.0) hisOweFee
|
|
|
- from pay_fee_detail_month t
|
|
|
+ select count(1) from (
|
|
|
+ select bu.floor_id,t.payer_obj_id
|
|
|
+ from report_owe_fee t
|
|
|
+ inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
|
|
|
+ inner join building_room br on t.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
|
|
|
- and t.obj_fpc_id = a.floor_id
|
|
|
- and t.status_cd = '0'
|
|
|
- and t.community_id= a.community_id
|
|
|
- and t.detail_id = '-1'
|
|
|
- and t.cur_month_time < #{startDate}
|
|
|
+ and t.payer_obj_type = '3333'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and pf.community_id= #{communityId}
|
|
|
+ and t.end_time <= #{endDate}
|
|
|
<if test="configIds !=null ">
|
|
|
and t.config_id in
|
|
|
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
@@ -476,9 +409,12 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="feeTypeCd != null and feeTypeCd != ''">
|
|
|
- and t.fee_type_cd = #{feeTypeCd}
|
|
|
+ and pf.fee_type_cd = #{feeTypeCd}
|
|
|
</if>
|
|
|
- ) hisOweFee,
|
|
|
+ group by bu.floor_id,t.payer_obj_id
|
|
|
+ ) b
|
|
|
+ where b.floor_id = a.floor_id
|
|
|
+ ) feeRoomCount,
|
|
|
(
|
|
|
select ifnull(sum(t.receivable_amount),0.0) curReceivableFee
|
|
|
from pay_fee_detail_month t
|
|
|
@@ -519,140 +455,22 @@
|
|
|
<if test="feeTypeCd != null and feeTypeCd != ''">
|
|
|
and t.fee_type_cd = #{feeTypeCd}
|
|
|
</if>
|
|
|
- ) curReceivedFee,
|
|
|
- (
|
|
|
- select ifnull(sum(t.received_amount),0.0) hisReceivedFee
|
|
|
- from pay_fee_detail_month t
|
|
|
- where
|
|
|
- 1=1
|
|
|
- and t.obj_fpc_id = a.floor_id
|
|
|
- and t.status_cd = '0'
|
|
|
- and t.community_id= a.community_id
|
|
|
- and t.pay_fee_time > #{startDate}
|
|
|
- and t.pay_fee_time < #{endDate}
|
|
|
- and t.cur_month_time < #{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 t.fee_type_cd = #{feeTypeCd}
|
|
|
- </if>
|
|
|
- ) hisReceivedFee
|
|
|
+ ) curReceivedFee
|
|
|
from f_floor a
|
|
|
where 1=1
|
|
|
and a.status_cd = '0'
|
|
|
and a.community_id = #{communityId}
|
|
|
+ <if test="floorId != null and floorId != ''">
|
|
|
+ and a.floor_id = #{floorId}
|
|
|
+ </if>
|
|
|
order by a.seq
|
|
|
</select>
|
|
|
|
|
|
<select id="getConfigFeeSummary" parameterType="Map" resultType="Map">
|
|
|
select a.name,
|
|
|
(
|
|
|
- select count(1) from (
|
|
|
- select pfc.fee_type_cd,t.payer_obj_id
|
|
|
- from report_owe_fee t
|
|
|
- inner join building_room br on t.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'
|
|
|
- left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
- where
|
|
|
- 1=1
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
- and t.community_id= #{communityId}
|
|
|
- and t.end_time <= #{endDate}
|
|
|
- and t.amount_owed != 0
|
|
|
- <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 pfc.fee_type_cd = #{feeTypeCd}
|
|
|
- </if>
|
|
|
- group by pfc.fee_type_cd,t.payer_obj_id
|
|
|
- ) b
|
|
|
- where b.fee_type_cd = a.status_cd
|
|
|
- ) oweRoomCount,
|
|
|
- (
|
|
|
- select count(1) from (
|
|
|
- select pf.fee_type_cd,t.payer_obj_id
|
|
|
- from report_owe_fee t
|
|
|
- inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
|
|
|
- inner join building_room br on t.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
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
- and t.community_id= #{communityId}
|
|
|
- and pf.community_id= #{communityId}
|
|
|
- and t.end_time <= #{endDate}
|
|
|
- <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>
|
|
|
- group by pf.fee_type_cd,t.payer_obj_id
|
|
|
- ) b
|
|
|
- where b.fee_type_cd = a.status_cd
|
|
|
- ) feeRoomCount,
|
|
|
- (
|
|
|
- select ifnull(sum(t.received_amount),0.0) receivedFee
|
|
|
- from pay_fee_detail 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 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'
|
|
|
- </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.create_time > #{startDate}
|
|
|
- and t.create_time < #{endDate}
|
|
|
- <if test="configIds !=null ">
|
|
|
- and pf.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
|
|
|
- where
|
|
|
- 1=1
|
|
|
- <if test="floorId != null and floorId != ''">
|
|
|
- and t.obj_fpc_id = #{floorId}
|
|
|
- </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}
|
|
|
- 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 t.fee_type_cd = a.status_cd
|
|
|
- ) preReceivedFee,
|
|
|
- (
|
|
|
- select ifnull(sum(t.receivable_amount),0.0) hisOweFee
|
|
|
- from pay_fee_detail_month t
|
|
|
+ select ifnull(sum(t.receivable_amount),0.0) curReceivableFee
|
|
|
+ from pay_fee_detail_month t force index(i_fc)
|
|
|
where
|
|
|
1=1
|
|
|
<if test="floorId != null and floorId != ''">
|
|
|
@@ -660,8 +478,8 @@
|
|
|
</if>
|
|
|
and t.status_cd = '0'
|
|
|
and t.community_id= #{communityId}
|
|
|
- and t.detail_id = '-1'
|
|
|
- and t.cur_month_time < #{startDate}
|
|
|
+ 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=",">
|
|
|
@@ -669,10 +487,10 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
and t.fee_type_cd = a.status_cd
|
|
|
- ) hisOweFee,
|
|
|
+ ) curReceivableFee,
|
|
|
(
|
|
|
- select ifnull(sum(t.receivable_amount),0.0) curReceivableFee
|
|
|
- from pay_fee_detail_month t
|
|
|
+ select ifnull(sum(t.receivable_amount),0.0) curReceivedFee
|
|
|
+ from pay_fee_detail_month t force index(i_fc)
|
|
|
where
|
|
|
1=1
|
|
|
<if test="floorId != null and floorId != ''">
|
|
|
@@ -682,6 +500,7 @@
|
|
|
and t.community_id= #{communityId}
|
|
|
and t.cur_month_time >= #{startDate}
|
|
|
and t.cur_month_time < #{endDate}
|
|
|
+ and t.detail_id != '-1'
|
|
|
<if test="configIds !=null ">
|
|
|
and t.config_id in
|
|
|
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
@@ -689,50 +508,59 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
and t.fee_type_cd = a.status_cd
|
|
|
- ) curReceivableFee,
|
|
|
+ ) curReceivedFee,
|
|
|
(
|
|
|
- select ifnull(sum(t.receivable_amount),0.0) curReceivedFee
|
|
|
- from pay_fee_detail_month t
|
|
|
+ select count(1) from (
|
|
|
+ select pfc.fee_type_cd,t.payer_obj_id
|
|
|
+ from report_owe_fee t
|
|
|
+ inner join building_room br on t.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'
|
|
|
+ left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
where
|
|
|
1=1
|
|
|
- <if test="floorId != null and floorId != ''">
|
|
|
- and t.obj_fpc_id = #{floorId}
|
|
|
- </if>
|
|
|
- and t.status_cd = '0'
|
|
|
- and t.community_id= #{communityId}
|
|
|
- and t.cur_month_time >= #{startDate}
|
|
|
- and t.cur_month_time < #{endDate}
|
|
|
- and t.detail_id != '-1'
|
|
|
+ and t.payer_obj_type = '3333'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and t.end_time <= #{endDate}
|
|
|
+ and t.amount_owed != 0
|
|
|
<if test="configIds !=null ">
|
|
|
and t.config_id in
|
|
|
<foreach collection="configIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- and t.fee_type_cd = a.status_cd
|
|
|
- ) curReceivedFee,
|
|
|
+ <if test="feeTypeCd != null and feeTypeCd != ''">
|
|
|
+ and pfc.fee_type_cd = #{feeTypeCd}
|
|
|
+ </if>
|
|
|
+ group by pfc.fee_type_cd,t.payer_obj_id
|
|
|
+ ) b
|
|
|
+ where b.fee_type_cd = a.status_cd
|
|
|
+ ) oweRoomCount,
|
|
|
(
|
|
|
- select ifnull(sum(t.received_amount),0.0) hisReceivedFee
|
|
|
- from pay_fee_detail_month t
|
|
|
+ select count(1) from (
|
|
|
+ select pf.fee_type_cd,t.payer_obj_id
|
|
|
+ from report_owe_fee t
|
|
|
+ inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
|
|
|
+ inner join building_room br on t.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
|
|
|
- <if test="floorId != null and floorId != ''">
|
|
|
- and t.obj_fpc_id = #{floorId}
|
|
|
- </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 < #{startDate}
|
|
|
- and t.detail_id != '-1'
|
|
|
+ and t.payer_obj_type = '3333'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and pf.community_id= #{communityId}
|
|
|
+ and t.end_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 t.fee_type_cd = a.status_cd
|
|
|
- ) hisReceivedFee
|
|
|
+ <if test="feeTypeCd != null and feeTypeCd != ''">
|
|
|
+ and pf.fee_type_cd = #{feeTypeCd}
|
|
|
+ </if>
|
|
|
+ group by pf.fee_type_cd,t.payer_obj_id
|
|
|
+ ) b
|
|
|
+ where b.fee_type_cd = a.status_cd
|
|
|
+ ) feeRoomCount
|
|
|
from t_dict a
|
|
|
where 1=1
|
|
|
and a.table_name = 'pay_fee_config'
|
|
|
@@ -743,17 +571,17 @@
|
|
|
select count(1) feeRoomCount
|
|
|
from
|
|
|
(
|
|
|
- select t.payer_ob_id
|
|
|
- from report_owe_fee t
|
|
|
- inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
|
|
|
+ select t.payer_ob_id
|
|
|
+ from report_owe_fee t
|
|
|
+ inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
|
|
|
inner join building_room br on t.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
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
- and t.community_id= #{communityId}
|
|
|
- and pf.community_id= #{communityId}
|
|
|
- group by a.payer_ob_id
|
|
|
+ left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
|
|
|
+ where
|
|
|
+ 1=1
|
|
|
+ and t.payer_obj_type = '3333'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and pf.community_id= #{communityId}
|
|
|
+ group by a.payer_ob_id
|
|
|
) b
|
|
|
</select>
|
|
|
<!-- 查询房屋费用明细表-->
|
|
|
@@ -1013,35 +841,35 @@
|
|
|
) roomCount,
|
|
|
(
|
|
|
select count(1) from (
|
|
|
- select bu.floor_id,br.room_id
|
|
|
- from report_owe_fee t
|
|
|
- inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
|
|
|
+ select bu.floor_id,br.room_id
|
|
|
+ from report_owe_fee t
|
|
|
+ inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
|
|
|
inner join building_room br on t.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
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
- and t.community_id= #{communityId}
|
|
|
+ left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
|
|
|
+ where
|
|
|
+ 1=1
|
|
|
+ and t.payer_obj_type = '3333'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
and pf.community_id= #{communityId}
|
|
|
- and t.end_time < #{endDate}
|
|
|
- group by bu.floor_id,br.room_id
|
|
|
+ and t.end_time < #{endDate}
|
|
|
+ group by bu.floor_id,br.room_id
|
|
|
) b
|
|
|
where b.floor_id = a.floor_id
|
|
|
) feeRoomCount,
|
|
|
(
|
|
|
select count(1) from (
|
|
|
- select bu.floor_id,br.room_id
|
|
|
- from report_owe_fee t
|
|
|
+ select bu.floor_id,br.room_id
|
|
|
+ from report_owe_fee t
|
|
|
inner join building_room br on t.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'
|
|
|
- left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
- where
|
|
|
- 1=1
|
|
|
- and t.payer_obj_type = '3333'
|
|
|
- and t.community_id= #{communityId}
|
|
|
- and t.end_time < #{endDate}
|
|
|
- and t.amount_owed != 0
|
|
|
- group by bu.floor_id,br.room_id
|
|
|
+ left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
|
|
|
+ left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
+ where
|
|
|
+ 1=1
|
|
|
+ and t.payer_obj_type = '3333'
|
|
|
+ and t.community_id= #{communityId}
|
|
|
+ and t.end_time < #{endDate}
|
|
|
+ and t.amount_owed != 0
|
|
|
+ group by bu.floor_id,br.room_id
|
|
|
) b
|
|
|
where b.floor_id = a.floor_id
|
|
|
) oweRoomCount,
|
|
|
@@ -1159,7 +987,7 @@
|
|
|
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
|
|
|
- and bu.floor_id = #{floorId}
|
|
|
+ and bu.floor_id = #{floorId}
|
|
|
and t.community_id = #{communityId}
|
|
|
and pf.community_id= #{communityId}
|
|
|
and t.pay_fee_time > #{startDate}
|