fix transaction

master
eason 6 years ago
parent c658495834
commit 76f0cec66d

@ -100,14 +100,14 @@
<select id="analysisTransFlow" resultType="com.alibaba.fastjson.JSONObject">
SELECT
count(t.transaction_id) order_count,
ifnull(sum(if(t.transaction_type='Credit' and t.refund_id is null and o.currency!='CNY',o.display_amount,0)),0)
count(DISTINCT o.order_id) order_count,
ifnull(sum(if(t.transaction_type='Credit' and t.refund_id is null and t.system_generate=0 and o.currency!='CNY',o.display_amount,0)),0)
display_amount,
ifnull(sum(if(t.transaction_type='Credit' and t.refund_id is null and o.currency!='CNY' and
ifnull(sum(if(t.transaction_type='Credit' and t.refund_id is null and t.system_generate=0 and o.currency!='CNY' and
o.pre_authorization=1,o.display_amount,0)),0) pre_display_amount,
ifnull(sum(if(t.transaction_type='Credit' and t.refund_id is null and o.currency='CNY',o.display_amount,0)),0)
ifnull(sum(if(t.transaction_type='Credit' and t.refund_id is null and t.system_generate=0 and o.currency='CNY',o.display_amount,0)),0)
cny_display_amount,
ifnull(sum(if(t.transaction_type='Credit' and t.refund_id is null and o.currency='CNY' and
ifnull(sum(if(t.transaction_type='Credit' and t.refund_id is null and t.system_generate=0 and o.currency='CNY' and
o.pre_authorization=1,o.display_amount,0)),0) pre_cny_display_amount,
ifnull(sum(if(t.transaction_type='Credit',t.clearing_amount,0)),0) paid_fee,
sum(if(t.transaction_type='Debit' AND t.refund_id is NOT NULL,t.clearing_amount,0))*-1

Loading…
Cancel
Save