select b.name as name, b.id_no as pid, b.phone_no as mobile, '1' as queryReason, '1' as guaranteeType, '1' as loanPurpose, '99' as customType, '-1' as applyAmount, a.order_no as loanId
select
from xyqb_i_apply_quota_record a left join xyqb_user_i_user_detail b on a.user_id=b.user_id
a.id reqID
where a.created_at>=DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), '%Y-%m-%d')
,'A' opCode
and 1>2;
,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 <= 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_i_loan_application_manifest_history a
left join xyqb_user_i_user_detail b on a.user_id=b.user_id
left join xyqb_i_loan_account_ext c on a.loan_application_history_id=c.loan_id
left join xyqb_i_apply_quota_record d on c.order_no=d.order_no
left join xyqb_i_loan_submit_info f on a.loan_application_history_id=f.loan_id
left join xyqb_i_loan_application_history h on a.loan_application_history_id=h.id
left join xyqb_i_quota_credit i on d.order_no=i.order_no
left join xyqb_i_loan_base_info j on a.loan_application_history_id=j.loan_id
where a.funding_corp_id in (420,520,580,650,670,810,240,640,700)
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 <=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 <=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 < #{endTime,jdbcType=VARCHAR};