|
|
@@ -2990,6 +2990,7 @@
|
|
|
LEFT JOIN dkic_b.t_psi_outbound tpo ON tpo.out_id = a.biznis_id
|
|
|
LEFT JOIN dkic_b.t_mac_rec_pay tmrp ON tmrp.rp_id = a.biznis_id
|
|
|
WHERE a.flg_valid
|
|
|
+ AND a.cp_id = #{cpId}
|
|
|
<if test="objectId != null and objectId != ''">
|
|
|
AND a.object_id = #{objectId}::uuid
|
|
|
</if>
|
|
|
@@ -3047,6 +3048,7 @@
|
|
|
LEFT JOIN dkic_b.t_mac_rec_pay tmrp ON tmrp.rp_id = a.biznis_id
|
|
|
LEFT JOIN dkic_b.t_mst_customer tmc ON tmc.cus_id = a.object_id
|
|
|
WHERE a.flg_valid
|
|
|
+ AND a.cp_id = #{cpId}
|
|
|
AND tmc.cus_name IS NOT NULL AND tmc.cus_name != ''
|
|
|
GROUP BY a.object_id, tmc.cus_name, tmc.cus_phone, tmc.address_full
|
|
|
HAVING SUM(COALESCE(tpo.out_amt, 0) + COALESCE(tpo.return_amt, 0)) - SUM(COALESCE(tmrp.sum_amt_rec, 0)) > 0
|