Commit 30a4fdcb by wenyang

龙虎榜与经纪人首页销售统计数据,以前是通过N22接口获取,现在通过本地获取

parent 022fb960
...@@ -10,6 +10,7 @@ public class PractitionerBasicInfo { ...@@ -10,6 +10,7 @@ public class PractitionerBasicInfo {
private String gender; private String gender;
private String mobileNo; private String mobileNo;
private Long practitionerTypeId; private Long practitionerTypeId;
private String spcDivName;
public Long getCustomerId() { public Long getCustomerId() {
return customerId; return customerId;
...@@ -82,4 +83,13 @@ public class PractitionerBasicInfo { ...@@ -82,4 +83,13 @@ public class PractitionerBasicInfo {
public void setPractitionerTypeId(Long practitionerTypeId) { public void setPractitionerTypeId(Long practitionerTypeId) {
this.practitionerTypeId = practitionerTypeId; this.practitionerTypeId = practitionerTypeId;
} }
public String getSpcDivName() {
return spcDivName;
}
public void setSpcDivName(String spcDivName) {
this.spcDivName = spcDivName;
}
} }
...@@ -29,9 +29,16 @@ public interface AclPractitionerMapper { ...@@ -29,9 +29,16 @@ public interface AclPractitionerMapper {
PractitionerBasicInfo getPractitionerInfoByMobileNoForOnline(String mobileNo); PractitionerBasicInfo getPractitionerInfoByMobileNoForOnline(String mobileNo);
List<PractitionerRankInfo> getPractitionerRankInfoForOnline(@Param("time") Integer time, @Param("practitionerTypeId") Long practitionerTypeId); List<PractitionerRankInfo> getPractitionerRankInfoForOnline(@Param("time") Integer time, @Param("practitionerTypeId") Long practitionerTypeId,@Param("platform") Integer platform,@Param("type") Integer type,@Param("mobileSpecials") List<String> mobileSpecials);
List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(@Param("mobileSpecials") List<String> mobileSpecials, @Param("time") Integer time); /**
* 查询经纪人的个人统计信息
* @param time 1-month,2-year
* @return
*/
List<PractitionerRankInfo> getPractitionerRankInfo(@Param("time") Integer time, @Param("practitionerTypeId") Long practitionerTypeId,@Param("platform") Integer platform,@Param("type") Integer type,@Param("practitionerId") Integer practitionerId);
List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(@Param("mobileSpecials") List<String> mobileSpecials, @Param("time") Integer time, @Param("platform") Integer platform);
PractitionerInfo findPractitionerInfoByLogin(@Param("mobileNo") String mobileNo); PractitionerInfo findPractitionerInfoByLogin(@Param("mobileNo") String mobileNo);
...@@ -53,7 +60,7 @@ public interface AclPractitionerMapper { ...@@ -53,7 +60,7 @@ public interface AclPractitionerMapper {
PractitionerRankInfo getPractitionerRankInfoByPractitionerIdEG(@Param("practitionerIdEG") String practitionerIdEG, @Param("time") Integer time); PractitionerRankInfo getPractitionerRankInfoByPractitionerIdEG(@Param("practitionerIdEG") String practitionerIdEG, @Param("time") Integer time);
PractitionerRankInfo getPractitionerRankInfoByPractitionerIdYD(@Param("practitionerId") Long practitionerId, @Param("time") Integer time); PractitionerRankInfo getPractitionerRankInfoByPractitionerIdYD(@Param("practitionerId") Long practitionerId, @Param("time") Integer time, @Param("platform") Integer platform);
List<PayScaleInfo> findPayScaleByPractitionerEG(@Param("practitionerIdEG") String practitionerIdEG); List<PayScaleInfo> findPayScaleByPractitionerEG(@Param("practitionerIdEG") String practitionerIdEG);
......
...@@ -49,14 +49,21 @@ public interface AclPractitionerDALService { ...@@ -49,14 +49,21 @@ public interface AclPractitionerDALService {
* @param time 1-month,2-year * @param time 1-month,2-year
* @return * @return
*/ */
List<PractitionerRankInfo> getPractitionerRankInfoForOnline(Integer time,Long practitionerTypeId); List<PractitionerRankInfo> getPractitionerRankInfoForOnline(Integer time,Long practitionerTypeId,Integer platform,Integer type,List<String> mobileSpecials);
/**
* 查询经纪人个人的统计信息
* @param time 1-month,2-year
* @return
*/
List<PractitionerRankInfo> getPractitionerRankInfo(Integer time,Long practitionerTypeId,Integer platform,Integer type,Integer practitionerId);
/** /**
* 线上--按照时间进行查询特殊人员的排名统计信息 * 线上--按照时间进行查询特殊人员的排名统计信息
* @param mobileSpecials * @param mobileSpecials
* @return * @return
*/ */
List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(List<String> mobileSpecials,Integer time); List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(List<String> mobileSpecials,Integer time,Integer platform);
/** /**
* 经纪人基本信息查询 * 经纪人基本信息查询
...@@ -149,7 +156,7 @@ public interface AclPractitionerDALService { ...@@ -149,7 +156,7 @@ public interface AclPractitionerDALService {
* @param time 时间 * @param time 时间
* @return 返回结果 * @return 返回结果
*/ */
PractitionerRankInfo getPractitionerRankInfoByPractitionerIdYD(Long practitionerId, Integer time); PractitionerRankInfo getPractitionerRankInfoByPractitionerIdYD(Long practitionerId, Integer time,Integer platform);
/** /**
* eGolden -- 根据经纪人id获取薪资表列表 * eGolden -- 根据经纪人id获取薪资表列表
......
...@@ -83,13 +83,23 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService ...@@ -83,13 +83,23 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
} }
@Override @Override
public List<PractitionerRankInfo> getPractitionerRankInfoForOnline(Integer time,Long practitionerTypeId) { public List<PractitionerRankInfo> getPractitionerRankInfoForOnline(Integer time,Long practitionerTypeId,Integer platform,Integer type,List<String> mobileSpecials) {
return aclPractitionerMapper.getPractitionerRankInfoForOnline(time,practitionerTypeId); return aclPractitionerMapper.getPractitionerRankInfoForOnline(time,practitionerTypeId,platform,type,mobileSpecials);
} }
/**
* 查询经纪人的个人统计信息
* @param time 1-month,2-year
* @return
*/
@Override @Override
public List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(List<String> mobileSpecials,Integer time) { public List<PractitionerRankInfo> getPractitionerRankInfo(Integer time,Long practitionerTypeId,Integer platform,Integer type,Integer practitionerId) {
return aclPractitionerMapper.getPractitionerRankInfoForSpecials(mobileSpecials,time); return aclPractitionerMapper.getPractitionerRankInfo(time,practitionerTypeId,platform,type,practitionerId);
}
@Override
public List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(List<String> mobileSpecials,Integer time,Integer platform) {
return aclPractitionerMapper.getPractitionerRankInfoForSpecials(mobileSpecials,time,platform);
} }
@Override @Override
...@@ -165,8 +175,8 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService ...@@ -165,8 +175,8 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
} }
@Override @Override
public PractitionerRankInfo getPractitionerRankInfoByPractitionerIdYD(Long practitionerId, Integer time) { public PractitionerRankInfo getPractitionerRankInfoByPractitionerIdYD(Long practitionerId, Integer time, Integer platform) {
return aclPractitionerMapper.getPractitionerRankInfoByPractitionerIdYD(practitionerId,time); return aclPractitionerMapper.getPractitionerRankInfoByPractitionerIdYD(practitionerId,time, platform);
} }
@Override @Override
......
...@@ -1168,6 +1168,7 @@ ...@@ -1168,6 +1168,7 @@
<!-- &lt;result column="mobile_no" property="titleCode" typeHandler="com.yd.util.deshandler.DESTypeHandler"/&gt;--> <!-- &lt;result column="mobile_no" property="titleCode" typeHandler="com.yd.util.deshandler.DESTypeHandler"/&gt;-->
<result column="titleName" property="titleName" /> <result column="titleName" property="titleName" />
<result column="gender" property="gender" /> <result column="gender" property="gender" />
<result column="spcDivName" property="spcDivName" />
</resultMap> </resultMap>
...@@ -1190,10 +1191,12 @@ ...@@ -1190,10 +1191,12 @@
o.drop_option_code as titleCode, o.drop_option_code as titleCode,
o.drop_option_name as titleName, o.drop_option_name as titleName,
p.gender as gender, p.gender as gender,
s.practitioner_type_id as practitionerTypeId s.practitioner_type_id as practitionerTypeId,
ss.name as spcDivName
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id left join ag_acl_insurer_branch b on p.insurer_branch_id = b.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
inner join ag_md_drop_options o on s.practitioner_level = o.id inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo} where c.login = #{mobileNo}
...@@ -1274,7 +1277,8 @@ ...@@ -1274,7 +1277,8 @@
</select> </select>
<select id="getPractitionerRankInfoForOnline" resultMap="practitioner_rank_map"> <select id="getPractitionerRankInfoForOnline" resultMap="practitioner_rank_map">
SELECT SELECT t.* FROM (
SELECT
p.customer_id as customerId, p.customer_id as customerId,
p.id as practitionerIdForOnLine , p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名 p.name as name ,-- 姓名
...@@ -1282,14 +1286,78 @@ ...@@ -1282,14 +1286,78 @@
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 (select t.* from ag_acl_customer_fortune t where t.drop_option_code = "S01" group by t.order_id ) f INNER JOIN ag_po_order o ON f.order_id = o.id and o.order_price &gt; 0 FROM (select t.* from ag_acl_customer_fortune t where t.drop_option_code IN('S01','C01') group by t.order_id ) f
INNER JOIN ag_po_order o ON f.order_id = o.id and o.order_price &gt; 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 left join ag_acl_customer c on p.customer_id = c.id
WHERE o.status = 3 and o.payment_status =3
<if test="practitionerTypeId != null">
and (s.practitioner_type_id = #{practitionerTypeId}
or c.login in
<foreach close=")" collection="mobileSpecials" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
)
</if>
<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>
<choose>
<when test="platform == 1">
and o.product_category_id != 8 -- o.flag != 'Manual'
</when>
<otherwise>
and o.product_category_id = 8
</otherwise>
</choose>
group by p.id
) t WHERE t.count > 0
<choose>
<when test="type == 2">
ORDER BY t.fyc DESC
</when>
<when test="type == 3">
ORDER BY t.count DESC
</when>
<otherwise>
ORDER BY t.fyp DESC
</otherwise>
</choose>
LIMIT 10
</select>
<select id="getPractitionerRankInfo" resultMap="practitioner_rank_map">
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 (select t.* from ag_acl_customer_fortune t where t.drop_option_code IN('S01','C01') group by t.order_id ) f
INNER JOIN ag_po_order o ON f.order_id = o.id and o.order_price &gt; 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 o.status = 3 and o.payment_status =3
<if test="practitionerTypeId != null"> <if test="practitionerTypeId != null">
and s.practitioner_type_id = #{practitionerTypeId} and s.practitioner_type_id = #{practitionerTypeId}
</if> </if>
<if test="practitionerId != null">
and p.id = #{practitionerId}
</if>
<choose> <choose>
<when test="time == 1"> <when test="time == 1">
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
...@@ -1301,6 +1369,14 @@ ...@@ -1301,6 +1369,14 @@
and YEAR(f.order_date) = YEAR(now()) and YEAR(f.order_date) = YEAR(now())
</otherwise> </otherwise>
</choose> </choose>
<choose>
<when test="platform == 1">
and o.product_category_id != 8 -- o.flag != 'Manual'
</when>
<otherwise>
and o.product_category_id = 8
</otherwise>
</choose>
group by p.id group by p.id
</select> </select>
...@@ -1318,7 +1394,7 @@ ...@@ -1318,7 +1394,7 @@
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 f.drop_option_code = "S01" WHERE o.status = 3 and o.payment_status =3 and f.drop_option_code IN('S01','C01')
and c.login in and c.login in
<foreach close=")" collection="mobileSpecials" index="index" item="item" open="(" separator=","> <foreach close=")" collection="mobileSpecials" index="index" item="item" open="(" separator=",">
#{item} #{item}
...@@ -1334,6 +1410,14 @@ ...@@ -1334,6 +1410,14 @@
and YEAR(f.order_date) = YEAR(now()) and YEAR(f.order_date) = YEAR(now())
</otherwise> </otherwise>
</choose> </choose>
<choose>
<when test="platform == 1">
and o.product_category_id = 8
</when>
<otherwise>
and o.product_category_id != 8 -- o.flag != 'Manual'
</otherwise>
</choose>
group by p.id group by p.id
</select> </select>
...@@ -1545,7 +1629,7 @@ ...@@ -1545,7 +1629,7 @@
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 p.id = #{practitionerId,jdbcType=BIGINT} and f.drop_option_code = "S01" WHERE p.id = #{practitionerId,jdbcType=BIGINT} and f.drop_option_code IN('S01','C01') and o.payment_status =3
<choose> <choose>
<when test="time == 1"> <when test="time == 1">
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
...@@ -1557,6 +1641,15 @@ ...@@ -1557,6 +1641,15 @@
and YEAR(f.order_date) = YEAR(now()) and YEAR(f.order_date) = YEAR(now())
</otherwise> </otherwise>
</choose> </choose>
<choose>
<when test="platform == 1">
and o.product_category_id != 8 -- o.flag != 'Manual'
</when>
<otherwise>
and o.product_category_id = 8
</otherwise>
</choose>
</select> </select>
<select id="findPayScaleByPractitionerEG" resultType="com.yd.api.practitioner.vo.payscale.PayScaleInfo"> <select id="findPayScaleByPractitionerEG" resultType="com.yd.api.practitioner.vo.payscale.PayScaleInfo">
select DISTINCT select DISTINCT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment