안녕하세요.
문의드릴게 있을때문 들어오게 됩니다. 죄송합니다.
혹시 고수님들에게서 답이 있을까 하여 문의합니다.
직접 쿼리를 보시죠.
insert into settle_trx
(report_date, tx_type, tx_id, partner_id, payout_partner_id, country_id, remit_method, status, sender_id, sender_email, sender_phone, sender_name, sender_country, sender_ident_type, sender_ident_num, recipient_first_name, recipient_last_name, recipient_country, recipient_phone, bank_id, bank_code, bank_name, branch_name, bank_account, lock_id, send_amount, send_currency, recipient_amount, recipient_currency, fee, used_point, fx_rate_mm, fx_rate_cp, fx_margin, settle_amount, settle_currency, settle_rate, margin_exrate, remit_id, confirmation_id, remit_pin_no, remit_status, remit_send_amount, remit_recv_amount, remit_collect_amount, remit_send_commission, remit_token_amount, remit_settle_rate, tx_create_at, tx_request_at, tx_complete_at, memo , partner_value_usd, partner_value_krw, base_usd_ex_rate, partner_settle_amount_usd, partner_settle_amount_krw, partner_settle_rate, partner_margin_exrate, partner_margin_fee, partner_fee_usd, partner_fee_krw) select * from (select date_format(trx.request_at, '%Y-%m-%d') as report_date, 'SEND' as tx_type, tx_id, partner_id, payout_partner_id, country_id, remit_method, status, sender_id, sender_email, sender_phone, sender_name, sender_country, sender_ident_type, sender_ident_num, recipient_first_name, recipient_last_name, recipient_country, recipient_phone, bank_id, bank_code, bank_name, branch_name, bank_account, lock_id, send_amount, send_currency, recipient_amount, recipient_currency, fee, used_point, fx_rate_mm, fx_rate_cp, fx_margin, settle_amount, settle_currency, settle_rate, margin_exrate, remit_id, confirmation_id, remit_pin_no, remit_status, remit_send_amount, remit_recv_amount, remit_collect_amount, remit_send_commission, remit_token_amount, remit_settle_rate, create_at as tx_create_at, request_at as tx_request_at, complete_at as tx_complete_at, memo, partner_value_usd, partner_value_krw, base_usd_ex_rate, partner_settle_amount_usd, partner_settle_amount_krw, partner_settle_rate, partner_margin_exrate, partner_margin_fee, partner_fee_usd, partner_fee_krw from remit_trx trx where trx.request_at >= date_format('2020-07-23', '%Y-%m-%d 00:00:00') AND trx.request_at <= date_format('2020-07-23', '%Y-%m-%d 23:59:59') AND (trx.status IN ('COMPLETE', 'DELAY_COMPLETE', 'REQUEST', 'PROCESSED') OR (trx.complete_at >= date_format('2020-07-23', '%Y-%m-%d 00:00:00') AND trx.status IN ('REJECT', 'CANCEL', 'REFUND'))) union all select date_format(trx.complete_at, '%Y-%m-%d') as report_date, 'CANCEL' as tx_type, tx_id, partner_id, payout_partner_id, country_id, remit_method, status, sender_id, sender_email, sender_phone, sender_name, sender_country, sender_ident_type, sender_ident_num, recipient_first_name, recipient_last_name, recipient_country, recipient_phone, bank_id, bank_code, bank_name, branch_name, bank_account, lock_id, send_amount, send_currency, recipient_amount, recipient_currency, fee, used_point, fx_rate_mm, fx_rate_cp, fx_margin, settle_amount, settle_currency, settle_rate, margin_exrate, remit_id, confirmation_id, remit_pin_no, remit_status, remit_send_amount, remit_recv_amount, remit_collect_amount, remit_send_commission, remit_token_amount, remit_settle_rate, create_at as tx_create_at, request_at as tx_request_at, complete_at as tx_complete_at, memo, partner_value_usd, partner_value_krw, base_usd_ex_rate, partner_settle_amount_usd, partner_settle_amount_krw, partner_settle_rate, partner_margin_exrate, partner_margin_fee, partner_fee_usd, partner_fee_krw from remit_trx trx where trx.complete_at >= date_format('2020-07-23', '%Y-%m-%d 00:00:00') AND trx.complete_at <= date_format('2020-07-23', '%Y-%m-%d 23:59:59') AND (trx.status IN ('REJECT', 'CANCEL', 'REFUND'))) x
설명을 간략히 드리면 원천 거래가 있는 remit_trx 테이블에서 조건별로 'SEND' 타입과 'CANCEL' 타입으로 select 를 해서 insert를 하는 구문입니다.
그런데 저 쿼리르 실행시키면(프로그램으로) 실행시
payout_partner_id 컬럼에 값이 들어가지 않고 있는데요.
실제 쿼리 툴에서 돌리면 값이 들어갑니다.
특별히 프로그램 문제도 아닌것 같은데요.
혹시 이런 현상 보신분 계실지요.
감사합니다.
|