Commit 52621cd2 by jianan

来佣比对列表查询优化后报错

parent a5d5af26
...@@ -124,12 +124,21 @@ ...@@ -124,12 +124,21 @@
IFNULL(sum(o.order_price),0) totalOrderPrice, IFNULL(sum(o.order_price),0) totalOrderPrice,
IFNULL(sum(o.commission_amount),0) totalCommission IFNULL(sum(o.commission_amount),0) totalCommission
from (SELECT order_price, commission_amount, commission_check_status, commission_check_id, order_date, from (SELECT order_price, commission_amount, commission_check_status, commission_check_id, order_date,
insurer_id insurer_id,id
from ag_po_order t from ag_po_order t
where t.status in (3,4) and policy_no is not null where t.status in (3,4) and policy_no is not null
and (t.plan_id not in (424,453,464) or t.plan_id is null) and (t.plan_id not in (424,453,464) or t.plan_id is null)
) o ) o
left join ag_po_order_commission_check c on o.commission_check_id = c.id left join ag_po_order_commission_check c on o.commission_check_id = c.id
left join (SELECT order_id, name, practitioner_type_id, f.customer_id
from (
select *
from (select order_id, customer_id from ag_acl_customer_fortune order by referral_amount desc) f
group by f.order_id
) f
left join ag_acl_practitioner practitioner on f.customer_id = practitioner.customer_id
left join ag_acl_practitioner_setting setting on setting.practitioner_id = practitioner.id
) f on f.order_id = o.id
where 1=1 where 1=1
<if test="insurerId != null"> <if test="insurerId != null">
and o.insurer_id = #{insurerId} and o.insurer_id = #{insurerId}
......
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