Commit a591142e by Water Wang

optimize

parent 9d8faaf1
......@@ -2,6 +2,7 @@ package com.yd.api.agms.vo.dashboard;
public class StatisticsSalesInfo {
private String typeName;
private Long typeId;
private String fyp;
private String fyc;
private Double api;
......@@ -16,6 +17,14 @@ public class StatisticsSalesInfo {
this.typeName = typeName;
}
public Long getTypeId() {
return typeId;
}
public void setTypeId(Long typeId) {
this.typeId = typeId;
}
public String getFyp() {
return fyp;
}
......
......@@ -93,15 +93,17 @@ order by predictFYC desc ,predictFYP desc ,pieces desc ,opportunityNum desc;
<choose>
<when test="type.equalsIgnoreCase('B')">
b.branch_name as typeName,
b.id as typeId,
</when>
<otherwise>
s.name as typeName,
s.id as typeId,
</otherwise>
</choose>
concat(ifnull(sum(cf.order_price),0),'') as fyp,
concat(ifnull(sum(cf.fyc_amount),0),'') as fyc,
ifnull(count(cf.order_id),0) as pieces
from ag_acl_practitioner p inner join ag_acl_customer_fortune cf on p.customer_id = cf.customer_id and cf.grade_commission_rate != 5
from ag_acl_practitioner p inner join ag_acl_customer_fortune cf on p.customer_id = cf.customer_id and cf.drop_option_code = "S01"
inner join ag_po_order o on cf.order_id = o.id and o.status = 3
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
......@@ -155,7 +157,7 @@ order by predictFYC desc ,predictFYP desc ,pieces desc ,opportunityNum desc;
from ag_acl_practitioner p left join
(
select p.insurer_branch_id insurer_branch_id,count(distinct f.customer_id) as real_count
from ag_acl_customer_fortune f inner join ag_po_order o on f.order_id = o.id and o.status = 3 and f.grade_commission_rate != 5
from ag_acl_customer_fortune f inner join ag_po_order o on f.order_id = o.id and o.status = 3 and f.drop_option_code = "S01"
inner join ag_acl_practitioner p on f.customer_id = p.customer_id
group by p.insurer_branch_id
)a on a.insurer_branch_id = p.insurer_branch_id
......@@ -178,7 +180,7 @@ order by predictFYC desc ,predictFYP desc ,pieces desc ,opportunityNum desc;
from ag_acl_practitioner p left join
(
select p.subordinate_system_id subordinate_system_id,count(distinct f.customer_id) as real_count
from ag_acl_customer_fortune f inner join ag_po_order o on f.order_id = o.id and o.status = 3 and f.grade_commission_rate != 5
from ag_acl_customer_fortune f inner join ag_po_order o on f.order_id = o.id and o.status = 3 and f.drop_option_code = "S01"
inner join ag_acl_practitioner p on f.customer_id = p.customer_id
group by p.subordinate_system_id
)a on a.subordinate_system_id = p.subordinate_system_id
......
......@@ -614,7 +614,7 @@
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
WHERE o.status = 3 and f.drop_option_code = "S01"
<if test="practitionerTypeId != null">
and s.practitioner_type_id = #{practitionerTypeId}
</if>
......@@ -646,7 +646,7 @@
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
WHERE o.status = 3
WHERE o.status = 3 and f.drop_option_code = "S01"
and c.login in
<foreach collection="mobileSpecials" index="index" item="item" open="(" separator="," close=")">
#{item}
......@@ -861,7 +861,7 @@
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 p.id = #{practitionerId,jdbcType=BIGINT}
WHERE p.id = #{practitionerId,jdbcType=BIGINT} and f.drop_option_code = "S01"
<choose>
<when test="time == 1">
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
......
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