|
|
@@ -478,6 +478,12 @@
|
|
|
<if test="configId !=null and configId != ''">
|
|
|
and t.config_id= #{configId}
|
|
|
</if>
|
|
|
+ <if test="configIds !=null">
|
|
|
+ and t.config_id in
|
|
|
+ <foreach collection="configIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="objId !=null and objId != ''">
|
|
|
and t.obj_id= #{objId}
|
|
|
</if>
|
|
|
@@ -506,7 +512,8 @@
|
|
|
</if>
|
|
|
,SUM(t.his_owe_amount) hisOweAmount,SUM(t.cur_receivable_amount) curReceivableAmount,
|
|
|
SUM(t.cur_received_amount) curReceivedAmount,SUM(t.his_owe_received_amount) hisOweReceivedAmount,SUM(t.pre_received_amount) preReceivedAmount,
|
|
|
- max(t.update_time) updateTime,sum(t.his_owe_amount+t.cur_receivable_amount) receivableAmount,sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount
|
|
|
+ max(t.update_time) updateTime,sum(t.his_owe_amount+t.cur_receivable_amount) receivableAmount,
|
|
|
+ sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount
|
|
|
from report_fee_month_statistics t
|
|
|
INNER JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
|
|
|
inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
|
|
|
@@ -619,6 +626,9 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!--
|
|
|
+ and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
|
|
|
+ -->
|
|
|
<select id="queryFeeBreakdownCount" parameterType="Map" resultType="Map">
|
|
|
select count(1) count
|
|
|
from (
|
|
|
@@ -633,7 +643,7 @@
|
|
|
left join t_dict td on pfc.fee_type_cd = td.status_cd and td.table_name='pay_fee_config' and
|
|
|
td.table_columns='fee_type_cd'
|
|
|
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' and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
|
|
|
+ where t.status_cd = '0'
|
|
|
<if test="roomNum !=null and roomNum != ''">
|
|
|
and br.room_num= #{roomNum}
|
|
|
</if>
|
|
|
@@ -676,15 +686,22 @@
|
|
|
<if test="endTime !=null and endTime != ''">
|
|
|
and pfc.start_time <= #{endTime}
|
|
|
</if>
|
|
|
+ <if test="yearMonth !=null and yearMonth != ''">
|
|
|
+ and concat(t.detail_year,t.detail_month) = #{yearMonth}
|
|
|
+ </if>
|
|
|
+
|
|
|
group by t.config_id,t.fee_name,pfc.start_time
|
|
|
) t
|
|
|
</select>
|
|
|
|
|
|
- <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
|
|
|
+ <!-- 查询费用月统计信息 add by wuxw 2018-07-03
|
|
|
+ and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
|
|
|
+ -->
|
|
|
<select id="queryFeeBreakdown" parameterType="Map" resultType="Map">
|
|
|
- select t.fee_name feeName,td.name feeTypeCd,pfc.fee_type_cd,pfc.start_time feeStartTime,pfc.end_time
|
|
|
- feeEndTime,SUM(t.receivable_amount)
|
|
|
- receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount,max(t.update_time) updateTime
|
|
|
+ select t.fee_name feeName,td.name feeTypeCd,pfc.fee_type_cd,SUM(t.his_owe_amount) hisOweAmount,SUM(t.cur_receivable_amount) curReceivableAmount,
|
|
|
+ SUM(t.cur_received_amount) curReceivedAmount,SUM(t.his_owe_received_amount) hisOweReceivedAmount,SUM(t.pre_received_amount) preReceivedAmount,
|
|
|
+ max(t.update_time) updateTime,sum(t.his_owe_amount+t.cur_receivable_amount) receivableAmount,
|
|
|
+ sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount,max(t.update_time) updateTime
|
|
|
from report_fee_month_statistics t
|
|
|
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'
|
|
|
@@ -693,7 +710,7 @@
|
|
|
left join t_dict td on pfc.fee_type_cd = td.status_cd and td.table_name='pay_fee_config' and
|
|
|
td.table_columns='fee_type_cd'
|
|
|
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' and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
|
|
|
+ where t.status_cd = '0'
|
|
|
<if test="roomNum !=null and roomNum != ''">
|
|
|
and br.room_num= #{roomNum}
|
|
|
</if>
|
|
|
@@ -736,6 +753,9 @@
|
|
|
<if test="endTime !=null and endTime != ''">
|
|
|
and pfc.start_time <= #{endTime}
|
|
|
</if>
|
|
|
+ <if test="yearMonth !=null and yearMonth != ''">
|
|
|
+ and concat(t.detail_year,t.detail_month) = #{yearMonth}
|
|
|
+ </if>
|
|
|
group by t.config_id,t.fee_name,pfc.start_time
|
|
|
order by t.create_time desc
|
|
|
<if test="page != -1 and page != null ">
|
|
|
@@ -744,9 +764,7 @@
|
|
|
</select>
|
|
|
<!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
|
|
|
<select id="queryFeeBreakdownMajor" parameterType="Map" resultType="Map">
|
|
|
- select SUM(t.receivable_amount)
|
|
|
- allReceivableAmount,SUM(t.received_amount)
|
|
|
- allReceivedAmount,SUM(t.owe_amount) allOweAmount
|
|
|
+ select sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) allReceivedAmount
|
|
|
from report_fee_month_statistics t
|
|
|
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'
|