nvl(wll.overdue_principal, 0) CAPITAL, --逾期本金

to_char(to_date(wll.putout_date, 'yyyymmdd'), 'yyyymmdd') LOAN_DATE, --贷款日期

trunc(wll.loan_amt, 2) LOAN_AMOUNT, --贷款金额

(select wpr.term_amt+(select sum(f.payfeeamt) from wrk_pln_fee f where f.loan_no=wpr.loan_no and f.term_no=1)

substrb(wll.login_org,0,50) F013, -- 机构全部为空 修改20170316

decode

(case
when wll.finish_date is not null then
wll.loan_term
else
(select count(distinct wprp.term_no)
from wrk_pln_rep wprp
where wprp.loan_no = wll.loan_no
and wprp.status = '04')
end)

 

 

when (select count(1) from wrk_lon_lbf wllf where wllf.loan_no=wll.loan_no and wllf.fee_subject='1005')>0