|
|
@ -28,9 +28,9 @@ |
|
|
|
IFNULL(verification_totals.checking_amt, 0) AS checking_amt, |
|
|
|
IFNULL(activity_totals.dont_check_amt, 0) AS dont_check_amt, |
|
|
|
IFNULL(payment_totals.pay_amt, 0) AS pay_amt, |
|
|
|
IFNULL(payment_totals.not_pay_amt, 0) AS not_pay_amt, |
|
|
|
IFNULL(activity_totals.cost_apply_amt - verification_totals.checked_amt - verification_totals.checking_amt - activity_totals.dont_check_amt,0) as not_check_amt, |
|
|
|
IFNULL(verification_totals.checked_amt - payment_totals.pay_amt - payment_totals.not_pay_amt,0) as un_pay_amt |
|
|
|
IFNULL(payment_totals.not_pay_amt, 0) AS un_pay_amt, |
|
|
|
IFNULL(activity_totals.cost_apply_amt,0) - IFNULL(verification_totals.checked_amt,0) - IFNULL(verification_totals.checking_amt,0) - IFNULL(activity_totals.dont_check_amt,0) as not_check_amt, |
|
|
|
IFNULL(verification_totals.checked_amt,0) - IFNULL(payment_totals.pay_amt,0) - IFNULL(payment_totals.not_pay_amt,0) as not_pay_amt |
|
|
|
FROM |
|
|
|
tbs_cost_apply c |
|
|
|
LEFT JOIN ( |
|
|
@ -42,6 +42,12 @@ |
|
|
|
tbs_activity |
|
|
|
WHERE |
|
|
|
del_flag = 0 |
|
|
|
<if test="costApplyIds !=null and costApplyIds.size > 0"> |
|
|
|
and cost_apply_id in |
|
|
|
<foreach collection="costApplyIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
cost_apply_id |
|
|
|
) activity_totals ON activity_totals.cost_apply_id = c.id |
|
|
@ -54,6 +60,12 @@ |
|
|
|
vtb_verification |
|
|
|
WHERE |
|
|
|
del_flag = 0 |
|
|
|
<if test="costApplyIds !=null and costApplyIds.size > 0"> |
|
|
|
and cost_apply_id in |
|
|
|
<foreach collection="costApplyIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
cost_apply_id |
|
|
|
) verification_totals ON verification_totals.cost_apply_id = c.id |
|
|
@ -66,6 +78,12 @@ |
|
|
|
pay_payment_item |
|
|
|
WHERE |
|
|
|
del_flag = 0 |
|
|
|
<if test="costApplyIds !=null and costApplyIds.size > 0"> |
|
|
|
and cost_apply_id in |
|
|
|
<foreach collection="costApplyIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
cost_apply_id |
|
|
|
) payment_totals ON payment_totals.cost_apply_id = c.id |
|
|
@ -106,9 +124,9 @@ |
|
|
|
IFNULL(SUM(verification_totals.checking_amt), 0) AS checking_amt, |
|
|
|
IFNULL(SUM(activity_totals.dont_check_amt), 0) AS dont_check_amt, |
|
|
|
IFNULL(SUM(payment_totals.pay_amt), 0) AS pay_amt, |
|
|
|
IFNULL(SUM(payment_totals.not_pay_amt), 0) AS not_pay_amt, |
|
|
|
IFNULL(SUM(activity_totals.cost_apply_amt - verification_totals.checked_amt - verification_totals.checking_amt - activity_totals.dont_check_amt),0) as not_check_amt, |
|
|
|
IFNULL(SUM(verification_totals.checked_amt - payment_totals.pay_amt - payment_totals.not_pay_amt),0) as un_pay_amt |
|
|
|
IFNULL(SUM(payment_totals.not_pay_amt), 0) AS un_pay_amt, |
|
|
|
IFNULL( SUM( activity_totals.cost_apply_amt) - SUM(verification_totals.checked_amt) - SUM(verification_totals.checking_amt) - SUM(activity_totals.dont_check_amt ), 0 ) AS not_check_amt, |
|
|
|
IFNULL( SUM( verification_totals.checked_amt) - SUM(payment_totals.pay_amt) - SUM(payment_totals.not_pay_amt ), 0 ) AS un_pay_amt |
|
|
|
FROM |
|
|
|
tbs_cost_apply c |
|
|
|
LEFT JOIN ( |
|
|
@ -120,6 +138,12 @@ |
|
|
|
tbs_activity |
|
|
|
WHERE |
|
|
|
del_flag = 0 |
|
|
|
<if test="costApplyIds !=null and costApplyIds.size > 0"> |
|
|
|
and cost_apply_id in |
|
|
|
<foreach collection="costApplyIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
cost_apply_id |
|
|
|
) activity_totals ON activity_totals.cost_apply_id = c.id |
|
|
@ -132,6 +156,12 @@ |
|
|
|
vtb_verification |
|
|
|
WHERE |
|
|
|
del_flag = 0 |
|
|
|
<if test="costApplyIds !=null and costApplyIds.size > 0"> |
|
|
|
and cost_apply_id in |
|
|
|
<foreach collection="costApplyIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
cost_apply_id |
|
|
|
) verification_totals ON verification_totals.cost_apply_id = c.id |
|
|
@ -144,6 +174,12 @@ |
|
|
|
pay_payment_item |
|
|
|
WHERE |
|
|
|
del_flag = 0 |
|
|
|
<if test="costApplyIds !=null and costApplyIds.size > 0"> |
|
|
|
and cost_apply_id in |
|
|
|
<foreach collection="costApplyIds" item ="selectId" index="i" open="(" close=")" separator=","> |
|
|
|
#{selectId} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
cost_apply_id |
|
|
|
) payment_totals ON payment_totals.cost_apply_id = c.id |
|
|
|