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
0984dca7
Commit
0984dca7
authored
Mar 31, 2022
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard-14
parent
60b4483b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
22 deletions
+31
-22
yd-api/src/main/java/com/yd/dal/service/agms/impl/AgmsDashboardDALServiceImpl.java
+3
-1
yd-api/src/main/resources/mapper/agms/AgmsDashboardMapper.xml
+28
-21
No files found.
yd-api/src/main/java/com/yd/dal/service/agms/impl/AgmsDashboardDALServiceImpl.java
View file @
0984dca7
...
...
@@ -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
);
}
}
...
...
yd-api/src/main/resources/mapper/agms/AgmsDashboardMapper.xml
View file @
0984dca7
...
...
@@ -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>
...
...
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