|
|
@ -433,16 +433,13 @@ |
|
|
|
AND s.isDelete = '0' |
|
|
|
</select> |
|
|
|
<select id="getOtherBankName" resultType="java.lang.String"> |
|
|
|
SELECT |
|
|
|
b.bankShortName |
|
|
|
FROM |
|
|
|
loan_repayment_plan_details AS p |
|
|
|
SELECT b.bankShortName |
|
|
|
FROM loan_repayment_plan_details AS p |
|
|
|
LEFT JOIN loan_solutions AS s ON p.salesOrderSid = s.salesOrderSid |
|
|
|
LEFT JOIN loan_solutions_otherpolicy AS o ON s.sid = o.solutionsSid |
|
|
|
LEFT JOIN loan_fin_otherpolicy AS po ON po.sid = o.otherPolicySid |
|
|
|
LEFT JOIN loan_fin_bank AS b ON po.bankSid = b.sid |
|
|
|
WHERE |
|
|
|
p.sid =#{sid} |
|
|
|
WHERE p.sid = #{sid} |
|
|
|
AND s.isDelete = '0' |
|
|
|
</select> |
|
|
|
<select id="checkOverDue" |
|
|
@ -669,32 +666,24 @@ |
|
|
|
</select> |
|
|
|
<select id="pushFund" |
|
|
|
resultType="com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanPlanDetailsVoForFundVoucher"> |
|
|
|
SELECT |
|
|
|
c.*, |
|
|
|
SELECT c.*, |
|
|
|
(c.reveivableMoney - c.fund) AS duePushMoney |
|
|
|
FROM |
|
|
|
( |
|
|
|
SELECT |
|
|
|
b.* |
|
|
|
FROM |
|
|
|
( |
|
|
|
SELECT |
|
|
|
a.*, |
|
|
|
IFNULL(( SELECT SUM( fund ) FROM loan_push_fund_history AS ph WHERE ph.busVinSid = #{busVinSid} ), 0 ) AS fund |
|
|
|
FROM |
|
|
|
( |
|
|
|
SELECT |
|
|
|
IFNULL( SUM( jr.reveivableMoney ), 0 ) AS reveivableMoney |
|
|
|
FROM |
|
|
|
anrui_fin.fin_uncollected_receivables_detailed_jr AS jr |
|
|
|
FROM ( |
|
|
|
SELECT b.* |
|
|
|
FROM ( |
|
|
|
SELECT a.*, |
|
|
|
IFNULL((SELECT SUM(fund) |
|
|
|
FROM loan_push_fund_history AS ph |
|
|
|
WHERE ph.busVinSid = #{busVinSid}), 0) AS fund |
|
|
|
FROM ( |
|
|
|
SELECT IFNULL(SUM(jr.reveivableMoney), 0) AS reveivableMoney |
|
|
|
FROM anrui_fin.fin_uncollected_receivables_detailed_jr AS jr |
|
|
|
LEFT JOIN loan_repayment_plan_details AS p ON p.sid = jr.busSid |
|
|
|
WHERE |
|
|
|
jr.payCostTitleKey = '006' |
|
|
|
WHERE jr.payCostTitleKey = '006' |
|
|
|
AND p.busVinSid = #{busVinSid} |
|
|
|
) AS a |
|
|
|
) AS b |
|
|
|
WHERE |
|
|
|
b.reveivableMoney - b.fund > 0 |
|
|
|
WHERE b.reveivableMoney - b.fund > 0 |
|
|
|
) c |
|
|
|
</select> |
|
|
|
<select id="selPushLaterVoucherOnBuckle" |
|
|
@ -783,21 +772,18 @@ |
|
|
|
</select> |
|
|
|
<select id="fetchMainBankByBusVinSid" |
|
|
|
resultType="com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanRepaymentPlanDetails"> |
|
|
|
select * from loan_repayment_plan_details where busVinSid =#{busVinSid} and policyOrOther = '0' limit 1 |
|
|
|
select * |
|
|
|
from loan_repayment_plan_details |
|
|
|
where busVinSid = #{busVinSid} |
|
|
|
and policyOrOther = '0' limit 1 |
|
|
|
</select> |
|
|
|
<select id="fetchCwDeptCodeByBusVinSid" resultType="java.lang.String"> |
|
|
|
SELECT |
|
|
|
s.cwDeptNo |
|
|
|
FROM |
|
|
|
loan_repayment_schedule AS s |
|
|
|
WHERE |
|
|
|
s.sid = ( |
|
|
|
SELECT |
|
|
|
p.scheduleSid |
|
|
|
FROM |
|
|
|
loan_repayment_plan_details AS p |
|
|
|
WHERE |
|
|
|
p.busVinSid = #{busVinSid} |
|
|
|
SELECT s.cwDeptNo |
|
|
|
FROM loan_repayment_schedule AS s |
|
|
|
WHERE s.sid = ( |
|
|
|
SELECT p.scheduleSid |
|
|
|
FROM loan_repayment_plan_details AS p |
|
|
|
WHERE p.busVinSid = #{busVinSid} |
|
|
|
LIMIT 1 |
|
|
|
) |
|
|
|
</select> |
|
|
|