From 4b926d6183c1cd8907b530e9dd936fe500c02d9e Mon Sep 17 00:00:00 2001 From: linfso Date: Fri, 27 Sep 2024 18:41:33 +0800 Subject: [PATCH] md --- .../resources/mapper/EmisSettleBillMapper.xml | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml b/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml index 0fa0e02c4..c06b0f13f 100644 --- a/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml @@ -113,8 +113,8 @@ tbb.noPayBillCount, ifnull(tbc.recdPayMoney,0) as recdPayMoney, (tba.recPayMoney-ifnull(tbc.recdPayMoney,0)) as noRecdPayMoney, - ifnull(tbd.expiredRecdPayMoney,0) as expiredRecdPayMoney, - (tba.recPayMoney-ifnull(tbd.expiredRecdPayMoney,0)) as expiredNoRecdPayMoney + ifnull(tbd.expiredRecdPayMoney,0) as expiredRecdPayMoney, + ifnull(tbe.expiredNoRecdPayMoney,0) as expiredNoRecdPayMoney from ( select salesmen,bill_month as billMonth, ROUND(sum(rec_money),2) as recPayMoney, @@ -207,6 +207,28 @@ group by salesmen,bill_month ) tbd on tba.salesmen=tbd.salesmen and tba.billMonth=tbd.billMonth + left join ( + select a.salesmen,a.bill_month as billMonth, + ROUND(sum(rec_money-reced_money),2) as expiredNoRecdPayMoney + from emis_settle_bill a + + a.del_flag='0' and now() ]]> a.payment_due_date + and a.salesmen = #{salesmen} + and a.bill_month = #{billMonth} + and a.open_bill_status = #{openBillStatus} + and a.payment_status = #{paymentStatus} + + and ( + a.salesmen=#{params.privEmpName} + or a.payee=#{params.privEmpName} + or a.salesmen in( + select salesmen from emis_salesmen_rel esr where esr.del_flag='0' and esr.bl_open='1' and now() = ]]> esr.start_date and now() esr.end_date and esr.sales_ass=#{params.privEmpName} + ) + ) + + + group by salesmen,bill_month + ) tbe on tba.salesmen=tbe.salesmen and tba.billMonth=tbe.billMonth