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
deaefb84
Commit
deaefb84
authored
Apr 21, 2022
by
akexiu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
1fd04e6c
f58eea4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
92 deletions
+114
-92
yd-api/src/main/java/com/yd/dal/service/agms/impl/AgmsDashboardDALServiceImpl.java
+1
-0
yd-api/src/main/resources/mapper/agms/AgmsDashboardMapper.xml
+113
-92
No files found.
yd-api/src/main/java/com/yd/dal/service/agms/impl/AgmsDashboardDALServiceImpl.java
View file @
deaefb84
...
@@ -122,6 +122,7 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
...
@@ -122,6 +122,7 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
}
else
{
}
else
{
// 新体系
// 新体系
List
<
Map
<
String
,
Object
>>
teamMapList
=
agmsDashboardDALService
.
queryTeamAllMap
();
List
<
Map
<
String
,
Object
>>
teamMapList
=
agmsDashboardDALService
.
queryTeamAllMap
();
teamMapList
=
teamMapList
.
stream
().
filter
((
Map
<
String
,
Object
>
i
)
->
i
.
size
()==
2
).
collect
(
Collectors
.
toList
());
teamMapList
=
teamMapList
.
stream
().
filter
((
Map
<
String
,
Object
>
i
)
->
i
.
size
()==
2
).
collect
(
Collectors
.
toList
());
return
agmsDashboardMapper
.
statisticsOpportunityTeam
(
type
,
time
,
dropOptionId
,
teamMapList
);
return
agmsDashboardMapper
.
statisticsOpportunityTeam
(
type
,
time
,
dropOptionId
,
teamMapList
);
}
}
...
...
yd-api/src/main/resources/mapper/agms/AgmsDashboardMapper.xml
View file @
deaefb84
...
@@ -8,25 +8,23 @@
...
@@ -8,25 +8,23 @@
if(p.insurer_branch_id is null,0,p.insurer_branch_id) branchId,
if(p.insurer_branch_id is null,0,p.insurer_branch_id) branchId,
if(s.name is null ,'暂无团队',s.name) subordinateName,
if(s.name is null ,'暂无团队',s.name) subordinateName,
if(p.subordinate_system_id is null ,0,p.subordinate_system_id) subordinateId,
if(p.subordinate_system_id is null ,0,p.subordinate_system_id) subordinateId,
sum(case when to_days(t.track_time)=to_days(now()) then t.track_score else 0 end
) scoreDay,
ifnull(sum(case when to_days(t.track_time)=to_days(now()) then t.track_score else 0 end), 0
) scoreDay,
sum(case when YEARWEEK(date_format(t.track_time,'%Y-%m-%d')) = YEARWEEK(now()) then t.track_score else 0 end
) scoreWeek,
ifnull(sum(case when YEARWEEK(date_format(t.track_time,'%Y-%m-%d')) = YEARWEEK(now()) then t.track_score else 0 end), 0
) scoreWeek,
sum(case when date_format(t.track_time,'%Y-%m')=date_format(now(),'%Y-%m') then t.track_score else 0 end
) scoreMonth,
ifnull(sum(case when date_format(t.track_time,'%Y-%m')=date_format(now(),'%Y-%m') then t.track_score else 0 end), 0
) scoreMonth,
sum(case when QUARTER(t.track_time)=QUARTER(now()) then t.track_score else 0 end
) scoreQuarter,
ifnull(sum(case when QUARTER(t.track_time)=QUARTER(now()) and YEAR(t.track_time)=YEAR(now()) then t.track_score else 0 end), 0
) scoreQuarter,
sum(case when YEAR(t.track_time)=YEAR(now()) then t.track_score else 0 end
) scoreYear,
ifnull(sum(case when YEAR(t.track_time)=YEAR(now()) then t.track_score else 0 end), 0
) scoreYear,
sum(case when t.track_score is not null then t.track_score else 0 end
) scoreTotal
ifnull(sum(case when t.track_score is not null then t.track_score else 0 end), 0
) scoreTotal
from ag_acl_practitioner p
from ag_acl_practitioner p
left join ag_mkt_
leads_assigneds a on p.id = a.assigned_practitioner_id and a.is_active = 1
left join ag_mkt_
schedule_task_tracking t on t.practitioner_id = p.id
left join ag_mkt_leads_assigned_track t on t.leads_assigned_id = a.id
left join ag_acl_insurer_branch b on b.id = p.insurer_branch_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
left join ag_acl_practitioner_subordinate_system s on s.id = p.subordinate_system_id
left join ag_acl_practitioner_setting ps on ps.practitioner_id = p.id
left join ag_acl_practitioner_setting ps on ps.practitioner_id = p.id
where ps.practitioner_type_id = 28
where ps.practitioner_type_id = 28
and p.is_active = 1
and p.is_active = 1
and not EXISTS(
and t.md_drop_option_id not in
select tt.leads_assigned_id
(SELECT o.id FROM ag_md_drop_options o LEFT JOIN ag_md_drop_master m ON m.id = o.drop_master_id
from ag_mkt_leads_assigned_track tt
WHERE m.scenario_code = 'pep_schedule_task_others')
where tt.md_drop_option_id = #{dropOptionId,jdbcType=BIGINT}
and a.id = tt.leads_assigned_id)
<choose>
<choose>
<when
test=
"type.equalsIgnoreCase('B')"
>
<when
test=
"type.equalsIgnoreCase('B')"
>
group by p.insurer_branch_id
group by p.insurer_branch_id
...
@@ -45,25 +43,24 @@
...
@@ -45,25 +43,24 @@
if(p.insurer_branch_id is null,0,p.insurer_branch_id) branchId,
if(p.insurer_branch_id is null,0,p.insurer_branch_id) branchId,
(select name from ag_acl_practitioner_subordinate_system where id=#{item.id}) as subordinateName,
(select name from ag_acl_practitioner_subordinate_system where id=#{item.id}) as subordinateName,
#{item.id} as subordinateId,
#{item.id} as subordinateId,
sum(case when to_days(t.track_time)=to_days(now()) then t.track_score else 0 end
) scoreDay,
ifnull(sum(case when to_days(t.track_time)=to_days(now()) then t.track_score else 0 end), 0
) scoreDay,
sum(case when YEARWEEK(date_format(t.track_time,'%Y-%m-%d')) = YEARWEEK(now()) then t.track_score else 0 end
) scoreWeek,
ifnull(sum(case when YEARWEEK(date_format(t.track_time,'%Y-%m-%d')) = YEARWEEK(now()) then t.track_score else 0 end), 0
) scoreWeek,
sum(case when date_format(t.track_time,'%Y-%m')=date_format(now(),'%Y-%m') then t.track_score else 0 end
) scoreMonth,
ifnull(sum(case when date_format(t.track_time,'%Y-%m')=date_format(now(),'%Y-%m') then t.track_score else 0 end), 0
) scoreMonth,
sum(case when QUARTER(t.track_time)=QUARTER(now()) then t.track_score else 0 end
) scoreQuarter,
ifnull(sum(case when QUARTER(t.track_time)=QUARTER(now()) and YEAR(t.track_time)=YEAR(now()) then t.track_score else 0 end), 0
) scoreQuarter,
sum(case when YEAR(t.track_time)=YEAR(now()) then t.track_score else 0 end
) scoreYear,
ifnull(sum(case when YEAR(t.track_time)=YEAR(now()) then t.track_score else 0 end), 0
) scoreYear,
sum(case when t.track_score is not null then t.track_score else 0 end
) scoreTotal
ifnull(sum(case when t.track_score is not null then t.track_score else 0 end), 0
) scoreTotal
from ag_acl_practitioner p
from ag_acl_practitioner p
left join ag_mkt_
leads_assigneds a on p.id = a.assigned_practitioner_id and a.is_active = 1
left join ag_mkt_
schedule_task_tracking t on t.practitioner_id = p.id
left join ag_mkt_leads_assigned_track t on t.leads_assigned_id = a.id
left join ag_acl_insurer_branch b on b.id = p.insurer_branch_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
left join ag_acl_practitioner_subordinate_system s on s.id = p.subordinate_system_id
left join ag_acl_practitioner_setting ps on ps.practitioner_id = p.id
left join ag_acl_practitioner_setting ps on ps.practitioner_id = p.id
where ps.practitioner_type_id = 28
where ps.practitioner_type_id = 28
and p.is_active = 1
and p.is_active = 1
and not EXISTS(
-- and t.md_drop_option_id not in
select tt.leads_assigned_id
-- (SELECT o.id FROM ag_md_drop_options o LEFT JOIN ag_md_drop_master m ON m.id = o.drop_master_id
from ag_mkt_leads_assigned_track tt
-- WHERE m.scenario_code = 'pep_schedule_task_others')
where tt.md_drop_option_id = #{dropOptionId,jdbcType=BIGINT}
and a.id = tt.leads_assigned_id)
and p.id in
<foreach
collection=
"item.teamMember"
item=
"p_id"
open=
"("
separator=
","
close=
")"
>
#{p_id,jdbcType=BIGINT}
</foreach>
and p.id in
<foreach
collection=
"item.teamMember"
item=
"p_id"
open=
"("
separator=
","
close=
")"
>
#{p_id,jdbcType=BIGINT}
</foreach>
</if>
</if>
...
@@ -128,9 +125,64 @@
...
@@ -128,9 +125,64 @@
group by p.subordinate_system_id
group by p.subordinate_system_id
</when>
</when>
</choose>
</choose>
<!-- 上海营业部 -->
union all
<include
refid=
"shangHaiDept"
/>
order by predictFYC desc ,predictFYP desc ,pieces desc ,opportunityNum desc
order by predictFYC desc ,predictFYP desc ,pieces desc ,opportunityNum desc
</select>
</select>
<sql
id=
"shangHaiDept"
>
select '上海营业部' as branchName,
'' as subordinateName,
<choose>
<when
test=
"time.equalsIgnoreCase('D')"
>
ifnull(sum(case when to_days(a.created_at)=to_days(now()) then 1 else 0 end), 0) opportunityNum,
ifnull(sum(case when to_days(a.time_to_close)=to_days(now()) then a.FYP else 0 end), 0) predictFYP,
ifnull(sum(case when to_days(a.time_to_close)=to_days(now()) then a.FYC else 0 end), 0) predictFYC,
ifnull(sum(case when to_days(a.time_to_close)=to_days(now()) then a.pieces else 0 end), 0) pieces
</when>
<when
test=
"time.equalsIgnoreCase('W')"
>
ifnull(sum(case when YEARWEEK(date_format(a.created_at, '%Y-%m-%d'))=YEARWEEK(now()) then 1 else 0 end), 0) opportunityNum,
ifnull(sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.FYP else 0 end), 0) predictFYP,
ifnull(sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.FYC else 0 end), 0) predictFYC,
ifnull(sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.pieces else 0 end), 0) pieces
</when>
<when
test=
"time.equalsIgnoreCase('M')"
>
ifnull(sum(case when date_format(a.created_at, '%Y-%m') = date_format(now(), '%Y-%m') then 1 else 0 end), 0) opportunityNum,
ifnull(sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.FYP else 0 end), 0) predictFYP,
ifnull(sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.FYC else 0 end), 0) predictFYC,
ifnull(sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.pieces else 0 end), 0) pieces
</when>
<when
test=
"time.equalsIgnoreCase('Q')"
>
ifnull(sum(case when QUARTER(a.created_at)=QUARTER(now()) then 1 else 0 end), 0) opportunityNum,
ifnull(sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.FYP else 0 end), 0) predictFYP,
ifnull(sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.FYC else 0 end), 0) predictFYC,
ifnull(sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.pieces else 0 end), 0) pieces
</when>
<when
test=
"time.equalsIgnoreCase('Y')"
>
ifnull(sum(case when YEAR(a.created_at)=YEAR(now()) then 1 else 0 end), 0) opportunityNum,
ifnull(sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.FYP else 0 end), 0) predictFYP,
ifnull(sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.FYC else 0 end), 0) predictFYC,
ifnull(sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.pieces else 0 end), 0) pieces
</when>
</choose>
from ag_acl_practitioner p
left join ag_mkt_leads_assigneds a on p.id = a.assigned_practitioner_id and a.is_active = 1
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
left join ag_acl_practitioner_setting ps on ps.practitioner_id = p.id
where
ps.practitioner_type_id = 28
and p.is_active = 1
and p.dept_id = (SELECT id from ag_acl_insurer_branch_dept where insurer_id=888 and name='上海营业部')
and not EXISTS(
select tt.leads_assigned_id
from ag_mkt_leads_assigned_track tt
where tt.md_drop_option_id = #{dropOptionId,jdbcType=BIGINT}
and a.id = tt.leads_assigned_id
)
</sql>
<select
id=
"statisticsOpportunityTeam"
resultType=
"com.yd.dal.entity.agms.dashboard.StatisticsOpportunityInfo"
>
<select
id=
"statisticsOpportunityTeam"
resultType=
"com.yd.dal.entity.agms.dashboard.StatisticsOpportunityInfo"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
" union all "
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
" union all "
>
<if
test=
"item.teamMember != null"
>
<if
test=
"item.teamMember != null"
>
...
@@ -138,34 +190,34 @@
...
@@ -138,34 +190,34 @@
(select name from ag_acl_practitioner_subordinate_system where id=#{item.id}) as subordinateName,
(select name from ag_acl_practitioner_subordinate_system where id=#{item.id}) as subordinateName,
<choose>
<choose>
<when
test=
"time.equalsIgnoreCase('D')"
>
<when
test=
"time.equalsIgnoreCase('D')"
>
sum(case when to_days(a.created_at)=to_days(now()) then 1 else 0 end
) opportunityNum,
ifnull(sum(case when to_days(a.created_at)=to_days(now()) then 1 else 0 end), 0
) opportunityNum,
sum(case when to_days(a.time_to_close)=to_days(now()) then a.FYP else 0 end
) predictFYP,
ifnull(sum(case when to_days(a.time_to_close)=to_days(now()) then a.FYP else 0 end), 0
) predictFYP,
sum(case when to_days(a.time_to_close)=to_days(now()) then a.FYC else 0 end
) predictFYC,
ifnull(sum(case when to_days(a.time_to_close)=to_days(now()) then a.FYC else 0 end), 0
) predictFYC,
sum(case when to_days(a.time_to_close)=to_days(now()) then a.pieces else 0 end
) pieces
ifnull(sum(case when to_days(a.time_to_close)=to_days(now()) then a.pieces else 0 end), 0
) pieces
</when>
</when>
<when
test=
"time.equalsIgnoreCase('W')"
>
<when
test=
"time.equalsIgnoreCase('W')"
>
sum(case when YEARWEEK(date_format(a.created_at, '%Y-%m-%d'))=YEARWEEK(now()) then 1 else 0 end
) opportunityNum,
ifnull(sum(case when YEARWEEK(date_format(a.created_at, '%Y-%m-%d'))=YEARWEEK(now()) then 1 else 0 end), 0
) opportunityNum,
sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.FYP else 0 end
) predictFYP,
ifnull(sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.FYP else 0 end), 0
) predictFYP,
sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.FYC else 0 end
) predictFYC,
ifnull(sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.FYC else 0 end), 0
) predictFYC,
sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.pieces else 0 end
) pieces
ifnull(sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.pieces else 0 end), 0
) pieces
</when>
</when>
<when
test=
"time.equalsIgnoreCase('M')"
>
<when
test=
"time.equalsIgnoreCase('M')"
>
sum(case when date_format(a.created_at, '%Y-%m') = date_format(now(), '%Y-%m') then 1 else 0 end
) opportunityNum,
ifnull(sum(case when date_format(a.created_at, '%Y-%m') = date_format(now(), '%Y-%m') then 1 else 0 end), 0
) opportunityNum,
sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.FYP else 0 end
) predictFYP,
ifnull(sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.FYP else 0 end), 0
) predictFYP,
sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.FYC else 0 end
) predictFYC,
ifnull(sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.FYC else 0 end), 0
) predictFYC,
sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.pieces else 0 end
) pieces
ifnull(sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.pieces else 0 end), 0
) pieces
</when>
</when>
<when
test=
"time.equalsIgnoreCase('Q')"
>
<when
test=
"time.equalsIgnoreCase('Q')"
>
sum(case when QUARTER(a.created_at)=QUARTER(now()) then 1 else 0 end
) opportunityNum,
ifnull(sum(case when QUARTER(a.created_at)=QUARTER(now()) then 1 else 0 end), 0
) opportunityNum,
sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.FYP else 0 end
) predictFYP,
ifnull(sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.FYP else 0 end), 0
) predictFYP,
sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.FYC else 0 end
) predictFYC,
ifnull(sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.FYC else 0 end), 0
) predictFYC,
sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.pieces else 0 end
) pieces
ifnull(sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.pieces else 0 end), 0
) pieces
</when>
</when>
<when
test=
"time.equalsIgnoreCase('Y')"
>
<when
test=
"time.equalsIgnoreCase('Y')"
>
sum(case when YEAR(a.created_at)=YEAR(now()) then 1 else 0 end
) opportunityNum,
ifnull(sum(case when YEAR(a.created_at)=YEAR(now()) then 1 else 0 end), 0
) opportunityNum,
sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.FYP else 0 end
) predictFYP,
ifnull(sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.FYP else 0 end), 0
) predictFYP,
sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.FYC else 0 end
) predictFYC,
ifnull(sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.FYC else 0 end), 0
) predictFYC,
sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.pieces else 0 end
) pieces
ifnull(sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.pieces else 0 end), 0
) pieces
</when>
</when>
</choose>
</choose>
from ag_acl_practitioner p
from ag_acl_practitioner p
...
@@ -354,7 +406,6 @@
...
@@ -354,7 +406,6 @@
ib.id AS typeId,
ib.id AS typeId,
ifnull( count( p.id ), 0 ) AS amount,
ifnull( count( p.id ), 0 ) AS amount,
ifnull( a.real_count, 0 ) AS realAmount,
ifnull( a.real_count, 0 ) AS realAmount,
<include
refid=
"statisticsPractitionerHiring"
/>
AS hiringAmount,
sum(case when p.cert_list LIKE "%1%" then 1 else 0 end) AS mdrt
sum(case when p.cert_list LIKE "%1%" then 1 else 0 end) AS mdrt
FROM
FROM
ag_acl_practitioner p
ag_acl_practitioner p
...
@@ -379,26 +430,19 @@
...
@@ -379,26 +430,19 @@
</select>
</select>
<select
id=
"statisticsPractitionerTeam"
resultType=
"com.yd.api.agms.vo.dashboard.StatisticsPractitionerInfo"
>
<select
id=
"statisticsPractitionerTeam"
resultType=
"com.yd.api.agms.vo.dashboard.StatisticsPractitionerInfo"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
" union all "
>
SELECT
<if
test=
"item.teamMember != null"
>
p.subordinate_system_id as typeId,
SELECT
(select name from ag_acl_practitioner_subordinate_system where id=p.subordinate_system_id) as typeName,
#{item.id} as typeId,
ifnull(count( p.id ), 0 ) AS amount,
(select name from ag_acl_practitioner_subordinate_system where id=#{item.id}) as typeName,
ifnull( count( p.id ), 0 ) AS amount,
<include
refid=
"realAmount"
/>
AS realAmount,
<include
refid=
"statisticsPractitionerHiring"
/>
AS hiringAmount,
sum(case when p.cert_list LIKE "%1%" then 1 else 0 end) AS mdrt
FROM
ag_acl_practitioner p
left join ag_acl_practitioner_hiring_approve_records hr on hr.hiring_basic_info_id=p.hiring_basic_info_id
and hr.approve_step_id=5 and hr.approving_status=1
WHERE 1=1
and p.id in
<foreach
collection=
"item.teamMember"
item=
"p_id"
open=
"("
separator=
","
close=
")"
>
#{p_id,jdbcType=BIGINT}
</foreach>
and p.is_active = 1
</if>
</foreach>
<include
refid=
"realAmount"
/>
AS realAmount,
sum(case when p.cert_list LIKE "%1%" then 1 else 0 end) AS mdrt
FROM ag_acl_practitioner p
WHERE 1=1
and p.is_active = 1
and p.subordinate_system_id is not null
GROUP BY p.subordinate_system_id
ORDER BY amount DESC
</select>
</select>
<sql
id=
"realAmount"
>
<sql
id=
"realAmount"
>
...
@@ -407,10 +451,10 @@
...
@@ -407,10 +451,10 @@
FROM
FROM
ag_acl_customer_fortune f
ag_acl_customer_fortune f
left JOIN ag_po_order o ON f.order_id = o.id and o.STATUS = 3 AND o.payment_status = 3
left JOIN ag_po_order o ON f.order_id = o.id and o.STATUS = 3 AND o.payment_status = 3
left JOIN ag_acl_practitioner p
ON p
.id = f.sale_practitioner_id
left JOIN ag_acl_practitioner p
2 ON p2
.id = f.sale_practitioner_id
WHERE 1=1
WHERE 1=1
and p
.id in
<foreach
collection=
"item.teamMember"
item=
"p_id"
open=
"("
separator=
","
close=
")"
>
#{p_id,jdbcType=BIGINT}
</foreach>
and p
2.subordinate_system_id = p.subordinate_system_id
and p.is_active = 1
and p
2
.is_active = 1
<choose>
<choose>
<when
test=
"time.equalsIgnoreCase('D')"
>
<when
test=
"time.equalsIgnoreCase('D')"
>
and TO_DAYS(o.underwriting_date) = TO_DAYS(now())
and TO_DAYS(o.underwriting_date) = TO_DAYS(now())
...
@@ -431,29 +475,6 @@
...
@@ -431,29 +475,6 @@
)
)
</sql>
</sql>
<sql
id=
"statisticsPractitionerHiring"
>
sum(case
when
<choose>
<when
test=
"time.equalsIgnoreCase('D')"
>
TO_DAYS(hr.created_at) = TO_DAYS(now())
</when>
<when
test=
"time.equalsIgnoreCase('W')"
>
YEARWEEK(DATE_FORMAT(hr.created_at,'%Y-%m-%d')) = YEARWEEK(NOW())
</when>
<when
test=
"time.equalsIgnoreCase('M')"
>
DATE_FORMAT(hr.created_at, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when
test=
"time.equalsIgnoreCase('Q')"
>
QUARTER(hr.created_at) = QUARTER(NOW()) AND year(hr.created_at)=year(now())
</when>
<otherwise>
YEAR(hr.created_at) = YEAR(now())
</otherwise>
</choose>
then 1 else 0 end)
</sql>
<select
id=
"statisticsSalesEG"
resultType=
"com.yd.api.agms.vo.dashboard.StatisticsSalesInfo"
>
<select
id=
"statisticsSalesEG"
resultType=
"com.yd.api.agms.vo.dashboard.StatisticsSalesInfo"
>
select
select
<choose>
<choose>
...
...
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