Commit f523da78 by akexiu

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

# Conflicts:
#	yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
parents 0f1ec912 a0cc0579
......@@ -232,10 +232,10 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
String approveRole = step.getApproveRole();
AclPractitionerHiringMembership membership = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
if ("subsystemOwner".equals(approveRole)) {
if (!practitionerId.equals(membership.getSubsystemOwnerId())) {
responseVO.setCommonResult(new CommonResult(false, "无此流程的审批权限"));
return;
}
// if (!practitionerId.equals(membership.getSubsystemOwnerId())) {
// responseVO.setCommonResult(new CommonResult(false, "无此流程的审批权限"));
// return;
// }
} else {
if (!practitionerId.equals(membership.getMentorPractitionerId())) {
responseVO.setCommonResult(new CommonResult(false, "无此流程的审批权限"));
......@@ -428,7 +428,7 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
if (StringUtils.isNotEmpty(approveRole)) {
AclPractitionerHiringMembership membership = membershipMapper.selectByHiringBasicInfoId(basicInfoId);
if (membership != null) {
if (loginPractitionerId.equals(membership.getSubsystemOwnerId())) {
if (loginPractitionerId.equals(membership.getApprovedBy())) {
return true;
}
}
......@@ -451,7 +451,7 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
//ag_acl_practitioner_setting
//ag_acl_practitioner_subordinate_system(如果是团队长)operator
AclPractitionerHiringBasicInfo basicInfo = aclPractitionerHiringBasicInfoDalService.findById(hiringBasicInfoId);
AclPractitionerHiringMembership membership = aclPractitionerHiringMembershipDalService.findByBasicInfoId(hiringBasicInfoId);
AclPractitionerHiringMembership membership = agmsHiringDalService.queryHiringMemberShip(hiringBasicInfoId);
AclPractitionerSubordinateSystem subordinateSystem = aclPractitionerSubordinateSystemDalService.findById(membership.getSubsystemId());
AclCustomer customer = aclCustomerDalService.findByMobileNo(basicInfo.getMobileNo());
AclPractitioner practitioner = new AclPractitioner();
......@@ -466,6 +466,10 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
practitioner.setIdType(basicInfo.getIdType());
practitioner.setIdNo(basicInfo.getIdNo());
practitioner.setS1Id(membership.getS1Id());
practitioner.setS2Id(membership.getS2Id());
practitioner.setS3Id(membership.getS3Id());
Date practitionerBirthdate = CommonUtil.stringParseDate(basicInfo.getPractitionerBirthdate(), "yyyy-MM-dd");
practitioner.setPractitionerBirthdate(practitionerBirthdate);
practitioner.setPractitionerRegNo(" ");
......
......@@ -6,6 +6,7 @@ import com.yd.api.practitioner.service.PractitionerHiringContractService;
import com.yd.dal.entity.customer.*;
import com.yd.dal.mapper.customer.*;
import com.yd.dal.mapper.practitioner.PractitionerHiringMapper;
import com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService;
import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil;
......@@ -43,6 +44,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
private AclInsurerBranchMapper branchMapper;
@Autowired
private AclInsurerBranchDeptMapper deptMapper;
@Autowired
private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDALService;
/**
......@@ -170,6 +173,14 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
AclPractitioner second = aclPractitionerMapper.selectByMobileNo(basicInfo.getMobileNo());
List<AclPractitionerHiringWorkingExperience> workingExperienceList = workingExperienceMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
// 获取审批的体系系负责人的systerm
AclPractitionerSubordinateSystem systemOfApproved = null;
if (memberShip.getApprovedBy() != null) {
List<AclPractitionerSubordinateSystem> subordinateSystems = aclPractitionerSubordinateSystemDALService.findByOwnerPractitionerId(memberShip.getApprovedBy());
systemOfApproved = subordinateSystems.get(0);
}
// 体系名称 报聘为S2, S3的没有所属体系
String subsystemName = (systemOfApproved != null) ? systemOfApproved.getName() : memberShip.getSubsystem();
String mentorName = mentor == null ? "" : mentor.getName();
String mentorIdNo = mentor == null ? "" : mentor.getIdNo();
......@@ -192,7 +203,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
//1页
data.put("contactNo", contractNo);
data.put("practitionerNo", second.getPractitionerCode());
data.put("subsystem", memberShip.getSubsystem());
data.put("subsystem", subsystemName);
data.put("practitioner", basicInfo.getName());
data.put("idNo", basicInfo.getIdNo());
......@@ -245,7 +256,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
data.put("secondEffectiveDay", applyDate.get(Calendar.DAY_OF_MONTH) + "");
data.put("secondParty802", basicInfo.getName());
data.put("secondMentor801", mentorName);
data.put("secondSubsystem", memberShip.getSubsystem());
data.put("secondSubsystem", subsystemName);
data.put("secondSubsystemNo", "");
// 签核人员
this.setApprovepeople(data, hiringBasicInfoId);
......@@ -272,8 +283,13 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
private void setSomeAddress(Map<String, String> data, Long hiringBasicInfoId) {
AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
AclPractitioner systemOwner = aclPractitionerMapper.selectByPrimaryKey(memberShip.getSubsystemOwnerId());
AclPractitioner mentor = aclPractitionerMapper.selectByPrimaryKey(memberShip.getMentorPractitionerId());
// 报聘职级
String mdDropOptionName = memberShip.getMdDropOptionName();
// 实际审批的体系负责人
AclPractitioner systemOwner = aclPractitionerMapper.selectByPrimaryKey(memberShip.getApprovedBy());
// 体系负责人姓名
String systemOwnerName = (systemOwner != null) ? systemOwner.getName() : memberShip.getSubsystemOwner();
String mentorName = mentor == null ? "" : mentor.getName();
String mentorIdNo = mentor == null ? "" : mentor.getIdNo();
......@@ -283,18 +299,18 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
data.put("secondPartyIDNo", basicInfo.getIdNo());
StringBuffer secondResidentAddress = new StringBuffer();
secondResidentAddress.append(basicInfo.getProvinceName()).append(basicInfo.getCityName());
data.put("secondPartyAddress", basicInfo.getResidentAddress());
data.put("secondPartyAddress", basicInfo.getResidentAddress().replace("null", ""));
data.put("secondMobileNo", basicInfo.getMobileNo());
data.put("secondSubsystemOwner", memberShip.getSubsystemOwner());
data.put("secondSubsystemOwner", systemOwnerName);
data.put("secondSubsystemSignature", memberShip.getSubsystemOwner());
// 查团队长信息
String systemOwnerIdNo = null;
String systemOwnerMobile = null;
StringBuffer systemOwnerAddress = new StringBuffer();
if (systemOwner == null) {
if (Long.valueOf("30").equals(memberShip.getMdDropOptionId())) {
if (mdDropOptionName.indexOf("S2") >= 0 || mdDropOptionName.indexOf("S3") >= 0) {
systemOwnerIdNo = basicInfo.getIdNo();
systemOwnerMobile = basicInfo.getMobileNo();
systemOwnerAddress.append(basicInfo.getResidentAddress());
......@@ -307,7 +323,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
systemOwnerAddress.append(systemOwner.getProvinceName()).append(systemOwner.getCityName());
}
data.put("secondSubsystemIDNo", systemOwnerIdNo);
data.put("secondSubsystemAddress", systemOwnerAddress.toString());
data.put("secondSubsystemAddress", systemOwnerAddress.toString().replace("null", ""));
data.put("secondSubsystemMobileNo", systemOwnerMobile);
data.put("secondMentor", mentorName);
......@@ -317,7 +333,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
if (mentor != null) {
mentorAddress.append(mentor.getProvinceName()).append(mentor.getCityName());
}
data.put("secondMentorAddress", mentorAddress.toString());
data.put("secondMentorAddress", mentorAddress.toString().replace("null", ""));
data.put("secondMentorMobileNo", mentorMobile);
}
......
......@@ -11,6 +11,7 @@ import com.yd.dal.entity.practitioner.hiring.*;
import com.yd.dal.mapper.customer.*;
import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.dal.service.customer.AclPractitionerHiringApproveRecordsDALService;
import com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.ali.send.service.SendService;
......@@ -61,6 +62,8 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private AclPractitionerDALService aclPractitionerDALService;
@Autowired
private AclPractitionerPotentialMapper aclPractitionerPotentialMapper;
@Autowired
private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDALService;
private PractitionerHiringDALService practitionerHiringDalService;
private SystemConfigService systemConfigService;
......@@ -422,11 +425,11 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
Long approvingStatus = requestVO.getApprovingStatus();
//等保调整
List<AclCustomer> findByObjSortable = aclPractitionerDALService.getAclCustomers(practitionerId,null);
if(null == findByObjSortable ){
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("630028")));
return responseVO;
}
// List<AclCustomer> findByObjSortable = aclPractitionerDALService.getAclCustomers(practitionerId,null);
// if(null == findByObjSortable ){
// responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("630028")));
// return responseVO;
// }
List<HiringListInfo> hiringListInfoList;
if (Long.valueOf("0").equals(approvingStatus)) {
// 当前经纪人的待审批记录
......@@ -641,7 +644,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
//基本信息
AclPractitionerHiringBasicInfo hiringBasicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
//组织关系
AclPractitionerHiringMembership hiringMemberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
AclPractitionerHiringMembership hiringMemberShip = this.queryHiringMemberShip(hiringBasicInfoId);
//工作经历
List<AclPractitionerHiringWorkingExperience> hiringWorkingExperienceList = workingExperienceMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
//申请名目
......@@ -668,6 +671,59 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
return resp;
}
private AclPractitionerHiringMembership queryHiringMemberShip(Long hiringBasicInfoId) {
AclPractitionerHiringMembership hiringMemberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
if (hiringMemberShip.getMentorPractitionerId() == null) {
return hiringMemberShip;
}
AclPractitioner mentor = aclPractitionerDALService.findPractitionerById(hiringMemberShip.getMentorPractitionerId());
// 查询并显示“辅导人”所属的S1分部,分部负责人,S2体系,体系负责人,S3纵队,纵队负责人,没有的显示空
List<AclPractitionerSubordinateSystem> subordinateSystemList = aclPractitionerSubordinateSystemDALService.findAll();
Map<Long, AclPractitionerSubordinateSystem> subordinateSystemMap = new HashMap<>();
subordinateSystemList.forEach(i -> subordinateSystemMap.put(i.getId(), i));
Map<Long, AclPractitioner> aclPractitionerMap = aclPractitionerDALService.findAllMap();
//所属体系
AclPractitionerSubordinateSystem subordinateSystem = null;
//体系团队长
AclPractitioner systemOwner = null;
if (mentor.getS1Id() != null) {
subordinateSystem = subordinateSystemMap.get(mentor.getS1Id());
if (subordinateSystem != null) {
hiringMemberShip.setS1SubordinateSystemName(subordinateSystem.getName());
systemOwner = aclPractitionerMap.get(subordinateSystem.getOwnerPractitionerId());
hiringMemberShip.setS1TeamLeaderName(systemOwner != null ? systemOwner.getName() : null);
hiringMemberShip.setS1TeamLeaderId(systemOwner != null ? systemOwner.getId() : null);
}
}
if (null != mentor.getS2Id()) {
subordinateSystem = subordinateSystemMap.get(mentor.getS2Id());
if (subordinateSystem != null) {
hiringMemberShip.setS2SubordinateSystemName(subordinateSystem != null ? subordinateSystem.getName() : null);
systemOwner = aclPractitionerMap.get(subordinateSystem.getOwnerPractitionerId());
hiringMemberShip.setS2TeamLeaderName(systemOwner != null ? systemOwner.getName() : null);
hiringMemberShip.setS2TeamLeaderId(systemOwner != null ? systemOwner.getId() : null);
}
}
if (null != mentor.getS3Id()) {
subordinateSystem = subordinateSystemMap.get(mentor.getS3Id());
if (subordinateSystem != null) {
hiringMemberShip.setS3SubordinateSystemName(subordinateSystem != null ? subordinateSystem.getName() : null);
systemOwner = aclPractitionerMap.get(subordinateSystem.getOwnerPractitionerId());
hiringMemberShip.setS3TeamLeaderName(systemOwner != null ? systemOwner.getName() : null);
hiringMemberShip.setS3TeamLeaderId(systemOwner != null ? systemOwner.getId() : null);
}
}
return hiringMemberShip;
}
@Override
public CommonResultResponseVO saveDigitalSignatures(SaveDigitalSignaturesRequestVO requestVO) {
CommonResultResponseVO resp = new CommonResultResponseVO();
......@@ -811,8 +867,8 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
mobileNoList.add(mentor.getMobileNo());
}
if (memberShip.getSubsystemOwnerId() != null) {
AclPractitioner system = aclPractitionerMapper.selectByPrimaryKey(memberShip.getSubsystemOwnerId());
if (memberShip.getApprovedBy() != null) {
AclPractitioner system = aclPractitionerMapper.selectByPrimaryKey(memberShip.getApprovedBy());
mobileNoList.add(system.getMobileNo());
}
// 若辅导人和团队长为同一人,去重
......@@ -887,6 +943,8 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
}
// 计算审批流程
basicInfo.setApproveStatus(this.handleApproveStatus(hiringMemberShip));
// 将申请人分配给体系负责人
this.distributeToSubsystemOwner(hiringMemberShip);
basicInfoMapper.updateByPrimaryKeySelective(basicInfo);
......@@ -899,8 +957,39 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
return resp;
}
private void distributeToSubsystemOwner(AclPractitionerHiringMembership memberShip) {
Long hiringBasicInfoId = memberShip.getHiringBasicInfoId();
String mdDropOptionName = memberShip.getMdDropOptionName();
// S2,S3报聘不用团队长审批
if (mdDropOptionName.indexOf("S2")>=0 || mdDropOptionName.indexOf("S3")>=0) {
return;
}
// 查询辅导人所在S1,S2,S3
AclPractitionerHiringMembership hiringMemberShip = this.queryHiringMemberShip(hiringBasicInfoId);
Long s1TeamLeaderId = hiringMemberShip.getS1TeamLeaderId();
Long s2TeamLeaderId = hiringMemberShip.getS2TeamLeaderId();
Long s3TeamLeaderId = hiringMemberShip.getS3TeamLeaderId();
Long approvedBy = hiringMemberShip.getSubsystemOwnerId();
if (s2TeamLeaderId != null) {
approvedBy = s2TeamLeaderId;
} else {
if (s1TeamLeaderId != null) {
approvedBy = s1TeamLeaderId;
} else {
approvedBy = s3TeamLeaderId;
}
}
// 保存审批的负责人
hiringMemberShip.setApprovedBy(approvedBy);
membershipMapper.updateByPrimaryKeySelective(hiringMemberShip);
}
private String handleApproveStatus(AclPractitionerHiringMembership hiringMemberShip) {
if (Long.valueOf("30").equals(hiringMemberShip.getMdDropOptionId())) {
// 经纪人报聘职级
String mdDropOptionName = hiringMemberShip.getMdDropOptionName();
if (mdDropOptionName.indexOf("S2")>=0 || mdDropOptionName.indexOf("S3")>=0) {
return "2";
}
if (hiringMemberShip.getMentor() == null || hiringMemberShip.getMentorPractitionerId() == null) {
......
......@@ -3424,6 +3424,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
statisticInfo.setTargetFyc(0D);
statisticInfo.setTargetFyp(0D);
statisticInfo.setTargetCount(0);
statisticInfo.setCompletionRate(0D);
if ((practitionerId != null || subordinateSystemId != null) && fycSum != null && time != null && fycSum > 0) {
List<MktLeadsGoals> leadsGoals;
Double goalsPremium = null;
......@@ -3486,7 +3487,6 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
}
}
}
statisticInfo.setCompletionRate(0D);
if (goalsPremium != null && goalsPremium > 0) {
BigDecimal fycBigDecimal = new BigDecimal(fycSum), goalsBigDecimal = new BigDecimal(goalsPremium);
statisticInfo.setCompletionRate(CommonUtil.doubleFormat(fycBigDecimal.divide(goalsBigDecimal, 4, BigDecimal.ROUND_HALF_UP).doubleValue() * 100, 2));
......
......@@ -40,6 +40,20 @@ public class PractitionerHiringMemberShip {
*/
private String branch;
/**
* 辅导人的组织架构信息
*/
private String systemFlag;//系统标志,区分公司营业部和体系,1,分公司,2营业部,3,S1分部,4,S2体系,5,S3纵队
private String s3SubordinateSystemName;//s3所属体系名称
private String s2SubordinateSystemName;//s2所属体系名称
private String s1SubordinateSystemName;//s1所属体系名称
private String s3TeamLeaderName;//S3团队长名称
private String s2TeamLeaderName;//S2团队长名称
private String s1TeamLeaderName;//S1团队长名称
private Long s3TeamLeaderId;//S3团队长Id
private Long s2TeamLeaderId;//S2团队长Id
private Long s1TeamLeaderId;//S1团队长Id
/**
* 获取 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
......@@ -167,6 +181,86 @@ public class PractitionerHiringMemberShip {
this.branch = branch;
}
public String getSystemFlag() {
return systemFlag;
}
public void setSystemFlag(String systemFlag) {
this.systemFlag = systemFlag;
}
public String getS3SubordinateSystemName() {
return s3SubordinateSystemName;
}
public void setS3SubordinateSystemName(String s3SubordinateSystemName) {
this.s3SubordinateSystemName = s3SubordinateSystemName;
}
public String getS2SubordinateSystemName() {
return s2SubordinateSystemName;
}
public void setS2SubordinateSystemName(String s2SubordinateSystemName) {
this.s2SubordinateSystemName = s2SubordinateSystemName;
}
public String getS1SubordinateSystemName() {
return s1SubordinateSystemName;
}
public void setS1SubordinateSystemName(String s1SubordinateSystemName) {
this.s1SubordinateSystemName = s1SubordinateSystemName;
}
public String getS3TeamLeaderName() {
return s3TeamLeaderName;
}
public void setS3TeamLeaderName(String s3TeamLeaderName) {
this.s3TeamLeaderName = s3TeamLeaderName;
}
public String getS2TeamLeaderName() {
return s2TeamLeaderName;
}
public void setS2TeamLeaderName(String s2TeamLeaderName) {
this.s2TeamLeaderName = s2TeamLeaderName;
}
public String getS1TeamLeaderName() {
return s1TeamLeaderName;
}
public void setS1TeamLeaderName(String s1TeamLeaderName) {
this.s1TeamLeaderName = s1TeamLeaderName;
}
public Long getS3TeamLeaderId() {
return s3TeamLeaderId;
}
public void setS3TeamLeaderId(Long s3TeamLeaderId) {
this.s3TeamLeaderId = s3TeamLeaderId;
}
public Long getS2TeamLeaderId() {
return s2TeamLeaderId;
}
public void setS2TeamLeaderId(Long s2TeamLeaderId) {
this.s2TeamLeaderId = s2TeamLeaderId;
}
public Long getS1TeamLeaderId() {
return s1TeamLeaderId;
}
public void setS1TeamLeaderId(Long s1TeamLeaderId) {
this.s1TeamLeaderId = s1TeamLeaderId;
}
@Override
public String toString() {
return "PractitionerHiringMemberShip{" +
......@@ -177,6 +271,16 @@ public class PractitionerHiringMemberShip {
", subsystem='" + subsystem + '\'' +
", subsystemOwner='" + subsystemOwner + '\'' +
", branch='" + branch + '\'' +
", systemFlag='" + systemFlag + '\'' +
", s3SubordinateSystemName='" + s3SubordinateSystemName + '\'' +
", s2SubordinateSystemName='" + s2SubordinateSystemName + '\'' +
", s1SubordinateSystemName='" + s1SubordinateSystemName + '\'' +
", s3TeamLeaderName='" + s3TeamLeaderName + '\'' +
", s2TeamLeaderName='" + s2TeamLeaderName + '\'' +
", s1TeamLeaderName='" + s1TeamLeaderName + '\'' +
", s3TeamLeaderId=" + s3TeamLeaderId +
", s2TeamLeaderId=" + s2TeamLeaderId +
", s1TeamLeaderId=" + s1TeamLeaderId +
'}';
}
}
package com.yd.dal.entity.customer;
import java.util.Date;
import lombok.Data;
import java.util.Date;
/**
* 報聘经纪人组织关系表
*/
......@@ -99,4 +100,23 @@ public class AclPractitionerHiringMembership {
private Date updatedAt;
private Long updatedBy;
private Long approvedBy;
/**
* 辅导人的组织架构信息
*/
private String systemFlag;//系统标志,区分公司营业部和体系,1,分公司,2营业部,3,S1分部,4,S2体系,5,S3纵队
private String s3SubordinateSystemName;//s3所属体系名称
private String s2SubordinateSystemName;//s2所属体系名称
private String s1SubordinateSystemName;//s1所属体系名称
private Long s1Id;
private Long s2Id;
private Long s3Id;
private String s3TeamLeaderName;//S3团队长名称
private String s2TeamLeaderName;//S2团队长名称
private String s1TeamLeaderName;//S1团队长名称
private Long s3TeamLeaderId;//S3团队长Id
private Long s2TeamLeaderId;//S2团队长Id
private Long s1TeamLeaderId;//S1团队长Id
}
\ No newline at end of file
package com.yd.dal.entity.practitioner.hiring;
import com.google.common.base.Strings;
import com.yd.dal.entity.order.CustomerPolicyInfo;
import com.yd.util.CommonUtil;
import java.util.Date;
......@@ -41,6 +40,10 @@ public class HiringListInfo implements Comparable<HiringListInfo> {
*/
private String applicationTime;
private Long s1PractitionerId;
private Long s2PractitionerId;
private Long s3PractitionerId;
/**
* 获取 经纪人基本信息id
*
......@@ -149,6 +152,30 @@ public class HiringListInfo implements Comparable<HiringListInfo> {
this.applicationTime = applicationTime;
}
public Long getS1PractitionerId() {
return s1PractitionerId;
}
public void setS1PractitionerId(Long s1PractitionerId) {
this.s1PractitionerId = s1PractitionerId;
}
public Long getS2PractitionerId() {
return s2PractitionerId;
}
public void setS2PractitionerId(Long s2PractitionerId) {
this.s2PractitionerId = s2PractitionerId;
}
public Long getS3PractitionerId() {
return s3PractitionerId;
}
public void setS3PractitionerId(Long s3PractitionerId) {
this.s3PractitionerId = s3PractitionerId;
}
@Override
public String toString() {
return "HiringListInfo{" +
......
......@@ -25,4 +25,17 @@ public interface AgmsDashboardMapper {
List<StatisticsSalesInfo> statisticsSalesEG(@Param("type")String type, @Param("time")String time);
List<PersonalOffLineFYC> personalOffLineFYC(List<String> mobileNoList);
List<Map<String, Object>> queryTeamAllMap();
List<StatisticsSalesInfo> statisticsSalesTeam(@Param("category")String category,
@Param("time")String time, @Param("list")List<Map<String, Object>> teamMapList);
List<StatisticsPractitionerInfo> statisticsPractitionerTeam(@Param("time")String time, @Param("list")List<Map<String, Object>> teamMapList);
List<StatisticsPEPInfo> statisticsPEPTeam(@Param("type")String type, @Param("dropOptionId")Long dropOptionId,
@Param("list")List<Map<String, Object>> teamMapList);
List<StatisticsOpportunityInfo> statisticsOpportunityTeam(@Param("type")String type, @Param("time")String time,
@Param("dropOptionId")Long dropOptionId, @Param("list")List<Map<String, Object>> teamMapList);
}
......@@ -5,6 +5,7 @@ import com.yd.dal.entity.practitioner.hiring.*;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author xxy
......@@ -12,42 +13,55 @@ import java.util.List;
public interface PractitionerHiringMapper {
/**
* 通过经纪人id查询此人审批的报聘经纪人
*
* @param practitionerId 经纪人id
* @return 返回结果
*/
List<HiringListInfo> findHiringList(@Param("practitionerId")Long practitionerId, @Param("approvingStatus")Long approvingStatus);
List<HiringListInfo> findHiringList(@Param("practitionerId") Long practitionerId, @Param("approvingStatus") Long approvingStatus);
/**
* 经纪人审批基本信息
*
* @param hiringBasicInfoId 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
* @return 查询结果
*/
HiringBasicInfo findHiringBasicInfo(Long hiringBasicInfoId);
/**
* 审批经纪人关系
*
* @param hiringBasicInfoId 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
* @return 查询结果
*/
HiringMemberShip findHiringMemberShip(Long hiringBasicInfoId);
/**
* 审批经纪人工作经历
*
* @param hiringBasicInfoId 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
* @return 查询结果
*/
List<HiringWorkingExperience> findHiringWorkingExperienceList(Long hiringBasicInfoId);
/**
* 经纪人申请名目
*
* @param hiringBasicInfoId 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
* @return 查询结果
*/
List<HiringPersonalStatements> findHiringPersonalStatementsList(Long hiringBasicInfoId);
/**
* 经纪人合同条款是否同意
*
* @param hiringBasicInfoId 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
* @return 查询结果
*/
List<HiringContractTermsConfirms> findHiringContractTermsConfirmsList(Long hiringBasicInfoId);
/**
* 已审批结果
*
* @param hiringBasicInfoId 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
* @return 查询结果
*/
......@@ -57,15 +71,20 @@ public interface PractitionerHiringMapper {
/**
* ydLife查询当前经纪人已通过或拒绝的报聘记录
*
* @param practitionerId
* @param approvingStatus
* @return
*/
List<HiringListInfo> queryHandledList(@Param("practitionerId")Long practitionerId, @Param("approvingStatus")int approvingStatus);
List<HiringListInfo> queryHandledList(@Param("practitionerId") Long practitionerId, @Param("approvingStatus") int approvingStatus);
List<HiringListInfo> queryMentorUnhandledList(Long practitionerId);
List<HiringListInfo> querySystemOwnerUnhandledList(Long practitionerId);
List<HiringListInfo> querySystemOwnerUnhandledList(@Param("practitionerId") Long practitionerId);
String getNextContractNo();
Map<String, Long> queryS1S2S3(Long practitionerId);
List<Long> queryBasicInfoIdList(List<Long> list);
}
......@@ -8,6 +8,7 @@ import com.yd.dal.entity.practitioner.PersonalOffLineFYC;
import com.yd.rmi.n22.salary.pojo.Achieve;
import java.util.List;
import java.util.Map;
public interface AgmsDashboardDALService {
List<StatisticsPEPInfo> statisticsPEP(String type,Long dropOptionId);
......@@ -32,4 +33,6 @@ public interface AgmsDashboardDALService {
* @return
*/
List<Achieve> queryN22FYC(Integer time, Integer isPersonal, String loginName);
List<Map<String, Object>> queryTeamAllMap();
}
......@@ -3,6 +3,7 @@ package com.yd.dal.service.agms;
import com.github.pagehelper.PageInfo;
import com.yd.api.agms.vo.hiring.PractitionerHiringListRequestVO;
import com.yd.dal.entity.agms.hiring.*;
import com.yd.dal.entity.customer.AclPractitionerHiringMembership;
import java.util.List;
......@@ -65,4 +66,6 @@ public interface AgmsHiringDALService {
PractitionerHiringListRequestVO requestVO);
List<PractitionerHiringListInfo> queryUnhandledList(PractitionerHiringListRequestVO requestVO);
AclPractitionerHiringMembership queryHiringMemberShip(Long hiringBasicInfoId);
}
......@@ -14,14 +14,13 @@ import com.yd.rmi.n22.salary.service.N22SalaryService;
import com.yd.util.CommonUtil;
import com.yd.util.intercept.annotation.TargetDataSource;
import com.yd.util.intercept.commons.DataSourceKey;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.stream.Collectors;
......@@ -33,15 +32,35 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
private AgmsDashboardMapper agmsDashboardMapper;
@Autowired
private N22SalaryService n22SalaryService;
@Autowired
private AgmsDashboardDALService agmsDashboardDALService;
@Override
public List<StatisticsPEPInfo> statisticsPEP(String type,Long dropOptionId) {
//查询总分数
List<StatisticsPEPInfo> statisticsPEPInfos = agmsDashboardMapper.statisticsPEP(type, dropOptionId);
//查询寿险经纪人人数统计,按type分类
List<Map<String,Long>> practitionerNums = agmsDashboardMapper.getPractitionerNums(type);
ConcurrentMap<Long,Long> practitionerNumMap = new ConcurrentHashMap<>();
practitionerNums.forEach(u->practitionerNumMap.put(u.get("id"),u.get("practitionerNum")));
//查询总分数
List<StatisticsPEPInfo> statisticsPEPInfos = new ArrayList<>();
if ("b".equalsIgnoreCase(type)) {
statisticsPEPInfos = agmsDashboardMapper.statisticsPEP(type, dropOptionId);
} else {
// 新体系
List<Map<String, Object>> teamMapList = agmsDashboardDALService.queryTeamAllMap();
teamMapList= teamMapList.stream().filter((Map<String, Object> i) -> i.size()==2).collect(Collectors.toList());
statisticsPEPInfos = agmsDashboardMapper.statisticsPEPTeam(type, dropOptionId, teamMapList);
for (Map<String, Object> teamMap :teamMapList) {
Object teamMember = teamMap.get("teamMember");
if (null != teamMember) {
List<Long> list = (List<Long>) teamMember;
practitionerNumMap.put((Long) teamMap.get("id"), (long) list.size());
}
}
}
for (StatisticsPEPInfo statisticsPEPInfo:statisticsPEPInfos) {
Long practitionerNum = 0L;
if (type.equalsIgnoreCase("B")){
......@@ -54,6 +73,9 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
practitionerNum = practitionerNumMap.get(0L);
statisticsPEPInfo.setPractitionerNum(practitionerNum);
}
if ("暂无公司".equals(statisticsPEPInfo.getBranchName())) {
continue;
}
Double scoreDay = BigDecimal.valueOf(statisticsPEPInfo.getScoreDay())
.divide(BigDecimal.valueOf(practitionerNum),2,BigDecimal.ROUND_HALF_UP)
.doubleValue();
......@@ -84,23 +106,37 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
.doubleValue();
statisticsPEPInfo.setScoreTotal(scoreTotal);
}
Comparator<StatisticsPEPInfo> byDay = Comparator.comparing(StatisticsPEPInfo::getScoreDay).reversed();
Comparator<StatisticsPEPInfo> byWeek = Comparator.comparing(StatisticsPEPInfo::getScoreWeek).reversed();
Comparator<StatisticsPEPInfo> byMonth = Comparator.comparing(StatisticsPEPInfo::getScoreMonth).reversed();
Comparator<StatisticsPEPInfo> byQuarter = Comparator.comparing(StatisticsPEPInfo::getScoreQuarter).reversed();
Comparator<StatisticsPEPInfo> byDay = Comparator.comparing(StatisticsPEPInfo::getScoreDay, Comparator.nullsLast(Double::compareTo)).reversed();
Comparator<StatisticsPEPInfo> byWeek = Comparator.comparing(StatisticsPEPInfo::getScoreWeek, Comparator.nullsLast(Double::compareTo)).reversed();
Comparator<StatisticsPEPInfo> byMonth = Comparator.comparing(StatisticsPEPInfo::getScoreMonth, Comparator.nullsLast(Double::compareTo)).reversed();
Comparator<StatisticsPEPInfo> byQuarter = Comparator.comparing(StatisticsPEPInfo::getScoreQuarter, Comparator.nullsLast(Double::compareTo)).reversed();
Comparator<StatisticsPEPInfo> statisticsPEPInfoComparator = byDay.thenComparing(byWeek).thenComparing(byMonth).thenComparing(byQuarter);
statisticsPEPInfos = statisticsPEPInfos.stream().sorted(statisticsPEPInfoComparator).collect(Collectors.toList());
return statisticsPEPInfos;
}
@Override
public List<StatisticsOpportunityInfo> statisticsOpportunity(String type,String time, Long dropOptionId) {
return agmsDashboardMapper.statisticsOpportunity(type , time, dropOptionId);
public List<StatisticsOpportunityInfo> statisticsOpportunity(String type, String time, Long dropOptionId) {
if ("b".equalsIgnoreCase(type)) {
return agmsDashboardMapper.statisticsOpportunity(type, time, dropOptionId);
} else {
// 新体系
List<Map<String, Object>> teamMapList = agmsDashboardDALService.queryTeamAllMap();
teamMapList= teamMapList.stream().filter((Map<String, Object> i) -> i.size()==2).collect(Collectors.toList());
return agmsDashboardMapper.statisticsOpportunityTeam(type, time, dropOptionId, teamMapList);
}
}
@Override
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, Object>> teamMapList = this.queryTeamAllMap();
teamMapList= teamMapList.stream().filter((Map<String, Object> i) -> i.size()==2).collect(Collectors.toList());
statisticsSalesInfos = agmsDashboardMapper.statisticsSalesTeam(category, time, teamMapList);
}
getUnitPremium(statisticsSalesInfos);
return statisticsSalesInfos;
}
......@@ -159,8 +195,30 @@ public class AgmsDashboardDALServiceImpl implements AgmsDashboardDALService {
}
@Override
public List<Map<String, Object>> queryTeamAllMap() {
List<Map<String, Object>> memberList = agmsDashboardMapper.queryTeamAllMap();
Object teamMember = null;
String[] arr = null;
for (Map<String, Object> map : memberList) {
teamMember = map.get("teamMember");
if (teamMember != null && StringUtils.isNotBlank((String) teamMember)) {
arr = ((String) teamMember).split(",");
map.put("teamMember", Arrays.asList(arr));
}
}
return memberList;
}
@Override
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, Object>> teamMapList = this.queryTeamAllMap();
statisticsPractitionerInfos = agmsDashboardMapper.statisticsPractitionerTeam(time, teamMapList);
}
//计算实动率
if(statisticsPractitionerInfos != null && statisticsPractitionerInfos.size() > 0){
Integer realAmount,amount;
......
......@@ -5,21 +5,22 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yd.api.agms.vo.hiring.PractitionerHiringListRequestVO;
import com.yd.dal.entity.agms.hiring.*;
import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.entity.customer.AclPractitionerHiringMembership;
import com.yd.dal.entity.customer.AclPractitionerSubordinateSystem;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.entity.practitioner.hiring.HiringListInfo;
import com.yd.dal.entity.user.AclUser;
import com.yd.dal.mapper.agms.AgmsHiringMapper;
import com.yd.dal.mapper.customer.AclPractitionerHiringMembershipMapper;
import com.yd.dal.service.agms.AgmsHiringDALService;
import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService;
import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.dal.service.user.AclUserDALService;
import com.yd.util.CommonUtil;
import com.yd.util.page.PageInfoUtils;
import net.sf.ehcache.Element;
import org.apache.commons.collections.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -42,7 +43,10 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
private PractitionerHiringDALService practitionerHiringDalService;
@Autowired
private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDalService;
@Autowired
private AclPractitionerHiringMembershipMapper membershipMapper;
@Autowired
private AclPractitionerDALService aclPractitionerDALService;
@Autowired
public void setAgmsHiringMapper(AgmsHiringMapper agmsHiringMapper){
......@@ -56,7 +60,79 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
@Override
public PractitionerHiringMemberShip findPractitionerHiringMemberShip(Long hiringBasicInfoId) {
return agmsHiringMapper.findPractitionerHiringMemberShip(hiringBasicInfoId);
PractitionerHiringMemberShip practitionerHiringMemberShip = agmsHiringMapper.findPractitionerHiringMemberShip(hiringBasicInfoId);
AclPractitionerHiringMembership hiringMemberShip = this.queryHiringMemberShip(hiringBasicInfoId);
practitionerHiringMemberShip.setS1TeamLeaderId(hiringMemberShip.getS1TeamLeaderId());
practitionerHiringMemberShip.setS2TeamLeaderId(hiringMemberShip.getS2TeamLeaderId());
practitionerHiringMemberShip.setS3TeamLeaderId(hiringMemberShip.getS3TeamLeaderId());
practitionerHiringMemberShip.setS1TeamLeaderName(hiringMemberShip.getS1TeamLeaderName());
practitionerHiringMemberShip.setS2TeamLeaderName(hiringMemberShip.getS2TeamLeaderName());
practitionerHiringMemberShip.setS3TeamLeaderName(hiringMemberShip.getS3TeamLeaderName());
practitionerHiringMemberShip.setS1SubordinateSystemName(hiringMemberShip.getS1SubordinateSystemName());
practitionerHiringMemberShip.setS2SubordinateSystemName(hiringMemberShip.getS2SubordinateSystemName());
practitionerHiringMemberShip.setS3SubordinateSystemName(hiringMemberShip.getS3SubordinateSystemName());
return practitionerHiringMemberShip;
}
@Override
public AclPractitionerHiringMembership queryHiringMemberShip(Long hiringBasicInfoId) {
AclPractitionerHiringMembership hiringMemberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
if (hiringMemberShip.getMentorPractitionerId() == null) {
return hiringMemberShip;
}
AclPractitioner mentor = aclPractitionerDALService.findPractitionerById(hiringMemberShip.getMentorPractitionerId());
hiringMemberShip.setS1Id(mentor.getS1Id());
hiringMemberShip.setS2Id(mentor.getS2Id());
hiringMemberShip.setS3Id(mentor.getS3Id());
// 查询并显示“辅导人”所属的S1分部,分部负责人,S2体系,体系负责人,S3纵队,纵队负责人,没有的显示空
List<AclPractitionerSubordinateSystem> subordinateSystemList = aclPractitionerSubordinateSystemDalService.findAll();
Map<Long, AclPractitionerSubordinateSystem> subordinateSystemMap = new HashMap<>();
subordinateSystemList.forEach(i -> subordinateSystemMap.put(i.getId(), i));
Map<Long, AclPractitioner> aclPractitionerMap = aclPractitionerDALService.findAllMap();
//所属体系
AclPractitionerSubordinateSystem subordinateSystem = null;
//体系团队长
AclPractitioner systemOwner = null;
if (mentor.getS1Id() != null) {
subordinateSystem = subordinateSystemMap.get(mentor.getS1Id());
if (subordinateSystem != null) {
hiringMemberShip.setS1SubordinateSystemName(subordinateSystem.getName());
systemOwner = aclPractitionerMap.get(subordinateSystem.getOwnerPractitionerId());
hiringMemberShip.setS1TeamLeaderName(systemOwner != null ? systemOwner.getName() : null);
hiringMemberShip.setS1TeamLeaderId(systemOwner != null ? systemOwner.getId() : null);
}
}
if (null != mentor.getS2Id()) {
subordinateSystem = subordinateSystemMap.get(mentor.getS2Id());
if (subordinateSystem != null) {
hiringMemberShip.setS2SubordinateSystemName(subordinateSystem != null ? subordinateSystem.getName() : null);
systemOwner = aclPractitionerMap.get(subordinateSystem.getOwnerPractitionerId());
hiringMemberShip.setS2TeamLeaderName(systemOwner != null ? systemOwner.getName() : null);
hiringMemberShip.setS2TeamLeaderId(systemOwner != null ? systemOwner.getId() : null);
}
}
if (null != mentor.getS3Id()) {
subordinateSystem = subordinateSystemMap.get(mentor.getS3Id());
if (subordinateSystem != null) {
hiringMemberShip.setS3SubordinateSystemName(subordinateSystem != null ? subordinateSystem.getName() : null);
systemOwner = aclPractitionerMap.get(subordinateSystem.getOwnerPractitionerId());
hiringMemberShip.setS3TeamLeaderName(systemOwner != null ? systemOwner.getName() : null);
hiringMemberShip.setS3TeamLeaderId(systemOwner != null ? systemOwner.getId() : null);
}
}
return hiringMemberShip;
}
@Override
......
......@@ -14,6 +14,7 @@ import com.yd.dal.entity.practitioner.payscale.PayScaleBasicInfo;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service("aclPractitionerDALService")
public interface AclPractitionerDALService {
......@@ -261,4 +262,6 @@ public interface AclPractitionerDALService {
* @author Yan Wenyang
*/
void updateUnionSales(Long unionSalesId, String ossPath, String signStatus);
Map<Long, AclPractitioner> findAllMap();
}
......@@ -33,7 +33,10 @@ import org.springframework.web.context.request.RequestContextHolder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("aclPractitionerDALService")
public class AclPractitionerDALServiceImpl implements AclPractitionerDALService {
private static final Logger LOG = Logger.getLogger(AclPractitionerDALServiceImpl.class);
......@@ -378,4 +381,12 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
aclPractitionerMapper.updateUnionSales(unionSalesId, ossPath, signStatus);
}
@Override
public Map<Long, AclPractitioner> findAllMap() {
List<AclPractitioner> list = this.findAll();
Map<Long, AclPractitioner> aclPractitionerMap = new HashMap<>();
list.forEach(i -> aclPractitionerMap.put(i.getId(), i));
return aclPractitionerMap;
}
}
package com.yd.dal.service.practitioner;
import com.github.pagehelper.PageInfo;
import com.yd.api.practitioner.vo.hiring.PractitionerHiringContractTerms;
import com.yd.dal.entity.agms.hiring.*;
import com.yd.dal.entity.practitioner.hiring.*;
import java.util.List;
......@@ -98,4 +96,6 @@ public interface PractitionerHiringDALService {
String getApproveStatusByStepSeq(Integer stepSeq);
Integer getNextStepSeqByApproveStatus(String approveStatus);
List<Long> queryBasicInfoIdList(List<Long> list);
}
......@@ -18,7 +18,6 @@ import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.dal.service.user.AclUserDALService;
import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -113,11 +112,18 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
List<MdPractitionerHiringApproveSteps> stepsList = systemConfigService.findHiringApproveStepsAll();
// 当前经纪人的报聘职级
AclPractitionerHiringMembership hiringMemberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
String mdDropOptionName = hiringMemberShip.getMdDropOptionName();
// 审批的体系负责人
String subsystemOwnerName = "";
if (hiringMemberShip.getApprovedBy() != null) {
AclPractitioner approvedBy = aclPractitionerDALService.findPractitionerById(hiringMemberShip.getApprovedBy());
subsystemOwnerName = (approvedBy != null) ? approvedBy.getName() : "";
}
HiringApproveRecords record;
for (MdPractitionerHiringApproveSteps step : stepsList) {
// S2前2步不用审批
if (Long.valueOf("30").equals(hiringMemberShip.getMdDropOptionId())
if ((mdDropOptionName.indexOf("S2")>=0 || mdDropOptionName.indexOf("S3")>=0)
&& (step.getStepSeq() == 1 || step.getStepSeq() == 2)
) {
continue;
......@@ -142,7 +148,7 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
if ("mentor".equals(step.getApproveRole())) {
obj.setApprovingPractitionerName(hiringMemberShip.getMentor());
} else if ("subsystemOwner".equals(step.getApproveRole())) {
obj.setApprovingPractitionerName(hiringMemberShip.getSubsystemOwner());
obj.setApprovingPractitionerName(subsystemOwnerName);
} else {
String names = aclUserDalService.selectNamesByMobileNos(step.getAppointedApprovePractitioners());
obj.setApprovingPractitionerName(names);
......@@ -207,20 +213,14 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
}
private List<HiringListInfo> queryYdLifeHiringinfoList(Long practitionerId) {
// 查询审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
int approvalIdentity = this.queryApprovalIdentity(practitionerId);
List<HiringListInfo> resultList = new ArrayList<>();
if (approvalIdentity == 1) {
resultList = practitionerHiringMapper.queryMentorUnhandledList(practitionerId);
} else if (approvalIdentity == 2) {
resultList = practitionerHiringMapper.querySystemOwnerUnhandledList(practitionerId);
} else {
List<HiringListInfo> list1 = practitionerHiringMapper.queryMentorUnhandledList(practitionerId);
List<HiringListInfo> list2 = practitionerHiringMapper.querySystemOwnerUnhandledList(practitionerId);
resultList.addAll(list1);
resultList.addAll(list2);
}
List<HiringListInfo> list1 = practitionerHiringMapper.queryMentorUnhandledList(practitionerId);
List<HiringListInfo> list2 = practitionerHiringMapper.querySystemOwnerUnhandledList(practitionerId);
resultList.addAll(list1);
resultList.addAll(list2);
return resultList;
}
......@@ -322,4 +322,9 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
}
return null;
}
@Override
public List<Long> queryBasicInfoIdList(List<Long> list) {
return practitionerHiringMapper.queryBasicInfoIdList(list);
}
}
......@@ -4,6 +4,7 @@ import com.yd.dal.entity.customer.AclInsurerBranch;
import com.yd.dal.entity.meta.*;
import com.yd.dal.service.customer.AclInsurerBranchDALService;
import com.yd.dal.service.meta.*;
import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.rmi.ali.ossinterf.service.AliOssInterfService;
import com.yd.util.CommonUtil;
import net.sf.ehcache.Cache;
......@@ -37,6 +38,8 @@ public class SystemConfigService implements CommandLineRunner{
private MdDropOptionsDALService mdDropOptionsDALService;
@Autowired
private AclInsurerBranchDALService aclInsurerBranchDALService;
@Autowired
private PractitionerHiringDALService practitionerHiringDalService;
/**
* 保存cache
......@@ -347,4 +350,5 @@ public class SystemConfigService implements CommandLineRunner{
}
return map;
}
}
......@@ -35,7 +35,40 @@
group by p.subordinate_system_id
</when>
</choose>
order by scoreDay desc ,scoreWeek desc ,scoreMonth desc;
order by scoreDay desc ,scoreWeek desc ,scoreMonth desc
</select>
<select id="statisticsPEPTeam" resultType="com.yd.dal.entity.agms.dashboard.StatisticsPEPInfo">
<foreach collection="list" item="item" index="index" separator=" union all " >
<if test="item.teamMember != null">
select if(b.branch_name is null,'暂无公司',b.branch_name) branchName,
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,
#{item.id} as subordinateId,
sum(case when to_days(t.track_time)=to_days(now()) then t.track_score else 0 end) scoreDay,
sum(case when YEARWEEK(date_format(t.track_time,'%Y-%m-%d')) = YEARWEEK(now()) then t.track_score else 0 end) scoreWeek,
sum(case when date_format(t.track_time,'%Y-%m')=date_format(now(),'%Y-%m') then t.track_score else 0 end) scoreMonth,
sum(case when QUARTER(t.track_time)=QUARTER(now()) then t.track_score else 0 end) scoreQuarter,
sum(case when YEAR(t.track_time)=YEAR(now()) then t.track_score else 0 end) scoreYear,
sum(case when t.track_score is not null then t.track_score else 0 end) scoreTotal
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_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_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 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)
and p.id in <foreach collection="item.teamMember" item="p_id" open="(" separator="," close=")">#{p_id,jdbcType=BIGINT}</foreach>
</if>
</foreach>
order by scoreDay desc ,scoreWeek desc ,scoreMonth desc
</select>
<select id="statisticsOpportunity" resultType="com.yd.dal.entity.agms.dashboard.StatisticsOpportunityInfo">
......@@ -75,8 +108,8 @@
</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 and b.is_active = 1
left join ag_acl_practitioner_subordinate_system s on s.id = p.subordinate_system_id and s.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
......@@ -88,7 +121,6 @@
and a.id = tt.leads_assigned_id)
<choose>
<when test="type.equalsIgnoreCase('B')">
and p.insurer_branch_id is not null
group by p.insurer_branch_id
</when>
<when test="type.equalsIgnoreCase('T')">
......@@ -96,7 +128,64 @@
group by p.subordinate_system_id
</when>
</choose>
order by predictFYC desc ,predictFYP desc ,pieces desc ,opportunityNum desc;
order by predictFYC desc ,predictFYP desc ,pieces desc ,opportunityNum desc
</select>
<select id="statisticsOpportunityTeam" resultType="com.yd.dal.entity.agms.dashboard.StatisticsOpportunityInfo">
<foreach collection="list" item="item" index="index" separator=" union all " >
<if test="item.teamMember != null">
select if(b.branch_name is null,'暂无公司',b.branch_name) branchName,
(select name from ag_acl_practitioner_subordinate_system where id=#{item.id}) as subordinateName,
<choose>
<when test="time.equalsIgnoreCase('D')">
sum(case when to_days(a.created_at)=to_days(now()) then 1 else 0 end) opportunityNum,
sum(case when to_days(a.time_to_close)=to_days(now()) then a.FYP else 0 end) predictFYP,
sum(case when to_days(a.time_to_close)=to_days(now()) then a.FYC else 0 end) predictFYC,
sum(case when to_days(a.time_to_close)=to_days(now()) then a.pieces else 0 end) pieces
</when>
<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,
sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.FYP else 0 end) predictFYP,
sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.FYC else 0 end) predictFYC,
sum(case when YEARWEEK(date_format(a.time_to_close, '%Y-%m-%d')) = YEARWEEK(now()) then a.pieces else 0 end) pieces
</when>
<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,
sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.FYP else 0 end) predictFYP,
sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.FYC else 0 end) predictFYC,
sum(case when date_format(a.time_to_close, '%Y-%m') = date_format(now(), '%Y-%m') then a.pieces else 0 end) pieces
</when>
<when test="time.equalsIgnoreCase('Q')">
sum(case when QUARTER(a.created_at)=QUARTER(now()) then 1 else 0 end) opportunityNum,
sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.FYP else 0 end) predictFYP,
sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.FYC else 0 end) predictFYC,
sum(case when QUARTER(a.time_to_close) = QUARTER(now()) then a.pieces else 0 end) pieces
</when>
<when test="time.equalsIgnoreCase('Y')">
sum(case when YEAR(a.created_at)=YEAR(now()) then 1 else 0 end) opportunityNum,
sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.FYP else 0 end) predictFYP,
sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.FYC else 0 end) predictFYC,
sum(case when YEAR(a.time_to_close) = YEAR(now()) then a.pieces else 0 end) 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 and b.is_active = 1
left join ag_acl_practitioner_subordinate_system s on s.id = p.subordinate_system_id and s.is_active = 1
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 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)
and p.id in <foreach collection="item.teamMember" item="p_id" open="(" separator="," close=")">#{p_id,jdbcType=BIGINT}</foreach>
</if>
</foreach>
order by predictFYC desc ,predictFYP desc ,pieces desc ,opportunityNum desc
</select>
<select id="getPractitionerNums" resultType="java.util.Map">
......@@ -146,10 +235,11 @@
</otherwise>
</choose>
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
from ag_acl_practitioner p
inner join ag_po_order o on o.broker_customer_id = p.customer_id
INNER JOIN ag_acl_life_insurance_practitioner lip ON lip.practitioner_id= p.id
INNER JOIN ag_po_order o ON o.policy_no = lip.policy_no
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
......@@ -180,7 +270,6 @@
</choose>
<choose>
<when test="type.equalsIgnoreCase('B')">
and p.insurer_branch_id is not null
group by p.insurer_branch_id
</when>
<otherwise>
......@@ -191,6 +280,59 @@
order by 4 desc
</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
(select name from ag_acl_practitioner_subordinate_system where id=#{item.id}) as typeName,
#{item.id} as typeId,
(SELECT drop_option_code
from ag_acl_practitioner_subordinate_system s
LEFT JOIN ag_acl_practitioner_setting b on b.practitioner_id = s.owner_practitioner_id
LEFT JOIN ag_md_drop_options op1 ON op1.id = b.practitioner_level
where s.id=#{item.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_acl_life_insurance_practitioner lip ON lip.practitioner_id= p.id
INNER JOIN ag_po_order o ON o.policy_no = lip.policy_no
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 <foreach collection="item.teamMember" item="p_id" open="(" separator="," close=")">#{p_id,jdbcType=BIGINT}</foreach>
<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">
<choose>
......@@ -246,13 +388,63 @@
WHERE p.is_active = 1
AND p.subordinate_system_id IS NOT NULL
GROUP BY p.subordinate_system_id
union all <include refid="statisticsPractitionerS2"/>
union all <include refid="statisticsPractitionerS3"/>
ORDER BY amount DESC
</otherwise>
</choose>
</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 <foreach collection="item.teamMember" item="p_id" open="(" separator="," close=")">#{p_id,jdbcType=BIGINT}</foreach>
and p.is_active = 1
</if>
</foreach>
</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">
SELECT
s.id as typeId,
......@@ -395,4 +587,18 @@
group by sales.SAL_MST_MOBILE
</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.s1_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>
\ No newline at end of file
......@@ -322,8 +322,14 @@
<if test="approveStatus != null">
and b.approve_status = #{approveStatus}
</if>
and m.md_drop_option_id = 30
and m.md_drop_option_id
in (select md.id
from ag_md_drop_options md
left join ag_md_drop_master ms on ms.id = md.drop_master_id
where 1=1
and ms.scenario_code = 'practitioner_level'
and md.drop_option_code in ('S2','S3')
)
</select>
</mapper>
......@@ -23,13 +23,14 @@
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
<result column="approved_by" jdbcType="BIGINT" property="approvedBy" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, hiring_basic_info_id, md_drop_option_id, md_drop_option_name, mentor_practitioner_id,
mentor, introducer_practitioner_id, introducer, subsystem_id, subsystem, subsystem_owner_id,
subsystem_owner, branch_id, branch, is_active, created_at, created_by,
updated_at, updated_by
updated_at, updated_by, approved_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
......@@ -243,6 +244,9 @@
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
<if test="approvedBy != null">
approved_by = #{approvedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......
......@@ -96,7 +96,7 @@
education_level, graduated_university, mentor_id,
introducer_id, gender, contract_oss_path,
hiring_basic_info_id, can_login_dyd, can_see_salary_list,
detail_address,account_bank,bank_card_no,email
detail_address,account_bank,bank_card_no,email,s1_id,s2_id,s3_id
)
values (#{insurerId,jdbcType=BIGINT}, #{insurerBranchId,jdbcType=BIGINT}, #{deptId,jdbcType=BIGINT},
#{subordinateSystemId,jdbcType=BIGINT}, #{practitionerCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
......@@ -113,7 +113,8 @@
#{educationLevel,jdbcType=VARCHAR}, #{graduatedUniversity,jdbcType=VARCHAR}, #{mentorId,jdbcType=BIGINT},
#{introducerId,jdbcType=BIGINT}, #{gender,jdbcType=INTEGER}, #{contractOssPath,jdbcType=VARCHAR},
#{hiringBasicInfoId,jdbcType=BIGINT}, #{canLoginDyd,jdbcType=BIGINT}, #{canSeeSalaryList,jdbcType=BIGINT},
#{detailAddress},#{accountBank,jdbcType=VARCHAR}, #{bankCardNo,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}
#{detailAddress},#{accountBank,jdbcType=VARCHAR}, #{bankCardNo,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR},
#{s1Id,jdbcType=BIGINT},#{s2Id,jdbcType=BIGINT},#{s3Id,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitioner" useGeneratedKeys="true">
......
......@@ -198,7 +198,7 @@
o.ydBranchId,
o.cover_term_type coverageTerm,
CONCAT(o.payment_term, (case o.payment_term_unit when 'Y' then '年' when 'M' then '月' else '' END)) payTerm
CONCAT(o.payment_term, (case o.payment_term_unit when 'Y' then '年' when 'M' then '月' else '' END)) payTerm
from ag_po_order_commission oc
left join
(SELECT id, order_price, product_id,
......@@ -206,7 +206,7 @@
payment_term, payment_term_unit,broker_customer_id,
cover_term_type
from ag_po_order t
where t.status in (3,4) and t.policy_no is not null
where t.status=3 and t.payment_status=3 and t.policy_no is not null
and (t.plan_id not in (424,453,464) or t.plan_id is null)
) o ON o.id = oc.order_id
left join ag_product_life_commission_base b on oc.commission_base_id = b.id
......
......@@ -9,6 +9,9 @@
<result column="practitionerLevel" jdbcType="VARCHAR" property="practitionerLevel"/>
<result column="mentor" jdbcType="VARCHAR" property="mentor"/>
<result column="applicationTime" jdbcType="VARCHAR" property="applicationTime"/>
<result column="s1PractitionerId" jdbcType="BIGINT" property="s1PractitionerId"/>
<result column="s2PractitionerId" jdbcType="BIGINT" property="s2PractitionerId"/>
<result column="s3PractitionerId" jdbcType="BIGINT" property="s3PractitionerId"/>
</resultMap>
<select id="findHiringList" resultMap="HiringListInfo">
select b.id hiringBasicInfoId,
......@@ -126,7 +129,7 @@
mentor mentor,
introducer introducer,
subsystem subsystem,
subsystem_owner subsystemOwner,
(select name from ag_acl_practitioner where id = approved_by) subsystemOwner,
branch branch
from ag_acl_practitioner_hiring_membership
where hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT}
......@@ -253,7 +256,7 @@
from ag_acl_practitioner_hiring_basic_info b
left join ag_acl_practitioner_hiring_membership m on b.id = m.hiring_basic_info_id
where 1=1
and m.subsystem_owner_id = #{practitionerId,jdbcType=BIGINT}
and m.approved_by = #{practitionerId,jdbcType=BIGINT}
and b.approve_status = '1'
and m.md_drop_option_id != (select id
from ag_md_drop_options
......@@ -266,4 +269,21 @@
<select id="getNextContractNo" resultType="java.lang.String" statementType="CALLABLE">
select f_getNextContractNo()
</select>
<select id="queryS1S2S3" resultType="Map">
SELECT
(select owner_practitioner_id from ag_acl_practitioner_subordinate_system where id=p.s1_id) as s1PractitionerId,
(select owner_practitioner_id from ag_acl_practitioner_subordinate_system where id=p.s2_id) as s2PractitionerId,
(select owner_practitioner_id from ag_acl_practitioner_subordinate_system where id=p.s3_id) as s3PractitionerId
from ag_acl_practitioner p
where p.id = #{practitionerId,jdbcType=BIGINT}
</select>
<select id="queryBasicInfoIdList" resultType="java.lang.Long">
select b.id
from ag_acl_practitioner_hiring_basic_info b
where 1=1
and b.id in <foreach collection="list" item="p_id" open="(" separator="," close=")">#{p_id,jdbcType=BIGINT}</foreach>
and b.approve_status = '1'
</select>
</mapper>
\ No newline at end of file
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