Commit cade1086 by hongzhong

Merge remote-tracking branch 'origin/dev_20210330' into dev_20210330

parents e82038e3 e72c5d6f
...@@ -233,6 +233,20 @@ public class AgmsController { ...@@ -233,6 +233,20 @@ public class AgmsController {
} }
/** /**
* AGMS -- 保单发佣清算明细报表导出
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping(value="/exportCommissionPayoutStatusQuerySheet2")
public Object exportCommissionPayoutStatusQuerySheet2(@RequestBody CommissionPayoutStatusQueryRequestVO requestVO, HttpServletResponse response) {
JsonResult result = new JsonResult();
ExportCommissionPayoutStatusQueryResponseVO responseVO = agmsFortuneService.exportCommissionPayoutStatusQuerySheet2(requestVO,response);
result.setData(responseVO);
result.addResult(responseVO);
return result;
}
/**
* AGMS -- 导出财富文档 * AGMS -- 导出财富文档
* @param requestVO 请求数据 * @param requestVO 请求数据
* @return 响应数据 * @return 响应数据
......
...@@ -66,4 +66,6 @@ public interface AgmsFortuneService { ...@@ -66,4 +66,6 @@ public interface AgmsFortuneService {
FortunePayoutBatchQueryResponseVO fortunePayoutBatchQuery(); FortunePayoutBatchQueryResponseVO fortunePayoutBatchQuery();
ExportCommissionPayoutStatusQueryResponseVO exportCommissionPayoutStatusQuery(CommissionPayoutStatusQueryRequestVO requestVO, HttpServletResponse response); ExportCommissionPayoutStatusQueryResponseVO exportCommissionPayoutStatusQuery(CommissionPayoutStatusQueryRequestVO requestVO, HttpServletResponse response);
ExportCommissionPayoutStatusQueryResponseVO exportCommissionPayoutStatusQuerySheet2(CommissionPayoutStatusQueryRequestVO requestVO, HttpServletResponse response);
} }
...@@ -43,7 +43,7 @@ public class CommissionPayoutStatusQueryRequestVO { ...@@ -43,7 +43,7 @@ public class CommissionPayoutStatusQueryRequestVO {
private Long practitionerId; private Long practitionerId;
/** /**
* 发佣状态 暂不开放 可发 保留 已发并关账 * 发佣状态 0-作废 1-待来佣 2-可发 3-保留 4-已发并关账
*/ */
private Long commissionPayoutStatus; private Long commissionPayoutStatus;
......
...@@ -15,7 +15,7 @@ public class CommissionPayoutStatusUpdateRequestVO { ...@@ -15,7 +15,7 @@ public class CommissionPayoutStatusUpdateRequestVO {
/** /**
* 佣金发放状态 * 佣金发放状态
* 2.可发放 3.保留 * 0.作废 1.待发佣 2.可发放 3.保留
*/ */
private String paymentStatus; private String paymentStatus;
......
package com.yd.dal.mapper.agms; package com.yd.dal.mapper.agms;
import com.yd.dal.entity.agms.fortune.*; import com.yd.dal.entity.agms.fortune.*;
import com.yd.dal.entity.customer.AclCustomerFortune;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author xxy * @author xxy
...@@ -45,6 +45,5 @@ public interface AgmsFortuneMapper { ...@@ -45,6 +45,5 @@ public interface AgmsFortuneMapper {
*/ */
List<WithdrawLabelInfo> salaryPolicyNoDetails(@Param("item")WithdrawQueryInfo info); List<WithdrawLabelInfo> salaryPolicyNoDetails(@Param("item")WithdrawQueryInfo info);
List<Map<String, Object>> querySheet2Data(List<Long> fortuneIdList);
} }
package com.yd.dal.service.agms; package com.yd.dal.service.agms;
import com.yd.dal.entity.agms.fortune.*; import com.yd.dal.entity.agms.fortune.*;
import com.yd.dal.entity.agms.fortune.CommissionPayoutStatus;
import com.yd.dal.entity.agms.fortune.CommissionPayoutStatusQueryInfo;
import com.yd.dal.entity.agms.fortune.CustomerFortuneStatisticalInfo;
import com.yd.dal.entity.customer.AclCustomerFortune;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -49,4 +45,5 @@ public interface AgmsFortuneDALService { ...@@ -49,4 +45,5 @@ public interface AgmsFortuneDALService {
*/ */
List<WithdrawLabelInfo> salaryPolicyNoDetails(WithdrawQueryInfo info); List<WithdrawLabelInfo> salaryPolicyNoDetails(WithdrawQueryInfo info);
List<Map<String, Object>> querySheet2Data(List<Long> fortuneIdList);
} }
...@@ -72,4 +72,9 @@ public class AgmsFortuneDALServiceImpl implements AgmsFortuneDALService { ...@@ -72,4 +72,9 @@ public class AgmsFortuneDALServiceImpl implements AgmsFortuneDALService {
public List<WithdrawLabelInfo> salaryPolicyNoDetails(WithdrawQueryInfo info) { public List<WithdrawLabelInfo> salaryPolicyNoDetails(WithdrawQueryInfo info) {
return agmsFortuneMapper.salaryPolicyNoDetails(info); return agmsFortuneMapper.salaryPolicyNoDetails(info);
} }
@Override
public List<Map<String, Object>> querySheet2Data(List<Long> fortuneIdList) {
return agmsFortuneMapper.querySheet2Data(fortuneIdList);
}
} }
...@@ -13,6 +13,7 @@ import org.springframework.boot.CommandLineRunner; ...@@ -13,6 +13,7 @@ import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -261,6 +262,24 @@ public class SystemConfigService implements CommandLineRunner{ ...@@ -261,6 +262,24 @@ public class SystemConfigService implements CommandLineRunner{
return mdDropOption; return mdDropOption;
} }
public MdDropOptions getDropOptionInfo(String elementKey, String dropOptionId, String masterCode) {
if (CommonUtil.isNullOrBlank(elementKey) || CommonUtil.isNullOrBlank(masterCode) || CommonUtil.isNullOrBlank(dropOptionId)) {
return null;
}
ConcurrentHashMap<String, MdDropOptions> mdDropOptionsMap;
Element element = systemConfigCache.get(elementKey);
if (element != null && element.getObjectValue() != null) {
mdDropOptionsMap = (ConcurrentHashMap<String, MdDropOptions>) element.getObjectValue();
} else {
List<MdDropOptions> mdDropOptionsList = mdDropOptionsDALService.findByDropMasterCode(masterCode);
mdDropOptionsMap = new ConcurrentHashMap<>();
mdDropOptionsList.forEach(i -> mdDropOptionsMap.put(i.getId() + "", i));
element = new Element(elementKey, mdDropOptionsMap);
systemConfigCache.put(element);
}
return mdDropOptionsMap.get(dropOptionId);
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public List<MdPractitionerHiringApproveSteps> findHiringApproveStepsByPractitionerLevel(String practitionerLevelCode) { public List<MdPractitionerHiringApproveSteps> findHiringApproveStepsByPractitionerLevel(String practitionerLevelCode) {
List<MdPractitionerHiringApproveSteps> hiringApproveSteps = new ArrayList<>(); List<MdPractitionerHiringApproveSteps> hiringApproveSteps = new ArrayList<>();
......
## 暂时不用更新2019/10/10-water ## ## \u6682\u65F6\u4E0D\u7528\u66F4\u65B02019/10/10-water ##
######################参数信息校验######################## ######################\u53C2\u6570\u4FE1\u606F\u6821\u9A8C########################
600000=参数检验成功! 600000=\u53C2\u6570\u68C0\u9A8C\u6210\u529F\uFF01
610001=入参中[{0}]不能为空! 610001=\u5165\u53C2\u4E2D[{0}]\u4E0D\u80FD\u4E3A\u7A7A\uFF01
610002=入参中[{0}]不能同时为空! 610002=\u5165\u53C2\u4E2D[{0}]\u4E0D\u80FD\u540C\u65F6\u4E3A\u7A7A\uFF01
##用户信息校验 ##\u7528\u6237\u4FE1\u606F\u6821\u9A8C
630001=用户的手机号码[{0}]格式不正确! 630001=\u7528\u6237\u7684\u624B\u673A\u53F7\u7801[{0}]\u683C\u5F0F\u4E0D\u6B63\u786E\uFF01
630002=手机号[{0}]已被注册,请勿重复注册! 630002=\u624B\u673A\u53F7[{0}]\u5DF2\u88AB\u6CE8\u518C\uFF0C\u8BF7\u52FF\u91CD\u590D\u6CE8\u518C\uFF01
######################用户提示信息######################## ######################\u7528\u6237\u63D0\u793A\u4FE1\u606F########################
800000=执行成功! 800000=\u6267\u884C\u6210\u529F\uFF01
800001=执行失败! 800001=\u6267\u884C\u5931\u8D25\uFF01
##系统提示信息 ##\u7CFB\u7EDF\u63D0\u793A\u4FE1\u606F
810001=token无效或者错误! 810001=token\u65E0\u6548\u6216\u8005\u9519\u8BEF\uFF01
820001=未查询到相应结果。 820001=\u672A\u67E5\u8BE2\u5230\u76F8\u5E94\u7ED3\u679C\u3002
830001=该用户非经纪人。 830001=\u8BE5\u7528\u6237\u975E\u7ECF\u7EAA\u4EBA\u3002
830002=只有寿险经纪人才有权限进入! 830002=\u53EA\u6709\u5BFF\u9669\u7ECF\u7EAA\u4EBA\u624D\u6709\u6743\u9650\u8FDB\u5165\uFF01
830003=请上传图片格式 830003=\u8BF7\u4E0A\u4F20\u56FE\u7247\u683C\u5F0F
830004=上传照片尺寸比例为4:3 830004=\u4E0A\u4F20\u7167\u7247\u5C3A\u5BF8\u6BD4\u4F8B\u4E3A4\uFF1A3
830005=上传头像尺寸比例为1:1 830005=\u4E0A\u4F20\u5934\u50CF\u5C3A\u5BF8\u6BD4\u4F8B\u4E3A1:1
830006=生活照只能有三张,请将之前的删除 830006=\u751F\u6D3B\u7167\u53EA\u80FD\u6709\u4E09\u5F20,\u8BF7\u5C06\u4E4B\u524D\u7684\u5220\u9664
830007=上传头像失败,请重新上传! 830007=\u4E0A\u4F20\u5934\u50CF\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\uFF01
830008=上传生活照失败,请重新上传! 830008=\u4E0A\u4F20\u751F\u6D3B\u7167\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\uFF01
830009=上传微信二维码失败,请重新上传! 830009=\u4E0A\u4F20\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\uFF01
830010=该用户已经注册为银盾经纪人 830010=\u8BE5\u7528\u6237\u5DF2\u7ECF\u6CE8\u518C\u4E3A\u94F6\u76FE\u7ECF\u7EAA\u4EBA
830011=该增员已存在! 830011=\u8BE5\u589E\u5458\u5DF2\u5B58\u5728\uFF01
830012=请填写跟进时间! 830012=\u8BF7\u586B\u5199\u8DDF\u8FDB\u65F6\u95F4\uFF01
830013=请填写备注! 830013=\u8BF7\u586B\u5199\u5907\u6CE8\uFF01
830014=此客户已是其他经纪人商机 830014=\u6B64\u5BA2\u6237\u5DF2\u662F\u5176\u4ED6\u7ECF\u7EAA\u4EBA\u5546\u673A
830015=每天同一个跟进状态只能对一个商机经行一次增加! 830015=\u6BCF\u5929\u540C\u4E00\u4E2A\u8DDF\u8FDB\u72B6\u6001\u53EA\u80FD\u5BF9\u4E00\u4E2A\u5546\u673A\u7ECF\u884C\u4E00\u6B21\u589E\u52A0!
830016=您不是团队长,无法进行编辑保存 830016=\u60A8\u4E0D\u662F\u56E2\u961F\u957F,\u65E0\u6CD5\u8FDB\u884C\u7F16\u8F91\u4FDD\u5B58
830017=您不是团队长,无法进行查看 830017=\u60A8\u4E0D\u662F\u56E2\u961F\u957F,\u65E0\u6CD5\u8FDB\u884C\u67E5\u770B
830018=您暂无团队,无法设置 830018=\u60A8\u6682\u65E0\u56E2\u961F,\u65E0\u6CD5\u8BBE\u7F6E
830019=已申请过专家支持!请等待 830019=\u5DF2\u7533\u8BF7\u8FC7\u4E13\u5BB6\u652F\u6301!\u8BF7\u7B49\u5F85
830020=活动时间段冲突 830020=\u6D3B\u52A8\u65F6\u95F4\u6BB5\u51B2\u7A81
830021=请选择发佣日期 830021=\u8BF7\u9009\u62E9\u53D1\u4F63\u65E5\u671F
830022=请选择关账记录 830022=\u8BF7\u9009\u62E9\u5173\u8D26\u8BB0\u5F55
830023=已关账并发放的记录,不能修改 830023=\u5DF2\u5173\u8D26\u5E76\u53D1\u653E\u7684\u8BB0\u5F55,\u4E0D\u80FD\u4FEE\u6539
830024=存在已关账保单,禁止修改为非可发放状态 830024=\u5B58\u5728\u5DF2\u5173\u8D26\u4FDD\u5355,\u7981\u6B62\u4FEE\u6539\u4E3A\u975E\u53EF\u53D1\u653E\u72B6\u6001
830025=上传失败,请重新上传! 830025=\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\uFF01
830026=经纪人审批步骤出现问题,请联系it! 830026=\u7ECF\u7EAA\u4EBA\u5BA1\u6279\u6B65\u9AA4\u51FA\u73B0\u95EE\u9898,\u8BF7\u8054\u7CFBit\uFF01
830027=标签级别不能为空! 830027=\u6807\u7B7E\u7EA7\u522B\u4E0D\u80FD\u4E3A\u7A7A\uFF01
830028=此标签不是一级标签,上级标签id不能为空! 830028=\u6B64\u6807\u7B7E\u4E0D\u662F\u4E00\u7EA7\u6807\u7B7E,\u4E0A\u7EA7\u6807\u7B7Eid\u4E0D\u80FD\u4E3A\u7A7A\uFF01
900003=保险公司响应报文为空! 900003=\u4FDD\u9669\u516C\u53F8\u54CD\u5E94\u62A5\u6587\u4E3A\u7A7A\uFF01
830029=标签显示类别不能为空! 830029=\u6807\u7B7E\u663E\u793A\u7C7B\u522B\u4E0D\u80FD\u4E3A\u7A7A\uFF01
830030=标签ID不能为空! 830030=\u6807\u7B7EID\u4E0D\u80FD\u4E3A\u7A7A\uFF01
830031=标签是否有效不能为空! 830031=\u6807\u7B7E\u662F\u5426\u6709\u6548\u4E0D\u80FD\u4E3A\u7A7A\uFF01
830032=上级显示标签不存在! 830032=\u4E0A\u7EA7\u663E\u793A\u6807\u7B7E\u4E0D\u5B58\u5728\uFF01
830033=上级显示标签的标签显示类别与保存标签的显示类别不一致! 830033=\u4E0A\u7EA7\u663E\u793A\u6807\u7B7E\u7684\u6807\u7B7E\u663E\u793A\u7C7B\u522B\u4E0E\u4FDD\u5B58\u6807\u7B7E\u7684\u663E\u793A\u7C7B\u522B\u4E0D\u4E00\u81F4\uFF01
830034=保存标签的标签级别与上级显示标签的标签级别不能相隔多级! 830034=\u4FDD\u5B58\u6807\u7B7E\u7684\u6807\u7B7E\u7EA7\u522B\u4E0E\u4E0A\u7EA7\u663E\u793A\u6807\u7B7E\u7684\u6807\u7B7E\u7EA7\u522B\u4E0D\u80FD\u76F8\u9694\u591A\u7EA7\uFF01
830035=根据基础标签ID查找不到有效的基础标签! 830035=\u6839\u636E\u57FA\u7840\u6807\u7B7EID\u67E5\u627E\u4E0D\u5230\u6709\u6548\u7684\u57FA\u7840\u6807\u7B7E\uFF01
830036=标签名称有值时标签级别不能为空! 830036=\u6807\u7B7E\u540D\u79F0\u6709\u503C\u65F6\u6807\u7B7E\u7EA7\u522B\u4E0D\u80FD\u4E3A\u7A7A\uFF01
830037=该标签类别已经有一级标签! 830037=\u8BE5\u6807\u7B7E\u7C7B\u522B\u5DF2\u7ECF\u6709\u4E00\u7EA7\u6807\u7B7E\uFF01
830038=该标签类别已存在相同的标签名称! 830038=\u8BE5\u6807\u7B7E\u7C7B\u522B\u5DF2\u5B58\u5728\u76F8\u540C\u7684\u6807\u7B7E\u540D\u79F0\uFF01
##等保水平越权错误信息 830039=\u5DF2\u4F5C\u5E9F\u7684\u8BB0\u5F55,\u4E0D\u80FD\u4FEE\u6539
630028=该账户无权限访问此接口! ##\u7B49\u4FDD\u6C34\u5E73\u8D8A\u6743\u9519\u8BEF\u4FE1\u606F
630028=\u8BE5\u8D26\u6237\u65E0\u6743\u9650\u8BBF\u95EE\u6B64\u63A5\u53E3\uFF01
...@@ -421,4 +421,113 @@ ...@@ -421,4 +421,113 @@
</select> </select>
<select id="querySheet2Data" resultType="java.util.LinkedHashMap">
select
pb.payout_yearmonth '0' /*对账月*/,
(select name from ag_acl_policyholder where order_id = f.order_id and type=2) '1',
o.policy_no '2',
i.name '3' /*保司*/,
o.order_price '4' ,
p.name '5' /*产品*/,
o.underwriting_date '6',
CONCAT(o.payment_term, (case o.payment_term_unit when 'Y' then '年' when 'M' then '月' else '日' END)) '7',
if(f.commission_period=1,f.fyc_rate,'') '8' /*'FYC%'*/,
if(f.order_id!=null, IFNULL(p.is_achievement_statistic,'100'), '') '9' /*'业绩折标率%'*/,
if(f.id=min(f.id),f.share_rate,'') '10' /*'分佣%'*/,
if(f.id=min(f.id),f.achievements_rate,'') '11' /*'业绩%'*/,
if(f.commission_period!=1,f.fyc_rate,'') '12' /*'RYC%'*/,
if(f.id=min(f.id),f.fyc_amount,'') '13'/*保单FYC*/,
if(f.id=min(f.id),f.referral_amount,'') '14' /*佣金FYC*/,
if(f.id=min(f.id),f.achievements,'') '15' /*业绩FYC*/,
if(f.commission_period!=1,f.fyc_amount,'') '16' /*保单RYC*/,
if(f.commission_period!=1,f.referral_amount,'') '17' /*佣金RYC*/,
(select name from ag_acl_channel where id = f.channel_id) '18' /*渠道*/,
coalesce(l.s1_id,l.s2_id,l.s3_id) '19' /*FYC体系*/,
pra.name '20' /*销售经纪人*/,
ps.practitioner_level '21' /*经纪人职级*/,
if(f.id=min(f.id),f.grade_commission_rate,'') '22' /*职级率*/,
sum(case when drop_option_code ='C01' then f.referral_amount else null end) '23' /*首年销售佣金*/,
sum(case when drop_option_code ='C02' then f.referral_amount else null end) '24' /*续年销售佣金*/,
if(f.commission_period!=1,l.mentor_id,'') '25' /*续期辅导人*/,
if(f.commission_period!=1,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where order_id=f.order_id and drop_option_code ='C06' and practitioner_id = l.mentor_id),
'') '26' /*续期辅导奖金率*/,
if(f.commission_period!=1,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where order_id=f.order_id and drop_option_code ='C06' and practitioner_id = l.mentor_id),
'') '27' /*续期辅导奖*/,
sum(case when drop_option_code ='C04' then f.calculation_rate else null end) '28' /*'经纪人月销售加码奖金%'*/,
sum(case when drop_option_code ='C04' then f.referral_amount else null end) '29' /*经纪人月销售加码奖金*/,
l.introducer_id '30' /*推荐人*/,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where order_id=f.order_id and drop_option_code ='C05' and practitioner_id = l.introducer_id) '31' /*个人推荐率*/,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where order_id=f.order_id and drop_option_code ='C05' and practitioner_id = l.introducer_id) '32' /*个人推荐奖¥*/,
sum(case when drop_option_code ='C15' then f.calculation_rate else null end) '33' /*体系推荐率*/,
sum(case when drop_option_code ='C15' then f.referral_amount else null end) '34' /*体系推荐奖金¥*/,
l.mentor_id '35' /*一代辅导人*/,
l.mentor_level '36' /*一代辅导人职级*/,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where order_id=f.order_id and drop_option_code ='C06' and practitioner_id = l.mentor_id) '37' /*'一代辅导人职级岗位津贴%'*/,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where order_id=f.order_id and drop_option_code ='C06' and practitioner_id = l.mentor_id) '38' /*一代辅导人岗位津贴*/,
l.in_mentor_id '39' /*二代辅导人*/,
l.in_mentor_level '40' /*二代辅导人职级*/,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where order_id=f.order_id and drop_option_code ='C07' and practitioner_id = l.in_mentor_id) '41' /*'二代辅导人职级岗位津贴%'*/,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where order_id=f.order_id and drop_option_code ='C07' and practitioner_id = l.in_mentor_id) '42' /*二代辅导人岗位津贴*/,
l.s1_id '43' /*所属S1分部*/,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where drop_option_code ='C08' and order_id=f.order_id and practitioner_id = l.s1_team_leader_id) '44' /*S1团队达标奖金率*/,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where drop_option_code ='C08' and order_id=f.order_id and practitioner_id = l.s1_team_leader_id) '45' /*'S1团队达标奖金¥(季度)'*/,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where drop_option_code ='C10' and order_id=f.order_id and practitioner_id = l.s1_team_leader_id) '46' /*S1团队长辅导津贴比率*/,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where drop_option_code ='C10' and order_id=f.order_id and practitioner_id = l.s1_team_leader_id) '47' /*S1团队长辅导津贴*/,
'' as '48' /*S1续期绩效奖金*/,
l.s2_id '49' /*所属S2体系*/,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where drop_option_code ='C08' and order_id=f.order_id and practitioner_id = l.s2_team_leader_id) '50' /*S2团队达标奖金率*/,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where drop_option_code ='C08' and order_id=f.order_id and practitioner_id = l.s2_team_leader_id) '51' /*'S2团队达标奖金¥(季度)'*/,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where drop_option_code ='C10' and order_id=f.order_id and practitioner_id = l.s2_team_leader_id) '52' /*S2团队长辅导津贴比率*/,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where drop_option_code ='C10' and order_id=f.order_id and practitioner_id = l.s2_team_leader_id) '53' /*S2团队长辅导津贴*/,
'' as '54' /*S2续期绩效奖金*/,
l.s3_id '55' /*所属S3纵队*/,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where drop_option_code ='C08' and order_id=f.order_id and practitioner_id = l.s3_team_leader_id) '56' /*S3团队达标奖金率*/,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where drop_option_code ='C08' and order_id=f.order_id and practitioner_id = l.s3_team_leader_id) '57' /*'S3团队达标奖金¥(季度)'*/,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where drop_option_code ='C10' and order_id=f.order_id and practitioner_id = l.s3_team_leader_id) '58' /*S3团队长辅导津贴比率*/,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where drop_option_code ='C10' and order_id=f.order_id and practitioner_id = l.s3_team_leader_id) '59' /*S3团队长辅导津贴*/,
l.raise_id '60' /*育成人*/,
l.raise_level '61' /*育成人职级*/,
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where drop_option_code ='C09' and order_id=f.order_id and practitioner_id = l.raise_id) '62' /*育成奖金率*/,
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where drop_option_code ='C09' and order_id=f.order_id and practitioner_id = l.raise_id) '63' /*育成金额*/,
sum(case when drop_option_code ='C14' then f.calculation_rate else null end) '64' /*C14直接销售加码佣金率*/,
sum(case when drop_option_code ='C14' then f.referral_amount else null end) '65' /*C14直接销售加码佣金*/,
if(o.settlement_rule_type=1,'简单基本法','标准基本法') '66' /*基本法属性*/,
sum(case when drop_option_code ='S01' then f.referral_amount else null end) '67' /*S01-首年度销售佣金*/,
sum(case when drop_option_code ='S03' then f.referral_amount else null end) '68' /*S03-首年度辅导奖金*/,
f.order_id,
f.customer_id
FROM ag_acl_customer_fortune f
LEFT JOIN ag_acl_customer_fortune_payout_batch pb on pb.id = f.payout_batch_id
LEFT JOIN ag_acl_life_insurance_practitioner l on l.order_id = f.order_id and l.practitioner_id = f.practitioner_id
LEFT JOIN ag_acl_practitioner pra on pra.customer_id = f.customer_id
LEFT JOIN ag_acl_practitioner_setting ps on ps.practitioner_id = pra.id
LEFT JOIN ag_po_order o on o.id = f.order_id
LEFT JOIN ag_acl_insurer i on i.id = o.insurer_id
LEFT JOIN ag_product p on p.id = o.product_id
WHERE
f.id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item,jdbcType=BIGINT}
</foreach>
GROUP BY f.order_id, f.customer_id
</select>
</mapper> </mapper>
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