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
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
...
...
@@ -657,13 +1305,13 @@
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 ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id and o.order_price > 0
FROM ag_acl_customer_fortune 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_customer c on p.customer_id = c.id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
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.status = 3 and o.order_price > 0
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.status = 3 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
...
...
@@ -959,6 +1608,10 @@
where is_active = 1
and subordinate_system_id =
(select subordinate_system_id from ag_acl_practitioner where id = #{practitionerId,jdbcType=BIGINT})