|
@@ -891,14 +891,15 @@
|
|
|
<select id="queryOweFeeDetailCount" parameterType="Map" resultType="Map">
|
|
<select id="queryOweFeeDetailCount" parameterType="Map" resultType="Map">
|
|
|
select count(1) count
|
|
select count(1) count
|
|
|
from (
|
|
from (
|
|
|
- select t.obj_name objName,t.fee_name feeName,pfc.start_time,SUM(t.owe_amount) oweAmount
|
|
|
|
|
- from report_fee_month_statistics t
|
|
|
|
|
|
|
+ select t.payer_obj_name objName,t.fee_name feeName,pf.end_time feeCreateTime,t.create_time
|
|
|
|
|
+ createTime,SUM(t.amount_owed) oweAmount,max(t.deadline_time) deadlineTime
|
|
|
|
|
+ from report_owe_fee t
|
|
|
inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
- left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
|
|
|
|
|
|
|
+ left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
|
|
|
left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
|
|
left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
|
|
|
left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
|
|
left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
|
|
|
inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
|
|
inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
|
|
|
- where t.status_cd = '0'
|
|
|
|
|
|
|
+ where 1=1
|
|
|
<if test="roomNum !=null and roomNum != ''">
|
|
<if test="roomNum !=null and roomNum != ''">
|
|
|
and br.room_num= #{roomNum}
|
|
and br.room_num= #{roomNum}
|
|
|
</if>
|
|
</if>
|
|
@@ -909,13 +910,7 @@
|
|
|
and f.floor_id = #{floorId}
|
|
and f.floor_id = #{floorId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="objName !=null and objName != ''">
|
|
<if test="objName !=null and objName != ''">
|
|
|
- and t.obj_name= #{objName}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="feeYear !=null and feeYear != ''">
|
|
|
|
|
- and t.fee_year= #{feeYear}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="feeMonth !=null and feeMonth != ''">
|
|
|
|
|
- and t.fee_month= #{feeMonth}
|
|
|
|
|
|
|
+ and t.payer_obj_name= #{objName}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="feeId !=null and feeId != ''">
|
|
<if test="feeId !=null and feeId != ''">
|
|
|
and t.fee_id= #{feeId}
|
|
and t.fee_id= #{feeId}
|
|
@@ -924,7 +919,7 @@
|
|
|
and t.config_id= #{configId}
|
|
and t.config_id= #{configId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="objId !=null and objId != ''">
|
|
<if test="objId !=null and objId != ''">
|
|
|
- and t.obj_id= #{objId}
|
|
|
|
|
|
|
+ and t.payer_obj_id= #{objId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="feeName !=null and feeName != ''">
|
|
<if test="feeName !=null and feeName != ''">
|
|
|
and t.fee_name= #{feeName}
|
|
and t.fee_name= #{feeName}
|
|
@@ -938,23 +933,22 @@
|
|
|
<if test="endTime !=null">
|
|
<if test="endTime !=null">
|
|
|
and t.create_time <= #{endTime}
|
|
and t.create_time <= #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
- group by t.config_id,t.fee_name,pfc.start_time,t.obj_id,t.obj_name
|
|
|
|
|
|
|
+ group by t.fee_name,t.payer_obj_id,t.payer_obj_name
|
|
|
HAVING oweAmount > 0
|
|
HAVING oweAmount > 0
|
|
|
) t
|
|
) t
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
|
|
<!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
|
|
|
<select id="queryOweFeeDetail" parameterType="Map" resultType="Map">
|
|
<select id="queryOweFeeDetail" parameterType="Map" resultType="Map">
|
|
|
- select t.obj_name objName,t.fee_name feeName,t.fee_create_time feeCreateTime,t.create_time
|
|
|
|
|
- createTime,SUM(t.receivable_amount)
|
|
|
|
|
- receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
|
|
|
|
|
- from report_fee_month_statistics t
|
|
|
|
|
|
|
+ select t.payer_obj_name objName,t.fee_name feeName,pf.end_time feeCreateTime,t.create_time
|
|
|
|
|
+ createTime,SUM(t.amount_owed) oweAmount,max(t.deadline_time) deadlineTime
|
|
|
|
|
+ from report_owe_fee t
|
|
|
inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
- left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
|
|
|
|
|
|
|
+ left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
|
|
|
left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
|
|
left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
|
|
|
left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
|
|
left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
|
|
|
inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
|
|
inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
|
|
|
- where t.status_cd = '0'
|
|
|
|
|
|
|
+ where 1=1
|
|
|
<if test="roomNum !=null and roomNum != ''">
|
|
<if test="roomNum !=null and roomNum != ''">
|
|
|
and br.room_num= #{roomNum}
|
|
and br.room_num= #{roomNum}
|
|
|
</if>
|
|
</if>
|
|
@@ -965,13 +959,7 @@
|
|
|
and f.floor_id = #{floorId}
|
|
and f.floor_id = #{floorId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="objName !=null and objName != ''">
|
|
<if test="objName !=null and objName != ''">
|
|
|
- and t.obj_name= #{objName}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="feeYear !=null and feeYear != ''">
|
|
|
|
|
- and t.fee_year= #{feeYear}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="feeMonth !=null and feeMonth != ''">
|
|
|
|
|
- and t.fee_month= #{feeMonth}
|
|
|
|
|
|
|
+ and t.payer_obj_name= #{objName}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="feeId !=null and feeId != ''">
|
|
<if test="feeId !=null and feeId != ''">
|
|
|
and t.fee_id= #{feeId}
|
|
and t.fee_id= #{feeId}
|
|
@@ -980,7 +968,7 @@
|
|
|
and t.config_id= #{configId}
|
|
and t.config_id= #{configId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="objId !=null and objId != ''">
|
|
<if test="objId !=null and objId != ''">
|
|
|
- and t.obj_id= #{objId}
|
|
|
|
|
|
|
+ and t.payer_obj_id= #{objId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="feeName !=null and feeName != ''">
|
|
<if test="feeName !=null and feeName != ''">
|
|
|
and t.fee_name= #{feeName}
|
|
and t.fee_name= #{feeName}
|
|
@@ -994,7 +982,7 @@
|
|
|
<if test="endTime !=null">
|
|
<if test="endTime !=null">
|
|
|
and t.create_time <= #{endTime}
|
|
and t.create_time <= #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
- group by t.config_id,t.fee_name,pfc.start_time,t.obj_id,t.obj_name
|
|
|
|
|
|
|
+ group by t.fee_name,t.payer_obj_id,t.payer_obj_name
|
|
|
HAVING oweAmount > 0
|
|
HAVING oweAmount > 0
|
|
|
<if test="page != -1 and page != null ">
|
|
<if test="page != -1 and page != null ">
|
|
|
limit #{page}, #{row}
|
|
limit #{page}, #{row}
|
|
@@ -1002,16 +990,14 @@
|
|
|
</select>
|
|
</select>
|
|
|
<!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
|
|
<!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
|
|
|
<select id="queryOweFeeDetailMajor" parameterType="Map" resultType="Map">
|
|
<select id="queryOweFeeDetailMajor" parameterType="Map" resultType="Map">
|
|
|
- select SUM(t.receivable_amount)
|
|
|
|
|
- allReceivableAmount,SUM(t.received_amount)
|
|
|
|
|
- allReceivedAmount,SUM(t.owe_amount) allOweAmount
|
|
|
|
|
- from report_fee_month_statistics t
|
|
|
|
|
|
|
+ select SUM(t.amount_owed) oweAmount
|
|
|
|
|
+ from report_owe_fee t
|
|
|
inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
|
|
|
- left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
|
|
|
|
|
|
|
+ left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
|
|
|
left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
|
|
left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
|
|
|
left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
|
|
left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
|
|
|
inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
|
|
inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
|
|
|
- where t.status_cd = '0'
|
|
|
|
|
|
|
+ where 1=1
|
|
|
<if test="roomNum !=null and roomNum != ''">
|
|
<if test="roomNum !=null and roomNum != ''">
|
|
|
and br.room_num= #{roomNum}
|
|
and br.room_num= #{roomNum}
|
|
|
</if>
|
|
</if>
|
|
@@ -1022,13 +1008,7 @@
|
|
|
and f.floor_id = #{floorId}
|
|
and f.floor_id = #{floorId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="objName !=null and objName != ''">
|
|
<if test="objName !=null and objName != ''">
|
|
|
- and t.obj_name= #{objName}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="feeYear !=null and feeYear != ''">
|
|
|
|
|
- and t.fee_year= #{feeYear}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="feeMonth !=null and feeMonth != ''">
|
|
|
|
|
- and t.fee_month= #{feeMonth}
|
|
|
|
|
|
|
+ and t.payer_obj_name= #{objName}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="feeId !=null and feeId != ''">
|
|
<if test="feeId !=null and feeId != ''">
|
|
|
and t.fee_id= #{feeId}
|
|
and t.fee_id= #{feeId}
|
|
@@ -1037,7 +1017,7 @@
|
|
|
and t.config_id= #{configId}
|
|
and t.config_id= #{configId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="objId !=null and objId != ''">
|
|
<if test="objId !=null and objId != ''">
|
|
|
- and t.obj_id= #{objId}
|
|
|
|
|
|
|
+ and t.payer_obj_id= #{objId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="feeName !=null and feeName != ''">
|
|
<if test="feeName !=null and feeName != ''">
|
|
|
and t.fee_name= #{feeName}
|
|
and t.fee_name= #{feeName}
|