Commit 327ec488 by jianan

【电子报聘】报聘经纪人所属体系规则优化

parent d1aa5bcf
...@@ -232,10 +232,10 @@ public class AgmsHiringServiceImpl implements AgmsHiringService { ...@@ -232,10 +232,10 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
String approveRole = step.getApproveRole(); String approveRole = step.getApproveRole();
AclPractitionerHiringMembership membership = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId); AclPractitionerHiringMembership membership = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
if ("subsystemOwner".equals(approveRole)) { if ("subsystemOwner".equals(approveRole)) {
if (!practitionerId.equals(membership.getSubsystemOwnerId())) { // if (!practitionerId.equals(membership.getSubsystemOwnerId())) {
responseVO.setCommonResult(new CommonResult(false, "无此流程的审批权限")); // responseVO.setCommonResult(new CommonResult(false, "无此流程的审批权限"));
return; // return;
} // }
} else { } else {
if (!practitionerId.equals(membership.getMentorPractitionerId())) { if (!practitionerId.equals(membership.getMentorPractitionerId())) {
responseVO.setCommonResult(new CommonResult(false, "无此流程的审批权限")); responseVO.setCommonResult(new CommonResult(false, "无此流程的审批权限"));
......
...@@ -6,11 +6,14 @@ import com.yd.api.practitioner.service.PractitionerHiringContractService; ...@@ -6,11 +6,14 @@ import com.yd.api.practitioner.service.PractitionerHiringContractService;
import com.yd.dal.entity.customer.*; import com.yd.dal.entity.customer.*;
import com.yd.dal.mapper.customer.*; import com.yd.dal.mapper.customer.*;
import com.yd.dal.mapper.practitioner.PractitionerHiringMapper; 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.ali.oss.service.OssService;
import com.yd.rmi.cache.SystemConfigService; import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import com.yd.util.HttpUtil; import com.yd.util.HttpUtil;
import com.yd.util.PDFConfiguration; import com.yd.util.PDFConfiguration;
import org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -43,6 +46,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -43,6 +46,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
private AclInsurerBranchMapper branchMapper; private AclInsurerBranchMapper branchMapper;
@Autowired @Autowired
private AclInsurerBranchDeptMapper deptMapper; private AclInsurerBranchDeptMapper deptMapper;
@Autowired
private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDALService;
/** /**
...@@ -169,7 +174,14 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -169,7 +174,14 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
AclPractitioner introducer = aclPractitionerMapper.selectByPrimaryKey(memberShip.getIntroducerPractitionerId()); AclPractitioner introducer = aclPractitionerMapper.selectByPrimaryKey(memberShip.getIntroducerPractitionerId());
AclPractitioner second = aclPractitionerMapper.selectByMobileNo(basicInfo.getMobileNo()); AclPractitioner second = aclPractitionerMapper.selectByMobileNo(basicInfo.getMobileNo());
List<AclPractitionerHiringWorkingExperience> workingExperienceList = workingExperienceMapper.selectByHiringBasicInfoId(hiringBasicInfoId); List<AclPractitionerHiringWorkingExperience> workingExperienceList = workingExperienceMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
//获取体系负责人的的审批记录
List<AclPractitionerHiringApproveRecords> recordsList = recordsMapper.queryListByBasicInfoId(hiringBasicInfoId);
BeanPropertyValueEqualsPredicate predicate = new BeanPropertyValueEqualsPredicate("approveStepId", 2);
List<AclPractitionerHiringApproveRecords> systermOwnerRecords = (List<AclPractitionerHiringApproveRecords>) CollectionUtils.select(recordsList, predicate);
AclPractitionerHiringApproveRecords systermOwnerRecord = systermOwnerRecords.get(0);
List<AclPractitionerSubordinateSystem> subordinateSystems = aclPractitionerSubordinateSystemDALService.findByOwnerPractitionerId(systermOwnerRecord.getApprovingPractitionerId());
AclPractitionerSubordinateSystem systermOwnerRecordSystem = subordinateSystems.get(0);
String mentorName = mentor == null ? "" : mentor.getName(); String mentorName = mentor == null ? "" : mentor.getName();
String mentorIdNo = mentor == null ? "" : mentor.getIdNo(); String mentorIdNo = mentor == null ? "" : mentor.getIdNo();
...@@ -192,7 +204,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -192,7 +204,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
//1页 //1页
data.put("contactNo", contractNo); data.put("contactNo", contractNo);
data.put("practitionerNo", second.getPractitionerCode()); data.put("practitionerNo", second.getPractitionerCode());
data.put("subsystem", memberShip.getSubsystem()); data.put("subsystem", systermOwnerRecordSystem.getName());
data.put("practitioner", basicInfo.getName()); data.put("practitioner", basicInfo.getName());
data.put("idNo", basicInfo.getIdNo()); data.put("idNo", basicInfo.getIdNo());
...@@ -205,7 +217,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -205,7 +217,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
data.put("firstPartyResponser", firstPartyResponser); data.put("firstPartyResponser", firstPartyResponser);
data.put("firstPartyAddress", firstPartyAddress); data.put("firstPartyAddress", firstPartyAddress);
// 设置一些地址 // 设置一些地址
this.setSomeAddress(data, hiringBasicInfoId); this.setSomeAddress(data, hiringBasicInfoId, systermOwnerRecordSystem);
Calendar now = Calendar.getInstance(); Calendar now = Calendar.getInstance();
data.put("contactYear", now.get(Calendar.YEAR) + ""); data.put("contactYear", now.get(Calendar.YEAR) + "");
...@@ -245,7 +257,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -245,7 +257,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
data.put("secondEffectiveDay", applyDate.get(Calendar.DAY_OF_MONTH) + ""); data.put("secondEffectiveDay", applyDate.get(Calendar.DAY_OF_MONTH) + "");
data.put("secondParty802", basicInfo.getName()); data.put("secondParty802", basicInfo.getName());
data.put("secondMentor801", mentorName); data.put("secondMentor801", mentorName);
data.put("secondSubsystem", memberShip.getSubsystem()); data.put("secondSubsystem", systermOwnerRecordSystem.getName());
data.put("secondSubsystemNo", ""); data.put("secondSubsystemNo", "");
// 签核人员 // 签核人员
this.setApprovepeople(data, hiringBasicInfoId); this.setApprovepeople(data, hiringBasicInfoId);
...@@ -269,10 +281,10 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -269,10 +281,10 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
return data; return data;
} }
private void setSomeAddress(Map<String, String> data, Long hiringBasicInfoId) { private void setSomeAddress(Map<String, String> data, Long hiringBasicInfoId, AclPractitionerSubordinateSystem systermOwnerRecordSystem) {
AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId); AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId); AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
AclPractitioner systemOwner = aclPractitionerMapper.selectByPrimaryKey(memberShip.getSubsystemOwnerId()); AclPractitioner systemOwner = aclPractitionerMapper.selectByPrimaryKey(systermOwnerRecordSystem.getOwnerPractitionerId());
AclPractitioner mentor = aclPractitionerMapper.selectByPrimaryKey(memberShip.getMentorPractitionerId()); AclPractitioner mentor = aclPractitionerMapper.selectByPrimaryKey(memberShip.getMentorPractitionerId());
String mentorName = mentor == null ? "" : mentor.getName(); String mentorName = mentor == null ? "" : mentor.getName();
...@@ -287,7 +299,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring ...@@ -287,7 +299,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
data.put("secondMobileNo", basicInfo.getMobileNo()); data.put("secondMobileNo", basicInfo.getMobileNo());
data.put("secondSubsystemOwner", memberShip.getSubsystemOwner()); data.put("secondSubsystemOwner", systermOwnerRecordSystem.getName());
data.put("secondSubsystemSignature", memberShip.getSubsystemOwner()); data.put("secondSubsystemSignature", memberShip.getSubsystemOwner());
// 查团队长信息 // 查团队长信息
String systemOwnerIdNo = null; String systemOwnerIdNo = null;
......
...@@ -11,6 +11,7 @@ import com.yd.dal.entity.practitioner.hiring.*; ...@@ -11,6 +11,7 @@ import com.yd.dal.entity.practitioner.hiring.*;
import com.yd.dal.mapper.customer.*; import com.yd.dal.mapper.customer.*;
import com.yd.dal.service.customer.AclPractitionerDALService; import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.dal.service.customer.AclPractitionerHiringApproveRecordsDALService; import com.yd.dal.service.customer.AclPractitionerHiringApproveRecordsDALService;
import com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService; import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.rmi.ali.oss.service.OssService; import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.ali.send.service.SendService; import com.yd.rmi.ali.send.service.SendService;
...@@ -61,6 +62,8 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -61,6 +62,8 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private AclPractitionerDALService aclPractitionerDALService; private AclPractitionerDALService aclPractitionerDALService;
@Autowired @Autowired
private AclPractitionerPotentialMapper aclPractitionerPotentialMapper; private AclPractitionerPotentialMapper aclPractitionerPotentialMapper;
@Autowired
private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDALService;
private PractitionerHiringDALService practitionerHiringDalService; private PractitionerHiringDALService practitionerHiringDalService;
private SystemConfigService systemConfigService; private SystemConfigService systemConfigService;
...@@ -422,11 +425,11 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -422,11 +425,11 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
Long approvingStatus = requestVO.getApprovingStatus(); Long approvingStatus = requestVO.getApprovingStatus();
//等保调整 //等保调整
List<AclCustomer> findByObjSortable = aclPractitionerDALService.getAclCustomers(practitionerId,null); // List<AclCustomer> findByObjSortable = aclPractitionerDALService.getAclCustomers(practitionerId,null);
if(null == findByObjSortable ){ // if(null == findByObjSortable ){
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("630028"))); // responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("630028")));
return responseVO; // return responseVO;
} // }
List<HiringListInfo> hiringListInfoList; List<HiringListInfo> hiringListInfoList;
if (Long.valueOf("0").equals(approvingStatus)) { if (Long.valueOf("0").equals(approvingStatus)) {
// 当前经纪人的待审批记录 // 当前经纪人的待审批记录
...@@ -795,6 +798,14 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -795,6 +798,14 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private void sendMsgAfterPDF(Long hiringBasicInfoId) { private void sendMsgAfterPDF(Long hiringBasicInfoId) {
AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId); AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId); AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
//获取体系负责人的的审批记录
List<AclPractitionerHiringApproveRecords> recordsList = recordsMapper.queryListByBasicInfoId(hiringBasicInfoId);
BeanPropertyValueEqualsPredicate predicate = new BeanPropertyValueEqualsPredicate("approveStepId", 2);
List<AclPractitionerHiringApproveRecords> systermOwnerRecords = (List<AclPractitionerHiringApproveRecords>) CollectionUtils.select(recordsList, predicate);
AclPractitionerHiringApproveRecords systermOwnerRecord = systermOwnerRecords.get(0);
List<AclPractitionerSubordinateSystem> subordinateSystems = aclPractitionerSubordinateSystemDALService.findByOwnerPractitionerId(systermOwnerRecord.getApprovingPractitionerId());
AclPractitionerSubordinateSystem systermOwnerRecordSystem = subordinateSystems.get(0);
List<String> mobileNoList = new ArrayList<>(3); List<String> mobileNoList = new ArrayList<>(3);
mobileNoList.add(basicInfo.getMobileNo()); mobileNoList.add(basicInfo.getMobileNo());
...@@ -811,8 +822,8 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -811,8 +822,8 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
mobileNoList.add(mentor.getMobileNo()); mobileNoList.add(mentor.getMobileNo());
} }
if (memberShip.getSubsystemOwnerId() != null) { if (systermOwnerRecord.getApprovingPractitionerId() != null) {
AclPractitioner system = aclPractitionerMapper.selectByPrimaryKey(memberShip.getSubsystemOwnerId()); AclPractitioner system = aclPractitionerMapper.selectByPrimaryKey(systermOwnerRecord.getApprovingPractitionerId());
mobileNoList.add(system.getMobileNo()); mobileNoList.add(system.getMobileNo());
} }
// 若辅导人和团队长为同一人,去重 // 若辅导人和团队长为同一人,去重
...@@ -900,7 +911,9 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService ...@@ -900,7 +911,9 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
} }
private String handleApproveStatus(AclPractitionerHiringMembership 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"; return "2";
} }
if (hiringMemberShip.getMentor() == null || hiringMemberShip.getMentorPractitionerId() == null) { if (hiringMemberShip.getMentor() == null || hiringMemberShip.getMentorPractitionerId() == null) {
......
package com.yd.dal.entity.practitioner.hiring; package com.yd.dal.entity.practitioner.hiring;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.yd.dal.entity.order.CustomerPolicyInfo;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import java.util.Date; import java.util.Date;
...@@ -41,6 +40,10 @@ public class HiringListInfo implements Comparable<HiringListInfo> { ...@@ -41,6 +40,10 @@ public class HiringListInfo implements Comparable<HiringListInfo> {
*/ */
private String applicationTime; private String applicationTime;
private Long s1PractitionerId;
private Long s2PractitionerId;
private Long s3PractitionerId;
/** /**
* 获取 经纪人基本信息id * 获取 经纪人基本信息id
* *
...@@ -149,6 +152,30 @@ public class HiringListInfo implements Comparable<HiringListInfo> { ...@@ -149,6 +152,30 @@ public class HiringListInfo implements Comparable<HiringListInfo> {
this.applicationTime = applicationTime; 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 @Override
public String toString() { public String toString() {
return "HiringListInfo{" + return "HiringListInfo{" +
......
...@@ -5,6 +5,7 @@ import com.yd.dal.entity.practitioner.hiring.*; ...@@ -5,6 +5,7 @@ import com.yd.dal.entity.practitioner.hiring.*;
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
...@@ -68,4 +69,6 @@ public interface PractitionerHiringMapper { ...@@ -68,4 +69,6 @@ public interface PractitionerHiringMapper {
List<HiringListInfo> querySystemOwnerUnhandledList(Long practitionerId); List<HiringListInfo> querySystemOwnerUnhandledList(Long practitionerId);
String getNextContractNo(); String getNextContractNo();
Map<String, Long> queryS1S2S3(Long practitionerId);
} }
...@@ -18,7 +18,6 @@ import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService; ...@@ -18,7 +18,6 @@ import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService; import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.dal.service.user.AclUserDALService; import com.yd.dal.service.user.AclUserDALService;
import com.yd.rmi.cache.SystemConfigService; import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -209,6 +208,8 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe ...@@ -209,6 +208,8 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
private List<HiringListInfo> queryYdLifeHiringinfoList(Long practitionerId) { private List<HiringListInfo> queryYdLifeHiringinfoList(Long practitionerId) {
// 查询审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长 // 查询审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
int approvalIdentity = this.queryApprovalIdentity(practitionerId); int approvalIdentity = this.queryApprovalIdentity(practitionerId);
// 查询当前经纪人的S1,S2,S3体系的团队长practitionerId
Map<String, Long> SystemOwners = practitionerHiringMapper.queryS1S2S3(practitionerId);
List<HiringListInfo> resultList = new ArrayList<>(); List<HiringListInfo> resultList = new ArrayList<>();
if (approvalIdentity == 1) { if (approvalIdentity == 1) {
...@@ -221,7 +222,27 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe ...@@ -221,7 +222,27 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
resultList.addAll(list1); resultList.addAll(list1);
resultList.addAll(list2); resultList.addAll(list2);
} }
return resultList;
// resultList = practitionerHiringMapper.querySystemOwnerUnhandledList(practitionerId);
List<HiringListInfo> list = new ArrayList<>();
for (HiringListInfo item :resultList) {
Long s2PractitionerId = item.getS2PractitionerId();
Long s1PractitionerId = item.getS1PractitionerId();
Long s3PractitionerId = item.getS3PractitionerId();
if(s2PractitionerId != null && practitionerId.equals(s2PractitionerId)){
list.add(item);
continue;
}
if(s2PractitionerId == null && s1PractitionerId != null && practitionerId.equals(s1PractitionerId)){
list.add(item);
continue;
}
if(s2PractitionerId == null && s1PractitionerId == null && practitionerId.equals(s3PractitionerId)){
list.add(item);
}
}
return list;
} }
private List<HiringListInfo> queryAGMSHiringinfoList(String practitionerMobileNo) { private List<HiringListInfo> queryAGMSHiringinfoList(String practitionerMobileNo) {
......
...@@ -322,8 +322,14 @@ ...@@ -322,8 +322,14 @@
<if test="approveStatus != null"> <if test="approveStatus != null">
and b.approve_status = #{approveStatus} and b.approve_status = #{approveStatus}
</if> </if>
and m.md_drop_option_id = 30 and m.md_drop_option_id
in (select id
from ag_md_drop_options md
left join ag_md_drop_master ms on ms.id = m.drop_master_id
where 1=1
and ms.scenario_code = 'practitioner_level'
and md.drop_option_code in ('S2','S3')
)
</select> </select>
</mapper> </mapper>
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
<result column="practitionerLevel" jdbcType="VARCHAR" property="practitionerLevel"/> <result column="practitionerLevel" jdbcType="VARCHAR" property="practitionerLevel"/>
<result column="mentor" jdbcType="VARCHAR" property="mentor"/> <result column="mentor" jdbcType="VARCHAR" property="mentor"/>
<result column="applicationTime" jdbcType="VARCHAR" property="applicationTime"/> <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> </resultMap>
<select id="findHiringList" resultMap="HiringListInfo"> <select id="findHiringList" resultMap="HiringListInfo">
select b.id hiringBasicInfoId, select b.id hiringBasicInfoId,
...@@ -249,11 +252,14 @@ ...@@ -249,11 +252,14 @@
date_format(b.created_at, '%Y-%m-%d %H:%i:%s') applicationTime, date_format(b.created_at, '%Y-%m-%d %H:%i:%s') applicationTime,
if(m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT} and if(m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT} and
m.subsystem_owner_id = #{practitionerId,jdbcType=BIGINT}, 0, m.subsystem_owner_id = #{practitionerId,jdbcType=BIGINT}, 0,
if(m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT}, 1, 2)) approvalIdentity if(m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT}, 1, 2)) approvalIdentity,
(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_hiring_basic_info b from ag_acl_practitioner_hiring_basic_info b
left join ag_acl_practitioner_hiring_membership m on b.id = m.hiring_basic_info_id left join ag_acl_practitioner_hiring_membership m on b.id = m.hiring_basic_info_id
left join ag_acl_practitioner p on m.subsystem_owner_id = p.id
where 1=1 where 1=1
and m.subsystem_owner_id = #{practitionerId,jdbcType=BIGINT}
and b.approve_status = '1' and b.approve_status = '1'
and m.md_drop_option_id != (select id and m.md_drop_option_id != (select id
from ag_md_drop_options from ag_md_drop_options
...@@ -266,4 +272,13 @@ ...@@ -266,4 +272,13 @@
<select id="getNextContractNo" resultType="java.lang.String" statementType="CALLABLE"> <select id="getNextContractNo" resultType="java.lang.String" statementType="CALLABLE">
select f_getNextContractNo() select f_getNextContractNo()
</select> </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>
</mapper> </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