JOIN test_mzh.repay_record_amount rr ON rr.record_id = brprrr.record_id AND rr.repay_channel = brprrr.repay_channel AND rr.repaid_at >= '%s' AND rr.repaid_at < '%s'
JOIN user_bt_repayment_plan ubrp ON ubrp.id = brprrr.plan_id
join bt_funding_repayment_plan bfrp on ubrp.repayment_plan_id =bfrp.repay_plan_id and ubrp.sys_tag='XYQB_BILL_BT'
JOIN baitiao_audit.baitiao_order bo ON bo.ref_id = ubrp.ref_id and bo.funding_corp_id=5 and bo.is_active in(1,-2)
JOIN baitiao_audit.merchant m ON m.merchant_id = bo.merchantId
JOIN baitiao_audit.fund_corp fc ON fc.id = bo.funding_corp_id
...
...
@@ -123,6 +125,8 @@ JOIN baitiao_audit.merchant m ON m.merchant_id = bo.merchantId
JOIN baitiao_audit.fund_corp fc ON fc.id = bo.funding_corp_id and bo.funding_corp_id=5
JOIN new_transaction.repay_channel rc ON rc.id = brprrr.repay_channel