From 9a7b03b8ae4fffa7024f912333256ec5f99f1dc8 Mon Sep 17 00:00:00 2001 From: linfso Date: Fri, 16 May 2025 20:22:23 +0800 Subject: [PATCH] md --- .../resources/mapper/EmisSettleBillMapper.xml | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml b/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml index 5d772f2ed..09aa02e1a 100644 --- a/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisSettleBillMapper.xml @@ -228,19 +228,26 @@ LEFT JOIN ( SELECT a.settle_bill_no, - sum( b.pay_money) AS totalPayMoney, - sum( if(b.trade_date a.payment_due_date,b.pay_money,0) ) AS recdMoneyIn, - sum( if(a.settle_type='2' and a.credit_period = ]]> 30 and b.trade_date ]]> a.payment_due_date and b.trade_date DATE_SUB( a.payment_due_date, INTERVAL (a.credit_period-60) DAY ),b.pay_money,0) ) AS recdPayMoney60D, - sum( if( (a.settle_type='2' and a.credit_period = ]]> 30 and b.trade_date = ]]> DATE_SUB( a.payment_due_date, INTERVAL (a.credit_period-60) DAY ) ) or ( ( (a.settle_type='2' and a.credit_period 30) or a.settle_type='1' ) and b.trade_date ]]> a.payment_due_date ),b.pay_money,0) ) AS recdPayMoneyGreat60D + sum( d.pay_money) AS totalPayMoney, + sum( if(b.trade_date a.payment_due_date,d.pay_money,0) ) AS recdMoneyIn, + sum( if(a.settle_type='2' and a.credit_period = ]]> 30 and b.trade_date ]]> a.payment_due_date and b.trade_date DATE_SUB( a.payment_due_date, INTERVAL (a.credit_period-60) DAY ),d.pay_money,0) ) AS recdPayMoney60D, + sum( if( (a.settle_type='2' and a.credit_period = ]]> 30 and b.trade_date = ]]> DATE_SUB( a.payment_due_date, INTERVAL (a.credit_period-60) DAY ) ) or ( ( (a.settle_type='2' and a.credit_period 30) or a.settle_type='1' ) and b.trade_date ]]> a.payment_due_date ),d.pay_money,0) ) AS recdPayMoneyGreat60D FROM emis_settle_bill a, emis_settle_pay_record b, - emis_settle_pay_bill_rel c + emis_settle_pay_bill_rel c, + emis_settle_pay_rel d, + emis_settle_sub_bill e + a.del_flag = '0' AND b.del_flag = '0' AND c.del_flag = '0' + and d.del_flag ='0' AND a.settle_bill_no = c.settle_bill_no + and d.pay_id=b.pay_id + and d.bill_no=e.bill_code + and e.settle_bill_no=a.settle_bill_no AND b.pay_id = c.pay_id and FIND_IN_SET(a.`settle_bill_no`,#{settleBillNo}) and a.cust_no = #{custNo} @@ -251,11 +258,7 @@ and a.open_bill_status = #{openBillStatus} and a.payment_status = #{paymentStatus} - and exists ( - select 1 from emis_settle_sub_bill b - where a.settle_bill_no=b.settle_bill_no - and ( FIND_IN_SET(b.`bill_code`,#{params.billCode}) or b.bill_code like concat('%', #{params.billCode}, '%') ) - ) + and ( FIND_IN_SET(e.`bill_code`,#{params.billCode}) or e.bill_code like concat('%', #{params.billCode}, '%') ) and b.create_by = #{params.payCreateBy}