Commit a51739bb by wenyang

龙虎榜与经纪人首页销售统计数据,以前是通过N22接口获取,现在通过本地获取2

parent 22c13cc2
......@@ -1290,13 +1290,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 (select t.* from ag_acl_customer_fortune t where t.drop_option_code IN('S01','C01') group by t.order_id ) f
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_practitioner_setting s on p.id = s.practitioner_id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
left join ag_acl_customer c on p.customer_id = c.id
WHERE o.status = 3 and o.payment_status =3
WHERE o.status = 3 and o.payment_status =3 and f.drop_option_code IN('S01','C01')
<if test="practitionerTypeId != null">
and (s.practitioner_type_id = #{practitionerTypeId}
or c.login in
......@@ -1350,12 +1350,12 @@
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 where t.drop_option_code IN('S01','C01') group by t.order_id ) f
FROM ag_acl_customer_fortune f
INNER JOIN ag_po_order o ON f.order_id = o.id and o.order_price &gt; 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 o.payment_status =3
WHERE o.status = 3 and o.payment_status =3 and f.drop_option_code IN('S01','C01')
<if test="practitionerTypeId != null">
and s.practitioner_type_id = #{practitionerTypeId}
</if>
......@@ -1394,7 +1394,8 @@
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 &gt; 0
FROM ag_acl_customer_fortune f
INNER JOIN ag_po_order o ON f.order_id = o.id and o.order_price &gt; 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
......@@ -1414,14 +1415,14 @@
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
<choose>
<when test="platform == 1">
and o.product_category_id = 8
</when>
<otherwise>
and o.product_category_id != 8 -- o.flag != 'Manual'
</otherwise>
</choose>
<!-- <choose> -->
<!-- <when test="platform == 1"> -->
<!-- and o.product_category_id = 8 -->
<!-- </when> -->
<!-- <otherwise> -->
<!-- and o.product_category_id != 8 -->
<!-- </otherwise> -->
<!-- </choose> -->
group by p.id
</select>
......@@ -1629,7 +1630,8 @@
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.status = 3 and o.order_price &gt; 0
FROM ag_acl_customer_fortune f
INNER JOIN ag_po_order o ON f.order_id = o.id and o.status = 3 and o.order_price &gt; 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
......
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