Commit 85398560 authored by 陈宏杰's avatar 陈宏杰

不影响定时

parent a64094de
...@@ -63,4 +63,7 @@ public interface ApplyLoanInfoMapper { ...@@ -63,4 +63,7 @@ public interface ApplyLoanInfoMapper {
List<ApplyLoanInfoZhuDai> findApplyInfoOfRefuse(BaiHangTimeRecord timeRecord); List<ApplyLoanInfoZhuDai> findApplyInfoOfRefuse(BaiHangTimeRecord timeRecord);
List<ApplyLoanInfoZhuDai> findApplyLoanZhuDai(BaiHangTimeRecord timeRecord);
} }
...@@ -209,7 +209,7 @@ public class BaiHangFileReportService { ...@@ -209,7 +209,7 @@ public class BaiHangFileReportService {
try { try {
Stopwatch queryWatch1 = Stopwatch.createStarted(); Stopwatch queryWatch1 = Stopwatch.createStarted();
BaiHangTimeRecord timeRecord = BaiHangTimeRecord.builder().startTime(starTime).endTime(endTime).build(); BaiHangTimeRecord timeRecord = BaiHangTimeRecord.builder().startTime(starTime).endTime(endTime).build();
List<ApplyLoanInfoZhuDai> applyLoanInfos = applyLoanInfoMapper.findRealTimeApplyLoanZhuDai(timeRecord); List<ApplyLoanInfoZhuDai> applyLoanInfos = applyLoanInfoMapper.findApplyLoanZhuDai(timeRecord);
log.info("量化派助贷TO百行报送(A1)-非联合贷申请查询完成, 大小: {} , 耗时: {} ", (applyLoanInfos != null ? applyLoanInfos.size() : 0), (queryWatch1.stop().elapsed(TimeUnit.MILLISECONDS) / 1000) + ".s"); log.info("量化派助贷TO百行报送(A1)-非联合贷申请查询完成, 大小: {} , 耗时: {} ", (applyLoanInfos != null ? applyLoanInfos.size() : 0), (queryWatch1.stop().elapsed(TimeUnit.MILLISECONDS) / 1000) + ".s");
if (applyLoanInfos == null) { if (applyLoanInfos == null) {
applyLoanInfos = new ArrayList<ApplyLoanInfoZhuDai>(); applyLoanInfos = new ArrayList<ApplyLoanInfoZhuDai>();
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
left join business_flow.apply_list i on d.order_no=i.apply_no left join business_flow.apply_list i on d.order_no=i.apply_no
left join xyqb.loan_base_info j on a.loan_application_history_id=j.loan_id left join xyqb.loan_base_info j on a.loan_application_history_id=j.loan_id
where a.funding_corp_id in (1080,100040) where a.funding_corp_id in (1080,100040,1030,100030)
and a.contract_term not in (2,3) and a.contract_term not in (2,3)
and a.transaction_status in (2,5) and a.transaction_status in (2,5)
and case when i.created_at is null and h.created_at &lt;=f.created_at then h.created_at and case when i.created_at is null and h.created_at &lt;=f.created_at then h.created_at
...@@ -190,4 +190,61 @@ ...@@ -190,4 +190,61 @@
</select> </select>
<select id="findApplyLoanZhuDai" parameterType="cn.quantgroup.report.domain.baihang.BaiHangTimeRecord" resultType="cn.quantgroup.report.domain.baihang.ApplyLoanInfoZhuDai">
select
a.id reqID
,'A' opCode
,DATE_FORMAT(now(),'%Y-%m-%dT%H:%i:%S') uploadTs
,'1' isFinTechAgencyBusiness
,DATE_FORMAT(case when i.created_at is null and h.created_at &lt;= f.created_at then h.created_at
when i.created_at is null and h.created_at>f.created_at then f.created_at
else i.created_at end,'%Y-%m-%dT%H:%i:%S') as applyDate
,if(d.order_no is null,a.loan_application_history_id,d.order_no) applyId
,'1' applyType
,b.name name
,'1' idType
,b.id_no pid
,b.phone_no mobile
,b.email emailAddress
,case when j.education=1 then '10'
when j.education=2 then '20'
when j.education=3 then '30'
when j.education in (4,6) then '40'
when j.education=5 then '50'
when j.education in (7,8) then '60'
else '70' end eduBackground
,'500' degree
,'1' guaranteeType
,'1' loanPurpose
,'99' customType
,'-1' applyAmount
,'8' livingCondition
,case when j.marry_status=1 then '10'
when j.marry_status=2 then '20'
when j.marry_status=4 then '30'
when j.marry_status=3 then '40'
else '90' end marriageStatus
from xyqb.loan_application_manifest_history a
left join xyqb_user.user_detail b on a.user_id=b.user_id
left join xyqb.loan_account_ext c on a.loan_application_history_id=c.loan_id
left join xyqb.apply_quota_record d on c.order_no=d.order_no
left join xyqb.loan_submit_info f on a.loan_application_history_id=f.loan_id
left join xyqb.loan_application_history h on a.loan_application_history_id=h.id
/* 2020.01.06表迁移 left join xyqb.quota_credit i on d.order_no=i.order_no */
left join business_flow.apply_list i on d.order_no=i.apply_no
left join xyqb.loan_base_info j on a.loan_application_history_id=j.loan_id
where a.funding_corp_id in (1080,100040)
and a.contract_term not in (2,3)
and a.transaction_status in (2,5)
and case when i.created_at is null and h.created_at &lt;=f.created_at then h.created_at
when i.created_at is null and h.created_at>f.created_at then f.created_at
else i.created_at end >= #{startTime,jdbcType=VARCHAR}
and case when i.created_at is null and h.created_at &lt;=f.created_at then h.created_at
when i.created_at is null and h.created_at>f.created_at then f.created_at
else i.created_at end &lt; #{endTime,jdbcType=VARCHAR};
</select>
</mapper> </mapper>
\ No newline at end of file
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