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
16393a09
Commit
16393a09
authored
Mar 31, 2022
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard-12fengongsi
parent
af5cda54
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
148 additions
and
4 deletions
+148
-4
yd-api/src/main/java/com/yd/dal/mapper/agms/AgmsDashboardMapper.java
+7
-0
yd-api/src/main/java/com/yd/dal/service/agms/AgmsDashboardDALService.java
+3
-0
yd-api/src/main/java/com/yd/dal/service/agms/impl/AgmsDashboardDALServiceImpl.java
+20
-2
yd-api/src/main/resources/mapper/agms/AgmsDashboardMapper.xml
+118
-2
No files found.
yd-api/src/main/java/com/yd/dal/mapper/agms/AgmsDashboardMapper.java
View file @
16393a09
...
@@ -25,4 +25,11 @@ public interface AgmsDashboardMapper {
...
@@ -25,4 +25,11 @@ public interface AgmsDashboardMapper {
List
<
StatisticsSalesInfo
>
statisticsSalesEG
(
@Param
(
"type"
)
String
type
,
@Param
(
"time"
)
String
time
);
List
<
StatisticsSalesInfo
>
statisticsSalesEG
(
@Param
(
"type"
)
String
type
,
@Param
(
"time"
)
String
time
);
List
<
PersonalOffLineFYC
>
personalOffLineFYC
(
List
<
String
>
mobileNoList
);
List
<
PersonalOffLineFYC
>
personalOffLineFYC
(
List
<
String
>
mobileNoList
);
List
<
Map
<
String
,
String
>>
queryTeamAllMap
();
List
<
StatisticsSalesInfo
>
statisticsSalesTeam
(
@Param
(
"category"
)
String
category
,
@Param
(
"time"
)
String
time
,
@Param
(
"list"
)
List
<
Map
<
String
,
String
>>
teamMapList
);
List
<
StatisticsPractitionerInfo
>
statisticsPractitionerTeam
(
@Param
(
"time"
)
String
time
,
@Param
(
"list"
)
List
<
Map
<
String
,
String
>>
teamMapList
);
}
}
yd-api/src/main/java/com/yd/dal/service/agms/AgmsDashboardDALService.java
View file @
16393a09
...
@@ -8,6 +8,7 @@ import com.yd.dal.entity.practitioner.PersonalOffLineFYC;
...
@@ -8,6 +8,7 @@ import com.yd.dal.entity.practitioner.PersonalOffLineFYC;
import
com.yd.rmi.n22.salary.pojo.Achieve
;
import
com.yd.rmi.n22.salary.pojo.Achieve
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
interface
AgmsDashboardDALService
{
public
interface
AgmsDashboardDALService
{
List
<
StatisticsPEPInfo
>
statisticsPEP
(
String
type
,
Long
dropOptionId
);
List
<
StatisticsPEPInfo
>
statisticsPEP
(
String
type
,
Long
dropOptionId
);
...
@@ -32,4 +33,6 @@ public interface AgmsDashboardDALService {
...
@@ -32,4 +33,6 @@ public interface AgmsDashboardDALService {
* @return
* @return
*/
*/
List
<
Achieve
>
queryN22FYC
(
Integer
time
,
Integer
isPersonal
,
String
loginName
);
List
<
Achieve
>
queryN22FYC
(
Integer
time
,
Integer
isPersonal
,
String
loginName
);
List
<
Map
<
String
,
String
>>
queryTeamAllMap
();
}
}
yd-api/src/main/java/com/yd/dal/service/agms/impl/AgmsDashboardDALServiceImpl.java
View file @
16393a09
...
@@ -100,7 +100,14 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
...
@@ -100,7 +100,14 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
@Override
@Override
public
List
<
StatisticsSalesInfo
>
statisticsSalesYD
(
String
category
,
String
type
,
String
time
)
{
public
List
<
StatisticsSalesInfo
>
statisticsSalesYD
(
String
category
,
String
type
,
String
time
)
{
List
<
StatisticsSalesInfo
>
statisticsSalesInfos
=
agmsDashboardMapper
.
statisticsSalesYD
(
category
,
type
,
time
);
List
<
StatisticsSalesInfo
>
statisticsSalesInfos
=
null
;
if
(
"b"
.
equalsIgnoreCase
(
type
))
{
statisticsSalesInfos
=
agmsDashboardMapper
.
statisticsSalesYD
(
category
,
type
,
time
);
}
else
{
List
<
Map
<
String
,
String
>>
teamMapList
=
this
.
queryTeamAllMap
();
System
.
out
.
println
(
teamMapList
);
statisticsSalesInfos
=
agmsDashboardMapper
.
statisticsSalesTeam
(
category
,
time
,
teamMapList
);
}
getUnitPremium
(
statisticsSalesInfos
);
getUnitPremium
(
statisticsSalesInfos
);
return
statisticsSalesInfos
;
return
statisticsSalesInfos
;
}
}
...
@@ -159,8 +166,19 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
...
@@ -159,8 +166,19 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
}
}
@Override
@Override
public
List
<
Map
<
String
,
String
>>
queryTeamAllMap
()
{
return
agmsDashboardMapper
.
queryTeamAllMap
();
}
@Override
public
List
<
StatisticsPractitionerInfo
>
statisticsPractitioner
(
String
type
,
String
time
)
{
public
List
<
StatisticsPractitionerInfo
>
statisticsPractitioner
(
String
type
,
String
time
)
{
List
<
StatisticsPractitionerInfo
>
statisticsPractitionerInfos
=
agmsDashboardMapper
.
statisticsPractitioner
(
type
,
time
);
List
<
StatisticsPractitionerInfo
>
statisticsPractitionerInfos
=
null
;
if
(
"b"
.
equalsIgnoreCase
(
type
))
{
statisticsPractitionerInfos
=
agmsDashboardMapper
.
statisticsPractitioner
(
type
,
time
);
}
else
{
List
<
Map
<
String
,
String
>>
teamMapList
=
this
.
queryTeamAllMap
();
statisticsPractitionerInfos
=
agmsDashboardMapper
.
statisticsPractitionerTeam
(
time
,
teamMapList
);
}
//计算实动率
//计算实动率
if
(
statisticsPractitionerInfos
!=
null
&&
statisticsPractitionerInfos
.
size
()
>
0
){
if
(
statisticsPractitionerInfos
!=
null
&&
statisticsPractitionerInfos
.
size
()
>
0
){
Integer
realAmount
,
amount
;
Integer
realAmount
,
amount
;
...
...
yd-api/src/main/resources/mapper/agms/AgmsDashboardMapper.xml
View file @
16393a09
...
@@ -146,7 +146,7 @@
...
@@ -146,7 +146,7 @@
</otherwise>
</otherwise>
</choose>
</choose>
concat(ifnull(sum(o.order_price),0),'') as fyp,
concat(ifnull(sum(o.order_price),0),'') as fyp,
concat(ifnull(sum(o.
commission
_amount),0),'') as fyc,
concat(ifnull(sum(o.
fyc
_amount),0),'') as fyc,
ifnull(count(o.id),0) as pieces
ifnull(count(o.id),0) as pieces
from ag_acl_practitioner p
from ag_acl_practitioner p
inner join ag_po_order o on o.broker_customer_id = p.customer_id
inner join ag_po_order o on o.broker_customer_id = p.customer_id
...
@@ -180,7 +180,6 @@
...
@@ -180,7 +180,6 @@
</choose>
</choose>
<choose>
<choose>
<when
test=
"type.equalsIgnoreCase('B')"
>
<when
test=
"type.equalsIgnoreCase('B')"
>
and p.insurer_branch_id is not null
group by p.insurer_branch_id
group by p.insurer_branch_id
</when>
</when>
<otherwise>
<otherwise>
...
@@ -191,6 +190,57 @@
...
@@ -191,6 +190,57 @@
order by 4 desc
order by 4 desc
</select>
</select>
<select
id=
"statisticsSalesTeam"
resultType=
"com.yd.api.agms.vo.dashboard.StatisticsSalesInfo"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
" union all "
>
<if
test=
"item.teamMember != null"
>
select
s.name as typeName,
s.id as typeId,
(SELECT drop_option_code
from ag_acl_practitioner_setting b
LEFT JOIN ag_md_drop_options op1 ON op1.id = b.practitioner_level
where b.practitioner_id = p.id
) as level,
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_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
and p.id in (#{item.teamMember})
<choose>
<when
test=
"category.equalsIgnoreCase('life')"
>
and o.product_category_id in (2,5,8)
</when>
<when
test=
"category.equalsIgnoreCase('pc')"
>
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
</select>
<select
id=
"statisticsPractitioner"
resultType=
"com.yd.api.agms.vo.dashboard.StatisticsPractitionerInfo"
>
<select
id=
"statisticsPractitioner"
resultType=
"com.yd.api.agms.vo.dashboard.StatisticsPractitionerInfo"
>
<choose>
<choose>
...
@@ -253,6 +303,57 @@
...
@@ -253,6 +303,57 @@
</choose>
</choose>
</select>
</select>
<select
id=
"statisticsPractitionerTeam"
resultType=
"com.yd.api.agms.vo.dashboard.StatisticsPractitionerInfo"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
" union all "
>
<if
test=
"item.teamMember != null"
>
SELECT
#{item.id} as typeId,
(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 (#{item.teamMember})
and p.is_active = 1
</if>
</foreach>
ORDER BY amount DESC
</select>
<sql
id=
"realAmount"
>
(SELECT
count( DISTINCT o.broker_customer_id )
FROM
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_acl_practitioner p ON o.broker_customer_id = p.customer_id
WHERE 1=1
<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>
)
</sql>
<sql
id=
"statisticsPractitionerS2"
>
<sql
id=
"statisticsPractitionerS2"
>
SELECT
SELECT
s.id as typeId,
s.id as typeId,
...
@@ -395,4 +496,18 @@
...
@@ -395,4 +496,18 @@
group by sales.SAL_MST_MOBILE
group by sales.SAL_MST_MOBILE
</select>
</select>
<select
id=
"queryTeamAllMap"
resultType=
"MAP"
>
select s.id,
(select group_concat(p.id)
from ag_acl_practitioner p
LEFT JOIN ag_acl_practitioner_subordinate_system ps ON p.s2_id = ps.id or p.subordinate_system_id = ps.id or p.s3_id = ps.id
WHERE ps.id = s.id
and p.is_active=1
) as 'teamMember'
from ag_acl_practitioner_subordinate_system s
WHERE s.is_active=1
</select>
</mapper>
</mapper>
\ No newline at end of file
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