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
f6ca4412
Commit
f6ca4412
authored
Jun 10, 2020
by
Water Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize-- rank complete rate
parent
8037d5fe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
187 additions
and
33 deletions
+187
-33
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
+71
-28
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerMapper.java
+5
-0
yd-api/src/main/java/com/yd/dal/mapper/marketing/MktLeadsGoalsMapper.java
+3
-0
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerDALService.java
+16
-0
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclPractitionerDALServiceImpl.java
+11
-0
yd-api/src/main/java/com/yd/dal/service/marketing/Impl/MktLeadsGoalsDALServiceImpl.java
+5
-0
yd-api/src/main/java/com/yd/dal/service/marketing/MktLeadsGoalsDALService.java
+2
-0
yd-api/src/main/resources/mapper/customer/AclPractitionerMapper.xml
+63
-4
yd-api/src/main/resources/mapper/marketing/MktLeadsGoalsMapper.xml
+10
-0
yd-api/src/main/resources/mapper/order/PoOrderMapper.xml
+1
-1
No files found.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
View file @
f6ca4412
This diff is collapsed.
Click to expand it.
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerMapper.java
View file @
f6ca4412
...
@@ -50,4 +50,8 @@ public interface AclPractitionerMapper {
...
@@ -50,4 +50,8 @@ public interface AclPractitionerMapper {
String
findMobileNoByPractitionerId
(
@Param
(
"practitionerId"
)
Long
practitionerId
);
String
findMobileNoByPractitionerId
(
@Param
(
"practitionerId"
)
Long
practitionerId
);
PractitionerBasicInfo
findByMobileNoE
(
@Param
(
"mobileNo"
)
String
mobileNo
);
PractitionerBasicInfo
findByMobileNoE
(
@Param
(
"mobileNo"
)
String
mobileNo
);
PractitionerRankInfo
getPractitionerRankInfoByPractitionerIdEG
(
@Param
(
"practitionerIdEG"
)
String
practitionerIdEG
,
@Param
(
"time"
)
Integer
time
);
PractitionerRankInfo
getPractitionerRankInfoByPractitionerIdYD
(
@Param
(
"practitionerId"
)
Long
practitionerId
,
@Param
(
"time"
)
Integer
time
);
}
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/mapper/marketing/MktLeadsGoalsMapper.java
View file @
f6ca4412
...
@@ -25,4 +25,6 @@ public interface MktLeadsGoalsMapper {
...
@@ -25,4 +25,6 @@ public interface MktLeadsGoalsMapper {
List
<
MktLeadsGoals
>
selectByPractitionerIds
(
@Param
(
"practitionerIds"
)
List
<
Long
>
practitionerIds
,
@Param
(
"year"
)
Integer
year
);
List
<
MktLeadsGoals
>
selectByPractitionerIds
(
@Param
(
"practitionerIds"
)
List
<
Long
>
practitionerIds
,
@Param
(
"year"
)
Integer
year
);
List
<
MktLeadsGoals
>
findByTypeAndTimeUnitAndSubordinateSystemId
(
@Param
(
"goalsType"
)
Integer
goalsType
,
@Param
(
"statisticTimeUnit"
)
Integer
statisticTimeUnit
,
@Param
(
"subordinateSystemId"
)
Long
subordinateSystemId
);
List
<
MktLeadsGoals
>
findByTypeAndTimeUnitAndSubordinateSystemId
(
@Param
(
"goalsType"
)
Integer
goalsType
,
@Param
(
"statisticTimeUnit"
)
Integer
statisticTimeUnit
,
@Param
(
"subordinateSystemId"
)
Long
subordinateSystemId
);
List
<
MktLeadsGoals
>
findByTypeAndTimeUnitAndPractitionerId
(
@Param
(
"goalsType"
)
Integer
goalsType
,
@Param
(
"statisticTimeUnit"
)
Integer
statisticTimeUnit
,
@Param
(
"practitionerId"
)
Long
practitionerId
);
}
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerDALService.java
View file @
f6ca4412
...
@@ -123,4 +123,20 @@ public interface AclPractitionerDALService {
...
@@ -123,4 +123,20 @@ public interface AclPractitionerDALService {
* @return 查询结果
* @return 查询结果
*/
*/
AclPractitioner
findById
(
Long
practitionerId
);
AclPractitioner
findById
(
Long
practitionerId
);
/**
* EGolden -- 根据practitionerId和时间段查询
* @param practitionerIdEG 经纪人id
* @param time 时间
* @return 返回结果
*/
PractitionerRankInfo
getPractitionerRankInfoByPractitionerIdEG
(
String
practitionerIdEG
,
Integer
time
);
/**
* YD -- 根据practitionerId和时间段查询
* @param practitionerId 经纪人id
* @param time 时间
* @return 返回结果
*/
PractitionerRankInfo
getPractitionerRankInfoByPractitionerIdYD
(
Long
practitionerId
,
Integer
time
);
}
}
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclPractitionerDALServiceImpl.java
View file @
f6ca4412
...
@@ -124,4 +124,15 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
...
@@ -124,4 +124,15 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
public
AclPractitioner
findById
(
Long
practitionerId
)
{
public
AclPractitioner
findById
(
Long
practitionerId
)
{
return
aclPractitionerMapper
.
selectByPrimaryKey
(
practitionerId
);
return
aclPractitionerMapper
.
selectByPrimaryKey
(
practitionerId
);
}
}
@Override
@TargetDataSource
(
dataSourceKey
=
DataSourceKey
.
DB_EGOLDEN
)
public
PractitionerRankInfo
getPractitionerRankInfoByPractitionerIdEG
(
String
practitionerIdEG
,
Integer
time
)
{
return
aclPractitionerMapper
.
getPractitionerRankInfoByPractitionerIdEG
(
practitionerIdEG
,
time
);
}
@Override
public
PractitionerRankInfo
getPractitionerRankInfoByPractitionerIdYD
(
Long
practitionerId
,
Integer
time
)
{
return
aclPractitionerMapper
.
getPractitionerRankInfoByPractitionerIdYD
(
practitionerId
,
time
);
}
}
}
yd-api/src/main/java/com/yd/dal/service/marketing/Impl/MktLeadsGoalsDALServiceImpl.java
View file @
f6ca4412
...
@@ -37,4 +37,9 @@ public class MktLeadsGoalsDALServiceImpl implements MktLeadsGoalsDALService {
...
@@ -37,4 +37,9 @@ public class MktLeadsGoalsDALServiceImpl implements MktLeadsGoalsDALService {
public
List
<
MktLeadsGoals
>
findByTypeAndTimeUnitAndSubordinateSystemId
(
Integer
goalsType
,
Integer
statisticTimeUnit
,
Long
subordinateSystemId
)
{
public
List
<
MktLeadsGoals
>
findByTypeAndTimeUnitAndSubordinateSystemId
(
Integer
goalsType
,
Integer
statisticTimeUnit
,
Long
subordinateSystemId
)
{
return
mktLeadsGoalsMapper
.
findByTypeAndTimeUnitAndSubordinateSystemId
(
goalsType
,
statisticTimeUnit
,
subordinateSystemId
);
return
mktLeadsGoalsMapper
.
findByTypeAndTimeUnitAndSubordinateSystemId
(
goalsType
,
statisticTimeUnit
,
subordinateSystemId
);
}
}
@Override
public
List
<
MktLeadsGoals
>
findByTypeAndTimeUnitAndPractitionerId
(
Integer
goalsType
,
Integer
statisticTimeUnit
,
Long
practitionerId
)
{
return
mktLeadsGoalsMapper
.
findByTypeAndTimeUnitAndPractitionerId
(
goalsType
,
statisticTimeUnit
,
practitionerId
);
}
}
}
yd-api/src/main/java/com/yd/dal/service/marketing/MktLeadsGoalsDALService.java
View file @
f6ca4412
...
@@ -15,4 +15,6 @@ public interface MktLeadsGoalsDALService {
...
@@ -15,4 +15,6 @@ public interface MktLeadsGoalsDALService {
List
<
MktLeadsGoals
>
selectByPractitionerIds
(
List
<
Long
>
practitionerIds
,
int
year
);
List
<
MktLeadsGoals
>
selectByPractitionerIds
(
List
<
Long
>
practitionerIds
,
int
year
);
List
<
MktLeadsGoals
>
findByTypeAndTimeUnitAndSubordinateSystemId
(
Integer
goalsType
,
Integer
statisticTimeUnit
,
Long
subordinateSystemId
);
List
<
MktLeadsGoals
>
findByTypeAndTimeUnitAndSubordinateSystemId
(
Integer
goalsType
,
Integer
statisticTimeUnit
,
Long
subordinateSystemId
);
List
<
MktLeadsGoals
>
findByTypeAndTimeUnitAndPractitionerId
(
Integer
goalsType
,
Integer
statisticTimeUnit
,
Long
practitionerId
);
}
}
yd-api/src/main/resources/mapper/customer/AclPractitionerMapper.xml
View file @
f6ca4412
...
@@ -610,11 +610,11 @@
...
@@ -610,11 +610,11 @@
ifnull(count(f.id),0) as count,-- 保单id
ifnull(count(f.id),0) as count,-- 保单id
ifnull(sum(f.order_price),0) as fyp,-- 保费
ifnull(sum(f.order_price),0) as fyp,-- 保费
ifnull(sum(f.fyc_amount),0) as fyc -- 应发佣金
ifnull(sum(f.fyc_amount),0) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
and o.order_price > 0
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3
and o.order_price > 0
WHERE o.status = 3
<if
test=
"practitionerTypeId != null"
>
<if
test=
"practitionerTypeId != null"
>
and s.practitioner_type_id = #{practitionerTypeId}
and s.practitioner_type_id = #{practitionerTypeId}
</if>
</if>
...
@@ -642,11 +642,11 @@
...
@@ -642,11 +642,11 @@
ifnull(count(f.id),0) as count,-- 保单id
ifnull(count(f.id),0) as count,-- 保单id
ifnull(sum(f.order_price),0) as fyp,-- 保费
ifnull(sum(f.order_price),0) as fyp,-- 保费
ifnull(sum(f.fyc_amount),0) as fyc -- 应发佣金
ifnull(sum(f.fyc_amount),0) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
and o.order_price > 0
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_customer c on p.customer_id = c.id
left join ag_acl_customer c on p.customer_id = c.id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3
and o.order_price > 0
WHERE o.status = 3
and c.login in
and c.login in
<foreach
collection=
"mobileSpecials"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"mobileSpecials"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
#{item}
...
@@ -812,4 +812,62 @@
...
@@ -812,4 +812,62 @@
FROM sal001 p
FROM sal001 p
where p.SAL_MST_MOBILE like concat(concat('%',#{mobileNo,jdbcType=VARCHAR}),'%')
where p.SAL_MST_MOBILE like concat(concat('%',#{mobileNo,jdbcType=VARCHAR}),'%')
</select>
</select>
<select
id=
"getPractitionerRankInfoByPractitionerIdEG"
resultType=
"com.yd.dal.entity.customer.practitioner.PractitionerRankInfo"
>
SELECT
p.SAL_MST_ID as practitionerId ,
p.SAL_MST_NAME as name ,-- 姓名
p.SAL_MST_ID_TYPE as titleCode,-- 职称code
p.SAL_MST_OFFICIAL_TITLE as titleName,-- 职称名称
spc.SPC_DIV_NAME as spcDivName,-- 体系id
ifnull(count(distinct policy.INS_MST_ID),0) as count,-- 保单id
ifnull(sum(policy.INS_MST_TOTAL_PREIUM),0) as fyp,-- 保费
ifnull(sum(policy.INS001_FYCTOTAL),0) as fyc -- 应发佣金
FROM
ins001 policy INNER JOIN mon025 m on policy.INS_MST_ID = m.MON025_002 and m.MON025_109 IN (1,2,3) AND m.MON025_303 = 1 AND m.mon025_108 = 'S01'
INNER JOIN (
SELECT mon025_002,MAX(MON025_405) as MON025_405 FROM mon025 group by mon025_002 ORDER BY mon025_002
) b on m.mon025_002 = b.mon025_002 AND m.MON025_405 = b.MON025_405
INNER JOIN sal001 p on m.MON025_007 = p.SAL_MST_ID -- 业务员id
inner join spc004 spc on m.MON025_006 = spc.SPC_DIV_ID -- 体系
where p.SAL_MST_ID = #{practitionerIdEG,jdbcType=VARCHAR}
<choose>
<when
test=
"time == 1"
>
and DATE_FORMAT(policy.INS_MST_ACCEPT_DATE, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when
test=
"time == 3"
>
and QUARTER(policy.INS_MST_ACCEPT_DATE) = QUARTER(NOW()) AND year(policy.INS_MST_ACCEPT_DATE)=year(now())
</when>
<otherwise>
and YEAR(policy.INS_MST_ACCEPT_DATE) = YEAR(now())
</otherwise>
</choose>
</select>
<select
id=
"getPractitionerRankInfoByPractitionerIdYD"
resultType=
"com.yd.dal.entity.customer.practitioner.PractitionerRankInfo"
>
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
ifnull(count(f.id),0) as count,-- 保单id
ifnull(sum(f.order_price),0) as fyp,-- 保费
ifnull(sum(f.fyc_amount),0) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id and o.status = 3 and o.order_price > 0
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE p.id = #{practitionerId,jdbcType=BIGINT}
<choose>
<when
test=
"time == 1"
>
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when
test=
"time == 3"
>
and QUARTER(f.order_date) = QUARTER(NOW()) AND year(f.order_date)=year(now())
</when>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
</select>
</mapper>
</mapper>
\ No newline at end of file
yd-api/src/main/resources/mapper/marketing/MktLeadsGoalsMapper.xml
View file @
f6ca4412
...
@@ -327,4 +327,13 @@
...
@@ -327,4 +327,13 @@
and subordinate_system_id = #{subordinateSystemId,jdbcType=BIGINT}
and subordinate_system_id = #{subordinateSystemId,jdbcType=BIGINT}
and is_active = 1
and is_active = 1
</select>
</select>
<select
id=
"findByTypeAndTimeUnitAndPractitionerId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_mkt_leads_goals
where goals_type = #{goalsType,jdbcType=INTEGER}
and statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER}
and practitioner_id = #{practitionerId,jdbcType=BIGINT}
and is_active = 1
</select>
</mapper>
</mapper>
\ No newline at end of file
yd-api/src/main/resources/mapper/order/PoOrderMapper.xml
View file @
f6ca4412
...
@@ -990,7 +990,7 @@
...
@@ -990,7 +990,7 @@
f.order_price as orderPrice,
f.order_price as orderPrice,
o.plan_id as planId,
o.plan_id as planId,
o.product_id as productId
o.product_id as productId
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id and o.status = 3 and o.order_price > 0
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id and o.status = 3 and o.order_price > 0
and o.insurer_id != 888
inner JOIN ag_acl_policyholder p ON o.id = p.order_id and p.type = 2
inner JOIN ag_acl_policyholder p ON o.id = p.order_id and p.type = 2
WHERE f.customer_id = #{customerId,jdbcType=BIGINT}
WHERE f.customer_id = #{customerId,jdbcType=BIGINT}
<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