select count(*) from agentCore.custInfo where channelid=393 and datediff(registertime,'2018-07-22')<=0; #貸款平臺
select count(*)from agentCore.loanCase where channelid=393and datediff(createtime,'2018-07-22')<=0;
2. 填寫補充資料人數
selectcount(*) from
(
select
a.id,
casewhen b.custid isnotnullthen1else0end submitstatus
from agentCore.loanCase a
leftjoin
agentCore.custCompleteInfo b on a.id=b.loancaseid where a.channelid=393and datediff(a.createtime,'2018-07-22')<=0
) t
where submitstatus=1;
3. 工作資訊及人行報告
selectcount(institution),
count(incomeMonthly),
count(reserveFundTime),
count(policyPeriod),
count(houseProperty),
sum(casewhen PBCReport=0then1end),
sum(casewhen PBCReport=1then1end),
sum(casewhen PBCReport=2then1end)
from
(
select
a.id,
a.brwid,
a.brwtelenc,
a.brwidcardcodeenc,
a.brwidcardnameenc,
a.createtime,
a.channelid,
b.custid,
b.loancaseid,
b.idcardnameenc,
b.custtelnoenc,
b.idcardcodeenc,
b.institution,
b.incomeMonthly,
b.reserveFundTime,
b.policyPeriod,
b.premiumYear,
b.houseProperty,
b.houseValuation,
b.repayMonthly,
b.PBCReport,
casewhen b.custid isnotnullthen1else0end submitstatus
from agentCore.loanCase a
leftjoin
agentCore.custCompleteInfo b on a.id=b.loancaseid where a.channelid=393and datediff(a.createtime,'2018-07-22')<=0
) t where submitstatus=1;
4. 電核資料
# {3:通過,4:拒絕,6:跟進,2:稽核中}
select
auditstatus,
count(*),
count(distinct id)
from
agentCore.loanCase where datediff(audittime,'2018-07-22')<=0groupby1orderby1;
5. 風控稽核資料
#{1000:拒絕,2000:通過}
select
b.resultcode,
count(distinct caseid)
from
agentCore.loanCase a
join
agentCore.loanCaseAutoAuditLog b
on a.id=b.caseid
where datediff(b.createtime,'2018-07-22')<=0groupby1orderby1;
6. 檢視三個平臺放款通過與沒通過的名單
select
a.channelid,
date(a.createtime) createtime,
a.id,
a.brwid,
a.brwtelenc,
a.brwidcardcodeenc,
a.brwidcardnameenc,
case when b.custid is notnullthen1else0endsubmitstatusfrom agentCore.loanCase a
left join
agentCore.custCompleteInfo b ona.id=b.loancaseidwherea.channelidin (393,393,397);