Commit 0984dca7 by jianan

dashboard-14

parent 60b4483b
......@@ -52,6 +52,7 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
} else {
// 新体系
List<Map<String, Object>> teamMapList = agmsDashboardDALService.queryTeamAllMap();
teamMapList= teamMapList.stream().filter((Map<String, Object> i) -> StringUtils.isBlank((String) i.get("teamMember"))).collect(Collectors.toList());
statisticsPEPInfos = agmsDashboardMapper.statisticsPEPTeam(type, dropOptionId, teamMapList);
for (Map<String, Object> teamMap :teamMapList) {
......@@ -118,12 +119,13 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
}
@Override
public List<StatisticsOpportunityInfo> statisticsOpportunity(String type,String time, Long dropOptionId) {
public List<StatisticsOpportunityInfo> statisticsOpportunity(String type, String time, Long dropOptionId) {
if ("b".equalsIgnoreCase(type)) {
return agmsDashboardMapper.statisticsOpportunity(type, time, dropOptionId);
} else {
// 新体系
List<Map<String, Object>> teamMapList = agmsDashboardDALService.queryTeamAllMap();
teamMapList = teamMapList.stream().filter((Map<String, Object> i) -> StringUtils.isBlank((String) i.get("teamMember"))).collect(Collectors.toList());
return agmsDashboardMapper.statisticsOpportunityTeam(type, time, dropOptionId, teamMapList);
}
}
......
......@@ -235,11 +235,35 @@
) as level,
</otherwise>
</choose>
concat(ifnull(sum(o.order_price),0),'') as fyp,
concat(ifnull(sum(o.fyc_amount),0),'') as fyc,
ifnull(count(o.id),0) as pieces
<choose>
<when test="time.equalsIgnoreCase('D')">
sum(case when to_days(o.underwriting_date)=to_days(now()) then o.order_price else 0 end) fyp,
sum(case when to_days(o.underwriting_date)=to_days(now()) then o.fyc_amount else 0 end) fyc,
sum(case when to_days(o.underwriting_date)=to_days(now()) then 1 else 0 end) pieces
</when>
<when test="time.equalsIgnoreCase('W')">
sum(case when YEARWEEK(date_format(o.underwriting_date, '%Y-%m-%d')) = YEARWEEK(now()) then o.order_price else 0 end) fyp,
sum(case when YEARWEEK(date_format(o.underwriting_date, '%Y-%m-%d')) = YEARWEEK(now()) then o.fyc_amount else 0 end) fyc,
sum(case when YEARWEEK(date_format(o.underwriting_date, '%Y-%m-%d')) = YEARWEEK(now()) then 1 else 0 end) pieces
</when>
<when test="time.equalsIgnoreCase('M')">
sum(case when date_format(o.underwriting_date, '%Y-%m') = date_format(now(), '%Y-%m') then o.order_price else 0 end) fyp,
sum(case when date_format(o.underwriting_date, '%Y-%m') = date_format(now(), '%Y-%m') then o.fyc_amount else 0 end) fyc,
sum(case when date_format(o.underwriting_date, '%Y-%m') = date_format(now(), '%Y-%m') then 1 else 0 end) pieces
</when>
<when test="time.equalsIgnoreCase('Q')">
sum(case when QUARTER(o.underwriting_date) = QUARTER(now()) and year(o.underwriting_date)=year(now()) then o.order_price else 0 end) fyp,
sum(case when QUARTER(o.underwriting_date) = QUARTER(now()) and year(o.underwriting_date)=year(now()) then o.fyc_amount else 0 end) fyc,
sum(case when QUARTER(o.underwriting_date) = QUARTER(now()) and year(o.underwriting_date)=year(now()) then 1 else 0 end) pieces
</when>
<when test="time.equalsIgnoreCase('Y')">
sum(case when YEAR(o.underwriting_date) = YEAR(now()) then o.order_price else 0 end) fyp,
sum(case when YEAR(o.underwriting_date) = YEAR(now()) then o.fyc_amount else 0 end) fyc,
sum(case when YEAR(o.underwriting_date) = YEAR(now()) then 1 else 0 end) pieces
</when>
</choose>
from ag_acl_practitioner p
inner join ag_po_order o on o.broker_customer_id = p.customer_id
left join ag_po_order o on o.broker_customer_id = p.customer_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
......@@ -252,23 +276,6 @@
</when>
</choose>
<choose>
<when test="time.equalsIgnoreCase('D')">
and TO_DAYS(o.underwriting_date) = TO_DAYS(now())
</when>
<when test="time.equalsIgnoreCase('W')">
and YEARWEEK(DATE_FORMAT(o.underwriting_date,'%Y-%m-%d')) = YEARWEEK(NOW())
</when>
<when test="time.equalsIgnoreCase('M')">
and DATE_FORMAT(o.underwriting_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when test="time.equalsIgnoreCase('Q')">
and QUARTER(o.underwriting_date) = QUARTER(NOW()) AND year(o.underwriting_date)=year(now())
</when>
<otherwise>
and YEAR(o.underwriting_date) = YEAR(now())
</otherwise>
</choose>
<choose>
<when test="type.equalsIgnoreCase('B')">
group by p.insurer_branch_id
</when>
......
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