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
3adadf98
Commit
3adadf98
authored
Mar 31, 2022
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard-17
parent
365d4984
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
54 deletions
+40
-54
yd-api/src/main/resources/mapper/agms/AgmsDashboardMapper.xml
+40
-54
No files found.
yd-api/src/main/resources/mapper/agms/AgmsDashboardMapper.xml
View file @
3adadf98
...
...
@@ -234,33 +234,9 @@
) as level,
</otherwise>
</choose>
<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>
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
from ag_acl_practitioner p
INNER JOIN ag_acl_life_insurance_practitioner lip ON lip.practitioner_id= p.id
INNER JOIN ag_po_order o ON o.policy_no = lip.policy_no
...
...
@@ -276,6 +252,23 @@
</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>
...
...
@@ -300,33 +293,9 @@
where s.id=#{item.id}
) as level,
<choose>
<when
test=
"time.equalsIgnoreCase('D')"
>
ifnull(sum(case when to_days(o.underwriting_date)=to_days(now()) then o.order_price else 0 end), 0) fyp,
ifnull(sum(case when to_days(o.underwriting_date)=to_days(now()) then o.fyc_amount else 0 end), 0) fyc,
ifnull(sum(case when to_days(o.underwriting_date)=to_days(now()) then 1 else 0 end), 0) pieces
</when>
<when
test=
"time.equalsIgnoreCase('W')"
>
ifnull(sum(case when YEARWEEK(date_format(o.underwriting_date, '%Y-%m-%d')) = YEARWEEK(now()) then o.order_price else 0 end), 0) fyp,
ifnull(sum(case when YEARWEEK(date_format(o.underwriting_date, '%Y-%m-%d')) = YEARWEEK(now()) then o.fyc_amount else 0 end), 0) fyc,
ifnull(sum(case when YEARWEEK(date_format(o.underwriting_date, '%Y-%m-%d')) = YEARWEEK(now()) then 1 else 0 end), 0) pieces
</when>
<when
test=
"time.equalsIgnoreCase('M')"
>
ifnull(sum(case when date_format(o.underwriting_date, '%Y-%m') = date_format(now(), '%Y-%m') then o.order_price else 0 end), 0) fyp,
ifnull(sum(case when date_format(o.underwriting_date, '%Y-%m') = date_format(now(), '%Y-%m') then o.fyc_amount else 0 end), 0) fyc,
ifnull(sum(case when date_format(o.underwriting_date, '%Y-%m') = date_format(now(), '%Y-%m') then 1 else 0 end), 0) pieces
</when>
<when
test=
"time.equalsIgnoreCase('Q')"
>
ifnull(sum(case when QUARTER(o.underwriting_date) = QUARTER(now()) and year(o.underwriting_date)=year(now()) then o.order_price else 0 end), 0) fyp,
ifnull(sum(case when QUARTER(o.underwriting_date) = QUARTER(now()) and year(o.underwriting_date)=year(now()) then o.fyc_amount else 0 end), 0) fyc,
ifnull(sum(case when QUARTER(o.underwriting_date) = QUARTER(now()) and year(o.underwriting_date)=year(now()) then 1 else 0 end), 0) pieces
</when>
<when
test=
"time.equalsIgnoreCase('Y')"
>
ifnull(sum(case when YEAR(o.underwriting_date) = YEAR(now()) then o.order_price else 0 end), 0) fyp,
ifnull(sum(case when YEAR(o.underwriting_date) = YEAR(now()) then o.fyc_amount else 0 end), 0) fyc,
ifnull(sum(case when YEAR(o.underwriting_date) = YEAR(now()) then 1 else 0 end), 0) pieces
</when>
</choose>
ifnull(sum(o.order_price),0) as fyp,
ifnull(sum(o.fyc_amount),0) as fyc,
ifnull(count(o.id),0) as pieces
from ag_acl_practitioner p
INNER JOIN ag_acl_life_insurance_practitioner lip ON lip.practitioner_id= p.id
INNER JOIN ag_po_order o ON o.policy_no = lip.policy_no
...
...
@@ -342,6 +311,23 @@
and o.product_category_id not in (2,5,8)
</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>
</if>
</foreach>
order by 4 desc
...
...
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