Commit 0bf96232 by jianan

dashboard分公司统计1

parent ddbfe8f9
......@@ -240,15 +240,20 @@
from ag_acl_practitioner p
INNER JOIN ag_acl_life_insurance_practitioner lip ON lip.practitioner_id= p.id
INNER JOIN ag_po_order o ON o.policy_no = lip.policy_no
left join ag_product prd on prd.id = o.product_id
left join ag_product_category c1 on c1.id = prd.product_category_id
left join ag_product_plan a on o.plan_id = a.id
left join ag_product aa on aa.id = a.product_id
left join ag_product_category c2 on c2.id = aa.product_category_id
left join ag_acl_insurer_branch b on b.id = p.insurer_branch_id
left join ag_acl_practitioner_subordinate_system s on s.id = p.subordinate_system_id
where o.status = 3 and o.payment_status=3
<choose>
<when test="category.equalsIgnoreCase('life')">
and o.product_category_id in (2,5,8)
and (c1.id in (2,5,8) or c2.id in (2,5,8))
</when>
<when test="category.equalsIgnoreCase('pc')">
and o.product_category_id not in (2,5,8)
and (c1.id not in (2,5,8) or c2.id not in (2,5,8))
</when>
</choose>
<choose>
......
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