|
|
@ -705,6 +705,15 @@ update daily_report r inner join (SELECT SUM(cc.scount) AS scount, |
|
|
|
WHERE fd.kxState = '01' |
|
|
|
AND fs.auditState = 3 |
|
|
|
GROUP BY fd.sid |
|
|
|
UNION ALL |
|
|
|
SELECT |
|
|
|
fd.reveivableMoney, |
|
|
|
fd.busVinSid,0 AS subscriptionMoney |
|
|
|
FROM anrui_fin.fin_uncollected_receivables_detailed fd |
|
|
|
left join (select fs.* from anrui_fin.fin_selected_receivables_detailed fs where fs.auditState = 3) s on s.receivablesSid = fd.sid |
|
|
|
WHERE fd.kxState = '01' and s.id is null |
|
|
|
GROUP BY |
|
|
|
fd.sid |
|
|
|
) s ON s.busVinSid = bv.sid |
|
|
|
LEFT JOIN anrui_portal.sys_organization so ON so.sid = ba.useOrgSid |
|
|
|
WHERE ba.nodeState = '已办结' |
|
|
@ -747,7 +756,17 @@ update daily_report r inner join (SELECT SUM(cc.scount) AS scount, |
|
|
|
ON fs.receivablesSid = fd.sid |
|
|
|
WHERE fd.kxState = '01' |
|
|
|
AND fs.auditState = 3 |
|
|
|
GROUP BY fd.sid) s ON s.busVinSid = bv.sid |
|
|
|
GROUP BY fd.sid |
|
|
|
UNION ALL |
|
|
|
SELECT |
|
|
|
fd.reveivableMoney, |
|
|
|
fd.busVinSid,0 AS subscriptionMoney |
|
|
|
FROM anrui_fin.fin_uncollected_receivables_detailed fd |
|
|
|
left join (select fs.* from anrui_fin.fin_selected_receivables_detailed fs where fs.auditState = 3) s on s.receivablesSid = fd.sid |
|
|
|
WHERE fd.kxState = '01' and s.id is null |
|
|
|
GROUP BY |
|
|
|
fd.sid |
|
|
|
) s ON s.busVinSid = bv.sid |
|
|
|
LEFT JOIN anrui_portal.sys_organization so ON so.sid = ba.useOrgSid |
|
|
|
WHERE ba.nodeState = '已办结' |
|
|
|
AND ba.paymentMethodKey = 1 |
|
|
@ -817,6 +836,15 @@ update daily_report r inner join (SELECT |
|
|
|
AND fs.auditState = 3 |
|
|
|
GROUP BY |
|
|
|
fd.sid |
|
|
|
UNION ALL |
|
|
|
SELECT |
|
|
|
fd.reveivableMoney, |
|
|
|
fd.busVinSid,0 AS subscriptionMoney |
|
|
|
FROM anrui_fin.fin_uncollected_receivables_detailed fd |
|
|
|
left join (select fs.* from anrui_fin.fin_selected_receivables_detailed fs where fs.auditState = 3) s on s.receivablesSid = fd.sid |
|
|
|
WHERE fd.kxState = '01' and s.id is null |
|
|
|
GROUP BY |
|
|
|
fd.sid |
|
|
|
) s ON s.busVinSid = bv.sid |
|
|
|
LEFT JOIN anrui_portal.sys_organization so ON so.sid = ba.useOrgSid |
|
|
|
WHERE |
|
|
@ -873,6 +901,15 @@ update daily_report r inner join (SELECT |
|
|
|
AND fs.auditState = 3 |
|
|
|
GROUP BY |
|
|
|
fd.sid |
|
|
|
UNION ALL |
|
|
|
SELECT |
|
|
|
fd.reveivableMoney, |
|
|
|
fd.busVinSid,0 AS subscriptionMoney |
|
|
|
FROM anrui_fin.fin_uncollected_receivables_detailed fd |
|
|
|
left join (select fs.* from anrui_fin.fin_selected_receivables_detailed fs where fs.auditState = 3) s on s.receivablesSid = fd.sid |
|
|
|
WHERE fd.kxState = '01' and s.id is null |
|
|
|
GROUP BY |
|
|
|
fd.sid |
|
|
|
) s ON s.busVinSid = bv.sid |
|
|
|
LEFT JOIN anrui_portal.sys_organization so ON so.sid = ba.useOrgSid |
|
|
|
WHERE |
|
|
@ -939,6 +976,13 @@ update daily_report r inner join ( |
|
|
|
and fd.receivablesName = '融资放款' |
|
|
|
GROUP BY |
|
|
|
fd.sid |
|
|
|
UNION ALL |
|
|
|
SELECT |
|
|
|
fd.reveivableMoney, |
|
|
|
fd.busVinSid,0 AS subscriptionMoney |
|
|
|
FROM anrui_fin.fin_uncollected_receivables_detailed fd WHERE fd.kxState = '01' AND fd.receivablesName = '融资放款' AND fd.sid NOT IN (SELECT fs.`receivablesSid` FROM anrui_fin.fin_selected_receivables_detailed fs WHERE fs.`auditState` = 3 AND fs.`receivablesName` = '融资放款') |
|
|
|
GROUP BY |
|
|
|
fd.sid |
|
|
|
) s ON s.busVinSid = bv.sid |
|
|
|
LEFT JOIN anrui_portal.sys_organization so ON so.sid = bo.useOrgSid |
|
|
|
where bo.payTypeKey = 2 |
|
|
@ -995,6 +1039,13 @@ update daily_report r inner join ( |
|
|
|
AND fd.receivablesName = '融资放款' |
|
|
|
GROUP BY |
|
|
|
fd.sid |
|
|
|
UNION ALL |
|
|
|
SELECT |
|
|
|
fd.reveivableMoney, |
|
|
|
fd.busVinSid,0 AS subscriptionMoney |
|
|
|
FROM anrui_fin.fin_uncollected_receivables_detailed fd WHERE fd.kxState = '01' AND fd.receivablesName = '融资放款' AND fd.sid NOT IN (SELECT fs.`receivablesSid` FROM anrui_fin.fin_selected_receivables_detailed fs WHERE fs.`auditState` = 3 AND fs.`receivablesName` = '融资放款') |
|
|
|
GROUP BY |
|
|
|
fd.sid |
|
|
|
) s ON s.busVinSid = bv.sid |
|
|
|
LEFT JOIN anrui_portal.sys_organization so ON so.sid = bo.useOrgSid |
|
|
|
WHERE bo.payTypeKey = 2 |
|
|
|