| | |
| | | <if test="oweAmount !=null and oweAmount != ''"> |
| | | , t.owe_amount= #{oweAmount} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | , t.community_id= #{communityId} |
| | | </if> |
| | | |
| | | <if test="feeCreateTime !=null and feeCreateTime != ''"> |
| | | , t.fee_create_time= #{feeCreateTime} |
| | | </if> |
| | |
| | | , t.obj_type= #{objType} |
| | | </if> |
| | | where 1=1 |
| | | <if test="statisticsId !=null and statisticsId != ''"> |
| | | and t.statistics_id= #{statisticsId} |
| | | and t.statistics_id= #{statisticsId} |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询费用月统计数量 add by wuxw 2018-07-03 --> |
| | |
| | | and pfc.config_id= #{configId} |
| | | </if> |
| | | <if test="objId !=null and objId != ''"> |
| | | and t.obj_id= #{objId} |
| | | and pf.payer_obj_id= #{objId} |
| | | </if> |
| | | <if test="feeName !=null and feeName != ''"> |
| | | and t.fee_name= #{feeName} |
| | |
| | | and pfc.config_id= #{configId} |
| | | </if> |
| | | <if test="objId !=null and objId != ''"> |
| | | and t.obj_id= #{objId} |
| | | and pf.payer_obj_id = #{objId} |
| | | </if> |
| | | <if test="feeName !=null and feeName != ''"> |
| | | and t.fee_name= #{feeName} |
| | |
| | | and pfc.config_id= #{configId} |
| | | </if> |
| | | <if test="objId !=null and objId != ''"> |
| | | and t.obj_id= #{objId} |
| | | and pf.payer_obj_id= #{objId} |
| | | </if> |
| | | <if test="feeName !=null and feeName != ''"> |
| | | and t.fee_name= #{feeName} |
| | |
| | | and pfc.config_id= #{configId} |
| | | </if> |
| | | <if test="objId !=null and objId != ''"> |
| | | and t.obj_id= #{objId} |
| | | and pf.payer_obj_id= #{objId} |
| | | </if> |
| | | <if test="feeName !=null and feeName != ''"> |
| | | and t.fee_name= #{feeName} |
| | |
| | | <select id="queryHuaningPayFeeTwoCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from ( |
| | | select t.floor_num floorNum,sum(pfdm.receivable_amount) receivableAmount , |
| | | sum(pfdm.received_amount) receivedAmount,SUM(pfdm1.discount_amount) receivedAmount1, |
| | | SUM(pfdm2.received_amount) receivedAmount2 |
| | | select a.floorNum,d.receivableAmount , |
| | | a.receivedAmount,b.receivedAmount1, |
| | | c.receivedAmount2 |
| | | from |
| | | (select t.floor_num floorNum,sum(pfd.received_amount) receivedAmount |
| | | from f_floor t |
| | | LEFT JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0' |
| | | LEFT JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0' |
| | | LEFT JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0' |
| | | LEFT join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0' |
| | | LEFT JOIN pay_fee_detail_month pfdm on pf.fee_id = pfdm.fee_id and pfd.detail_id = pfdm.detail_id and pfdm.status_cd = '0' |
| | | inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0' |
| | | inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0' |
| | | inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0' |
| | | inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0' |
| | | where 1=1 |
| | | and t.status_cd = '0' |
| | | and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth} |
| | | and t.community_id= #{communityId} |
| | | GROUP BY floor_num |
| | | ) a, |
| | | (select t.floor_num floorNum,SUM(pfdm1.discount_amount) receivedAmount1 |
| | | from f_floor t |
| | | inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0' |
| | | inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0' |
| | | inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0' |
| | | inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0' |
| | | LEFT JOIN pay_fee_detail_month pfdm1 on pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and pfdm1.status_cd = '0' and pfdm1.detail_year = #{year} and pfdm1.detail_month < #{month} |
| | | where 1=1 |
| | | and t.status_cd = '0' |
| | | and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth} |
| | | and t.community_id= #{communityId} |
| | | GROUP BY floor_num |
| | | ) b, |
| | | (select t.floor_num floorNum,SUM(pfdm2.received_amount) receivedAmount2 |
| | | from f_floor t |
| | | inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0' |
| | | inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0' |
| | | inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0' |
| | | inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0' |
| | | LEFT JOIN pay_fee_detail_month pfdm2 on pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and pfdm2.status_cd = '0' and pfdm2.detail_year = #{year} and pfdm2.detail_month > #{month} |
| | | where 1=1 |
| | | and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth} |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | GROUP BY t.floor_num |
| | | and t.status_cd = '0' |
| | | and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth} |
| | | and t.community_id= #{communityId} |
| | | GROUP BY floor_num |
| | | ) c, |
| | | (select t.floor_num floorNum,SUM(rfms.owe_amount) receivableAmount |
| | | from f_floor t |
| | | inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0' |
| | | inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0' |
| | | inner JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.status_cd = '0' |
| | | where t.community_id= #{communityId} |
| | | group by t.floor_num |
| | | ) d |
| | | where a.floorNum = b.floorNum |
| | | and b.floorNum = c.floorNum |
| | | and c.floorNum = d.floorNum |
| | | ) tt |
| | | </select> |
| | | |
| | | <!-- 查询费用月统计信息 add by wuxw 2018-07-03 --> |
| | | <select id="queryHuaningPayFeeTwo" parameterType="Map" resultType="Map"> |
| | | select t.floor_num floorNum,sum(pfdm.receivable_amount) receivableAmount , |
| | | sum(pfdm.received_amount) receivedAmount,SUM(pfdm1.discount_amount) receivedAmount1, |
| | | SUM(pfdm2.received_amount) receivedAmount2 |
| | | select a.floorNum,d.receivableAmount , |
| | | a.receivedAmount,b.receivedAmount1, |
| | | c.receivedAmount2 |
| | | from |
| | | (select t.floor_num floorNum,sum(pfd.received_amount) receivedAmount |
| | | from f_floor t |
| | | LEFT JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0' |
| | | LEFT JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0' |
| | | LEFT JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0' |
| | | LEFT join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0' |
| | | LEFT JOIN pay_fee_detail_month pfdm on pf.fee_id = pfdm.fee_id and pfd.detail_id = pfdm.detail_id and pfdm.status_cd = '0' |
| | | inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0' |
| | | inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0' |
| | | inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0' |
| | | inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0' |
| | | where 1=1 |
| | | and t.status_cd = '0' |
| | | and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth} |
| | | and t.community_id= #{communityId} |
| | | GROUP BY floor_num |
| | | ) a, |
| | | (select t.floor_num floorNum,SUM(pfdm1.discount_amount) receivedAmount1 |
| | | from f_floor t |
| | | inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0' |
| | | inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0' |
| | | inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0' |
| | | inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0' |
| | | LEFT JOIN pay_fee_detail_month pfdm1 on pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and pfdm1.status_cd = '0' and pfdm1.detail_year = #{year} and pfdm1.detail_month < #{month} |
| | | where 1=1 |
| | | and t.status_cd = '0' |
| | | and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth} |
| | | and t.community_id= #{communityId} |
| | | GROUP BY floor_num |
| | | ) b, |
| | | (select t.floor_num floorNum,SUM(pfdm2.received_amount) receivedAmount2 |
| | | from f_floor t |
| | | inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0' |
| | | inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0' |
| | | inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0' |
| | | inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0' |
| | | LEFT JOIN pay_fee_detail_month pfdm2 on pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and pfdm2.status_cd = '0' and pfdm2.detail_year = #{year} and pfdm2.detail_month > #{month} |
| | | where 1=1 |
| | | and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth} |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | GROUP BY t.floor_num |
| | | and t.status_cd = '0' |
| | | and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth} |
| | | and t.community_id= #{communityId} |
| | | GROUP BY floor_num |
| | | ) c, |
| | | (select t.floor_num floorNum,SUM(rfms.owe_amount) receivableAmount |
| | | from f_floor t |
| | | inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0' |
| | | inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0' |
| | | inner JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.status_cd = '0' |
| | | where t.community_id= #{communityId} |
| | | group by t.floor_num |
| | | ) d |
| | | where a.floorNum = b.floorNum |
| | | and b.floorNum = c.floorNum |
| | | and c.floorNum = d.floorNum |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | |
| | | <select id="queryHuaningOweFeeDetailCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from ( |
| | | select t.payer_obj_name payerObjName,br.built_up_area builtUpArea,pfc.square_price squarePrice, t.fee_id feeId,t.end_time startTime,t.deadline_time endTime,t.amount_owed oweAmount |
| | | select t.payer_obj_name payerObjName,br.built_up_area builtUpArea,pfc.square_price squarePrice, t.fee_id |
| | | feeId,t.end_time startTime,t.deadline_time endTime,t.amount_owed oweAmount |
| | | from report_owe_fee t |
| | | left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0' |
| | | left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' |
| | |
| | | |
| | | <!-- 查询费用月统计信息 add by wuxw 2018-07-03 --> |
| | | <select id="queryHuaningOweFeeDetail" parameterType="Map" resultType="Map"> |
| | | select t.payer_obj_name payerObjName,br.built_up_area builtUpArea,pfc.square_price squarePrice, t.fee_id feeId,t.end_time startTime,t.deadline_time endTime,t.amount_owed oweAmount |
| | | select t.payer_obj_name payerObjName,br.built_up_area builtUpArea,pfc.square_price squarePrice, t.fee_id |
| | | feeId,t.end_time startTime,t.deadline_time endTime,t.amount_owed oweAmount |
| | | from report_owe_fee t |
| | | left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0' |
| | | left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' |