Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
7402a45b
Commit
7402a45b
authored
Jul 17, 2020
by
yao.xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加-AGMS中Dashboard商机预测列表
parent
90cc4e19
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
yd-api/src/main/java/com/yd/dal/entity/agms/dashboard/StatisticsOpportunityInfo.java
+2
-0
yd-api/src/main/resources/mapper/agms/AgmsDashboardMapper.xml
+8
-1
No files found.
yd-api/src/main/java/com/yd/dal/entity/agms/dashboard/StatisticsOpportunityInfo.java
View file @
7402a45b
...
...
@@ -5,6 +5,8 @@ import lombok.Data;
@Data
public
class
StatisticsOpportunityInfo
{
private
String
branchName
;
private
String
subordinateName
;
private
Long
opportunityNum
;
private
Double
predictFYC
;
private
Double
predictFYP
;
private
Long
pieces
;
...
...
yd-api/src/main/resources/mapper/agms/AgmsDashboardMapper.xml
View file @
7402a45b
...
...
@@ -33,29 +33,35 @@
</select>
<select
id=
"statisticsOpportunity"
resultType=
"com.yd.dal.entity.agms.dashboard.StatisticsOpportunityInfo"
>
select b.branch_name branchName,
select if(b.branch_name is null,'暂无公司',b.branch_name) branchName,
if(s.name is null ,'暂无团队',s.name) subordinateName,
<choose>
<when
test=
"time.equalsIgnoreCase('D')"
>
count(case when to_days(a.created_at)=to_days(now()) then a.id else 0 end) opportunityNum,
sum(case when to_days(a.time_to_close)=to_days(now()) then a.FYP else 0 end) predictFYP,
sum(case when to_days(a.time_to_close)=to_days(now()) then a.FYC else 0 end) predictFYC,
sum(case when to_days(a.time_to_close)=to_days(now()) then a.pieces else 0 end) pieces
</when>
<when
test=
"time.equalsIgnoreCase('W')"
>
count(case when YEARWEEK(date_format(a.created_at, '%Y-%m-%d'))=YEARWEEK(now()) then a.id else 0 end) opportunityNum,
sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.FYP else 0 end) predictFYP,
sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.FYC else 0 end) predictFYC,
sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.pieces else 0 end) pieces
</when>
<when
test=
"time.equalsIgnoreCase('M')"
>
count(case when date_format(a.created_at, '%Y-%m') = date_format(now(), '%Y-%m') then a.id else 0 end) opportunityNum,
sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.FYP else 0 end) predictFYP,
sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.FYC else 0 end) predictFYC,
sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.pieces else 0 end) pieces
</when>
<when
test=
"time.equalsIgnoreCase('Q')"
>
count(case when QUARTER(a.created_at)=QUARTER(now()) then a.id else 0 end) opportunityNum,
sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.FYP else 0 end) predictFYP,
sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.FYC else 0 end) predictFYC,
sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.pieces else 0 end) pieces
</when>
<when
test=
"time.equalsIgnoreCase('Y')"
>
count(case when YEAR(a.created_at)=YEAR(now()) then a.id else 0 end) opportunityNum,
sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.FYP else 0 end) predictFYP,
sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.FYC else 0 end) predictFYC,
sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.pieces else 0 end) pieces
...
...
@@ -64,6 +70,7 @@ select b.branch_name branchName,
from ag_acl_practitioner p
left join ag_mkt_leads_assigneds a on p.id = a.assigned_practitioner_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 not EXISTS(
select tt.leads_assigned_id
from ag_mkt_leads_assigned_track tt
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment