java110
2021-02-26 db55c4b35bc881286e8a1c4797127f63bb2f7499
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
@@ -454,7 +454,8 @@
        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'
        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'
@@ -1037,7 +1038,8 @@
        select pfc.fee_name feeName,f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,oc.car_num carNum,
        pf.payer_obj_type payerObjType,t.start_time startTime,t.end_time endTime,t.create_time createTime,
        t.receivable_amount receivableAmount,t.received_amount receivedAmount,pfa.`value`
        importFeeName,t.prime_rate,d.name primeRate,fdr.discount_small_type discountSmallType,fdr.rule_name ruleName,pfdd.discount_price,
        importFeeName,t.prime_rate,d.name primeRate,fdr.discount_small_type discountSmallType,fdr.rule_name
        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'
@@ -1404,4 +1406,160 @@
        </if>
    </select>
    <select id="getRepairInfo" parameterType="Map" resultType="Map">
        select r.staff_id staffId,r.staff_name staffName,r.state, t.name stateName, count(*) amount from r_repair_user r
        left join t_dict t on t.table_name="r_repair_user" and t.table_columns="state" and t.status_cd=r.state
        where r.state != "10005" and r.status_cd = "0"
        <if test="ruId != null and ruId != ''">
            and r.ru_id = #{ruId}
        </if>
        <if test="repairId != null and repairId != ''">
            and r.repair_id = #{repairId}
        </if>
        <if test="communityId != null and communityId !=''">
            and r.community_id = #{communityId}
        </if>
        <if test="bId != null and bId !=''">
            and r.b_id = #{bId}
        </if>
        <if test="state != null and state != ''">
            and r.state = #{state}
        </if>
        <if test="context != null and context !=''">
            and r.context = #{context}
        </if>
        <if test="statusCd != null and statusCd != ''">
            and r.status_cd = #{statusCd}
        </if>
        <if test="staffId != null and staffId !=''">
            and r.staff_id = #{staffId}
        </if>
        <if test="staffName != null and staffName !=''">
            and r.staff_name = #{staffName}
        </if>
        <if test="preStaffId != null and preStaffId !=''">
            and r.pre_staff_id = #{preStaffId}
        </if>
        <if test="preStaffName != null and preStaffName !=''">
            and r.pre_staff_name = #{preStaffName}
        </if>
        <if test="beginStartTime != null and beginStartTime !=''">
            and r.start_time &gt;= #{beginStartTime}
        </if>
        <if test="beginEndTime != null and beginEndTime !=''">
            and r.start_time &lt;= #{beginEndTime}
        </if>
        <if test="finishStartTime != null and finishStartTime !=''">
            and r.end_time &gt;= #{finishStartTime}
        </if>
        <if test="finishEndTime != null and finishEndTime !=''">
            and r.end_time &lt;= #{finishEndTime}
        </if>
        <if test="createTime != null and createTime !=''">
            and r.create_time = #{createTime}
        </if>
        group by r.staff_id,r.state
        order by r.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <select id="getRepairWithOutPage" parameterType="Map" resultType="Map">
        select r.staff_id staffId,r.staff_name staffName,r.state, t.name stateName, count(*) amount from r_repair_user r
        left join t_dict t on t.table_name="r_repair_user" and t.table_columns="state" and t.status_cd=r.state
        where r.state != "10005" and r.status_cd = "0"
        <if test="ruId != null and ruId != ''">
            and r.ru_id = #{ruId}
        </if>
        <if test="repairId != null and repairId != ''">
            and r.repair_id = #{repairId}
        </if>
        <if test="communityId != null and communityId !=''">
            and r.community_id = #{communityId}
        </if>
        <if test="bId != null and bId !=''">
            and r.b_id = #{bId}
        </if>
        <if test="state != null and state != ''">
            and r.state = #{state}
        </if>
        <if test="context != null and context !=''">
            and r.context = #{context}
        </if>
        <if test="statusCd != null and statusCd != ''">
            and r.status_cd = #{statusCd}
        </if>
        <if test="staffId != null and staffId !=''">
            and r.staff_id = #{staffId}
        </if>
        <if test="staffName != null and staffName !=''">
            and r.staff_name = #{staffName}
        </if>
        <if test="preStaffId != null and preStaffId !=''">
            and r.pre_staff_id = #{preStaffId}
        </if>
        <if test="preStaffName != null and preStaffName !=''">
            and r.pre_staff_name = #{preStaffName}
        </if>
        <if test="beginStartTime != null and beginStartTime !=''">
            and r.start_time &gt;= #{beginStartTime}
        </if>
        <if test="beginEndTime != null and beginEndTime !=''">
            and r.start_time &lt;= #{beginEndTime}
        </if>
        <if test="finishStartTime != null and finishStartTime !=''">
            and r.end_time &gt;= #{finishStartTime}
        </if>
        <if test="finishEndTime != null and finishEndTime !=''">
            and r.end_time &lt;= #{finishEndTime}
        </if>
        <if test="createTime != null and createTime !=''">
            and r.create_time = #{createTime}
        </if>
        group by r.staff_id,r.state
        order by r.create_time desc
    </select>
    <select id="queryRepairForStaff" parameterType="Map" resultType="Map">
        SELECT r.staff_id staffId,r.staff_name staffName FROM r_repair_user r
        WHERE r.state!='10005' AND
        r.repair_event!='payUser' AND r.repair_event!="startUser"
        <if test="communityId != null and communityId !=''">
            and r.community_id = #{communityId}
        </if>
        <if test="staffId != null and staffId != ''">
            and r.staff_id = #{staffId}
        </if>
        group by r.staff_id
        order by r.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <select id="getReceivableInformation" parameterType="Map" resultType="Map">
        select sum(t.receivable_amount) receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount)
        oweAmount
        from report_fee_month_statistics t
        where t.community_id = #{communityId}
    </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
        from report_fee_month_statistics t
        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}
        group by f.floor_num ,f.`name`
    </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
        from report_fee_month_statistics t
        where t.community_id =  #{communityId}
        group by t.fee_name
    </select>
</mapper>