Commit 3df7bcb4 authored by 陈宏杰's avatar 陈宏杰

同期

parent 404c9b2f
......@@ -1077,7 +1077,7 @@
left join xyqb.apply_quota_record d on c.order_no=d.order_no
left join (
select a.loan_application_history_id,a.term_no
,sum(if((a.repayment_status !=3 or (a.repayment_status =3 and a.repaid_at>=c.deadline)) and a.deadline <= c.deadline,a.required_repayment,0)) yqze
,sum(if((a.repayment_status !=3 or (a.repayment_status =3 and (a.repaid_at>=c.deadline or TO_DAYS(a.repaid_at)=TO_DAYS(date(DATE_sub(c.deadline,INTERVAL 1 second)))))) and a.deadline <= c.deadline,c.required_repayment,0)) yqze
,sum(if(a.repayment_status !=3 or (a.repayment_status =3 and a.repaid_at>=#{endTime,jdbcType=VARCHAR}),if(b.loan_paid_at>='2018-01-01',g.principal,h.principle),0)) dkye
,min(if((a.repayment_status !=3 or (a.repayment_status =3 and a.repaid_at>=c.deadline)) and a.deadline <= c.deadline,c.deadline,null)) min_deadline
,max(a.term_no) max_term_no
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment