Commit f9496744 by yao.xiao

补充agms经纪人报聘详情查询

parent 96914641
package com.yd.api.agms.service.impl; package com.yd.api.agms.service.impl;
import com.yd.api.agms.service.AgmsHiringService; import com.yd.api.agms.service.AgmsHiringService;
import com.yd.api.agms.vo.hiring.PractitionerHiringApproveSteps;
import com.yd.api.agms.vo.hiring.PractitionerHiringDetailRequestVO; import com.yd.api.agms.vo.hiring.PractitionerHiringDetailRequestVO;
import com.yd.api.agms.vo.hiring.PractitionerHiringDetailResponseVO; import com.yd.api.agms.vo.hiring.PractitionerHiringDetailResponseVO;
import com.yd.api.result.CommonResult; import com.yd.api.result.CommonResult;
import com.yd.dal.entity.agms.hiring.*; import com.yd.dal.entity.agms.hiring.*;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.entity.user.AclUser;
import com.yd.dal.service.agms.AgmsHiringDALService; import com.yd.dal.service.agms.AgmsHiringDALService;
import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.dal.service.user.AclUserDALService;
import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil;
import com.yd.util.config.ZHBErrorConfig; import com.yd.util.config.ZHBErrorConfig;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -19,31 +26,50 @@ import java.util.List; ...@@ -19,31 +26,50 @@ import java.util.List;
public class AgmsHiringServiceImpl implements AgmsHiringService { public class AgmsHiringServiceImpl implements AgmsHiringService {
private AgmsHiringDALService agmsHiringDalService; private AgmsHiringDALService agmsHiringDalService;
private SystemConfigService systemConfigService;
private AclUserDALService aclUserDalService;
private MdPractitionerHiringApproveStepsDALService mdPractitionerHiringApproveStepsDalService;
@Autowired @Autowired
public void setAgmsHiringDalService(AgmsHiringDALService agmsHiringDalService){ public void setAgmsHiringDalService(AgmsHiringDALService agmsHiringDalService){
this.agmsHiringDalService = agmsHiringDalService; this.agmsHiringDalService = agmsHiringDalService;
} }
@Autowired
public void setSystemConfigService(SystemConfigService systemConfigService) {
this.systemConfigService = systemConfigService;
}
@Autowired
public void setMdPractitionerHiringApproveStepsDalService(MdPractitionerHiringApproveStepsDALService mdPractitionerHiringApproveStepsDalService) {
this.mdPractitionerHiringApproveStepsDalService = mdPractitionerHiringApproveStepsDalService;
}
@Autowired
public void setAclUserDalService(AclUserDALService aclUserDalService) {
this.aclUserDalService = aclUserDalService;
}
@Override @Override
public PractitionerHiringDetailResponseVO practitionerHiringDetail(PractitionerHiringDetailRequestVO requestVO) { public PractitionerHiringDetailResponseVO practitionerHiringDetail(PractitionerHiringDetailRequestVO requestVO) {
PractitionerHiringDetailResponseVO responseVO = new PractitionerHiringDetailResponseVO(); PractitionerHiringDetailResponseVO responseVO = new PractitionerHiringDetailResponseVO();
Long hiringBasicInfoId = requestVO.getHiringBasicInfoId(); Long hiringBasicInfoId = requestVO.getHiringBasicInfoId();
Long loginId = requestVO.getLoginId();
//经纪人审批基本信息 //经纪人审批基本信息
PractitionerHiringBasicInfo practitionerHiringBasicInfo = agmsHiringDalService.findPractitionerHiringBasicInfo(hiringBasicInfoId); PractitionerHiringBasicInfo practitionerHiringBasicInfo = agmsHiringDalService.findPractitionerHiringBasicInfo(hiringBasicInfoId);
//审批经纪人关系 //审批经纪人关系
PractitionerHiringMemberShip practitionerHiringMemberShip = agmsHiringDalService.findPractitionerHiringMemberShip(hiringBasicInfoId); PractitionerHiringMemberShip practitionerHiringMemberShip = agmsHiringDalService.findPractitionerHiringMemberShip(hiringBasicInfoId);
//审批经纪人工作经历 //审批经纪人工作经历
List<PractitionerHiringWorkingExperience> practitionerHiringWorkingExperienceList = agmsHiringDalService.findPractitionerHiringWorkingExperienceList(hiringBasicInfoId);; List<PractitionerHiringWorkingExperience> practitionerHiringWorkingExperienceList = agmsHiringDalService.findPractitionerHiringWorkingExperienceList(hiringBasicInfoId);
//经纪人申请名目 //经纪人申请名目
List<PractitionerHiringPersonalStatements> practitionerHiringPersonalStatementsList = agmsHiringDalService.findPractitionerHiringPersonalStatementsList(hiringBasicInfoId);; List<PractitionerHiringPersonalStatements> practitionerHiringPersonalStatementsList = agmsHiringDalService.findPractitionerHiringPersonalStatementsList(hiringBasicInfoId);
//经纪人合同条款是否同意 //经纪人合同条款是否同意
List<PractitionerHiringContractTermsConfirms> practitionerHiringContractTermsConfirmsList = agmsHiringDalService.findPractitionerHiringContractTermsConfirmsList(hiringBasicInfoId);; List<PractitionerHiringContractTermsConfirms> practitionerHiringContractTermsConfirmsList = agmsHiringDalService.findPractitionerHiringContractTermsConfirmsList(hiringBasicInfoId);
//已审批结果 //已审批结果
List<PractitionerHiringApproveRecords> practitionerHiringApproveRecordsList = agmsHiringDalService.findPractitionerHiringApproveRecordsList(hiringBasicInfoId);; List<PractitionerHiringApproveRecords> practitionerHiringApproveRecordsList = agmsHiringDalService.findPractitionerHiringApproveRecordsList(hiringBasicInfoId);
//查询是否可进行审批操作 0.不可审批(未到) 1.可审批 2.已审批 3.无权审批(默认)
PractitionerHiringApproveSteps practitionerHiringApproveSteps = getHiringApproveStatus(loginId,practitionerHiringMemberShip.getPractitionerLevelId(),practitionerHiringApproveRecordsList);
responseVO.setHiringBasicInfoId(hiringBasicInfoId); responseVO.setHiringBasicInfoId(hiringBasicInfoId);
responseVO.setPractitionerHiringApproveSteps(practitionerHiringApproveSteps);
responseVO.setPractitionerHiringBasicInfo(practitionerHiringBasicInfo); responseVO.setPractitionerHiringBasicInfo(practitionerHiringBasicInfo);
responseVO.setPractitionerHiringMemberShip(practitionerHiringMemberShip); responseVO.setPractitionerHiringMemberShip(practitionerHiringMemberShip);
responseVO.setPractitionerHiringWorkingExperienceList(practitionerHiringWorkingExperienceList); responseVO.setPractitionerHiringWorkingExperienceList(practitionerHiringWorkingExperienceList);
...@@ -53,4 +79,90 @@ public class AgmsHiringServiceImpl implements AgmsHiringService { ...@@ -53,4 +79,90 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO; return responseVO;
} }
private PractitionerHiringApproveSteps getHiringApproveStatus(Long loginId, String practitionerLevelId, List<PractitionerHiringApproveRecords> practitionerHiringApproveRecordsList) {
//是否可进行审批操作 0.不可审批(未到) 1.可审批 2.已审批 3.无权审批(默认) 4.已驳回
Long hiringApproveStatus = 3L;
//审批到哪一步了
Long hiringApproveStepsId = null;
//查看审批流程最后一次,是否通过
PractitionerHiringApproveRecords recordsFinally = null;
if (!practitionerHiringApproveRecordsList.isEmpty()) {
recordsFinally = practitionerHiringApproveRecordsList.get(practitionerHiringApproveRecordsList.size() - 1);
Long approvingStatusId = recordsFinally.getApprovingStatusId();
if (CommonUtil.isNullOrZero(approvingStatusId)) {
//已驳回
hiringApproveStatus = 4L;
return new PractitionerHiringApproveSteps(hiringApproveStatus, hiringApproveStepsId);
}
}
//通过loginId查询对应的经纪人id
Long loginPractitionerId = agmsHiringDalService.findPractitionerIdByLoginId(loginId);
//AGMS登入者手机号不是经纪人手机号,无权审批
if (!CommonUtil.isNullOrZero(loginPractitionerId)) {
return new PractitionerHiringApproveSteps(hiringApproveStatus, hiringApproveStepsId);
}
//遍历已审批结果,查看此agms登入者是否已审批
for (PractitionerHiringApproveRecords practitionerHiringApproveRecords : practitionerHiringApproveRecordsList) {
Long approvingPractitionerId = practitionerHiringApproveRecords.getApprovingPractitionerId();
if (approvingPractitionerId.equals(loginPractitionerId)) {
//已审批
hiringApproveStatus = 2L;
return new PractitionerHiringApproveSteps(hiringApproveStatus, hiringApproveStepsId);
}
}
//查询审批流程
List<MdPractitionerHiringApproveSteps> hiringApproveSteps = systemConfigService.findHiringApproveStepsByPractitionerLevel(practitionerLevelId);
//通过loginId查询登入者手机号码
AclUser user = aclUserDalService.selectByPrimaryKey(loginId);
String loginMobileNo = user.getMobileNo();
//所有通过agms审批的手机号码
List<String> hiringApproveMobileNo = systemConfigService.findHiringApproveMobileNo(hiringApproveSteps, practitionerLevelId);
//agms登入者无审批权力
if (!hiringApproveMobileNo.contains(loginMobileNo)) {
return new PractitionerHiringApproveSteps(hiringApproveStatus, hiringApproveStepsId);
}
//此经纪人最后一次审批步骤id
hiringApproveStepsId = recordsFinally.getApproveStepId();
//查询此经纪人最后一次审批步骤详细信息
int seq = 0;
for (int i = 0; i < hiringApproveSteps.size(); i++) {
Long id = hiringApproveSteps.get(i).getId();
if (id.equals(hiringApproveStepsId)) {
seq = i;
break;
}
}
MdPractitionerHiringApproveSteps mdPractitionerHiringApproveSteps = hiringApproveSteps.get(seq);
//通过手机号码查询此agmd登入者拥有哪些审批步骤(肯定有值)
List<MdPractitionerHiringApproveSteps> hiringApproves = mdPractitionerHiringApproveStepsDalService.findByAppointedApprovePractitioners(loginMobileNo);
//最后一个审批步骤的seq
Integer stepSeq = mdPractitionerHiringApproveSteps.getStepSeq();
MdPractitionerHiringApproveSteps loginHiringApproveStep = null;
for (MdPractitionerHiringApproveSteps hiringApprove : hiringApproves) {
Integer loginStepSeq = hiringApprove.getStepSeq();
if (stepSeq < loginStepSeq) {
loginHiringApproveStep = hiringApprove;
break;
}
}
if (loginHiringApproveStep == null){
hiringApproveStatus = 2L;
return new PractitionerHiringApproveSteps(hiringApproveStatus, hiringApproveStepsId);
}
//查看下一审批步骤
mdPractitionerHiringApproveSteps = hiringApproveSteps.get(seq+1);
Long mdPractitionerHiringApproveStepsId = mdPractitionerHiringApproveSteps.getId();
Long loginHiringApproveStepId = loginHiringApproveStep.getId();
if (mdPractitionerHiringApproveStepsId.equals(loginHiringApproveStepId)){
//可审批
hiringApproveStatus = 1L;
hiringApproveStepsId = mdPractitionerHiringApproveStepsId;
}else {
//0.不可审批(未到)
hiringApproveStatus = 0L;
}
return new PractitionerHiringApproveSteps(hiringApproveStatus, hiringApproveStepsId);
}
} }
package com.yd.api.agms.vo.hiring;
/**
* @author xxy
*/
public class PractitionerHiringApproveSteps {
/**
* 是否可进行审批操作 0.不可审批(未到) 1.可审批 2.已审批 3.无权审批(默认)
*/
private Long hiringApproveStatus;
/**
* 审批步骤经行到哪一步了
*/
private Long hiringApproveStepsId;
/**
* 获取 是否可进行审批操作 0.不可审批(未到) 1.可审批 2.已审批 3.无权审批(默认)
*
* @return hiringApproveStatus 是否可进行审批操作 0.不可审批(未到) 1.可审批 2.已审批 3.无权审批(默认)
*/
public Long getHiringApproveStatus() {
return this.hiringApproveStatus;
}
/**
* 设置 是否可进行审批操作 0.不可审批(未到) 1.可审批 2.已审批 3.无权审批(默认)
*
* @param hiringApproveStatus 是否可进行审批操作 0.不可审批(未到) 1.可审批 2.已审批 3.无权审批(默认)
*/
public void setHiringApproveStatus(Long hiringApproveStatus) {
this.hiringApproveStatus = hiringApproveStatus;
}
/**
* 获取 审批步骤经行到哪一步了
*
* @return hiringApproveStepsId 审批步骤经行到哪一步了
*/
public Long getHiringApproveStepsId() {
return this.hiringApproveStepsId;
}
/**
* 设置 审批步骤经行到哪一步了
*
* @param hiringApproveStepsId 审批步骤经行到哪一步了
*/
public void setHiringApproveStepsId(Long hiringApproveStepsId) {
this.hiringApproveStepsId = hiringApproveStepsId;
}
public PractitionerHiringApproveSteps(Long hiringApproveStatus,Long hiringApproveStepsId){
this.hiringApproveStatus = hiringApproveStatus;
this.hiringApproveStepsId = hiringApproveStepsId;
}
public PractitionerHiringApproveSteps(){
}
@Override
public String toString() {
return "PractitionerHiringApproveSteps{" +
"hiringApproveStatus=" + hiringApproveStatus +
", hiringApproveStepsId=" + hiringApproveStepsId +
'}';
}
}
...@@ -6,11 +6,34 @@ package com.yd.api.agms.vo.hiring; ...@@ -6,11 +6,34 @@ package com.yd.api.agms.vo.hiring;
public class PractitionerHiringDetailRequestVO { public class PractitionerHiringDetailRequestVO {
/** /**
* AGMS登入者id
*/
private Long loginId;
/**
* 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id * 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
*/ */
private Long hiringBasicInfoId; private Long hiringBasicInfoId;
/** /**
* 获取 AGMS登入者id
*
* @return loginId AGMS登入者id
*/
public Long getLoginId() {
return this.loginId;
}
/**
* 设置 AGMS登入者id
*
* @param loginId AGMS登入者id
*/
public void setLoginId(Long loginId) {
this.loginId = loginId;
}
/**
* 获取 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id * 获取 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
* *
* @return hiringBasicInfoId 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id * @return hiringBasicInfoId 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
...@@ -31,7 +54,8 @@ public class PractitionerHiringDetailRequestVO { ...@@ -31,7 +54,8 @@ public class PractitionerHiringDetailRequestVO {
@Override @Override
public String toString() { public String toString() {
return "PractitionerHiringDetailRequestVO{" + return "PractitionerHiringDetailRequestVO{" +
"hiringBasicInfoId=" + hiringBasicInfoId + "loginId=" + loginId +
", hiringBasicInfoId=" + hiringBasicInfoId +
'}'; '}';
} }
} }
...@@ -14,6 +14,10 @@ public class PractitionerHiringDetailResponseVO { ...@@ -14,6 +14,10 @@ public class PractitionerHiringDetailResponseVO {
*/ */
private Long hiringBasicInfoId; private Long hiringBasicInfoId;
/** /**
* 经纪人审批步骤/状态
*/
private PractitionerHiringApproveSteps practitionerHiringApproveSteps;
/**
* 经纪人审批基本信息 * 经纪人审批基本信息
*/ */
private PractitionerHiringBasicInfo practitionerHiringBasicInfo; private PractitionerHiringBasicInfo practitionerHiringBasicInfo;
...@@ -60,6 +64,24 @@ public class PractitionerHiringDetailResponseVO { ...@@ -60,6 +64,24 @@ public class PractitionerHiringDetailResponseVO {
} }
/** /**
* 获取 经纪人审批步骤状态
*
* @return practitionerHiringApproveSteps 经纪人审批步骤状态
*/
public PractitionerHiringApproveSteps getPractitionerHiringApproveSteps() {
return this.practitionerHiringApproveSteps;
}
/**
* 设置 经纪人审批步骤状态
*
* @param practitionerHiringApproveSteps 经纪人审批步骤状态
*/
public void setPractitionerHiringApproveSteps(PractitionerHiringApproveSteps practitionerHiringApproveSteps) {
this.practitionerHiringApproveSteps = practitionerHiringApproveSteps;
}
/**
* 获取 经纪人审批基本信息 * 获取 经纪人审批基本信息
* *
* @return practitionerHiringBasicInfo 经纪人审批基本信息 * @return practitionerHiringBasicInfo 经纪人审批基本信息
...@@ -189,6 +211,7 @@ public class PractitionerHiringDetailResponseVO { ...@@ -189,6 +211,7 @@ public class PractitionerHiringDetailResponseVO {
public String toString() { public String toString() {
return "PractitionerHiringDetailResponseVO{" + return "PractitionerHiringDetailResponseVO{" +
"hiringBasicInfoId=" + hiringBasicInfoId + "hiringBasicInfoId=" + hiringBasicInfoId +
", practitionerHiringApproveSteps=" + practitionerHiringApproveSteps +
", practitionerHiringBasicInfo=" + practitionerHiringBasicInfo + ", practitionerHiringBasicInfo=" + practitionerHiringBasicInfo +
", practitionerHiringMemberShip=" + practitionerHiringMemberShip + ", practitionerHiringMemberShip=" + practitionerHiringMemberShip +
", practitionerHiringWorkingExperienceList=" + practitionerHiringWorkingExperienceList + ", practitionerHiringWorkingExperienceList=" + practitionerHiringWorkingExperienceList +
......
...@@ -8,15 +8,26 @@ import java.util.Date; ...@@ -8,15 +8,26 @@ import java.util.Date;
public class PractitionerHiringApproveRecords { public class PractitionerHiringApproveRecords {
/** /**
* 审批步骤id
*/
private Long approveStepId;
/**
* 审批步骤名称 * 审批步骤名称
*/ */
private String approveStepName; private String approveStepName;
/**
* 执行动作的审批经纪人Id
*/
private Long approvingPractitionerId;
/** /**
* 执行动作的审批经纪人 * 执行动作的审批经纪人
*/ */
private String approvingPractitionerName; private String approvingPractitionerName;
/**
* 1:通过,0:驳回
*/
private Long approvingStatusId;
/** /**
* 1:通过,0:驳回 * 1:通过,0:驳回
*/ */
...@@ -32,6 +43,23 @@ public class PractitionerHiringApproveRecords { ...@@ -32,6 +43,23 @@ public class PractitionerHiringApproveRecords {
*/ */
private String hiringAt; private String hiringAt;
/**
* 获取 审批步骤id
*
* @return approveStepId 审批步骤id
*/
public Long getApproveStepId() {
return this.approveStepId;
}
/**
* 设置 审批步骤id
*
* @param approveStepId 审批步骤id
*/
public void setApproveStepId(Long approveStepId) {
this.approveStepId = approveStepId;
}
/** /**
* 获取 审批步骤名称 * 获取 审批步骤名称
...@@ -52,6 +80,24 @@ public class PractitionerHiringApproveRecords { ...@@ -52,6 +80,24 @@ public class PractitionerHiringApproveRecords {
} }
/** /**
* 获取 执行动作的审批经纪人Id
*
* @return approvingPractitionerId 执行动作的审批经纪人Id
*/
public Long getApprovingPractitionerId() {
return this.approvingPractitionerId;
}
/**
* 设置 执行动作的审批经纪人Id
*
* @param approvingPractitionerId 执行动作的审批经纪人Id
*/
public void setApprovingPractitionerId(Long approvingPractitionerId) {
this.approvingPractitionerId = approvingPractitionerId;
}
/**
* 获取 执行动作的审批经纪人 * 获取 执行动作的审批经纪人
* *
* @return approvingPractitionerName 执行动作的审批经纪人 * @return approvingPractitionerName 执行动作的审批经纪人
...@@ -72,6 +118,24 @@ public class PractitionerHiringApproveRecords { ...@@ -72,6 +118,24 @@ public class PractitionerHiringApproveRecords {
/** /**
* 获取 1:通过,0:驳回 * 获取 1:通过,0:驳回
* *
* @return approvingStatusId 1:通过,0:驳回
*/
public Long getApprovingStatusId() {
return this.approvingStatusId;
}
/**
* 设置 1:通过,0:驳回
*
* @param approvingStatusId 1:通过,0:驳回
*/
public void setApprovingStatusId(Long approvingStatusId) {
this.approvingStatusId = approvingStatusId;
}
/**
* 获取 1:通过,0:驳回
*
* @return approvingStatus 1:通过,0:驳回 * @return approvingStatus 1:通过,0:驳回
*/ */
public String getApprovingStatus() { public String getApprovingStatus() {
...@@ -126,11 +190,14 @@ public class PractitionerHiringApproveRecords { ...@@ -126,11 +190,14 @@ public class PractitionerHiringApproveRecords {
@Override @Override
public String toString() { public String toString() {
return "PractitionerHiringApproveRecords{" + return "PractitionerHiringApproveRecords{" +
"approveStepName='" + approveStepName + '\'' + "approveStepId=" + approveStepId +
", approveStepName='" + approveStepName + '\'' +
", approvingPractitionerId=" + approvingPractitionerId +
", approvingPractitionerName='" + approvingPractitionerName + '\'' + ", approvingPractitionerName='" + approvingPractitionerName + '\'' +
", approvingStatus=" + approvingStatus + ", approvingStatusId=" + approvingStatusId +
", approvingStatus='" + approvingStatus + '\'' +
", rejectNote='" + rejectNote + '\'' + ", rejectNote='" + rejectNote + '\'' +
", hiringAt=" + hiringAt + ", hiringAt='" + hiringAt + '\'' +
'}'; '}';
} }
} }
...@@ -8,6 +8,11 @@ public class PractitionerHiringMemberShip { ...@@ -8,6 +8,11 @@ public class PractitionerHiringMemberShip {
/** /**
* 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level" * 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*/ */
private String practitionerLevelId;
/**
* 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*/
private String practitionerLevel; private String practitionerLevel;
/** /**
...@@ -35,6 +40,43 @@ public class PractitionerHiringMemberShip { ...@@ -35,6 +40,43 @@ public class PractitionerHiringMemberShip {
*/ */
private String branch; private String branch;
/**
* 获取 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*
* @return practitionerLevelCode 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*/
public String getPractitionerLevelId() {
return this.practitionerLevelId;
}
/**
* 设置 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*
* @param practitionerLevelId 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*/
public void setPractitionerLevelId(String practitionerLevelId) {
this.practitionerLevelId = practitionerLevelId;
}
/**
* 获取 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*
* @return practitionerLevel 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*/
public String getPractitionerLevel() {
return this.practitionerLevel;
}
/**
* 设置 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*
* @param practitionerLevel 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*/
public void setPractitionerLevel(String practitionerLevel) {
this.practitionerLevel = practitionerLevel;
}
/** /**
* 获取 辅导人 * 获取 辅导人
* *
...@@ -125,28 +167,11 @@ public class PractitionerHiringMemberShip { ...@@ -125,28 +167,11 @@ public class PractitionerHiringMemberShip {
this.branch = branch; this.branch = branch;
} }
/**
* 获取 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*
* @return practitionerLevel 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*/
public String getPractitionerLevel() {
return this.practitionerLevel;
}
/**
* 设置 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*
* @param practitionerLevel 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
*/
public void setPractitionerLevel(String practitionerLevel) {
this.practitionerLevel = practitionerLevel;
}
@Override @Override
public String toString() { public String toString() {
return "PractitionerHiringMemberShip{" + return "PractitionerHiringMemberShip{" +
"practitionerLevel='" + practitionerLevel + '\'' + "practitionerLevelId='" + practitionerLevelId + '\'' +
", practitionerLevel='" + practitionerLevel + '\'' +
", mentor='" + mentor + '\'' + ", mentor='" + mentor + '\'' +
", introducer='" + introducer + '\'' + ", introducer='" + introducer + '\'' +
", subsystem='" + subsystem + '\'' + ", subsystem='" + subsystem + '\'' +
...@@ -154,5 +179,4 @@ public class PractitionerHiringMemberShip { ...@@ -154,5 +179,4 @@ public class PractitionerHiringMemberShip {
", branch='" + branch + '\'' + ", branch='" + branch + '\'' +
'}'; '}';
} }
} }
package com.yd.dal.entity.meta; package com.yd.dal.entity.meta;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data; import lombok.Data;
/** /**
* 報聘经纪人報聘审批步骤设置 * 報聘经纪人報聘审批步骤设置
*/ */
@Data @Data
public class MdPractitionerHiringApproveSteps { public class MdPractitionerHiringApproveSteps implements Serializable {
/** /**
* serial id * serial id
*/ */
private Long id; private Long id;
/** /**
* 审批步骤名称 * 审批步骤名称
*/ */
private String stepName; private String stepName;
/** /**
* 审批负责人角色 * 审批负责人角色
*/ */
private String approveRole; private String approveRole;
/** /**
* 指定审批负责人 * 指定审批负责人
*/ */
private String appointedApprovePractitioners; private String appointedApprovePractitioners;
/** /**
* 审批顺序 * 审批顺序
*/ */
private Integer stepSeq; private Integer stepSeq;
/** /**
* 0=No, 1=Yes * 总经理审批职级S2以上,FK ag_acl_practitioner_hiring_membership.md_drop_option_id
*/ */
private Long ceoAprroveGrade;
/**
* 0=No, 1=Yes
*/
private Integer isActive; private Integer isActive;
/** /**
* 建置日 * 建置日
*/ */
private Date createdAt; private Date createdAt;
/** /**
* 建置者 * 建置者
*/ */
private Long createdBy; private Long createdBy;
/** /**
* 更新日 * 更新日
*/ */
private Date updatedAt; private Date updatedAt;
private Long updatedBy; private Long updatedBy;
......
...@@ -212,4 +212,31 @@ public class AclUser { ...@@ -212,4 +212,31 @@ public class AclUser {
public void setUpdatedBy(Long updatedBy) { public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy; this.updatedBy = updatedBy;
} }
@Override
public String toString() {
return "AclUser{" +
"id=" + id +
", userRole=" + userRole +
", employeeNo='" + employeeNo + '\'' +
", company=" + company +
", deptId=" + deptId +
", roleId=" + roleId +
", login='" + login + '\'' +
", password='" + password + '\'' +
", name='" + name + '\'' +
", nickname='" + nickname + '\'' +
", mobileNo='" + mobileNo + '\'' +
", idNo='" + idNo + '\'' +
", lastLoginTime=" + lastLoginTime +
", logoutTime=" + logoutTime +
", loginSource=" + loginSource +
", isActive=" + isActive +
", email='" + email + '\'' +
", createdAt=" + createdAt +
", createdBy=" + createdBy +
", updatedAt=" + updatedAt +
", updatedBy=" + updatedBy +
'}';
}
} }
\ No newline at end of file
...@@ -44,4 +44,11 @@ public interface AgmsHiringMapper { ...@@ -44,4 +44,11 @@ public interface AgmsHiringMapper {
* @return 查询结果 * @return 查询结果
*/ */
List<PractitionerHiringApproveRecords> findPractitionerHiringApproveRecordsList(Long hiringBasicInfoId); List<PractitionerHiringApproveRecords> findPractitionerHiringApproveRecordsList(Long hiringBasicInfoId);
/**
* 通过loginId查询对应的经纪人id
* @param loginId agms登入者id
* @return 经纪人id
*/
Long findPractitionerIdByLoginId(Long loginId);
} }
...@@ -22,4 +22,10 @@ public interface MdPractitionerHiringApproveStepsMapper { ...@@ -22,4 +22,10 @@ public interface MdPractitionerHiringApproveStepsMapper {
int updateBatchSelective(List<MdPractitionerHiringApproveSteps> list); int updateBatchSelective(List<MdPractitionerHiringApproveSteps> list);
int batchInsert(@Param("list") List<MdPractitionerHiringApproveSteps> list); int batchInsert(@Param("list") List<MdPractitionerHiringApproveSteps> list);
List<MdPractitionerHiringApproveSteps> findAll();
List<MdPractitionerHiringApproveSteps> findByPractitionerLevel(String practitionerLevelId);
List<MdPractitionerHiringApproveSteps> findByAppointedApprovePractitioners(String appointedApprovePractitioners);
} }
\ No newline at end of file
...@@ -44,4 +44,11 @@ public interface AgmsHiringDALService { ...@@ -44,4 +44,11 @@ public interface AgmsHiringDALService {
* @return 查询结果 * @return 查询结果
*/ */
List<PractitionerHiringApproveRecords> findPractitionerHiringApproveRecordsList(Long hiringBasicInfoId); List<PractitionerHiringApproveRecords> findPractitionerHiringApproveRecordsList(Long hiringBasicInfoId);
/**
* 通过loginId查询对应的经纪人id
* @param loginId agms登入者id
* @return 经纪人id
*/
Long findPractitionerIdByLoginId(Long loginId);
} }
...@@ -50,4 +50,9 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService { ...@@ -50,4 +50,9 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
public List<PractitionerHiringApproveRecords> findPractitionerHiringApproveRecordsList(Long hiringBasicInfoId) { public List<PractitionerHiringApproveRecords> findPractitionerHiringApproveRecordsList(Long hiringBasicInfoId) {
return agmsHiringMapper.findPractitionerHiringApproveRecordsList(hiringBasicInfoId); return agmsHiringMapper.findPractitionerHiringApproveRecordsList(hiringBasicInfoId);
} }
@Override
public Long findPractitionerIdByLoginId(Long loginId) {
return agmsHiringMapper.findPractitionerIdByLoginId(loginId);
}
} }
package com.yd.dal.service.meta; package com.yd.dal.service.meta;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import java.util.List;
/**
* @author xxy
*/
public interface MdPractitionerHiringApproveStepsDALService { public interface MdPractitionerHiringApproveStepsDALService {
/**
* 查询所有审批步骤
* @return 审批步骤
*/
List<MdPractitionerHiringApproveSteps> findAll();
/**
* 通过职级查询审批步骤
* @param practitionerLevelId 职级code
* @return 审批步骤
*/
List<MdPractitionerHiringApproveSteps> findByPractitionerLevel(String practitionerLevelId);
/**
*通过手机号码查询此agmd登入者拥有哪些审批步骤
* @param appointedApprovePractitioners 手机号码
* @return
*/
List<MdPractitionerHiringApproveSteps> findByAppointedApprovePractitioners(String appointedApprovePractitioners);
} }
package com.yd.dal.service.meta.impl; package com.yd.dal.service.meta.impl;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps; import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.mapper.meta.MdPractitionerHiringApproveStepsMapper;
import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService; import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.util.deshandler.DESTypeHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
@Service("mdPractitionerHiringApproveStepsDALService") @Service("mdPractitionerHiringApproveStepsDALService")
public class MdPractitionerHiringApproveStepsDALServiceImpl implements MdPractitionerHiringApproveStepsDALService { public class MdPractitionerHiringApproveStepsDALServiceImpl implements MdPractitionerHiringApproveStepsDALService {
private MdPractitionerHiringApproveStepsMapper mdPractitionerHiringApproveStepsMapper;
@Autowired
public void setMdPractitionerHiringApproveStepsMapper(MdPractitionerHiringApproveStepsMapper mdPractitionerHiringApproveStepsMapper) {
this.mdPractitionerHiringApproveStepsMapper = mdPractitionerHiringApproveStepsMapper;
}
@Override
public List<MdPractitionerHiringApproveSteps> findAll() {
return mdPractitionerHiringApproveStepsMapper.findAll();
}
@Override
public List<MdPractitionerHiringApproveSteps> findByPractitionerLevel(String practitionerLevelId) {
return mdPractitionerHiringApproveStepsMapper.findByPractitionerLevel(practitionerLevelId);
}
@Override
public List<MdPractitionerHiringApproveSteps> findByAppointedApprovePractitioners(String appointedApprovePractitioners) {
DESTypeHandler desTypeHandler = new DESTypeHandler();
appointedApprovePractitioners = desTypeHandler.decode(appointedApprovePractitioners);
return mdPractitionerHiringApproveStepsMapper.findByAppointedApprovePractitioners(appointedApprovePractitioners);
}
} }
...@@ -3,9 +3,11 @@ package com.yd.rmi.cache; ...@@ -3,9 +3,11 @@ package com.yd.rmi.cache;
import com.yd.dal.entity.meta.MdCode; import com.yd.dal.entity.meta.MdCode;
import com.yd.dal.entity.meta.MdIncometaxRate; import com.yd.dal.entity.meta.MdIncometaxRate;
import com.yd.dal.entity.meta.MdMkCampaign; import com.yd.dal.entity.meta.MdMkCampaign;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.service.meta.MdCodeDALService; import com.yd.dal.service.meta.MdCodeDALService;
import com.yd.dal.service.meta.MdIncometaxRateDALService; import com.yd.dal.service.meta.MdIncometaxRateDALService;
import com.yd.dal.service.meta.MdMkCampaignDALService; import com.yd.dal.service.meta.MdMkCampaignDALService;
import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.rmi.ali.ossinterf.service.AliOssInterfService; import com.yd.rmi.ali.ossinterf.service.AliOssInterfService;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import net.sf.ehcache.Cache; import net.sf.ehcache.Cache;
...@@ -18,7 +20,11 @@ import java.util.ArrayList; ...@@ -18,7 +20,11 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors;
/**
* @author xxy
*/
@Service("systemConfigService") @Service("systemConfigService")
@org.springframework.core.annotation.Order(1) @org.springframework.core.annotation.Order(1)
public class SystemConfigService implements CommandLineRunner{ public class SystemConfigService implements CommandLineRunner{
...@@ -27,6 +33,12 @@ public class SystemConfigService implements CommandLineRunner{ ...@@ -27,6 +33,12 @@ public class SystemConfigService implements CommandLineRunner{
private MdCodeDALService mdCodeService; private MdCodeDALService mdCodeService;
@Autowired @Autowired
private AliOssInterfService aliOssInterfService; private AliOssInterfService aliOssInterfService;
@Autowired
private MdPractitionerHiringApproveStepsDALService mdPractitionerHiringApproveStepsDalService;
@Autowired
private MdMkCampaignDALService mdMkCampaignDALService;
@Autowired
private MdIncometaxRateDALService mdIncometaxRateDALService;
/** /**
* 保存cache * 保存cache
...@@ -207,8 +219,7 @@ public class SystemConfigService implements CommandLineRunner{ ...@@ -207,8 +219,7 @@ public class SystemConfigService implements CommandLineRunner{
aliOssInterfService.initAttribute(); aliOssInterfService.initAttribute();
} }
@Autowired
private MdMkCampaignDALService mdMkCampaignDALService;
public Long getMdMkCampaignId(String campaignCode) { public Long getMdMkCampaignId(String campaignCode) {
Long configValue = null; Long configValue = null;
Element element = systemConfigCache.get("campaignCode:"+campaignCode); Element element = systemConfigCache.get("campaignCode:"+campaignCode);
...@@ -223,8 +234,6 @@ public class SystemConfigService implements CommandLineRunner{ ...@@ -223,8 +234,6 @@ public class SystemConfigService implements CommandLineRunner{
return configValue; return configValue;
} }
@Autowired
private MdIncometaxRateDALService mdIncometaxRateDALService;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public List<MdIncometaxRate> findIncometax(){ public List<MdIncometaxRate> findIncometax(){
List<MdIncometaxRate> incometaxRates = new ArrayList<>(); List<MdIncometaxRate> incometaxRates = new ArrayList<>();
...@@ -238,4 +247,41 @@ public class SystemConfigService implements CommandLineRunner{ ...@@ -238,4 +247,41 @@ public class SystemConfigService implements CommandLineRunner{
} }
return incometaxRates; return incometaxRates;
} }
@SuppressWarnings("unchecked")
public List<MdPractitionerHiringApproveSteps> findHiringApproveStepsByPractitionerLevel(String practitionerLevelCode) {
List<MdPractitionerHiringApproveSteps> hiringApproveSteps = new ArrayList<>();
Element element = systemConfigCache.get("HiringApproveSteps"+practitionerLevelCode);
if(element != null && element.getObjectValue() != null){
hiringApproveSteps = (List<MdPractitionerHiringApproveSteps>)element.getObjectValue();
}else{
hiringApproveSteps = mdPractitionerHiringApproveStepsDalService.findByPractitionerLevel(practitionerLevelCode);
element = new Element("HiringApproveSteps"+practitionerLevelCode,hiringApproveSteps);
systemConfigCache.put(element);
}
return hiringApproveSteps;
}
@SuppressWarnings("unchecked")
public List<String> findHiringApproveMobileNo(List<MdPractitionerHiringApproveSteps> hiringApproveSteps ,String practitionerLevelCode) {
List<String> hiringApproveMobileNos = new ArrayList<>();
Element element = systemConfigCache.get("HiringApproveMobileNo"+practitionerLevelCode);
if(element != null && element.getObjectValue() != null){
hiringApproveMobileNos = (List<String>)element.getObjectValue();
}else{
for (MdPractitionerHiringApproveSteps hiringApproveStep : hiringApproveSteps){
String appointedApprovePractitioners = hiringApproveStep.getAppointedApprovePractitioners();
if (!CommonUtil.isNullOrBlank(appointedApprovePractitioners)){
hiringApproveMobileNos.addAll(Arrays.asList(appointedApprovePractitioners.split(",")));
}
}
//去重
hiringApproveMobileNos = hiringApproveMobileNos.stream().distinct().collect(Collectors.toList());
element = new Element("HiringApproveMobileNo"+practitionerLevelCode,hiringApproveMobileNos);
systemConfigCache.put(element);
}
return hiringApproveMobileNos;
}
} }
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
<select id="findPractitionerHiringMemberShip" <select id="findPractitionerHiringMemberShip"
resultType="com.yd.dal.entity.agms.hiring.PractitionerHiringMemberShip"> resultType="com.yd.dal.entity.agms.hiring.PractitionerHiringMemberShip">
select md_drop_option_name practitionerLevel, select md_drop_option_name practitionerLevel,
md_drop_option_id practitionerLevelId,
mentor mentor, mentor mentor,
introducer introducer, introducer introducer,
subsystem subsystem, subsystem subsystem,
...@@ -100,14 +101,25 @@ ...@@ -100,14 +101,25 @@
<select id="findPractitionerHiringApproveRecordsList" <select id="findPractitionerHiringApproveRecordsList"
resultType="com.yd.dal.entity.agms.hiring.PractitionerHiringApproveRecords"> resultType="com.yd.dal.entity.agms.hiring.PractitionerHiringApproveRecords">
select p.name approvingPractitionerName, select r.approving_practitioner_id approvingPractitionerId,
r.approve_step_name approveStepName, p.name approvingPractitionerName,
if(r.approving_status is null, null, if(r.approving_status = 1, '通过', '驳回')), r.approve_step_id approveStepId,
r.reject_note rejectNote, r.approve_step_name approveStepName,
date_format(r.created_at, '%Y-%m-%d %H:%i:%s') hiringAt r.approving_status approvingStatusId,
if(r.approving_status is null, null, if(r.approving_status = 1, '通过', '驳回')) approvingStatus,
r.reject_note rejectNote,
date_format(r.created_at, '%Y-%m-%d %H:%i:%s') hiringAt
from ag_acl_practitioner_hiring_approve_records r from ag_acl_practitioner_hiring_approve_records r
left join ag_acl_practitioner p on p.id = r.approving_practitioner_id left join ag_acl_practitioner p on p.id = r.approving_practitioner_id
where r.is_active = 1 where r.is_active = 1
and r.hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT} and r.hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT}
order by r.id
</select>
<select id="findPractitionerIdByLoginId" resultType="java.lang.Long">
select p.id
from ag_acl_practitioner p
left join ag_acl_user u on u.mobile_no = p.mobile_no
where u.id = #{loginId,jdbcType=BIGINT}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.dal.mapper.meta.MdPractitionerHiringApproveStepsMapper"> <mapper namespace="com.yd.dal.mapper.meta.MdPractitionerHiringApproveStepsMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps"> <resultMap id="BaseResultMap" type="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps">
<!--@mbg.generated--> <!--@mbg.generated-->
<!--@Table ag_md_practitioner_hiring_approve_steps--> <!--@Table ag_md_practitioner_hiring_approve_steps-->
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id"/>
<result column="step_name" jdbcType="VARCHAR" property="stepName" /> <result column="step_name" jdbcType="VARCHAR" property="stepName"/>
<result column="approve_role" jdbcType="VARCHAR" property="approveRole" /> <result column="approve_role" jdbcType="VARCHAR" property="approveRole"/>
<result column="appointed_approve_practitioners" jdbcType="VARCHAR" property="appointedApprovePractitioners" /> <result column="appointed_approve_practitioners" jdbcType="VARCHAR" property="appointedApprovePractitioners"/>
<result column="step_seq" jdbcType="INTEGER" property="stepSeq" /> <result column="step_seq" jdbcType="INTEGER" property="stepSeq"/>
<result column="is_active" jdbcType="INTEGER" property="isActive" /> <result column="ceo_aprrove_grade" jdbcType="BIGINT" property="ceoAprroveGrade"/>
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> <result column="is_active" jdbcType="INTEGER" property="isActive"/>
<result column="created_by" jdbcType="BIGINT" property="createdBy" /> <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> <result column="created_by" jdbcType="BIGINT" property="createdBy"/>
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" /> <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
</resultMap> <result column="updated_by" jdbcType="BIGINT" property="updatedBy"/>
<sql id="Base_Column_List"> </resultMap>
<!--@mbg.generated--> <sql id="Base_Column_List">
id, step_name, approve_role, appointed_approve_practitioners, step_seq, is_active, <!--@mbg.generated-->
created_at, created_by, updated_at, updated_by id, step_name, approve_role, appointed_approve_practitioners, step_seq, ceo_aprrove_grade,
</sql> is_active, created_at, created_by, updated_at, updated_by
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> </sql>
<!--@mbg.generated--> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select <!--@mbg.generated-->
<include refid="Base_Column_List" /> select
from ag_md_practitioner_hiring_approve_steps <include refid="Base_Column_List"/>
where id = #{id,jdbcType=BIGINT} from ag_md_practitioner_hiring_approve_steps
</select> where id = #{id,jdbcType=BIGINT}
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> </select>
<!--@mbg.generated--> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_md_practitioner_hiring_approve_steps <!--@mbg.generated-->
where id = #{id,jdbcType=BIGINT} delete
</delete> from ag_md_practitioner_hiring_approve_steps
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps" useGeneratedKeys="true"> where id = #{id,jdbcType=BIGINT}
<!--@mbg.generated--> </delete>
insert into ag_md_practitioner_hiring_approve_steps (step_name, approve_role, appointed_approve_practitioners, <insert id="insert" keyColumn="id" keyProperty="id"
step_seq, is_active, created_at, parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps" useGeneratedKeys="true">
created_by, updated_at, updated_by <!--@mbg.generated-->
) insert into ag_md_practitioner_hiring_approve_steps (step_name, approve_role, appointed_approve_practitioners,
values (#{stepName,jdbcType=VARCHAR}, #{approveRole,jdbcType=VARCHAR}, #{appointedApprovePractitioners,jdbcType=VARCHAR}, step_seq, ceo_aprrove_grade, is_active,
#{stepSeq,jdbcType=INTEGER}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, created_at, created_by, updated_at,
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT} updated_by)
) values (#{stepName,jdbcType=VARCHAR}, #{approveRole,jdbcType=VARCHAR},
</insert> #{appointedApprovePractitioners,jdbcType=VARCHAR},
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps" useGeneratedKeys="true"> #{stepSeq,jdbcType=INTEGER}, #{ceoAprroveGrade,jdbcType=BIGINT}, #{isActive,jdbcType=INTEGER},
<!--@mbg.generated--> #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
insert into ag_md_practitioner_hiring_approve_steps #{updatedBy,jdbcType=BIGINT})
<trim prefix="(" suffix=")" suffixOverrides=","> </insert>
<if test="stepName != null"> <insert id="insertSelective" keyColumn="id" keyProperty="id"
step_name, parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps" useGeneratedKeys="true">
</if> <!--@mbg.generated-->
<if test="approveRole != null"> insert into ag_md_practitioner_hiring_approve_steps
approve_role, <trim prefix="(" suffix=")" suffixOverrides=",">
</if> <if test="stepName != null">
<if test="appointedApprovePractitioners != null"> step_name,
appointed_approve_practitioners, </if>
</if> <if test="approveRole != null">
<if test="stepSeq != null"> approve_role,
step_seq, </if>
</if> <if test="appointedApprovePractitioners != null">
<if test="isActive != null"> appointed_approve_practitioners,
is_active, </if>
</if> <if test="stepSeq != null">
<if test="createdAt != null"> step_seq,
created_at, </if>
</if> <if test="ceoAprroveGrade != null">
<if test="createdBy != null"> ceo_aprrove_grade,
created_by, </if>
</if> <if test="isActive != null">
<if test="updatedAt != null"> is_active,
updated_at, </if>
</if> <if test="createdAt != null">
<if test="updatedBy != null"> created_at,
updated_by, </if>
</if> <if test="createdBy != null">
</trim> created_by,
<trim prefix="values (" suffix=")" suffixOverrides=","> </if>
<if test="stepName != null"> <if test="updatedAt != null">
#{stepName,jdbcType=VARCHAR}, updated_at,
</if> </if>
<if test="approveRole != null"> <if test="updatedBy != null">
#{approveRole,jdbcType=VARCHAR}, updated_by,
</if> </if>
<if test="appointedApprovePractitioners != null"> </trim>
#{appointedApprovePractitioners,jdbcType=VARCHAR}, <trim prefix="values (" suffix=")" suffixOverrides=",">
</if> <if test="stepName != null">
<if test="stepSeq != null"> #{stepName,jdbcType=VARCHAR},
#{stepSeq,jdbcType=INTEGER}, </if>
</if> <if test="approveRole != null">
<if test="isActive != null"> #{approveRole,jdbcType=VARCHAR},
#{isActive,jdbcType=INTEGER}, </if>
</if> <if test="appointedApprovePractitioners != null">
<if test="createdAt != null"> #{appointedApprovePractitioners,jdbcType=VARCHAR},
#{createdAt,jdbcType=TIMESTAMP}, </if>
</if> <if test="stepSeq != null">
<if test="createdBy != null"> #{stepSeq,jdbcType=INTEGER},
#{createdBy,jdbcType=BIGINT}, </if>
</if> <if test="ceoAprroveGrade != null">
<if test="updatedAt != null"> #{ceoAprroveGrade,jdbcType=BIGINT},
#{updatedAt,jdbcType=TIMESTAMP}, </if>
</if> <if test="isActive != null">
<if test="updatedBy != null"> #{isActive,jdbcType=INTEGER},
#{updatedBy,jdbcType=BIGINT}, </if>
</if> <if test="createdAt != null">
</trim> #{createdAt,jdbcType=TIMESTAMP},
</insert> </if>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps"> <if test="createdBy != null">
<!--@mbg.generated--> #{createdBy,jdbcType=BIGINT},
update ag_md_practitioner_hiring_approve_steps </if>
<set> <if test="updatedAt != null">
<if test="stepName != null"> #{updatedAt,jdbcType=TIMESTAMP},
step_name = #{stepName,jdbcType=VARCHAR}, </if>
</if> <if test="updatedBy != null">
<if test="approveRole != null"> #{updatedBy,jdbcType=BIGINT},
approve_role = #{approveRole,jdbcType=VARCHAR}, </if>
</if> </trim>
<if test="appointedApprovePractitioners != null"> </insert>
appointed_approve_practitioners = #{appointedApprovePractitioners,jdbcType=VARCHAR}, <update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps">
</if> <!--@mbg.generated-->
<if test="stepSeq != null"> update ag_md_practitioner_hiring_approve_steps
step_seq = #{stepSeq,jdbcType=INTEGER}, <set>
</if> <if test="stepName != null">
<if test="isActive != null"> step_name = #{stepName,jdbcType=VARCHAR},
is_active = #{isActive,jdbcType=INTEGER}, </if>
</if> <if test="approveRole != null">
<if test="createdAt != null"> approve_role = #{approveRole,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP}, </if>
</if> <if test="appointedApprovePractitioners != null">
<if test="createdBy != null"> appointed_approve_practitioners = #{appointedApprovePractitioners,jdbcType=VARCHAR},
created_by = #{createdBy,jdbcType=BIGINT}, </if>
</if> <if test="stepSeq != null">
<if test="updatedAt != null"> step_seq = #{stepSeq,jdbcType=INTEGER},
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, </if>
</if> <if test="ceoAprroveGrade != null">
<if test="updatedBy != null"> ceo_aprrove_grade = #{ceoAprroveGrade,jdbcType=BIGINT},
updated_by = #{updatedBy,jdbcType=BIGINT}, </if>
</if> <if test="isActive != null">
</set> is_active = #{isActive,jdbcType=INTEGER},
where id = #{id,jdbcType=BIGINT} </if>
</update> <if test="createdAt != null">
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps"> created_at = #{createdAt,jdbcType=TIMESTAMP},
<!--@mbg.generated--> </if>
update ag_md_practitioner_hiring_approve_steps <if test="createdBy != null">
set step_name = #{stepName,jdbcType=VARCHAR}, created_by = #{createdBy,jdbcType=BIGINT},
approve_role = #{approveRole,jdbcType=VARCHAR}, </if>
appointed_approve_practitioners = #{appointedApprovePractitioners,jdbcType=VARCHAR}, <if test="updatedAt != null">
step_seq = #{stepSeq,jdbcType=INTEGER}, updated_at = #{updatedAt,jdbcType=TIMESTAMP},
is_active = #{isActive,jdbcType=INTEGER}, </if>
created_at = #{createdAt,jdbcType=TIMESTAMP}, <if test="updatedBy != null">
created_by = #{createdBy,jdbcType=BIGINT}, updated_by = #{updatedBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, </if>
updated_by = #{updatedBy,jdbcType=BIGINT} </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateBatch" parameterType="java.util.List"> <update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps">
<!--@mbg.generated--> <!--@mbg.generated-->
update ag_md_practitioner_hiring_approve_steps update ag_md_practitioner_hiring_approve_steps
<trim prefix="set" suffixOverrides=","> set step_name = #{stepName,jdbcType=VARCHAR},
<trim prefix="step_name = case" suffix="end,"> approve_role = #{approveRole,jdbcType=VARCHAR},
<foreach collection="list" index="index" item="item"> appointed_approve_practitioners = #{appointedApprovePractitioners,jdbcType=VARCHAR},
when id = #{item.id,jdbcType=BIGINT} then #{item.stepName,jdbcType=VARCHAR} step_seq = #{stepSeq,jdbcType=INTEGER},
ceo_aprrove_grade = #{ceoAprroveGrade,jdbcType=BIGINT},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update ag_md_practitioner_hiring_approve_steps
<trim prefix="set" suffixOverrides=",">
<trim prefix="step_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.stepName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="approve_role = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.approveRole,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="appointed_approve_practitioners = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.appointedApprovePractitioners,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="step_seq = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.stepSeq,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="ceo_aprrove_grade = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.ceoAprroveGrade,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="is_active = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.isActive,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="created_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="created_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="updated_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="updated_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=BIGINT}
</foreach> </foreach>
</trim> </update>
<trim prefix="approve_role = case" suffix="end,"> <update id="updateBatchSelective" parameterType="java.util.List">
<foreach collection="list" index="index" item="item"> <!--@mbg.generated-->
when id = #{item.id,jdbcType=BIGINT} then #{item.approveRole,jdbcType=VARCHAR} update ag_md_practitioner_hiring_approve_steps
<trim prefix="set" suffixOverrides=",">
<trim prefix="step_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.stepName != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.stepName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="approve_role = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.approveRole != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.approveRole,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="appointed_approve_practitioners = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.appointedApprovePractitioners != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.appointedApprovePractitioners,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="step_seq = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.stepSeq != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.stepSeq,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="ceo_aprrove_grade = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.ceoAprroveGrade != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.ceoAprroveGrade,jdbcType=BIGINT}
</if>
</foreach>
</trim>
<trim prefix="is_active = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.isActive != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.isActive,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="created_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createdAt != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="created_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createdBy != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
</if>
</foreach>
</trim>
<trim prefix="updated_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updatedAt != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="updated_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updatedBy != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=BIGINT}
</foreach> </foreach>
</trim> </update>
<trim prefix="appointed_approve_practitioners = case" suffix="end,"> <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<foreach collection="list" index="index" item="item"> <!--@mbg.generated-->
when id = #{item.id,jdbcType=BIGINT} then #{item.appointedApprovePractitioners,jdbcType=VARCHAR} insert into ag_md_practitioner_hiring_approve_steps
(step_name, approve_role, appointed_approve_practitioners, step_seq, ceo_aprrove_grade,
is_active, created_at, created_by, updated_at, updated_by)
values
<foreach collection="list" item="item" separator=",">
(#{item.stepName,jdbcType=VARCHAR}, #{item.approveRole,jdbcType=VARCHAR},
#{item.appointedApprovePractitioners,jdbcType=VARCHAR},
#{item.stepSeq,jdbcType=INTEGER}, #{item.ceoAprroveGrade,jdbcType=BIGINT},
#{item.isActive,jdbcType=INTEGER},
#{item.createdAt,jdbcType=TIMESTAMP}, #{item.createdBy,jdbcType=BIGINT},
#{item.updatedAt,jdbcType=TIMESTAMP},
#{item.updatedBy,jdbcType=BIGINT})
</foreach> </foreach>
</trim> </insert>
<trim prefix="step_seq = case" suffix="end,">
<foreach collection="list" index="index" item="item"> <select id="findAll" resultMap="BaseResultMap">
when id = #{item.id,jdbcType=BIGINT} then #{item.stepSeq,jdbcType=INTEGER} select
</foreach> <include refid="Base_Column_List"/>
</trim> from ag_md_practitioner_hiring_approve_steps
<trim prefix="is_active = case" suffix="end,"> where is_active = 1
<foreach collection="list" index="index" item="item"> order by step_seq
when id = #{item.id,jdbcType=BIGINT} then #{item.isActive,jdbcType=INTEGER} </select>
</foreach>
</trim> <select id="findByPractitionerLevel" resultMap="BaseResultMap">
<trim prefix="created_at = case" suffix="end,"> select
<foreach collection="list" index="index" item="item"> <include refid="Base_Column_List"/>
when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP} from ag_md_practitioner_hiring_approve_steps
</foreach> where is_active = 1
</trim> and (ceo_aprrove_grade is null or find_in_set(#{practitionerLevelId,jdbcType=VARCHAR}, ceo_aprrove_grade))
<trim prefix="created_by = case" suffix="end,"> order by step_seq
<foreach collection="list" index="index" item="item"> </select>
when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
</foreach> <select id="findByAppointedApprovePractitioners" resultMap="BaseResultMap">
</trim> select
<trim prefix="updated_at = case" suffix="end,"> <include refid="Base_Column_List"/>
<foreach collection="list" index="index" item="item"> from ag_md_practitioner_hiring_approve_steps
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP} where is_active = 1
</foreach> and find_in_set(#{appointedApprovePractitioners,jdbcType=VARCHAR},appointed_approve_practitioners)
</trim> order by step_seq
<trim prefix="updated_by = case" suffix="end,"> </select>
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=BIGINT}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update ag_md_practitioner_hiring_approve_steps
<trim prefix="set" suffixOverrides=",">
<trim prefix="step_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.stepName != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.stepName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="approve_role = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.approveRole != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.approveRole,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="appointed_approve_practitioners = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.appointedApprovePractitioners != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.appointedApprovePractitioners,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="step_seq = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.stepSeq != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.stepSeq,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="is_active = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.isActive != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.isActive,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="created_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createdAt != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="created_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createdBy != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
</if>
</foreach>
</trim>
<trim prefix="updated_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updatedAt != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="updated_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updatedBy != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=BIGINT}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_md_practitioner_hiring_approve_steps
(step_name, approve_role, appointed_approve_practitioners, step_seq, is_active, created_at,
created_by, updated_at, updated_by)
values
<foreach collection="list" item="item" separator=",">
(#{item.stepName,jdbcType=VARCHAR}, #{item.approveRole,jdbcType=VARCHAR}, #{item.appointedApprovePractitioners,jdbcType=VARCHAR},
#{item.stepSeq,jdbcType=INTEGER}, #{item.isActive,jdbcType=INTEGER}, #{item.createdAt,jdbcType=TIMESTAMP},
#{item.createdBy,jdbcType=BIGINT}, #{item.updatedAt,jdbcType=TIMESTAMP}, #{item.updatedBy,jdbcType=BIGINT}
)
</foreach>
</insert>
</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