Commit 61c80a16 by akexiu

commision_id关联查询调整

parent f523da78
......@@ -442,7 +442,9 @@
<sql id="sheet2Data1" >
select
ifnull((SELECT t.commission_time FROM ag_po_order_commission t WHERE t.id= f.commission_id),
ifnull((SELECT t.commission_time FROM ag_po_order_commission t WHERE /*t.id= f.commission_id*/
t.commission_status='2' and t.commission_type='1'
and t.order_id=f.order_id and t.commission_period=f.commission_period limit 1),
if(f.payout_batch_id is not null,(SELECT t.payout_yearmonth FROM ag_acl_customer_fortune_payout_batch t WHERE t.id= f.payout_batch_id), '')
) '0' /*对账月*/,
(select name from ag_acl_policyholder where order_id = f.order_id and type=2) '1',
......@@ -854,7 +856,9 @@
<if test="list2.size() > 0">
UNION ALL
select
(SELECT t.commission_time FROM ag_po_order_commission t WHERE t.id= f.commission_id) '0' /*对账月*/,
(SELECT t.commission_time FROM ag_po_order_commission t WHERE /*t.id= f.commission_id*/
t.commission_status='2' and t.commission_type='1'
and t.order_id=f.order_id and t.commission_period=f.commission_period limit 1 ) '0' /*对账月*/,
(select name from ag_acl_policyholder where order_id = f.order_id and type=2) '1',
o.policy_no '2',
i.name '3' /*保司*/,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment