SELECT lid, mid, fid, ctid, state, account_type AS accountType, SUM(AMOUNT) AS amount, SUM(FORCE_AMOUNT) AS forceAmount,
start_index AS startIndex, end_index AS endIndex, source_lid AS sourceLid, SUM(REWARD_AMOUNT) AS rewardAmount, SUM(REAL_AMOUNT) AS realAmount,
SUM(PERCENT) AS percent
FROM NWD_LOAN_BID
where ] ] > < if
test = "condList!=null" > <
foreach
collection = "condList"
item = "condList"
index = "index" open = "("
close = ")"
separator = "," >
(1 = 1 < if
test = "condList.lid!=null" > and LID =
#{condList.lid} < / if > < if
test = "condList.mid!=null" > and MID =
#{condList.mid} < / if > < if
test = "condList.fid!=null" > and FID =
#{condList.fid} < / if > < if
test =
"condList.ctid!=null" > and CTID =
#{condList.ctid} < / if >) < /
foreach > < / if >
< ! [ CDATA [
GROUP BY (LID, MID, FID, CTID,
STATE, ACCOUNT_TYPE,
START_INDEX, END_INDEX,
SOURCE_LID)) b
JOIN nwd_loan_repayment r
on r.lid = b.sourceLid
where ((b.startIndex is null or
r.indexs >= b.startIndex) and
(b.endIndex is null or
r.indexs < b.endIndex))
] ] > < if
test = "states!=null" >
AND r.state in < foreach
collection = "states"
item = "states" index = "index"
open = "(" close = ")"
separator = "," >
#{states} < / foreach > < / if > < if
test = "repayeeState==0" >
AND (r.state = 0 or
(r.state = 6 and r.overbx = 0)) < / if > < if
test = "repayeeState==1" >
AND (r.state in (1, 2, 3, 4, 5) or
(r.state = 6 and r.overbx = 1)) < / if > < ! [
CDATA [) lr
left join nwd_loan_repayment_ext a
on lr.rid = a.rid ] ] > < ! [ CDATA [) lri
LEFT OUTER JOIN nwd_loan_cpy_interest cpi
ON (lri.lid = cpi.lid AND lri.mid = cpi.mid AND
lri.fid = cpi.fid AND lri.ctid = cpi.ctid AND
lri.rid = cpi.rid)
order by lri.indexs) f
left join nwd.NWD_LOAN_REPAY_T_SLICE_SUMMARY lss
on ((f.lid = lss.lid and lss.ext_01 is null) or (f.lid = lss.ext_01)) and f.mid = lss.mid and f.fid = lss.fid and f.ctid = lss.ctid)
group by lid, mid, fid, ctid, sourceLid) cal
left join NWD_LOAN_REPAY_T_SLICE_SUMMARY lss
on cal.sourceLid = lss.lid
and (lss.ext_01 is null or lss.ext_01 = cal.lid)
and cal.fid = lss.fid
and cal.ctid = lss.ctid
uj5u.com熱心網友回復:
樓主,你能說一下,你想干什么 嗎?uj5u.com熱心網友回復:
那么長,有什么問題?uj5u.com熱心網友回復:
增加可用分
uj5u.com熱心網友回復:
只發陳述句不發問題啊
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/110560.html
標籤:高級技術
上一篇:請問能把RAC的機器時間往前調嗎
下一篇:分組查詢
