Home > database >  Please everyone a great god taught, the problem of SQL
Please everyone a great god taught, the problem of SQL

Time:10-04

The SELECT lid, mid, fid, ctid, state, account_type AS accountType, SUM (AMOUNT) AS the 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,
The SUM (PERCENT) AS PERCENT
The FROM NWD_LOAN_BID

Where]] & gt; Test="condList!=null "& gt;
The foreach
The collection="condList"
The item="condList"
The index="index" open="("
The close=") "
The separator=", "& gt;
(1=1 & lt; If
The test="condList lid!=null "& gt; And LID=
# {condList. Lid} & lt;/if & gt; The test="condList mid!=null "& gt; And MID=
# {condList. Mid} & lt;/if & gt; The test="condList fid!=null "& gt; And FID=
# {condList. Fid} & lt;/if & gt; Test=
"CondList ctid!=null "& gt; And CTID=
# {condList. Ctid} & lt;/if & gt;)
The foreach & gt;


GROUP BY (LID, MID, FID, CTID,
The STATE, the ACCOUNT_TYPE,
START_INDEX END_INDEX,
SOURCE_LID))
bThe JOIN nwd_loan_repayment r
On r.l id=b.s ourceLid
The where ((b.s tartIndex is null or
R.i ndexs & gt;=b.s tartIndex) and
(b.e ndIndex is null or
R.i ndexs & lt; B.e ndIndex))

]] & gt; Test="states!=null "& gt;
AND r.s Tate in & lt; The foreach
The collection="states"
The item="states" index="index"
The open="(" the close=") "
The separator=", "& gt;
# {states} & lt;/foreach & gt;
Test="repayeeState==0" & gt;
AND (r.s Tate=0 or
(r.s Tate=6 and r.o verbx=0)) & lt;/if & gt; Test="repayeeState==1" & gt;
AND (r.s Tate in (1, 2, 3, 4, 5) or
(r.s Tate=6 and r.o verbx=1)) & lt;/if & gt; CDATA [lr)
Left the join nwd_loan_repayment_ext a
On lr. Rids=a.r id]] & gt; The LEFT OUTER JOIN nwd_loan_cpy_interest cpi
ON (lri) lid=cpi) lid AND lri. The mid=cpi. The mids AND
Lri. Fid=cpi. Fid AND lri. Ctid=cpi. Ctid AND
Lri. Rids=cpi. Rids)
The order by lri. Indexs) f
Left the join NWD. NWD_LOAN_REPAY_T_SLICE_SUMMARY LSS
On ((f.l id=LSS. The lid and LSS. Ext_01 is null) or (f.l id=LSS. Ext_01)) and f. may id=LSS. The mids and f.f id=LSS. The fid and f. tid=LSS. Ctid)
Group by lid, mid, fid, ctid, CAL sourceLid)
Left the join NWD_LOAN_REPAY_T_SLICE_SUMMARY LSS
On CAL. SourceLid=LSS. Lid
And (LSS) ext_01 is null or LSS) ext_01=CAL. The lid)
And CAL. Fid=LSS. Fid
And CAL. Ctid=LSS. Ctid

CodePudding user response:

The building Lord, can you say that you want to do?

CodePudding user response:

So long, what's the problem?

CodePudding user response:

Increase the available points

CodePudding user response:

Only send statements not hair problem
  • Related