Commit cf4edb4f by Water Wang

optimize rank

parent cca75084
......@@ -610,11 +610,11 @@
ifnull(count(f.id),0) as count,-- 保单id
ifnull(sum(f.order_price),0) as fyp,-- 保费
ifnull(sum(f.fyc_amount),0) as fyc -- 应发佣金
FROM (select t.* from ag_acl_customer_fortune t group by t.order_id ) f INNER JOIN ag_po_order o ON f.order_id = o.id and o.order_price > 0
FROM (select t.* from ag_acl_customer_fortune t where t.drop_option_code = "S01" group by t.order_id ) f INNER JOIN ag_po_order o ON f.order_id = o.id and o.order_price > 0
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and f.drop_option_code = "S01"
WHERE o.status = 3
<if test="practitionerTypeId != null">
and s.practitioner_type_id = #{practitionerTypeId}
</if>
......
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