Commit 204bab40 authored by 郝彦辉's avatar 郝彦辉

逾期和还款查询sql优化,增加xyqb_i_repayment_plan_bak和xyqb_i_loan_a_m_history_bak临时表

parent 404f3b01
......@@ -102,7 +102,7 @@ public class LoanApplicationManifestHistoryTask {
tmp_sql = tmp_sql.replace("##ENDTIME##",endTime);
int upCount = xyqbHistoryJdbcTemplate.update(tmp_sql);
log.info("同步xyqb_i_loan_application_manifest_history数据结束,startTime: {} , 耗时:{} , updateCount: {} ", starTime, startwatch.stop().elapsed(TimeUnit.MILLISECONDS), upCount);
log.info("同步xyqb_i_loan_application_manifest_history数据结束,startTime: {} , 耗时:{} , updateCount: {} ", starTime, startwatch.stop().elapsed(TimeUnit.MILLISECONDS)+".ms", upCount);
}catch (Exception e){
log.error("同步xyqb_i_loan_application_manifest_history数据异常, startTime: {} , endTime: {} , counter: {} ", starTime, endTime,counter, e);
......@@ -133,7 +133,7 @@ public class LoanApplicationManifestHistoryTask {
tmp_sql = tmp_sql.replace("##ENDTIME##",endTime);
int upCount = xyqbHistoryJdbcTemplate.update(tmp_sql);
log.info("同步xyqb_i_repayment_plan数据结束,startTime: {} , 耗时:{} , updateCount: {} ", starTime, startwatch.stop().elapsed(TimeUnit.MILLISECONDS), upCount);
log.info("同步xyqb_i_repayment_plan数据结束,startTime: {} , 耗时:{} , updateCount: {} ", starTime, startwatch.stop().elapsed(TimeUnit.MILLISECONDS)+".ms", upCount);
}catch (Exception e){
log.error("同步xyqb_i_repayment_plan数据异常, startTime: {} , endTime: {} , counter: {} ", starTime, endTime,counter, e);
......
......@@ -334,7 +334,7 @@
<!--3.1百行助贷-非联合贷 实时还款 2019.10.28-->
<select id="findRealTimeRepayMentInfo" parameterType="cn.quantgroup.report.domain.baihang.BaiHangTimeRecord"
resultType="cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai">
/*select
<!-- select
a.id reqID
,'A' opCode
,DATE_FORMAT(now(),'%Y-%m-%dT%H:%i:%S') uploadTs
......@@ -360,7 +360,7 @@
end as loanStatus
,if(f.yqze>0,'overdue','normal') termStatus
from (
select -- a.*,
select ## a.*,
a.id,a.user_id,a.loan_application_history_id,a.term_no,a.deadline,a.required_repayment,a.repayment_status,a.repaid_at,a.created_at,
if(c.term_no is null,a.term_no,c.term_no) next_term
,if(c.deadline is null,a.deadline,c.deadline) next_deadline
......@@ -430,7 +430,7 @@
and if(DATEDIFF(a.next_deadline,a.repaid_at)>1,a.term_no,h.max_term)=j.term_no
group by if(d.order_no is null,a.loan_application_history_id,d.order_no),
if(DATEDIFF(a.next_deadline,a.repaid_at)>1,a.term_no,h.max_term);
*/
-->
select
a.id reqID
......@@ -547,7 +547,7 @@
<!--4.1百行助贷-非联合贷 实时逾期还款 2019.10.28-->
<select id="findRealTimeRepayMentOverdue" parameterType="cn.quantgroup.report.domain.baihang.BaiHangTimeRecord"
resultType="cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai">
/*
<!--
select
a.id reqID
,'A' opCode
......@@ -573,7 +573,7 @@
end as loanStatus
,'overdue' termStatus
from (
select -- a.*
select ## a.*
a.id,a.user_id,a.loan_application_history_id,a.term_no,a.deadline,a.required_repayment,a.repayment_status,a.repaid_at,a.repayment_received_at
from xyqb_i_repayment_plan a
left join xyqb_i_loan_application_manifest_history b
......@@ -600,7 +600,7 @@
where b.funding_corp_id in (420,520,580,650,670,810,240,640,700)
group by a.loan_application_history_id) f on a.loan_application_history_id=f.loan_application_history_id
left join xyqb_i_repayment_record g on a.id=g.repayment_plan_id;
*/
-->
select
a.id reqID
......
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