Commit f9496744 by yao.xiao

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

parent 96914641
package com.yd.api.agms.service.impl;
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.PractitionerHiringDetailResponseVO;
import com.yd.api.result.CommonResult;
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.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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -19,31 +26,50 @@ import java.util.List;
public class AgmsHiringServiceImpl implements AgmsHiringService {
private AgmsHiringDALService agmsHiringDalService;
private SystemConfigService systemConfigService;
private AclUserDALService aclUserDalService;
private MdPractitionerHiringApproveStepsDALService mdPractitionerHiringApproveStepsDalService;
@Autowired
public void setAgmsHiringDalService(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
public PractitionerHiringDetailResponseVO practitionerHiringDetail(PractitionerHiringDetailRequestVO requestVO) {
PractitionerHiringDetailResponseVO responseVO = new PractitionerHiringDetailResponseVO();
Long hiringBasicInfoId = requestVO.getHiringBasicInfoId();
Long loginId = requestVO.getLoginId();
//经纪人审批基本信息
PractitionerHiringBasicInfo practitionerHiringBasicInfo = agmsHiringDalService.findPractitionerHiringBasicInfo(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.setPractitionerHiringApproveSteps(practitionerHiringApproveSteps);
responseVO.setPractitionerHiringBasicInfo(practitionerHiringBasicInfo);
responseVO.setPractitionerHiringMemberShip(practitionerHiringMemberShip);
responseVO.setPractitionerHiringWorkingExperienceList(practitionerHiringWorkingExperienceList);
......@@ -53,4 +79,90 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
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;
public class PractitionerHiringDetailRequestVO {
/**
* AGMS登入者id
*/
private Long loginId;
/**
* 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
*/
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
*
* @return hiringBasicInfoId 经纪人基本信息id ag_acl_practitioner_hiring_basic_info.id
......@@ -31,7 +54,8 @@ public class PractitionerHiringDetailRequestVO {
@Override
public String toString() {
return "PractitionerHiringDetailRequestVO{" +
"hiringBasicInfoId=" + hiringBasicInfoId +
"loginId=" + loginId +
", hiringBasicInfoId=" + hiringBasicInfoId +
'}';
}
}
......@@ -14,6 +14,10 @@ public class PractitionerHiringDetailResponseVO {
*/
private Long hiringBasicInfoId;
/**
* 经纪人审批步骤/状态
*/
private PractitionerHiringApproveSteps practitionerHiringApproveSteps;
/**
* 经纪人审批基本信息
*/
private PractitionerHiringBasicInfo practitionerHiringBasicInfo;
......@@ -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 经纪人审批基本信息
......@@ -189,6 +211,7 @@ public class PractitionerHiringDetailResponseVO {
public String toString() {
return "PractitionerHiringDetailResponseVO{" +
"hiringBasicInfoId=" + hiringBasicInfoId +
", practitionerHiringApproveSteps=" + practitionerHiringApproveSteps +
", practitionerHiringBasicInfo=" + practitionerHiringBasicInfo +
", practitionerHiringMemberShip=" + practitionerHiringMemberShip +
", practitionerHiringWorkingExperienceList=" + practitionerHiringWorkingExperienceList +
......
......@@ -8,15 +8,26 @@ import java.util.Date;
public class PractitionerHiringApproveRecords {
/**
* 审批步骤id
*/
private Long approveStepId;
/**
* 审批步骤名称
*/
private String approveStepName;
/**
* 执行动作的审批经纪人Id
*/
private Long approvingPractitionerId;
/**
* 执行动作的审批经纪人
*/
private String approvingPractitionerName;
/**
* 1:通过,0:驳回
*/
private Long approvingStatusId;
/**
* 1:通过,0:驳回
*/
......@@ -32,6 +43,23 @@ public class PractitionerHiringApproveRecords {
*/
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 {
}
/**
* 获取 执行动作的审批经纪人Id
*
* @return approvingPractitionerId 执行动作的审批经纪人Id
*/
public Long getApprovingPractitionerId() {
return this.approvingPractitionerId;
}
/**
* 设置 执行动作的审批经纪人Id
*
* @param approvingPractitionerId 执行动作的审批经纪人Id
*/
public void setApprovingPractitionerId(Long approvingPractitionerId) {
this.approvingPractitionerId = approvingPractitionerId;
}
/**
* 获取 执行动作的审批经纪人
*
* @return approvingPractitionerName 执行动作的审批经纪人
......@@ -72,6 +118,24 @@ public class PractitionerHiringApproveRecords {
/**
* 获取 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:驳回
*/
public String getApprovingStatus() {
......@@ -126,11 +190,14 @@ public class PractitionerHiringApproveRecords {
@Override
public String toString() {
return "PractitionerHiringApproveRecords{" +
"approveStepName='" + approveStepName + '\'' +
"approveStepId=" + approveStepId +
", approveStepName='" + approveStepName + '\'' +
", approvingPractitionerId=" + approvingPractitionerId +
", approvingPractitionerName='" + approvingPractitionerName + '\'' +
", approvingStatus=" + approvingStatus +
", approvingStatusId=" + approvingStatusId +
", approvingStatus='" + approvingStatus + '\'' +
", rejectNote='" + rejectNote + '\'' +
", hiringAt=" + hiringAt +
", hiringAt='" + hiringAt + '\'' +
'}';
}
}
......@@ -8,6 +8,11 @@ public class PractitionerHiringMemberShip {
/**
* 報聘经纪人职级类型 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;
/**
......@@ -35,6 +40,43 @@ public class PractitionerHiringMemberShip {
*/
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 {
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
public String toString() {
return "PractitionerHiringMemberShip{" +
"practitionerLevel='" + practitionerLevel + '\'' +
"practitionerLevelId='" + practitionerLevelId + '\'' +
", practitionerLevel='" + practitionerLevel + '\'' +
", mentor='" + mentor + '\'' +
", introducer='" + introducer + '\'' +
", subsystem='" + subsystem + '\'' +
......@@ -154,5 +179,4 @@ public class PractitionerHiringMemberShip {
", branch='" + branch + '\'' +
'}';
}
}
package com.yd.dal.entity.meta;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 報聘经纪人報聘审批步骤设置
*/
* 報聘经纪人報聘审批步骤设置
*/
@Data
public class MdPractitionerHiringApproveSteps {
public class MdPractitionerHiringApproveSteps implements Serializable {
/**
* serial id
*/
* serial id
*/
private Long id;
/**
* 审批步骤名称
*/
* 审批步骤名称
*/
private String stepName;
/**
* 审批负责人角色
*/
* 审批负责人角色
*/
private String approveRole;
/**
* 指定审批负责人
*/
* 指定审批负责人
*/
private String appointedApprovePractitioners;
/**
* 审批顺序
*/
* 审批顺序
*/
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 Date createdAt;
/**
* 建置者
*/
* 建置者
*/
private Long createdBy;
/**
* 更新日
*/
* 更新日
*/
private Date updatedAt;
private Long updatedBy;
......
......@@ -212,4 +212,31 @@ public class AclUser {
public void setUpdatedBy(Long 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 {
* @return 查询结果
*/
List<PractitionerHiringApproveRecords> findPractitionerHiringApproveRecordsList(Long hiringBasicInfoId);
/**
* 通过loginId查询对应的经纪人id
* @param loginId agms登入者id
* @return 经纪人id
*/
Long findPractitionerIdByLoginId(Long loginId);
}
......@@ -22,4 +22,10 @@ public interface MdPractitionerHiringApproveStepsMapper {
int updateBatchSelective(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 {
* @return 查询结果
*/
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 {
public List<PractitionerHiringApproveRecords> findPractitionerHiringApproveRecordsList(Long hiringBasicInfoId) {
return agmsHiringMapper.findPractitionerHiringApproveRecordsList(hiringBasicInfoId);
}
@Override
public Long findPractitionerIdByLoginId(Long loginId) {
return agmsHiringMapper.findPractitionerIdByLoginId(loginId);
}
}
package com.yd.dal.service.meta;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import java.util.List;
/**
* @author xxy
*/
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;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.mapper.meta.MdPractitionerHiringApproveStepsMapper;
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 java.util.List;
@Service("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;
import com.yd.dal.entity.meta.MdCode;
import com.yd.dal.entity.meta.MdIncometaxRate;
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.MdIncometaxRateDALService;
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.util.CommonUtil;
import net.sf.ehcache.Cache;
......@@ -18,7 +20,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @author xxy
*/
@Service("systemConfigService")
@org.springframework.core.annotation.Order(1)
public class SystemConfigService implements CommandLineRunner{
......@@ -27,6 +33,12 @@ public class SystemConfigService implements CommandLineRunner{
private MdCodeDALService mdCodeService;
@Autowired
private AliOssInterfService aliOssInterfService;
@Autowired
private MdPractitionerHiringApproveStepsDALService mdPractitionerHiringApproveStepsDalService;
@Autowired
private MdMkCampaignDALService mdMkCampaignDALService;
@Autowired
private MdIncometaxRateDALService mdIncometaxRateDALService;
/**
* 保存cache
......@@ -207,8 +219,7 @@ public class SystemConfigService implements CommandLineRunner{
aliOssInterfService.initAttribute();
}
@Autowired
private MdMkCampaignDALService mdMkCampaignDALService;
public Long getMdMkCampaignId(String campaignCode) {
Long configValue = null;
Element element = systemConfigCache.get("campaignCode:"+campaignCode);
......@@ -223,8 +234,6 @@ public class SystemConfigService implements CommandLineRunner{
return configValue;
}
@Autowired
private MdIncometaxRateDALService mdIncometaxRateDALService;
@SuppressWarnings("unchecked")
public List<MdIncometaxRate> findIncometax(){
List<MdIncometaxRate> incometaxRates = new ArrayList<>();
......@@ -238,4 +247,41 @@ public class SystemConfigService implements CommandLineRunner{
}
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 @@
<select id="findPractitionerHiringMemberShip"
resultType="com.yd.dal.entity.agms.hiring.PractitionerHiringMemberShip">
select md_drop_option_name practitionerLevel,
md_drop_option_id practitionerLevelId,
mentor mentor,
introducer introducer,
subsystem subsystem,
......@@ -100,14 +101,25 @@
<select id="findPractitionerHiringApproveRecordsList"
resultType="com.yd.dal.entity.agms.hiring.PractitionerHiringApproveRecords">
select p.name approvingPractitionerName,
r.approve_step_name approveStepName,
if(r.approving_status is null, null, if(r.approving_status = 1, '通过', '驳回')),
r.reject_note rejectNote,
date_format(r.created_at, '%Y-%m-%d %H:%i:%s') hiringAt
select r.approving_practitioner_id approvingPractitionerId,
p.name approvingPractitionerName,
r.approve_step_id approveStepId,
r.approve_step_name approveStepName,
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
left join ag_acl_practitioner p on p.id = r.approving_practitioner_id
where r.is_active = 1
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>
</mapper>
\ No newline at end of file
<?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">
<mapper namespace="com.yd.dal.mapper.meta.MdPractitionerHiringApproveStepsMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps">
<!--@mbg.generated-->
<!--@Table ag_md_practitioner_hiring_approve_steps-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="step_name" jdbcType="VARCHAR" property="stepName" />
<result column="approve_role" jdbcType="VARCHAR" property="approveRole" />
<result column="appointed_approve_practitioners" jdbcType="VARCHAR" property="appointedApprovePractitioners" />
<result column="step_seq" jdbcType="INTEGER" property="stepSeq" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, step_name, approve_role, appointed_approve_practitioners, step_seq, is_active,
created_at, created_by, updated_at, updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from ag_md_practitioner_hiring_approve_steps
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from ag_md_practitioner_hiring_approve_steps
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps" 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 (#{stepName,jdbcType=VARCHAR}, #{approveRole,jdbcType=VARCHAR}, #{appointedApprovePractitioners,jdbcType=VARCHAR},
#{stepSeq,jdbcType=INTEGER}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_md_practitioner_hiring_approve_steps
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stepName != null">
step_name,
</if>
<if test="approveRole != null">
approve_role,
</if>
<if test="appointedApprovePractitioners != null">
appointed_approve_practitioners,
</if>
<if test="stepSeq != null">
step_seq,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stepName != null">
#{stepName,jdbcType=VARCHAR},
</if>
<if test="approveRole != null">
#{approveRole,jdbcType=VARCHAR},
</if>
<if test="appointedApprovePractitioners != null">
#{appointedApprovePractitioners,jdbcType=VARCHAR},
</if>
<if test="stepSeq != null">
#{stepSeq,jdbcType=INTEGER},
</if>
<if test="isActive != null">
#{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps">
<!--@mbg.generated-->
update ag_md_practitioner_hiring_approve_steps
<set>
<if test="stepName != null">
step_name = #{stepName,jdbcType=VARCHAR},
</if>
<if test="approveRole != null">
approve_role = #{approveRole,jdbcType=VARCHAR},
</if>
<if test="appointedApprovePractitioners != null">
appointed_approve_practitioners = #{appointedApprovePractitioners,jdbcType=VARCHAR},
</if>
<if test="stepSeq != null">
step_seq = #{stepSeq,jdbcType=INTEGER},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps">
<!--@mbg.generated-->
update ag_md_practitioner_hiring_approve_steps
set step_name = #{stepName,jdbcType=VARCHAR},
approve_role = #{approveRole,jdbcType=VARCHAR},
appointed_approve_practitioners = #{appointedApprovePractitioners,jdbcType=VARCHAR},
step_seq = #{stepSeq,jdbcType=INTEGER},
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}
<resultMap id="BaseResultMap" type="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps">
<!--@mbg.generated-->
<!--@Table ag_md_practitioner_hiring_approve_steps-->
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="step_name" jdbcType="VARCHAR" property="stepName"/>
<result column="approve_role" jdbcType="VARCHAR" property="approveRole"/>
<result column="appointed_approve_practitioners" jdbcType="VARCHAR" property="appointedApprovePractitioners"/>
<result column="step_seq" jdbcType="INTEGER" property="stepSeq"/>
<result column="ceo_aprrove_grade" jdbcType="BIGINT" property="ceoAprroveGrade"/>
<result column="is_active" jdbcType="INTEGER" property="isActive"/>
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
<result column="created_by" jdbcType="BIGINT" property="createdBy"/>
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
<result column="updated_by" jdbcType="BIGINT" property="updatedBy"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, step_name, approve_role, appointed_approve_practitioners, step_seq, ceo_aprrove_grade,
is_active, created_at, created_by, updated_at, updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List"/>
from ag_md_practitioner_hiring_approve_steps
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete
from ag_md_practitioner_hiring_approve_steps
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id"
parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps" useGeneratedKeys="true">
<!--@mbg.generated-->
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 (#{stepName,jdbcType=VARCHAR}, #{approveRole,jdbcType=VARCHAR},
#{appointedApprovePractitioners,jdbcType=VARCHAR},
#{stepSeq,jdbcType=INTEGER}, #{ceoAprroveGrade,jdbcType=BIGINT}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id"
parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_md_practitioner_hiring_approve_steps
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stepName != null">
step_name,
</if>
<if test="approveRole != null">
approve_role,
</if>
<if test="appointedApprovePractitioners != null">
appointed_approve_practitioners,
</if>
<if test="stepSeq != null">
step_seq,
</if>
<if test="ceoAprroveGrade != null">
ceo_aprrove_grade,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stepName != null">
#{stepName,jdbcType=VARCHAR},
</if>
<if test="approveRole != null">
#{approveRole,jdbcType=VARCHAR},
</if>
<if test="appointedApprovePractitioners != null">
#{appointedApprovePractitioners,jdbcType=VARCHAR},
</if>
<if test="stepSeq != null">
#{stepSeq,jdbcType=INTEGER},
</if>
<if test="ceoAprroveGrade != null">
#{ceoAprroveGrade,jdbcType=BIGINT},
</if>
<if test="isActive != null">
#{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps">
<!--@mbg.generated-->
update ag_md_practitioner_hiring_approve_steps
<set>
<if test="stepName != null">
step_name = #{stepName,jdbcType=VARCHAR},
</if>
<if test="approveRole != null">
approve_role = #{approveRole,jdbcType=VARCHAR},
</if>
<if test="appointedApprovePractitioners != null">
appointed_approve_practitioners = #{appointedApprovePractitioners,jdbcType=VARCHAR},
</if>
<if test="stepSeq != null">
step_seq = #{stepSeq,jdbcType=INTEGER},
</if>
<if test="ceoAprroveGrade != null">
ceo_aprrove_grade = #{ceoAprroveGrade,jdbcType=BIGINT},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps">
<!--@mbg.generated-->
update ag_md_practitioner_hiring_approve_steps
set step_name = #{stepName,jdbcType=VARCHAR},
approve_role = #{approveRole,jdbcType=VARCHAR},
appointed_approve_practitioners = #{appointedApprovePractitioners,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>
</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}
</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="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>
</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}
</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, 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>
</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="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>
</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>
</insert>
<select id="findAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from ag_md_practitioner_hiring_approve_steps
where is_active = 1
order by step_seq
</select>
<select id="findByPractitionerLevel" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from ag_md_practitioner_hiring_approve_steps
where is_active = 1
and (ceo_aprrove_grade is null or find_in_set(#{practitionerLevelId,jdbcType=VARCHAR}, ceo_aprrove_grade))
order by step_seq
</select>
<select id="findByAppointedApprovePractitioners" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from ag_md_practitioner_hiring_approve_steps
where is_active = 1
and find_in_set(#{appointedApprovePractitioners,jdbcType=VARCHAR},appointed_approve_practitioners)
order by step_seq
</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