java110
2021-11-18 4e01e72b92e3605641f8ed7f6fb775274ad5e997
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
@@ -292,6 +292,13 @@
        <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>
@@ -313,7 +320,11 @@
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
    <select id="queryReportFeeSummary" parameterType="Map" resultType="Map">
        select t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime,SUM(t.his_owe_amount) hisOweAmount,SUM(t.cur_receivable_amount) curReceivableAmount,
        select t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime
        <if test="configIds !=null">
            ,t.config_id configId
        </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
        from report_fee_month_statistics t
@@ -346,6 +357,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>
@@ -362,6 +379,9 @@
            and t.create_time &lt;= #{endTime}
        </if>
        group by t.fee_year,t.fee_month
        <if test="configIds !=null">
            ,t.config_id
        </if>
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
@@ -370,11 +390,7 @@
    <!-- 查询费用月统计信息 大计 add by wuxw 2018-07-03 -->
    <select id="queryReportFeeSummaryMajor" parameterType="Map" resultType="Map">
        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-his_owe_received_amount) &lt; 0,
        0,
        sum(t.his_owe_amount+t.cur_receivable_amount-t.cur_received_amount-his_owe_received_amount)) allOweAmount
        sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) allReceivedAmount
        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'
@@ -405,6 +421,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>