| | |
| | | </if> |
| | | </update> |
| | | |
| | | |
| | | <!-- 修改费用月统计信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateReportFeeMonthStatisticsInfo" parameterType="Map"> |
| | | update report_fee_month_statistics t set t.status_cd = #{statusCd} |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryReportFeeSummaryDetailCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from report_fee_month_statistics t |
| | | 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_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' |
| | | 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' |
| | | <if test="roomNum !=null and roomNum != ''"> |
| | | and br.room_num= #{roomNum} |
| | | </if> |
| | | <if test="unitId !=null and unitId != ''"> |
| | | and bu.unit_id= #{unitId} |
| | | </if> |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and f.floor_id = #{floorId} |
| | | </if> |
| | | <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} |
| | | </if> |
| | | <if test="feeId !=null and feeId != ''"> |
| | | and t.fee_id= #{feeId} |
| | | </if> |
| | | <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> |
| | | <if test="feeName !=null and feeName != ''"> |
| | | and t.fee_name= #{feeName} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.create_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询费用月统计信息 add by wuxw 2018-07-03 --> |
| | | <select id="queryReportFeeSummaryDetail" parameterType="Map" resultType="Map"> |
| | | select t.obj_name objName,t.fee_name feeName,t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime |
| | | ,t.config_id configId |
| | | ,t.his_owe_amount hisOweAmount,t.cur_receivable_amount curReceivableAmount, |
| | | t.cur_received_amount curReceivedAmount,t.his_owe_received_amount |
| | | hisOweReceivedAmount,t.pre_received_amount preReceivedAmount, |
| | | t.update_time updateTime,t.his_owe_amount+t.cur_receivable_amount |
| | | receivableAmount,t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount receivedAmount |
| | | from report_fee_month_statistics t |
| | | 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_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' |
| | | 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' |
| | | <if test="roomNum !=null and roomNum != ''"> |
| | | and br.room_num= #{roomNum} |
| | | </if> |
| | | <if test="unitId !=null and unitId != ''"> |
| | | and bu.unit_id= #{unitId} |
| | | </if> |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and f.floor_id = #{floorId} |
| | | </if> |
| | | <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} |
| | | </if> |
| | | <if test="feeId !=null and feeId != ''"> |
| | | and t.fee_id= #{feeId} |
| | | </if> |
| | | <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> |
| | | <if test="feeName !=null and feeName != ''"> |
| | | and t.fee_name= #{feeName} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.create_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询费用月统计信息 大计 add by wuxw 2018-07-03 --> |
| | | <select id="queryReportFeeSummaryMajor" parameterType="Map" resultType="Map"> |
| | | select |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryReportFloorUnitFeeSummaryDetailCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | 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' |
| | | inner 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' |
| | | where t.status_cd = '0' |
| | | <if test="roomNum !=null and roomNum != ''"> |
| | | and br.room_num= #{roomNum} |
| | | </if> |
| | | <if test="unitId !=null and unitId != ''"> |
| | | and bu.unit_id= #{unitId} |
| | | </if> |
| | | <if test="unitNum !=null and unitNum != ''"> |
| | | and bu.unit_num= #{unitNum} |
| | | </if> |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and f.floor_id = #{floorId} |
| | | </if> |
| | | <if test="floorNum !=null and floorNum != ''"> |
| | | and f.floor_num = #{floorNum} |
| | | </if> |
| | | <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} |
| | | </if> |
| | | <if test="feeId !=null and feeId != ''"> |
| | | and t.fee_id= #{feeId} |
| | | </if> |
| | | <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> |
| | | <if test="feeName !=null and feeName != ''"> |
| | | and t.fee_name= #{feeName} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.create_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询费用月统计信息 add by wuxw 2018-07-03 --> |
| | | <select id="queryReportFloorUnitFeeSummaryDetail" parameterType="Map" resultType="Map"> |
| | | select t.obj_name objName,t.fee_name feeName,t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime |
| | | ,t.config_id configId |
| | | ,t.his_owe_amount hisOweAmount,t.cur_receivable_amount curReceivableAmount, |
| | | t.cur_received_amount curReceivedAmount,t.his_owe_received_amount |
| | | hisOweReceivedAmount,t.pre_received_amount preReceivedAmount, |
| | | t.update_time updateTime,t.his_owe_amount+t.cur_receivable_amount receivableAmount, |
| | | 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' |
| | | inner 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' |
| | | where t.status_cd = '0' |
| | | <if test="roomNum !=null and roomNum != ''"> |
| | | and br.room_num= #{roomNum} |
| | | </if> |
| | | <if test="unitId !=null and unitId != ''"> |
| | | and bu.unit_id= #{unitId} |
| | | </if> |
| | | <if test="unitNum !=null and unitNum != ''"> |
| | | and bu.unit_num= #{unitNum} |
| | | </if> |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and f.floor_id = #{floorId} |
| | | </if> |
| | | <if test="floorNum !=null and floorNum != ''"> |
| | | and f.floor_num = #{floorNum} |
| | | </if> |
| | | <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} |
| | | </if> |
| | | <if test="feeId !=null and feeId != ''"> |
| | | and t.fee_id= #{feeId} |
| | | </if> |
| | | <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> |
| | | <if test="feeName !=null and feeName != ''"> |
| | | and t.fee_name= #{feeName} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.create_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询费用月统计信息 add by wuxw 2018-07-03 --> |
| | | <select id="queryReportFloorUnitFeeSummaryMajor" parameterType="Map" resultType="Map"> |
| | | select |
| | |
| | | and pfc.start_time <= #{endTime} |
| | | </if> |
| | | <if test="yearMonth !=null and yearMonth != ''"> |
| | | and concat(t.fee_year,t.fee_month) = #{yearMonth} |
| | | and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth} |
| | | </if> |
| | | |
| | | group by t.config_id,t.fee_name,pfc.start_time |
| | |
| | | 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,SUM(t.his_owe_amount) |
| | | select t.fee_name feeName,td.name feeTypeCd,pfc.fee_type_cd,t.config_id configId,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, |
| | |
| | | and pfc.start_time <= #{endTime} |
| | | </if> |
| | | <if test="yearMonth !=null and yearMonth != ''"> |
| | | and concat(t.fee_year,t.fee_month) = #{yearMonth} |
| | | and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth} |
| | | </if> |
| | | group by t.config_id,t.fee_name,pfc.start_time |
| | | order by t.create_time desc |
| | |
| | | limit #{page}, #{row} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryFeeBreakdownDetailCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | 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' |
| | | 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 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' |
| | | <if test="roomNum !=null and roomNum != ''"> |
| | | and br.room_num= #{roomNum} |
| | | </if> |
| | | <if test="unitId !=null and unitId != ''"> |
| | | and bu.unit_id= #{unitId} |
| | | </if> |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and f.floor_id = #{floorId} |
| | | </if> |
| | | <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} |
| | | </if> |
| | | <if test="feeId !=null and feeId != ''"> |
| | | and t.fee_id= #{feeId} |
| | | </if> |
| | | <if test="configId !=null and configId != ''"> |
| | | and pfc.config_id= #{configId} |
| | | </if> |
| | | <if test="objId !=null and objId != ''"> |
| | | and t.obj_id= #{objId} |
| | | </if> |
| | | <if test="feeName !=null and feeName != ''"> |
| | | and t.fee_name= #{feeName} |
| | | </if> |
| | | <if test="feeTypeCd != null and feeTypeCd != ''"> |
| | | and pfc.fee_type_cd = #{feeTypeCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and pfc.start_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and pfc.start_time <= #{endTime} |
| | | </if> |
| | | <if test="yearMonth !=null and yearMonth != ''"> |
| | | and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询费用月统计信息 add by wuxw 2018-07-03 |
| | | and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0 |
| | | --> |
| | | <select id="queryFeeBreakdownDetail" parameterType="Map" resultType="Map"> |
| | | select t.obj_name objName,t.fee_name feeName,t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime |
| | | ,t.config_id configId,t.his_owe_amount |
| | | hisOweAmount,t.cur_receivable_amount curReceivableAmount, |
| | | t.cur_received_amount curReceivedAmount,t.his_owe_received_amount |
| | | hisOweReceivedAmount,t.pre_received_amount preReceivedAmount, |
| | | t.update_time updateTime,t.his_owe_amount+t.cur_receivable_amount receivableAmount, |
| | | t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount receivedAmount,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' |
| | | 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 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' |
| | | <if test="roomNum !=null and roomNum != ''"> |
| | | and br.room_num= #{roomNum} |
| | | </if> |
| | | <if test="unitId !=null and unitId != ''"> |
| | | and bu.unit_id= #{unitId} |
| | | </if> |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and f.floor_id = #{floorId} |
| | | </if> |
| | | <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} |
| | | </if> |
| | | <if test="feeId !=null and feeId != ''"> |
| | | and t.fee_id= #{feeId} |
| | | </if> |
| | | <if test="configId !=null and configId != ''"> |
| | | and pfc.config_id= #{configId} |
| | | </if> |
| | | <if test="objId !=null and objId != ''"> |
| | | and t.obj_id= #{objId} |
| | | </if> |
| | | <if test="feeName !=null and feeName != ''"> |
| | | and t.fee_name= #{feeName} |
| | | </if> |
| | | <if test="feeTypeCd != null and feeTypeCd != ''"> |
| | | and pfc.fee_type_cd = #{feeTypeCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and pfc.start_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and pfc.start_time <= #{endTime} |
| | | </if> |
| | | <if test="yearMonth !=null and yearMonth != ''"> |
| | | and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询费用月统计信息 add by wuxw 2018-07-03 and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0 --> |
| | | <select id="queryFeeBreakdownMajor" parameterType="Map" resultType="Map"> |
| | | select |
| | |
| | | and pfc.start_time <= #{endTime} |
| | | </if> |
| | | <if test="yearMonth !=null and yearMonth != ''"> |
| | | and concat(t.fee_year,t.fee_month) = #{yearMonth} |
| | | and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth} |
| | | </if> |
| | | order by t.create_time desc |
| | | </select> |
| | |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.create_time >= #{startTime} |
| | | and t.fee_create_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | and t.deadline_time <= #{endTime} |
| | | </if> |
| | | group by t.config_id,t.fee_name,t.fee_create_time,t.obj_id,t.obj_name,t.deadline_time |
| | | ) t |
| | |
| | | <select id="queryFeeDetail" parameterType="Map" resultType="Map"> |
| | | select t.obj_name objName,t.fee_name feeName,t.fee_create_time feeCreateTime,pfa.`value` |
| | | ownerName,br.built_up_area builtUpArea ,max(t.deadline_time) |
| | | deadlineTime,t.create_time createTime,SUM(t.receivable_amount) receivableAmount,SUM(t.received_amount) |
| | | receivedAmount,SUM(t.owe_amount) oweAmount,max(t.update_time) updateTime |
| | | deadlineTime,t.create_time createTime,max(t.update_time) updateTime,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, |
| | | 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 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 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' |
| | | left join pay_fee_attrs pfa on pf.fee_id = pfa.fee_id and pfa.spec_cd = '390008' and pfa.status_cd ='0' |
| | | where t.status_cd = '0' and t.receivable_amount >=0 and t.receivable_amount >= 0 |
| | | where t.status_cd = '0' |
| | | <if test="roomNum !=null and roomNum != ''"> |
| | | and br.room_num= #{roomNum} |
| | | </if> |
| | |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.create_time >= #{startTime} |
| | | and t.fee_create_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | and t.deadline_time <= #{endTime} |
| | | </if> |
| | | group by t.config_id,t.fee_name,t.fee_create_time,t.obj_id,t.obj_name,pfa.`value`,br.built_up_area |
| | | order by pfa.`value` |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | |
| | | |
| | | <!-- 查询费用月统计信息 add by wuxw 2018-07-03 --> |
| | | <select id="queryAllFeeDetail" 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.his_owe_amount + t.cur_receivable_amount) allReceivableAmount, |
| | | SUM(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) allReceivedAmount, |
| | | if(SUM(t.his_owe_amount + t.cur_receivable_amount - t.cur_received_amount - t.his_owe_received_amount) < 0,0, |
| | | SUM(t.his_owe_amount + t.cur_receivable_amount - t.cur_received_amount - t.his_owe_received_amount)) |
| | | allOweAmount, |
| | | SUM(t.his_owe_received_amount) allHisOweReceivedAmount |
| | | 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' |
| | | left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0' |
| | |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.create_time >= #{startTime} |
| | | and t.fee_create_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | and t.deadline_time <= #{endTime} |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | and t.amount_owed > 0 |
| | | group by t.fee_name,t.payer_obj_id,t.payer_obj_name |
| | | HAVING oweAmount > 0 |
| | | ) t |
| | |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | and t.amount_owed > 0 |
| | | group by t.fee_name,t.payer_obj_id,t.payer_obj_name,pfa.`value`,br.built_up_area |
| | | HAVING oweAmount > 0 |
| | | order by t.payer_obj_name |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | |
| | | t.receivable_amount receivableAmount,t.received_amount receivedAmount,d.name,d2.name feeTypeCdName, |
| | | pfc.fee_type_cd feeTypeCd,t.state,d3.name stateName |
| | | from pay_fee_detail t |
| | | INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0' |
| | | left JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0' |
| | | left join building_room br on pf.payer_obj_id = br.room_id and pf.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 f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0' |
| | |
| | | d2.name feeTypeCdName,pfc.fee_type_cd feeTypeCd,t.state,d3.name stateName,t.fee_id feeId,pft.`value` repairId, |
| | | t.detail_id,t.detail_id detailId,pf.payer_obj_id,pfb.value ownerId,concat(pa.num,'停车场',ps.num,'车位') psName |
| | | from pay_fee_detail t |
| | | INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0' |
| | | left JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0' |
| | | left join building_room br on pf.payer_obj_id = br.room_id and pf.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 f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0' |
| | |
| | | <select id="queryAllPayFeeDetail" parameterType="Map" resultType="Map"> |
| | | select SUM(t.receivable_amount) allReceivableAmount,SUM(t.received_amount) allReceivedAmount |
| | | from pay_fee_detail t |
| | | INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0' |
| | | left JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0' |
| | | left join building_room br on pf.payer_obj_id = br.room_id and pf.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 f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0' |
| | |
| | | ruleName,pfdd.discount_price, |
| | | SUM(pfdd.discount_price) discountPrice |
| | | from pay_fee_detail t |
| | | INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0' |
| | | left JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0' |
| | | left join building_room br on pf.payer_obj_id = br.room_id and pf.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 f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0' |
| | |
| | | |
| | | <select id="queryRepairForStaff" parameterType="Map" resultType="Map"> |
| | | SELECT r.staff_id staffId,r.staff_name staffName,r.state FROM r_repair_user r |
| | | inner join u_user u on u.user_id = r.staff_id and u.status_cd = '0' |
| | | WHERE r.state!='10005' AND r.state!='10009' AND r.state!='11000' AND |
| | | r.state!='12000' AND r.state != '10007' AND r.status_cd = '0' AND |
| | | r.repair_event != 'payUser' AND r.repair_event != 'startUser' AND r.staff_id != '-1' |
| | |
| | | </select> |
| | | |
| | | <select id="getReceivableInformation" parameterType="Map" resultType="Map"> |
| | | select sum(t.receivable_amount) receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) |
| | | oweAmount |
| | | select a.receivableAmount,a.receivedAmount, IF(a.receivableAmount < |
| | | a.oweReceivedAmount,'0',a.receivableAmount-a.oweReceivedAmount) oweAmount |
| | | from ( |
| | | select 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, |
| | | sum(t.cur_received_amount+t.his_owe_received_amount) oweReceivedAmount |
| | | from report_fee_month_statistics t |
| | | inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | where t.community_id = #{communityId} |
| | | where 1=1 |
| | | and t.fee_year= #{feeYear} |
| | | and t.fee_month= #{feeMonth} |
| | | and t.community_id = #{communityId} |
| | | ) a |
| | | </select> |
| | | |
| | | <select id="getFloorReceivableInformation" parameterType="Map" resultType="Map"> |
| | | select f.floor_num floorNum,f.`name`,sum(t.receivable_amount) receivableAmount,SUM(t.received_amount) |
| | | receivedAmount,SUM(t.owe_amount) oweAmount |
| | | select a.floorNum,a.`name`,a.receivableAmount,a.receivedAmount, IF(a.receivableAmount < |
| | | a.oweReceivedAmount,'0',a.receivableAmount-a.oweReceivedAmount) oweAmount |
| | | from ( |
| | | select f.floor_num floorNum,f.`name`,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, |
| | | sum(t.cur_received_amount+t.his_owe_received_amount) oweReceivedAmount |
| | | from report_fee_month_statistics t |
| | | inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | inner join building_room br on br.room_id = t.obj_id and t.obj_type = '3333' and br.community_id = |
| | | t.community_id and br.status_cd = '0' |
| | | inner join building_unit bu on bu.unit_id = br.unit_id and bu.status_cd = '0' |
| | | inner join f_floor f on f.floor_id = bu.floor_id and f.status_cd = '0' |
| | | where t.community_id = #{communityId} |
| | | where 1=1 |
| | | and t.fee_year= #{feeYear} |
| | | and t.fee_month= #{feeMonth} |
| | | and t.community_id = #{communityId} |
| | | group by f.floor_num ,f.`name` |
| | | ) a |
| | | </select> |
| | | |
| | | <select id="getFeeConfigReceivableInformation" parameterType="Map" resultType="Map"> |
| | | select t.fee_name feeName,sum(t.receivable_amount) receivableAmount,SUM(t.received_amount) |
| | | receivedAmount,SUM(t.owe_amount) oweAmount |
| | | select a.feeName,a.receivableAmount,a.receivedAmount, IF(a.receivableAmount < |
| | | a.oweReceivedAmount,'0',a.receivableAmount-a.oweReceivedAmount) oweAmount |
| | | from ( |
| | | select t.fee_name feeName,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, |
| | | sum(t.cur_received_amount+t.his_owe_received_amount) oweReceivedAmount |
| | | from report_fee_month_statistics t |
| | | inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | where t.community_id = #{communityId} |
| | | left join building_room br on br.room_id = t.obj_id and t.obj_type = '3333' and br.community_id = |
| | | t.community_id and br.status_cd = '0' |
| | | left join building_unit bu on bu.unit_id = br.unit_id and bu.status_cd = '0' |
| | | left join f_floor f on f.floor_id = bu.floor_id and f.status_cd = '0' |
| | | where 1=1 |
| | | and t.fee_year= #{feeYear} |
| | | and t.fee_month= #{feeMonth} |
| | | and t.community_id = #{communityId} |
| | | group by t.fee_name |
| | | ) a |
| | | </select> |
| | | |
| | | |
| | |
| | | select 1 from pay_fee pf where t.room_id = pf.payer_obj_id and pf.status_cd = '0' and pf.state = '2008001' |
| | | ) |
| | | and t.community_id = #{communityId} |
| | | order by t.create_time desc |
| | | order by bo.name |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | |
| | | </if> |
| | | <if test="objName !=null and objName != ''"> |
| | | and rfms.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} |
| | | </if> |
| | | GROUP BY t.floor_num |
| | | ) a, |
| | |
| | | and t.create_time < #{endTime} |
| | | and t.fee_id = #{feeId} |
| | | <if test="flag == 1"> |
| | | and concat(t.detail_year,t.detail_month) = #{yearMonth} |
| | | and concat(t.detail_year,lpad(t.detail_month,2,0)) = #{yearMonth} |
| | | </if> |
| | | <if test="flag == 2"> |
| | | and concat(t.detail_year,t.detail_month) < #{yearMonth} |
| | | and concat(t.detail_year,lpad(t.detail_month,2,0)) < #{yearMonth} |
| | | </if> |
| | | <if test="flag == 3"> |
| | | and concat(t.detail_year,t.detail_month) > #{yearMonth} |
| | | and concat(t.detail_year,lpad(t.detail_month,2,0)) > #{yearMonth} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | |
| | | </foreach> |
| | | </select> |
| | | |
| | | <!-- 查询无效费用 add by wuxw 2018-07-03 --> |
| | | <select id="queryInvalidFeeMonthStatistics" parameterType="Map" resultType="Map"> |
| | | select t.fee_id feeId from pay_fee t |
| | | inner join pay_fee_config pfc on t.config_id = pfc.config_id |
| | | inner join report_fee_month_statistics rfms on t.fee_id = rfms.fee_id and rfms.status_cd = '0' |
| | | where (t.status_cd = '1' or pfc.status_cd = '1') |
| | | and t.community_id= #{communityId} |
| | | </select> |
| | | |
| | | |
| | | <!--清理报表 无效数据--> |
| | | <update id="deleteInvalidFee" parameterType="Map"> |
| | | delete from report_fee_month_statistics where fee_id in |
| | | <foreach collection="feeIds" item="item" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | and community_id = #{communityId} |
| | | </update> |
| | | </mapper> |