Commit 2a40f262 by Water Wang

optimize

parent fbb45b38
...@@ -17,8 +17,10 @@ import com.yd.api.practitioner.vo.setting.*; ...@@ -17,8 +17,10 @@ import com.yd.api.practitioner.vo.setting.*;
import com.yd.api.result.CommonResult; import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.*; import com.yd.dal.entity.customer.*;
import com.yd.dal.entity.customer.practitioner.*; import com.yd.dal.entity.customer.practitioner.*;
import com.yd.dal.entity.meta.MdDropOptions;
import com.yd.dal.service.customer.*; import com.yd.dal.service.customer.*;
import com.yd.dal.service.meta.MdCodeDALService; import com.yd.dal.service.meta.MdCodeDALService;
import com.yd.dal.service.meta.MdDropOptionsDALService;
import com.yd.rmi.ali.oss.service.OssService; import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.tencent.wechat.service.WechatService; import com.yd.rmi.tencent.wechat.service.WechatService;
import com.yd.rmi.tencent.wechat.vo.WeChatInfoByENV; import com.yd.rmi.tencent.wechat.vo.WeChatInfoByENV;
...@@ -69,6 +71,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -69,6 +71,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private AclPractitionerPotentialAssignedTrackDALService aclPractitionerPotentialAssignedTrackDALService; private AclPractitionerPotentialAssignedTrackDALService aclPractitionerPotentialAssignedTrackDALService;
@Autowired @Autowired
private AclCustomerDALService aclCustomerDALService; private AclCustomerDALService aclCustomerDALService;
@Autowired
private MdDropOptionsDALService mdDropOptionsDALService;
@Autowired
private AclUserDALService aclUserDALService;
@Override @Override
...@@ -407,7 +413,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -407,7 +413,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
double width = img.getWidth(null); double width = img.getWidth(null);
double height = img.getHeight(null); double height = img.getHeight(null);
double value =height/width; double value =height/width;
Double scaleDouble = Double.valueOf(scale); double scaleDouble = Double.parseDouble(scale);
if (value !=scaleDouble) { if (value !=scaleDouble) {
if (scaleDouble == 1){ if (scaleDouble == 1){
//上传头像尺寸比例为1:1 //上传头像尺寸比例为1:1
...@@ -491,16 +497,25 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -491,16 +497,25 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
if (practitionerId != null && !practitionerPotentialIdList.isEmpty()) { if (practitionerId != null && !practitionerPotentialIdList.isEmpty()) {
List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList = new ArrayList<>(); List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList = new ArrayList<>();
AclPractitionerPotentialAssignedTrack potentialAssignedTrack; AclPractitionerPotentialAssignedTrack potentialAssignedTrack;
Long trackStatusId = 107L;
int trackScore = 2;
List<MdDropOptions> optionsList = mdDropOptionsDALService.findByMasterIdAndOrder(16L,1);
if(optionsList != null && !optionsList.isEmpty()){
MdDropOptions options = optionsList.get(0);
trackStatusId = options.getId();
trackScore = options.getDropOptionScore();
}
for (Long potentialId : practitionerPotentialIdList) { for (Long potentialId : practitionerPotentialIdList) {
potentialAssignedTrack = new AclPractitionerPotentialAssignedTrack(); potentialAssignedTrack = new AclPractitionerPotentialAssignedTrack();
potentialAssignedTrack.setPractitionerPotentialId(potentialId); potentialAssignedTrack.setPractitionerPotentialId(potentialId);
potentialAssignedTrack.setPractitionerAssignedId(practitionerId); potentialAssignedTrack.setPractitionerAssignedId(practitionerId);
potentialAssignedTrack.setTrackStatusId(112L);//待跟进 potentialAssignedTrack.setTrackStatusId(trackStatusId);//待跟进
potentialAssignedTrack.setIsActive(1); potentialAssignedTrack.setIsActive(1);
potentialAssignedTrack.setIsLasted(1); potentialAssignedTrack.setIsLasted(1);
potentialAssignedTrack.setCreatedAt(new Date()); potentialAssignedTrack.setCreatedAt(new Date());
potentialAssignedTrack.setCreatedBy(practitionerId); potentialAssignedTrack.setCreatedBy(practitionerId);
potentialAssignedTrack.setCreatorType(2); potentialAssignedTrack.setCreatorType(2);
potentialAssignedTrack.setTrackScore(trackScore);
potentialAssignedTrackList.add(potentialAssignedTrack); potentialAssignedTrackList.add(potentialAssignedTrack);
} }
aclPractitionerPotentialAssignedTrackDALService.saveAll(potentialAssignedTrackList); aclPractitionerPotentialAssignedTrackDALService.saveAll(potentialAssignedTrackList);
...@@ -508,44 +523,126 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -508,44 +523,126 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
} }
@Override @Override
@Transactional
public AddRecruitTrackResponseVO addRecruitTrack(AddRecruitTrackRequestVO requestVO) { public AddRecruitTrackResponseVO addRecruitTrack(AddRecruitTrackRequestVO requestVO) {
AddRecruitTrackResponseVO responseVO = new AddRecruitTrackResponseVO(); AddRecruitTrackResponseVO responseVO = new AddRecruitTrackResponseVO();
Long trackId = requestVO.getTrackId();
Long trackStatusId = requestVO.getTrackStatusId(); Long trackStatusId = requestVO.getTrackStatusId();
Long practitionerId = requestVO.getPractitionerId(); Long practitionerId = requestVO.getPractitionerId();
Long potentialId = requestVO.getPractitionerPotentialId(); Long potentialId = requestVO.getPotentialId();
if(trackId != null && trackStatusId != null && practitionerId != null && potentialId != null){ if(trackStatusId != null && practitionerId != null && potentialId != null){
AclPractitionerPotentialAssignedTrack assignedTrack = new AclPractitionerPotentialAssignedTrack(); AclPractitionerPotentialAssignedTrack assignedTrack = new AclPractitionerPotentialAssignedTrack();
//1、查询团队长对该增员几天是否已经进行过该增员状态 List<AclPractitionerPotentialAssignedTrack> assignedTrackIsLastedList = aclPractitionerPotentialAssignedTrackDALService.findByPotentialIdAndIsLasted(potentialId,1);
List<AclPractitionerPotentialAssignedTrack> assignedTrackList = aclPractitionerPotentialAssignedTrackDALService.findByPractitionerIdAndPotentialId(practitionerId,potentialId); //1、更新最新的状态
if(assignedTrackIsLastedList != null && !assignedTrackIsLastedList.isEmpty()){
List<AclPractitionerPotentialAssignedTrack> assignedTrackUpdateList = new ArrayList<>();
for(AclPractitionerPotentialAssignedTrack item : assignedTrackIsLastedList){
item.setIsLasted(0);
item.setUpdatedBy(practitionerId);
item.setUpdatorType(2);
item.setUpdatedAt(new Date());
assignedTrackUpdateList.add(item);
}
aclPractitionerPotentialAssignedTrackDALService.updateAll(assignedTrackUpdateList);
}
//2、查询团队长对该增员所有增员状态
List<AclPractitionerPotentialAssignedTrack> assignedTrackList = aclPractitionerPotentialAssignedTrackDALService.findByPractitionerIdAndPotentialIdAndTrackStatusId(practitionerId,potentialId,trackStatusId);
if(assignedTrackList == null || assignedTrackList.isEmpty()){//3、如果没有,获取增员状态对应的分值, if(assignedTrackList == null || assignedTrackList.isEmpty()){//3、如果没有,获取增员状态对应的分值,
// assignedTrack.setTrackScore(); MdDropOptions options = mdDropOptionsDALService.findById(trackStatusId);
assignedTrack.setTrackScore(options.getDropOptionScore());
}else{
assignedTrack.setTrackScore(0);
} }
assignedTrack.setPractitionerAssignedId(practitionerId); assignedTrack.setPractitionerAssignedId(practitionerId);
assignedTrack.setPractitionerPotentialId(potentialId); assignedTrack.setPractitionerPotentialId(potentialId);
assignedTrack.setTrackStatusId(trackStatusId); assignedTrack.setTrackStatusId(trackStatusId);
assignedTrack.setNotice(requestVO.getNotice()); assignedTrack.setNotice(requestVO.getNotice());
assignedTrack.setIsActive(1); assignedTrack.setIsActive(1);
assignedTrack.setIsLasted(1);
assignedTrack.setCreatorType(2); assignedTrack.setCreatorType(2);
assignedTrack.setCreatedBy(practitionerId); assignedTrack.setCreatedBy(practitionerId);
assignedTrack.setCreatedAt(new Date()); assignedTrack.setCreatedAt(new Date());
aclPractitionerPotentialAssignedTrackDALService.save(assignedTrack);
responseVO.setTrackId(assignedTrack.getId());
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{ }else{
String [] paras = {"trackId,trackStatusId,practitionerId,potentialId"}; String [] paras = {"trackStatusId,practitionerId,potentialId"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras))); responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
} }
return null; return responseVO;
} }
@Override @Override
public RecruitTrackQueryResponseVO recruitTrackQuery(RecruitTrackQueryRequestVO requestVO) { public RecruitTrackQueryResponseVO recruitTrackQuery(RecruitTrackQueryRequestVO requestVO) {
return null; RecruitTrackQueryResponseVO responseVO = new RecruitTrackQueryResponseVO();
Long practitionerId = requestVO.getPractitionerId();
Long potentialId = requestVO.getPotentialId();
if(potentialId != null && practitionerId != null){
List<AclPractitionerPotentialAssignedTrack> assignedTrackList = aclPractitionerPotentialAssignedTrackDALService.findByPractitionerIdAndPotentialId(practitionerId,potentialId);
if(assignedTrackList != null && !assignedTrackList.isEmpty()){
Map<Integer,Map<Long,String>> nameMap = getOperateName(assignedTrackList);
Map<Long,String> userMap = nameMap.get(1);
Map<Long,String> practitionerMap = nameMap.get(2);
Map<Long,String> trackStatusMap = new HashMap<>();
List<MdDropOptions> dropOptionsList = mdDropOptionsDALService.findByMasterId(16L);
dropOptionsList.forEach(i->trackStatusMap.put(i.getId(),i.getDropOptionName()));
List<RecruitTrackInfo> recruitTrackInfoList = new ArrayList<>();
RecruitTrackInfo recruitTrack;
Long operateUserId,trackStatusId;
Integer operateUserType;
String operateUserName;
for(AclPractitionerPotentialAssignedTrack item : assignedTrackList){
operateUserId = item.getCreatedBy();
trackStatusId = item.getTrackStatusId();
operateUserType = item.getCreatorType();
operateUserName = (operateUserType == 1) ? userMap.get(operateUserId) : practitionerMap.get(operateUserId);
recruitTrack = new RecruitTrackInfo();
recruitTrack.setTrackId(item.getId());
recruitTrack.setNotice(item.getNotice());
recruitTrack.setOperateUserId(operateUserId);
recruitTrack.setOperateUserName(operateUserName);
recruitTrack.setTrackStatusId(trackStatusId);
recruitTrack.setTrackStatus(trackStatusMap.get(trackStatusId));
recruitTrack.setCreateAt(CommonUtil.dateParseString(item.getCreatedAt(),"yyyy-MM-dd HH:mm:ss"));
recruitTrackInfoList.add(recruitTrack);
responseVO.setRecruitTrackInfoList(recruitTrackInfoList);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}
}else{
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("820001")));
}
}else{
String [] paras = {"practitionerId,potentialId"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
}
return responseVO;
}
private Map<Integer, Map<Long, String>> getOperateName(List<AclPractitionerPotentialAssignedTrack> assignedTrackList) {
Map<Integer, Map<Long, String>> nameMap = new HashMap<>();
Map<Long, String> practitionerMap = new HashMap<>();
Map<Long, String> userMap = new HashMap<>();
Set<Long> practitionerIdSet = new HashSet<>();
Set<Long> userIdSet = new HashSet<>();
for(AclPractitionerPotentialAssignedTrack item : assignedTrackList){
if(item.getCreatorType() == 2){
practitionerIdSet.add(item.getCreatedBy());
}else{
userIdSet.add(item.getCreatedBy());
}
}
List<Long> practitionerIdList = new ArrayList<>(practitionerIdSet);
List<Long> userIdList = new ArrayList<>(userIdSet);
if(!practitionerIdList.isEmpty()){
List<AclPractitioner> practitionerList = aclPractitionerDALService.findByIds(practitionerIdList);
practitionerList.forEach(i->practitionerMap.put(i.getId(),i.getName()));
}
if(!userIdList.isEmpty()){
List<AclUser> userList = aclUserDALService.findByIds(userIdList);
userList.forEach(i->userMap.put(i.getId(),i.getName()));
}
nameMap.put(1,userMap);
nameMap.put(2,practitionerMap);
return nameMap;
} }
@Override @Override
......
package com.yd.api.practitioner.vo.recruit; package com.yd.api.practitioner.vo.recruit;
public class AddRecruitTrackRequestVO { public class AddRecruitTrackRequestVO {
private Long trackId;
private Long practitionerId; private Long practitionerId;
private Long practitionerPotentialId; private Long potentialId;
private Integer trackScore;
private Long trackStatusId; private Long trackStatusId;
private String notice; private String notice;
private Integer isActive; private Integer isActive;
public Long getTrackId() {
return trackId;
}
public void setTrackId(Long trackId) {
this.trackId = trackId;
}
public Long getTrackStatusId() { public Long getTrackStatusId() {
return trackStatusId; return trackStatusId;
...@@ -49,19 +40,12 @@ public class AddRecruitTrackRequestVO { ...@@ -49,19 +40,12 @@ public class AddRecruitTrackRequestVO {
this.practitionerId = practitionerId; this.practitionerId = practitionerId;
} }
public Long getPractitionerPotentialId() { public Long getPotentialId() {
return practitionerPotentialId; return potentialId;
} }
public void setPractitionerPotentialId(Long practitionerPotentialId) { public void setPotentialId(Long potentialId) {
this.practitionerPotentialId = practitionerPotentialId; this.potentialId = potentialId;
} }
public Integer getTrackScore() {
return trackScore;
}
public void setTrackScore(Integer trackScore) {
this.trackScore = trackScore;
}
} }
package com.yd.api.practitioner.vo.recruit;
public class RecruitTrackInfo {
private Long trackId;
private Long trackStatusId;
private String trackStatus;
private String notice;
private String createAt;
private Long operateUserId;
private String operateUserName;
public Long getTrackId() {
return trackId;
}
public void setTrackId(Long trackId) {
this.trackId = trackId;
}
public Long getTrackStatusId() {
return trackStatusId;
}
public void setTrackStatusId(Long trackStatusId) {
this.trackStatusId = trackStatusId;
}
public String getTrackStatus() {
return trackStatus;
}
public void setTrackStatus(String trackStatus) {
this.trackStatus = trackStatus;
}
public String getNotice() {
return notice;
}
public void setNotice(String notice) {
this.notice = notice;
}
public String getCreateAt() {
return createAt;
}
public void setCreateAt(String createAt) {
this.createAt = createAt;
}
public Long getOperateUserId() {
return operateUserId;
}
public void setOperateUserId(Long operateUserId) {
this.operateUserId = operateUserId;
}
public String getOperateUserName() {
return operateUserName;
}
public void setOperateUserName(String operateUserName) {
this.operateUserName = operateUserName;
}
}
...@@ -2,7 +2,7 @@ package com.yd.api.practitioner.vo.recruit; ...@@ -2,7 +2,7 @@ package com.yd.api.practitioner.vo.recruit;
public class RecruitTrackQueryRequestVO { public class RecruitTrackQueryRequestVO {
private Long potentialId; private Long potentialId;
private Long assignedId; private Long practitionerId;
public Long getPotentialId() { public Long getPotentialId() {
return potentialId; return potentialId;
...@@ -12,11 +12,11 @@ public class RecruitTrackQueryRequestVO { ...@@ -12,11 +12,11 @@ public class RecruitTrackQueryRequestVO {
this.potentialId = potentialId; this.potentialId = potentialId;
} }
public Long getAssignedId() { public Long getPractitionerId() {
return assignedId; return practitionerId;
} }
public void setAssignedId(Long assignedId) { public void setPractitionerId(Long practitionerId) {
this.assignedId = assignedId; this.practitionerId = practitionerId;
} }
} }
package com.yd.api.practitioner.vo.recruit; package com.yd.api.practitioner.vo.recruit;
public class RecruitTrackQueryResponseVO { import com.yd.api.result.CommonResult;
private Long trackId;
private Long trackStatusId;
private String trackStatus;
private String notice;
private String createAt;
private Long operateUserId;
private String operateUserName;
public Long getTrackId() {
return trackId;
}
public void setTrackId(Long trackId) {
this.trackId = trackId;
}
public Long getTrackStatusId() {
return trackStatusId;
}
public void setTrackStatusId(Long trackStatusId) {
this.trackStatusId = trackStatusId;
}
public String getTrackStatus() {
return trackStatus;
}
public void setTrackStatus(String trackStatus) {
this.trackStatus = trackStatus;
}
public String getNotice() {
return notice;
}
public void setNotice(String notice) { import java.util.List;
this.notice = notice;
}
public String getCreateAt() {
return createAt;
}
public void setCreateAt(String createAt) { public class RecruitTrackQueryResponseVO {
this.createAt = createAt; private List<RecruitTrackInfo> recruitTrackInfoList;
} private CommonResult commonResult;
public Long getOperateUserId() { public List<RecruitTrackInfo> getRecruitTrackInfoList() {
return operateUserId; return recruitTrackInfoList;
} }
public void setOperateUserId(Long operateUserId) { public void setRecruitTrackInfoList(List<RecruitTrackInfo> recruitTrackInfoList) {
this.operateUserId = operateUserId; this.recruitTrackInfoList = recruitTrackInfoList;
} }
public String getOperateUserName() { public CommonResult getCommonResult() {
return operateUserName; return commonResult;
} }
public void setOperateUserName(String operateUserName) { public void setCommonResult(CommonResult commonResult) {
this.operateUserName = operateUserName; this.commonResult = commonResult;
} }
} }
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_acl_user
* @author
*/
@Data
public class AclUser implements Serializable {
/**
* serial id
*/
private Long id;
/**
* 1= Staff 2.Customer 3.Partner
*/
private Integer userRole;
/**
* 员工编号
*/
private String employeeNo;
/**
* 1= 安吉保 2=银盾
*/
private Integer company;
/**
* FK ag_system_dept.id
*/
private Long deptId;
/**
* FK ag_system_role.id
*/
private Long roleId;
/**
* login ID
*/
private String login;
/**
* 88888888
*/
private String password;
/**
* user name
*/
private String name;
/**
* user nickname
*/
private String nickname;
private String mobileNo;
private String idNo;
/**
* 最后登入时间
*/
private Date lastLoginTime;
/**
* 最后登出时间
*/
private Date logoutTime;
/**
* 1=PC 2=Mobile 3=Pad
*/
private Integer loginSource;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 员工email
*/
private String email;
/**
* 创建日期
*/
private Date createdAt;
/**
* creator
*/
private Long createdBy;
/**
* 0000-00-00 00:00:00
*/
private Date updatedAt;
/**
* updator, FK ag_acl_user.id
*/
private Long updatedBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.meta;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_md_drop_master
* @author
*/
@Data
public class MdDropMaster implements Serializable {
/**
* 下拉选框编号
*/
private Long id;
/**
* 下拉选框场景编码
*/
private String scenarioCode;
/**
* 下拉选框场景名称:产品维护中文件上传哪里的文件类型
*/
private String scenarioName;
/**
* 下拉选框代码
*/
private String dropCode;
/**
* 下拉选框名称
*/
private String dropName;
/**
* 下拉选框说明
*/
private String dropCodeDesc;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
private Date createdAt;
private Long createdBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.meta;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_md_drop_options
* @author
*/
@Data
public class MdDropOptions implements Serializable {
/**
* 选项编号
*/
private Long id;
/**
* 选单编号
*/
private Long dropMasterId;
/**
* 选项名称
*/
private String dropOptionName;
/**
* 选项数值
*/
private String dropOptionCode;
/**
* 选项顺序
*/
private Integer dropOptionOrder;
/**
* 选项分值
*/
private Integer dropOptionScore;
/**
* 选项备注
*/
private String dropOptionRemark;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
private Date createdAt;
private Long createdBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
...@@ -35,4 +35,6 @@ public interface AclPractitionerMapper { ...@@ -35,4 +35,6 @@ public interface AclPractitionerMapper {
PractitionerInfo findPractitionerInfoByLogin(@Param("mobileNo")String mobileNo); PractitionerInfo findPractitionerInfoByLogin(@Param("mobileNo")String mobileNo);
AclPractitioner findByCustomerIdIsActive(@Param("customerId") Long customerId, @Param("isActive")int isActive); AclPractitioner findByCustomerIdIsActive(@Param("customerId") Long customerId, @Param("isActive")int isActive);
List<AclPractitioner> findByIds(@Param("practitionerIdList") List<Long> practitionerIdList);
} }
\ No newline at end of file
...@@ -19,5 +19,11 @@ public interface AclPractitionerPotentialAssignedTrackMapper { ...@@ -19,5 +19,11 @@ public interface AclPractitionerPotentialAssignedTrackMapper {
void insertList(@Param("potentialAssignedTrackList") List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList); void insertList(@Param("potentialAssignedTrackList") List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(@Param("practitionerId") Long practitionerId, @Param("potentialId")Long potentialId); List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialIdAndTrackStatusId(@Param("practitionerId") Long practitionerId, @Param("potentialId")Long potentialId,@Param("trackStatusId")Long trackStatusId);
List<AclPractitionerPotentialAssignedTrack> findByPotentialIdAndIsLasted(@Param("potentialId")Long potentialId, @Param("isLasted")int isLasted);
void updateAll(@Param("assignedTrackUpdateList")List<AclPractitionerPotentialAssignedTrack> assignedTrackUpdateList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(@Param("practitionerId")Long practitionerId, @Param("potentialId")Long potentialId);
} }
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclUser;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AclUserMapper {
int deleteByPrimaryKey(Long id);
int insert(AclUser record);
int insertSelective(AclUser record);
AclUser selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclUser record);
int updateByPrimaryKey(AclUser record);
List<AclUser> findByIds(@Param("userIdList") List<Long> userIdList);
}
\ No newline at end of file
package com.yd.dal.mapper.meta;
import com.yd.dal.entity.meta.MdDropMaster;
public interface MdDropMasterMapper {
int deleteByPrimaryKey(Long id);
int insert(MdDropMaster record);
int insertSelective(MdDropMaster record);
MdDropMaster selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(MdDropMaster record);
int updateByPrimaryKey(MdDropMaster record);
}
\ No newline at end of file
package com.yd.dal.mapper.meta;
import com.yd.dal.entity.meta.MdDropOptions;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MdDropOptionsMapper {
int deleteByPrimaryKey(Long id);
int insert(MdDropOptions record);
int insertSelective(MdDropOptions record);
MdDropOptions selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(MdDropOptions record);
int updateByPrimaryKey(MdDropOptions record);
List<MdDropOptions> findByMasterId(@Param("masterId") Long masterId);
List<MdDropOptions> findByMasterIdAndOrder(@Param("masterId")long masterId, @Param("orderId")int orderId);
}
\ No newline at end of file
...@@ -72,4 +72,11 @@ public interface AclPractitionerDALService { ...@@ -72,4 +72,11 @@ public interface AclPractitionerDALService {
* @param practitioner * @param practitioner
*/ */
void updatePractitioner(AclPractitioner practitioner); void updatePractitioner(AclPractitioner practitioner);
/**
* 通过id数组查询
* @param practitionerIdList
* @return
*/
List<AclPractitioner> findByIds(List<Long> practitionerIdList);
} }
...@@ -10,5 +10,13 @@ public interface AclPractitionerPotentialAssignedTrackDALService { ...@@ -10,5 +10,13 @@ public interface AclPractitionerPotentialAssignedTrackDALService {
void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList); void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialIdAndTrackStatusId(Long practitionerId, Long potentialId,Long trackStatusId);
void save(AclPractitionerPotentialAssignedTrack assignedTrack);
List<AclPractitionerPotentialAssignedTrack> findByPotentialIdAndIsLasted(Long potentialId, int isLasted);
void updateAll(List<AclPractitionerPotentialAssignedTrack> assignedTrackUpdateList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId); List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId);
} }
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclUser;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclUserDALService")
public interface AclUserDALService {
List<AclUser> findByIds(List<Long> userIdList);
}
...@@ -78,4 +78,9 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService ...@@ -78,4 +78,9 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
public void updatePractitioner(AclPractitioner practitioner) { public void updatePractitioner(AclPractitioner practitioner) {
aclPractitionerMapper.updateByPrimaryKeySelective(practitioner); aclPractitionerMapper.updateByPrimaryKeySelective(practitioner);
} }
@Override
public List<AclPractitioner> findByIds(List<Long> practitionerIdList) {
return aclPractitionerMapper.findByIds(practitionerIdList);
}
} }
...@@ -19,6 +19,26 @@ public class AclPractitionerPotentialAssignedTrackDALServiceImpl implements AclP ...@@ -19,6 +19,26 @@ public class AclPractitionerPotentialAssignedTrackDALServiceImpl implements AclP
} }
@Override @Override
public List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialIdAndTrackStatusId(Long practitionerId, Long potentialId,Long trackStatusId) {
return aclPractitionerPotentialAssignedTrackMapper.findByPractitionerIdAndPotentialIdAndTrackStatusId(practitionerId,potentialId,trackStatusId);
}
@Override
public void save(AclPractitionerPotentialAssignedTrack assignedTrack) {
aclPractitionerPotentialAssignedTrackMapper.insertSelective(assignedTrack);
}
@Override
public List<AclPractitionerPotentialAssignedTrack> findByPotentialIdAndIsLasted(Long potentialId, int isLasted) {
return aclPractitionerPotentialAssignedTrackMapper.findByPotentialIdAndIsLasted(potentialId,isLasted);
}
@Override
public void updateAll(List<AclPractitionerPotentialAssignedTrack> assignedTrackUpdateList) {
aclPractitionerPotentialAssignedTrackMapper.updateAll(assignedTrackUpdateList);
}
@Override
public List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId) { public List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialId(Long practitionerId, Long potentialId) {
return aclPractitionerPotentialAssignedTrackMapper.findByPractitionerIdAndPotentialId(practitionerId,potentialId); return aclPractitionerPotentialAssignedTrackMapper.findByPractitionerIdAndPotentialId(practitionerId,potentialId);
} }
......
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclUser;
import com.yd.dal.mapper.customer.AclUserMapper;
import com.yd.dal.service.customer.AclUserDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("aclUserDALService")
public class AclUserDALServiceImpl implements AclUserDALService {
@Resource
private AclUserMapper aclUserMapper;
@Override
public List<AclUser> findByIds(List<Long> userIdList) {
return aclUserMapper.findByIds(userIdList);
}
}
package com.yd.dal.service.meta;
import com.yd.dal.entity.meta.MdDropOptions;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("mdDropOptionsDALService")
public interface MdDropOptionsDALService {
MdDropOptions findById(Long trackStatusId);
List<MdDropOptions> findByMasterId(long masterId);
List<MdDropOptions> findByMasterIdAndOrder(long masterId, int orderId);
}
package com.yd.dal.service.meta.impl;
import com.yd.dal.entity.meta.MdDropOptions;
import com.yd.dal.mapper.meta.MdDropOptionsMapper;
import com.yd.dal.service.meta.MdDropOptionsDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("mdDropOptionsDALService")
public class MdDropOptionsDALServiceImpl implements MdDropOptionsDALService {
@Autowired
private MdDropOptionsMapper mdDropOptionsMapper;
@Override
public MdDropOptions findById(Long trackStatusId) {
return mdDropOptionsMapper.selectByPrimaryKey(trackStatusId);
}
@Override
public List<MdDropOptions> findByMasterId(long masterId) {
return mdDropOptionsMapper.findByMasterId(masterId);
}
@Override
public List<MdDropOptions> findByMasterIdAndOrder(long masterId, int orderId) {
return mdDropOptionsMapper.findByMasterIdAndOrder(masterId,orderId);
}
}
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
800000=执行成功! 800000=执行成功!
##系统提示信息 ##系统提示信息
810001=token无效或者错误! 810001=token无效或者错误!
820001=为查询到相应结果。
830001=该用户非寿险经纪人。 830001=该用户非寿险经纪人。
830002=只有寿险经纪人才有权限进入! 830002=只有寿险经纪人才有权限进入!
......
...@@ -678,4 +678,13 @@ ...@@ -678,4 +678,13 @@
where customer_id = #{customerId,jdbcType=BIGINT} where customer_id = #{customerId,jdbcType=BIGINT}
and is_active = #{isActive,jdbcType=INTEGER} and is_active = #{isActive,jdbcType=INTEGER}
</select> </select>
<select id="findByIds" resultType="com.yd.dal.entity.customer.AclPractitioner">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner
where id in
<foreach collection="practitionerIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -27,14 +27,34 @@ ...@@ -27,14 +27,34 @@
from ag_acl_practitioner_potential_assigned_track from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</select> </select>
<select id="findByPractitionerIdAndPotentialId" <select id="findByPractitionerIdAndPotentialIdAndTrackStatusId"
resultType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack"> resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigned_track from ag_acl_practitioner_potential_assigned_track
where practitioner_assigned_id = #{practitionerId,jdbcType=BIGINT} where practitioner_assigned_id = #{practitionerId,jdbcType=BIGINT}
AND practitioner_potential_id = #{potentialId,jdbcType=BIGINT} AND practitioner_potential_id = #{potentialId,jdbcType=BIGINT}
AND track_status_id = #{trackStatusId,jdbcType=BIGINT}
AND to_days(created_at) = to_days(now())
</select>
<select id="findByPotentialIdAndIsLasted"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigned_track
where practitioner_potential_id = #{potentialId,jdbcType=BIGINT}
AND is_lasted = #{isLasted,jdbcType=INTEGER}
</select>
<select id="findByPractitionerIdAndPotentialId"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigned_track
where practitioner_assigned_id = #{practitionerId,jdbcType=BIGINT}
AND practitioner_potential_id = #{potentialId,jdbcType=BIGINT}
order by created_at desc
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_assigned_track delete from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
...@@ -82,6 +102,15 @@ ...@@ -82,6 +102,15 @@
<if test="updatedBy != null"> <if test="updatedBy != null">
updated_by, updated_by,
</if> </if>
<if test="creatorType != null">
creator_type,
</if>
<if test="updatorType != null">
updator_type,
</if>
<if test="isLasted != null">
is_lasted,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="practitionerPotentialId != null"> <if test="practitionerPotentialId != null">
...@@ -93,6 +122,9 @@ ...@@ -93,6 +122,9 @@
<if test="trackStatusId != null"> <if test="trackStatusId != null">
#{trackStatusId,jdbcType=BIGINT}, #{trackStatusId,jdbcType=BIGINT},
</if> </if>
<if test="trackScore != null">
#{trackScore,jdbcType=INTEGER},
</if>
<if test="notice != null"> <if test="notice != null">
#{notice,jdbcType=VARCHAR}, #{notice,jdbcType=VARCHAR},
</if> </if>
...@@ -111,6 +143,15 @@ ...@@ -111,6 +143,15 @@
<if test="updatedBy != null"> <if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT}, #{updatedBy,jdbcType=BIGINT},
</if> </if>
<if test="creatorType != null">
#{creatorType,jdbcType=BIGINT},
</if>
<if test="updatorType != null">
#{updatorType,jdbcType=BIGINT},
</if>
<if test="isLasted != null">
#{isLasted,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" > <insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" >
...@@ -186,4 +227,51 @@ ...@@ -186,4 +227,51 @@
updated_by = #{updatedBy,jdbcType=BIGINT} updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateAll" parameterType="java.util.List">
<foreach collection="assignedTrackUpdateList" item = "item" index="index" separator=";">
update ag_acl_practitioner_potential_assigned_track
<set>
<if test="item.practitionerPotentialId != null">
practitioner_potential_id = #{item.practitionerPotentialId,jdbcType=BIGINT},
</if>
<if test="item.practitionerAssignedId != null">
practitioner_assigned_id = #{item.practitionerAssignedId,jdbcType=BIGINT},
</if>
<if test="item.trackStatusId != null">
track_status_id = #{item.trackStatusId,jdbcType=BIGINT},
</if>
<if test="item.trackScore != null">
track_score = #{item.trackScore,jdbcType=INTEGER},
</if>
<if test="item.notice != null">
notice = #{item.notice,jdbcType=VARCHAR},
</if>
<if test="item.isActive != null">
is_active = #{item.isActive,jdbcType=INTEGER},
</if>
<if test="item.createdAt != null">
created_at = #{item.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="item.createdBy != null">
created_by = #{item.createdBy,jdbcType=BIGINT},
</if>
<if test="item.updatedAt != null">
updated_at = #{item.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="item.updatedBy != null">
updated_by = #{item.updatedBy,jdbcType=BIGINT},
</if>
<if test="item.creatorType != null">
creator_type = #{item.creatorType,jdbcType=INTEGER},
</if>
<if test="item.updatorType != null">
updator_type = #{item.updatorType,jdbcType=INTEGER},
</if>
<if test="item.isLasted != null">
is_lasted = #{item.isLasted,jdbcType=INTEGER},
</if>
</set>
where id = #{item.id,jdbcType=BIGINT}
</foreach>
</update>
</mapper> </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.customer.AclUserMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclUser">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_role" jdbcType="INTEGER" property="userRole" />
<result column="employee_no" jdbcType="VARCHAR" property="employeeNo" />
<result column="company" jdbcType="INTEGER" property="company" />
<result column="dept_id" jdbcType="BIGINT" property="deptId" />
<result column="role_id" jdbcType="BIGINT" property="roleId" />
<result column="login" jdbcType="VARCHAR" property="login" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="nickname" jdbcType="VARCHAR" property="nickname" />
<result column="mobile_no" jdbcType="VARCHAR" property="mobileNo" />
<result column="id_no" jdbcType="VARCHAR" property="idNo" />
<result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
<result column="logout_time" jdbcType="TIMESTAMP" property="logoutTime" />
<result column="login_source" jdbcType="INTEGER" property="loginSource" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="email" jdbcType="VARCHAR" property="email" />
<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">
id, user_role, employee_no, company, dept_id, role_id, `login`, `password`, `name`,
nickname, mobile_no, id_no, last_login_time, logout_time, login_source, is_active,
email, created_at, created_by, updated_at, updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_user
where id = #{id,jdbcType=BIGINT}
</select>
<select id="findByIds" resultType="com.yd.dal.entity.customer.AclUser">
select
<include refid="Base_Column_List" />
from ag_acl_user
where id in
<foreach collection="userIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_user
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclUser" useGeneratedKeys="true">
insert into ag_acl_user (user_role, employee_no, company,
dept_id, role_id, `login`,
`password`, `name`, nickname,
mobile_no, id_no, last_login_time,
logout_time, login_source, is_active,
email, created_at, created_by,
updated_at, updated_by)
values (#{userRole,jdbcType=INTEGER}, #{employeeNo,jdbcType=VARCHAR}, #{company,jdbcType=INTEGER},
#{deptId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT}, #{login,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR},
#{mobileNo,jdbcType=VARCHAR}, #{idNo,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP},
#{logoutTime,jdbcType=TIMESTAMP}, #{loginSource,jdbcType=INTEGER}, #{isActive,jdbcType=INTEGER},
#{email,jdbcType=VARCHAR}, #{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.customer.AclUser" useGeneratedKeys="true">
insert into ag_acl_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userRole != null">
user_role,
</if>
<if test="employeeNo != null">
employee_no,
</if>
<if test="company != null">
company,
</if>
<if test="deptId != null">
dept_id,
</if>
<if test="roleId != null">
role_id,
</if>
<if test="login != null">
`login`,
</if>
<if test="password != null">
`password`,
</if>
<if test="name != null">
`name`,
</if>
<if test="nickname != null">
nickname,
</if>
<if test="mobileNo != null">
mobile_no,
</if>
<if test="idNo != null">
id_no,
</if>
<if test="lastLoginTime != null">
last_login_time,
</if>
<if test="logoutTime != null">
logout_time,
</if>
<if test="loginSource != null">
login_source,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="email != null">
email,
</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="userRole != null">
#{userRole,jdbcType=INTEGER},
</if>
<if test="employeeNo != null">
#{employeeNo,jdbcType=VARCHAR},
</if>
<if test="company != null">
#{company,jdbcType=INTEGER},
</if>
<if test="deptId != null">
#{deptId,jdbcType=BIGINT},
</if>
<if test="roleId != null">
#{roleId,jdbcType=BIGINT},
</if>
<if test="login != null">
#{login,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="mobileNo != null">
#{mobileNo,jdbcType=VARCHAR},
</if>
<if test="idNo != null">
#{idNo,jdbcType=VARCHAR},
</if>
<if test="lastLoginTime != null">
#{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="logoutTime != null">
#{logoutTime,jdbcType=TIMESTAMP},
</if>
<if test="loginSource != null">
#{loginSource,jdbcType=INTEGER},
</if>
<if test="isActive != null">
#{isActive,jdbcType=INTEGER},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</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.customer.AclUser">
update ag_acl_user
<set>
<if test="userRole != null">
user_role = #{userRole,jdbcType=INTEGER},
</if>
<if test="employeeNo != null">
employee_no = #{employeeNo,jdbcType=VARCHAR},
</if>
<if test="company != null">
company = #{company,jdbcType=INTEGER},
</if>
<if test="deptId != null">
dept_id = #{deptId,jdbcType=BIGINT},
</if>
<if test="roleId != null">
role_id = #{roleId,jdbcType=BIGINT},
</if>
<if test="login != null">
`login` = #{login,jdbcType=VARCHAR},
</if>
<if test="password != null">
`password` = #{password,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="mobileNo != null">
mobile_no = #{mobileNo,jdbcType=VARCHAR},
</if>
<if test="idNo != null">
id_no = #{idNo,jdbcType=VARCHAR},
</if>
<if test="lastLoginTime != null">
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="logoutTime != null">
logout_time = #{logoutTime,jdbcType=TIMESTAMP},
</if>
<if test="loginSource != null">
login_source = #{loginSource,jdbcType=INTEGER},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</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.customer.AclUser">
update ag_acl_user
set user_role = #{userRole,jdbcType=INTEGER},
employee_no = #{employeeNo,jdbcType=VARCHAR},
company = #{company,jdbcType=INTEGER},
dept_id = #{deptId,jdbcType=BIGINT},
role_id = #{roleId,jdbcType=BIGINT},
`login` = #{login,jdbcType=VARCHAR},
`password` = #{password,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
mobile_no = #{mobileNo,jdbcType=VARCHAR},
id_no = #{idNo,jdbcType=VARCHAR},
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
logout_time = #{logoutTime,jdbcType=TIMESTAMP},
login_source = #{loginSource,jdbcType=INTEGER},
is_active = #{isActive,jdbcType=INTEGER},
email = #{email,jdbcType=VARCHAR},
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>
</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.MdDropMasterMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.meta.MdDropMaster">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="scenario_code" jdbcType="VARCHAR" property="scenarioCode" />
<result column="scenario_name" jdbcType="VARCHAR" property="scenarioName" />
<result column="drop_code" jdbcType="VARCHAR" property="dropCode" />
<result column="drop_name" jdbcType="VARCHAR" property="dropName" />
<result column="drop_code_desc" jdbcType="VARCHAR" property="dropCodeDesc" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
</resultMap>
<sql id="Base_Column_List">
id, scenario_code, scenario_name, drop_code, drop_name, drop_code_desc, is_active,
created_at, created_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_md_drop_master
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_md_drop_master
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdDropMaster" useGeneratedKeys="true">
insert into ag_md_drop_master (scenario_code, scenario_name, drop_code,
drop_name, drop_code_desc, is_active,
created_at, created_by)
values (#{scenarioCode,jdbcType=VARCHAR}, #{scenarioName,jdbcType=VARCHAR}, #{dropCode,jdbcType=VARCHAR},
#{dropName,jdbcType=VARCHAR}, #{dropCodeDesc,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdDropMaster" useGeneratedKeys="true">
insert into ag_md_drop_master
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="scenarioCode != null">
scenario_code,
</if>
<if test="scenarioName != null">
scenario_name,
</if>
<if test="dropCode != null">
drop_code,
</if>
<if test="dropName != null">
drop_name,
</if>
<if test="dropCodeDesc != null">
drop_code_desc,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="scenarioCode != null">
#{scenarioCode,jdbcType=VARCHAR},
</if>
<if test="scenarioName != null">
#{scenarioName,jdbcType=VARCHAR},
</if>
<if test="dropCode != null">
#{dropCode,jdbcType=VARCHAR},
</if>
<if test="dropName != null">
#{dropName,jdbcType=VARCHAR},
</if>
<if test="dropCodeDesc != null">
#{dropCodeDesc,jdbcType=VARCHAR},
</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>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.meta.MdDropMaster">
update ag_md_drop_master
<set>
<if test="scenarioCode != null">
scenario_code = #{scenarioCode,jdbcType=VARCHAR},
</if>
<if test="scenarioName != null">
scenario_name = #{scenarioName,jdbcType=VARCHAR},
</if>
<if test="dropCode != null">
drop_code = #{dropCode,jdbcType=VARCHAR},
</if>
<if test="dropName != null">
drop_name = #{dropName,jdbcType=VARCHAR},
</if>
<if test="dropCodeDesc != null">
drop_code_desc = #{dropCodeDesc,jdbcType=VARCHAR},
</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>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.meta.MdDropMaster">
update ag_md_drop_master
set scenario_code = #{scenarioCode,jdbcType=VARCHAR},
scenario_name = #{scenarioName,jdbcType=VARCHAR},
drop_code = #{dropCode,jdbcType=VARCHAR},
drop_name = #{dropName,jdbcType=VARCHAR},
drop_code_desc = #{dropCodeDesc,jdbcType=VARCHAR},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</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.MdDropOptionsMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.meta.MdDropOptions">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="drop_master_id" jdbcType="BIGINT" property="dropMasterId" />
<result column="drop_option_name" jdbcType="VARCHAR" property="dropOptionName" />
<result column="drop_option_code" jdbcType="VARCHAR" property="dropOptionCode" />
<result column="drop_option_order" jdbcType="INTEGER" property="dropOptionOrder" />
<result column="drop_option_score" jdbcType="INTEGER" property="dropOptionScore" />
<result column="drop_option_remark" jdbcType="VARCHAR" property="dropOptionRemark" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
</resultMap>
<sql id="Base_Column_List">
id, drop_master_id, drop_option_name, drop_option_code, drop_option_order, drop_option_score,
drop_option_remark, is_active, created_at, created_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_md_drop_options
where id = #{id,jdbcType=BIGINT}
</select>
<select id="findByMasterId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_md_drop_options
where drop_master_id = #{masterId,jdbcType=BIGINT} AND is_active = 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_md_drop_options
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdDropOptions" useGeneratedKeys="true">
insert into ag_md_drop_options (drop_master_id, drop_option_name, drop_option_code,
drop_option_order, drop_option_score, drop_option_remark,
is_active, created_at, created_by
)
values (#{dropMasterId,jdbcType=BIGINT}, #{dropOptionName,jdbcType=VARCHAR}, #{dropOptionCode,jdbcType=VARCHAR},
#{dropOptionOrder,jdbcType=INTEGER}, #{dropOptionScore,jdbcType=INTEGER}, #{dropOptionRemark,jdbcType=VARCHAR},
#{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdDropOptions" useGeneratedKeys="true">
insert into ag_md_drop_options
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dropMasterId != null">
drop_master_id,
</if>
<if test="dropOptionName != null">
drop_option_name,
</if>
<if test="dropOptionCode != null">
drop_option_code,
</if>
<if test="dropOptionOrder != null">
drop_option_order,
</if>
<if test="dropOptionScore != null">
drop_option_score,
</if>
<if test="dropOptionRemark != null">
drop_option_remark,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dropMasterId != null">
#{dropMasterId,jdbcType=BIGINT},
</if>
<if test="dropOptionName != null">
#{dropOptionName,jdbcType=VARCHAR},
</if>
<if test="dropOptionCode != null">
#{dropOptionCode,jdbcType=VARCHAR},
</if>
<if test="dropOptionOrder != null">
#{dropOptionOrder,jdbcType=INTEGER},
</if>
<if test="dropOptionScore != null">
#{dropOptionScore,jdbcType=INTEGER},
</if>
<if test="dropOptionRemark != null">
#{dropOptionRemark,jdbcType=VARCHAR},
</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>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.meta.MdDropOptions">
update ag_md_drop_options
<set>
<if test="dropMasterId != null">
drop_master_id = #{dropMasterId,jdbcType=BIGINT},
</if>
<if test="dropOptionName != null">
drop_option_name = #{dropOptionName,jdbcType=VARCHAR},
</if>
<if test="dropOptionCode != null">
drop_option_code = #{dropOptionCode,jdbcType=VARCHAR},
</if>
<if test="dropOptionOrder != null">
drop_option_order = #{dropOptionOrder,jdbcType=INTEGER},
</if>
<if test="dropOptionScore != null">
drop_option_score = #{dropOptionScore,jdbcType=INTEGER},
</if>
<if test="dropOptionRemark != null">
drop_option_remark = #{dropOptionRemark,jdbcType=VARCHAR},
</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>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.meta.MdDropOptions">
update ag_md_drop_options
set drop_master_id = #{dropMasterId,jdbcType=BIGINT},
drop_option_name = #{dropOptionName,jdbcType=VARCHAR},
drop_option_code = #{dropOptionCode,jdbcType=VARCHAR},
drop_option_order = #{dropOptionOrder,jdbcType=INTEGER},
drop_option_score = #{dropOptionScore,jdbcType=INTEGER},
drop_option_remark = #{dropOptionRemark,jdbcType=VARCHAR},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="findByMasterIdAndOrder" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_md_drop_options
where drop_master_id = #{masterId,jdbcType=BIGINT}
AND is_active = 1
AND drop_option_order = #{orderId,jdbcType=INTEGER}
</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