Commit d7c661fc by Water Wang

optimize -- recruit list query

parent 1b4a9b45
...@@ -499,7 +499,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -499,7 +499,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
AclPractitionerPotentialAssignedTrack potentialAssignedTrack; AclPractitionerPotentialAssignedTrack potentialAssignedTrack;
Long trackStatusId = 107L; Long trackStatusId = 107L;
int trackScore = 2; int trackScore = 2;
List<MdDropOptions> optionsList = mdDropOptionsDALService.findByMasterIdAndOrder(16L,1); List<MdDropOptions> optionsList = mdDropOptionsDALService.findByMasterCodeAndOrderId("team_building_track",1);
if(optionsList != null && !optionsList.isEmpty()){ if(optionsList != null && !optionsList.isEmpty()){
MdDropOptions options = optionsList.get(0); MdDropOptions options = optionsList.get(0);
trackStatusId = options.getId(); trackStatusId = options.getId();
...@@ -529,7 +529,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -529,7 +529,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
Long trackStatusId = requestVO.getTrackStatusId(); Long trackStatusId = requestVO.getTrackStatusId();
Long practitionerId = requestVO.getPractitionerId(); Long practitionerId = requestVO.getPractitionerId();
Long potentialId = requestVO.getPotentialId(); Long potentialId = requestVO.getPotentialId();
if(trackStatusId != null && practitionerId != null && potentialId != null){ String trackTime = requestVO.getTrackTime();
if(trackStatusId != null && practitionerId != null && potentialId != null && Strings.isNullOrEmpty(trackTime)){
AclPractitionerPotentialAssignedTrack assignedTrack = new AclPractitionerPotentialAssignedTrack(); AclPractitionerPotentialAssignedTrack assignedTrack = new AclPractitionerPotentialAssignedTrack();
List<AclPractitionerPotentialAssignedTrack> assignedTrackIsLastedList = aclPractitionerPotentialAssignedTrackDALService.findByPotentialIdAndIsLasted(potentialId,1); List<AclPractitionerPotentialAssignedTrack> assignedTrackIsLastedList = aclPractitionerPotentialAssignedTrackDALService.findByPotentialIdAndIsLasted(potentialId,1);
//1、更新最新的状态 //1、更新最新的状态
...@@ -556,6 +557,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -556,6 +557,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
assignedTrack.setPractitionerPotentialId(potentialId); assignedTrack.setPractitionerPotentialId(potentialId);
assignedTrack.setTrackStatusId(trackStatusId); assignedTrack.setTrackStatusId(trackStatusId);
assignedTrack.setNotice(requestVO.getNotice()); assignedTrack.setNotice(requestVO.getNotice());
assignedTrack.setTrackTime(CommonUtil.stringParseDate(trackTime,"yyyy-MM-dd"));
assignedTrack.setIsActive(1); assignedTrack.setIsActive(1);
assignedTrack.setIsLasted(1); assignedTrack.setIsLasted(1);
assignedTrack.setCreatorType(2); assignedTrack.setCreatorType(2);
...@@ -565,7 +567,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -565,7 +567,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
responseVO.setTrackId(assignedTrack.getId()); responseVO.setTrackId(assignedTrack.getId());
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{ }else{
String [] paras = {"trackStatusId,practitionerId,potentialId"}; String [] paras = {"trackStatusId,practitionerId,potentialId,trackTime"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras))); responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
} }
return responseVO; return responseVO;
...@@ -583,7 +585,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -583,7 +585,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
Map<Long,String> userMap = nameMap.get(1); Map<Long,String> userMap = nameMap.get(1);
Map<Long,String> practitionerMap = nameMap.get(2); Map<Long,String> practitionerMap = nameMap.get(2);
Map<Long,String> trackStatusMap = new HashMap<>(); Map<Long,String> trackStatusMap = new HashMap<>();
List<MdDropOptions> dropOptionsList = mdDropOptionsDALService.findByMasterId(16L); List<MdDropOptions> dropOptionsList = mdDropOptionsDALService.findByMasterCode("team_building_track");
dropOptionsList.forEach(i->trackStatusMap.put(i.getId(),i.getDropOptionName())); dropOptionsList.forEach(i->trackStatusMap.put(i.getId(),i.getDropOptionName()));
List<RecruitTrackInfo> recruitTrackInfoList = new ArrayList<>(); List<RecruitTrackInfo> recruitTrackInfoList = new ArrayList<>();
RecruitTrackInfo recruitTrack; RecruitTrackInfo recruitTrack;
...@@ -603,6 +605,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -603,6 +605,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
recruitTrack.setTrackStatusId(trackStatusId); recruitTrack.setTrackStatusId(trackStatusId);
recruitTrack.setTrackStatus(trackStatusMap.get(trackStatusId)); recruitTrack.setTrackStatus(trackStatusMap.get(trackStatusId));
recruitTrack.setCreateAt(CommonUtil.dateParseString(item.getCreatedAt(),"yyyy-MM-dd HH:mm:ss")); recruitTrack.setCreateAt(CommonUtil.dateParseString(item.getCreatedAt(),"yyyy-MM-dd HH:mm:ss"));
recruitTrack.setTrackTime(CommonUtil.dateParseString(item.getTrackTime(),"yyyy-MM-dd"));
recruitTrackInfoList.add(recruitTrack); recruitTrackInfoList.add(recruitTrack);
responseVO.setRecruitTrackInfoList(recruitTrackInfoList); responseVO.setRecruitTrackInfoList(recruitTrackInfoList);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
...@@ -647,7 +650,73 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -647,7 +650,73 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
@Override @Override
public RecruitListResponseVO recruitListQuery(RecruitListRequestVO requestVO) { public RecruitListResponseVO recruitListQuery(RecruitListRequestVO requestVO) {
return null; RecruitListResponseVO responseVO = new RecruitListResponseVO();
Long practitionerId = requestVO.getPractitionerId();
if(practitionerId != null){
Integer status = requestVO.getStatus();
status = (status == null) ? 1 : status;
//1、获取用户数据
List<PractitionerPotentialInfo> practitionerPotentialInfoList = aclPractitionerPotentialDALService.findByPractitionerIdAndLasted(practitionerId);
if(practitionerPotentialInfoList != null && !practitionerPotentialInfoList.isEmpty()){
List<MdDropOptions> trackStatusList = mdDropOptionsDALService.findByMasterCode("team_building_track");
Map<Integer,Long> trackStatusInfo = getTrackStatusInfo(trackStatusList);
Long firstTrackStatusId = trackStatusInfo.get(1);
Long LastStatusId = trackStatusInfo.get(2);
Map<Long,String> trackStatusMap = new HashMap<>();
trackStatusList.forEach(i->trackStatusMap.put(i.getId(),i.getDropOptionName()));
List<MdDropOptions> recruitSourceList = mdDropOptionsDALService.findByMasterCode("team_building_source");
Map<Long,String> recruitSourceMap = new HashMap<>();
recruitSourceList.forEach(i->recruitSourceMap.put(i.getId(),i.getDropOptionName()));
List<PractitionerPotentialInfo> potentialInfoList = new ArrayList<>();
Long trackStatusId;
for(PractitionerPotentialInfo item : practitionerPotentialInfoList){
trackStatusId = item.getTrackStatusId();
if(status == 1 && trackStatusId.longValue() == firstTrackStatusId){
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item);
}else if(status == 3 && trackStatusId.longValue() == LastStatusId){
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item);
}else if(status == 2 && trackStatusId.longValue() != LastStatusId && trackStatusId.longValue() != firstTrackStatusId){
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item);
}
}
responseVO.setPractitionerPotentialInfoList(potentialInfoList);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("820001")));
}
}else{
String [] paras = {"practitionerId"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
}
return responseVO;
}
private void getResponseMessage(List<PractitionerPotentialInfo> potentialInfoList, Map<Long, String> trackStatusMap,Map<Long,String> recruitSourceMap, PractitionerPotentialInfo item) {
PractitionerPotentialInfo potentialInfo = new PractitionerPotentialInfo();
BeanUtils.copyProperties(item,potentialInfo);
potentialInfo.setTrackStatus(trackStatusMap.get(item.getTrackStatusId()));
potentialInfo.setResourceDropMasterName(recruitSourceMap.get(item.getResourceDropMasterId()));
potentialInfoList.add(potentialInfo);
}
private Map<Integer,Long> getTrackStatusInfo(List<MdDropOptions> trackStatusList) {
Map<Integer,Long> trackStatusInfo = new HashMap<>();
Long firstTrackStatusId = null ,LastStatusId = null,id;
for(MdDropOptions item : trackStatusList){
id = item.getId();
if(firstTrackStatusId == null){
firstTrackStatusId = LastStatusId = id;
}else{
if(id.doubleValue() < firstTrackStatusId){
firstTrackStatusId = id;
}else if(id.doubleValue() > LastStatusId){
LastStatusId = id;
}
}
}
trackStatusInfo.put(1,firstTrackStatusId);
trackStatusInfo.put(2,LastStatusId);
return trackStatusInfo;
} }
private CommonResult paramCheck(SettingSaveRequestVO requestVO) { private CommonResult paramCheck(SettingSaveRequestVO requestVO) {
......
...@@ -5,6 +5,7 @@ public class AddRecruitTrackRequestVO { ...@@ -5,6 +5,7 @@ public class AddRecruitTrackRequestVO {
private Long potentialId; private Long potentialId;
private Long trackStatusId; private Long trackStatusId;
private String notice; private String notice;
private String trackTime;
private Integer isActive; private Integer isActive;
...@@ -48,4 +49,11 @@ public class AddRecruitTrackRequestVO { ...@@ -48,4 +49,11 @@ public class AddRecruitTrackRequestVO {
this.potentialId = potentialId; this.potentialId = potentialId;
} }
public String getTrackTime() {
return trackTime;
}
public void setTrackTime(String trackTime) {
this.trackTime = trackTime;
}
} }
...@@ -16,13 +16,9 @@ public class PractitionerPotentialInfo { ...@@ -16,13 +16,9 @@ public class PractitionerPotentialInfo {
private String tag; private String tag;
private String remark; private String remark;
private String ossPathResume; private String ossPathResume;
private String assignedId;
private String assignedName;
private Long trackStatusId; private Long trackStatusId;
private String trackStatus; private String trackStatus;
private Long trackId; private Long trackId;
private Long operateUserId;
private String operateUserName;
private String createdAt; private String createdAt;
public Long getPotentialId() { public Long getPotentialId() {
...@@ -145,22 +141,6 @@ public class PractitionerPotentialInfo { ...@@ -145,22 +141,6 @@ public class PractitionerPotentialInfo {
this.ossPathResume = ossPathResume; this.ossPathResume = ossPathResume;
} }
public String getAssignedId() {
return assignedId;
}
public void setAssignedId(String assignedId) {
this.assignedId = assignedId;
}
public String getAssignedName() {
return assignedName;
}
public void setAssignedName(String assignedName) {
this.assignedName = assignedName;
}
public Long getTrackStatusId() { public Long getTrackStatusId() {
return trackStatusId; return trackStatusId;
} }
...@@ -185,22 +165,6 @@ public class PractitionerPotentialInfo { ...@@ -185,22 +165,6 @@ public class PractitionerPotentialInfo {
this.trackId = trackId; this.trackId = trackId;
} }
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;
}
public String getCreatedAt() { public String getCreatedAt() {
return createdAt; return createdAt;
} }
......
package com.yd.api.practitioner.vo.recruit; package com.yd.api.practitioner.vo.recruit;
public class RecruitListRequestVO { public class RecruitListRequestVO {
private Long assignedId; private Long practitionerId;
private Integer status;//1-待跟进,2-跟进中,3-以完成 private Integer status;//1-待跟进,2-跟进中,3-以完成
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;
} }
public Integer getStatus() { public Integer getStatus() {
......
...@@ -5,6 +5,7 @@ public class RecruitTrackInfo { ...@@ -5,6 +5,7 @@ public class RecruitTrackInfo {
private Long trackStatusId; private Long trackStatusId;
private String trackStatus; private String trackStatus;
private String notice; private String notice;
private String trackTime;
private String createAt; private String createAt;
private Long operateUserId; private Long operateUserId;
private String operateUserName; private String operateUserName;
...@@ -64,4 +65,12 @@ public class RecruitTrackInfo { ...@@ -64,4 +65,12 @@ public class RecruitTrackInfo {
public void setOperateUserName(String operateUserName) { public void setOperateUserName(String operateUserName) {
this.operateUserName = operateUserName; this.operateUserName = operateUserName;
} }
public String getTrackTime() {
return trackTime;
}
public void setTrackTime(String trackTime) {
this.trackTime = trackTime;
}
} }
...@@ -68,5 +68,7 @@ public class AclPractitionerPotentialAssignedTrack implements Serializable { ...@@ -68,5 +68,7 @@ public class AclPractitionerPotentialAssignedTrack implements Serializable {
private Integer trackScore; private Integer trackScore;
private Date trackTime;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
package com.yd.dal.mapper.customer; package com.yd.dal.mapper.customer;
import com.yd.api.practitioner.vo.recruit.PractitionerPotentialInfo;
import com.yd.dal.entity.customer.AclPractitionerPotential; import com.yd.dal.entity.customer.AclPractitionerPotential;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -19,4 +20,6 @@ public interface AclPractitionerPotentialMapper { ...@@ -19,4 +20,6 @@ public interface AclPractitionerPotentialMapper {
int updateByPrimaryKey(AclPractitionerPotential record); int updateByPrimaryKey(AclPractitionerPotential record);
List<AclPractitionerPotential> findByMobileNo(@Param("mobileNo") String mobileNo, @Param("isActive") Integer isActive); List<AclPractitionerPotential> findByMobileNo(@Param("mobileNo") String mobileNo, @Param("isActive") Integer isActive);
List<PractitionerPotentialInfo> findByPractitionerIdAndLasted(@Param("practitionerId")Long practitionerId);
} }
\ No newline at end of file
...@@ -18,7 +18,7 @@ public interface MdDropOptionsMapper { ...@@ -18,7 +18,7 @@ public interface MdDropOptionsMapper {
int updateByPrimaryKey(MdDropOptions record); int updateByPrimaryKey(MdDropOptions record);
List<MdDropOptions> findByMasterId(@Param("masterId") Long masterId); List<MdDropOptions> findByMasterCode(@Param("masterCode")String masterCode);
List<MdDropOptions> findByMasterIdAndOrder(@Param("masterId")long masterId, @Param("orderId")int orderId); List<MdDropOptions> findByMasterCodeAndOrderId(@Param("masterCode")String masterCode, @Param("orderId")int orderId);
} }
\ No newline at end of file
package com.yd.dal.service.customer; package com.yd.dal.service.customer;
import com.yd.api.practitioner.vo.recruit.PractitionerPotentialInfo;
import com.yd.dal.entity.customer.AclPractitionerPotential; import com.yd.dal.entity.customer.AclPractitionerPotential;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -20,4 +21,11 @@ public interface AclPractitionerPotentialDALService { ...@@ -20,4 +21,11 @@ public interface AclPractitionerPotentialDALService {
* @return * @return
*/ */
int save(AclPractitionerPotential practitionerPotential); int save(AclPractitionerPotential practitionerPotential);
/**
* 查询该团队长对于每个增员最新的记录
* @param practitionerId
* @return
*/
List<PractitionerPotentialInfo> findByPractitionerIdAndLasted(Long practitionerId);
} }
package com.yd.dal.service.customer.impl; package com.yd.dal.service.customer.impl;
import com.yd.api.practitioner.vo.recruit.PractitionerPotentialInfo;
import com.yd.dal.entity.customer.AclPractitionerPotential; import com.yd.dal.entity.customer.AclPractitionerPotential;
import com.yd.dal.mapper.customer.AclPractitionerPotentialMapper; import com.yd.dal.mapper.customer.AclPractitionerPotentialMapper;
import com.yd.dal.service.customer.AclPractitionerPotentialDALService; import com.yd.dal.service.customer.AclPractitionerPotentialDALService;
...@@ -21,4 +22,9 @@ public class AclPractitionerPotentialDALServiceImpl implements AclPractitionerPo ...@@ -21,4 +22,9 @@ public class AclPractitionerPotentialDALServiceImpl implements AclPractitionerPo
public int save(AclPractitionerPotential practitionerPotential) { public int save(AclPractitionerPotential practitionerPotential) {
return aclPractitionerPotentialMapper.insert(practitionerPotential); return aclPractitionerPotentialMapper.insert(practitionerPotential);
} }
@Override
public List<PractitionerPotentialInfo> findByPractitionerIdAndLasted(Long practitionerId) {
return aclPractitionerPotentialMapper.findByPractitionerIdAndLasted(practitionerId) ;
}
} }
...@@ -10,7 +10,7 @@ public interface MdDropOptionsDALService { ...@@ -10,7 +10,7 @@ public interface MdDropOptionsDALService {
MdDropOptions findById(Long trackStatusId); MdDropOptions findById(Long trackStatusId);
List<MdDropOptions> findByMasterId(long masterId); List<MdDropOptions> findByMasterCode(String masterCode);
List<MdDropOptions> findByMasterIdAndOrder(long masterId, int orderId); List<MdDropOptions> findByMasterCodeAndOrderId(String masterCode, int orderId);
} }
...@@ -18,12 +18,12 @@ public class MdDropOptionsDALServiceImpl implements MdDropOptionsDALService { ...@@ -18,12 +18,12 @@ public class MdDropOptionsDALServiceImpl implements MdDropOptionsDALService {
} }
@Override @Override
public List<MdDropOptions> findByMasterId(long masterId) { public List<MdDropOptions> findByMasterCode(String masterCode) {
return mdDropOptionsMapper.findByMasterId(masterId); return mdDropOptionsMapper.findByMasterCode(masterCode);
} }
@Override @Override
public List<MdDropOptions> findByMasterIdAndOrder(long masterId, int orderId) { public List<MdDropOptions> findByMasterCodeAndOrderId(String masterCode, int orderId) {
return mdDropOptionsMapper.findByMasterIdAndOrder(masterId,orderId); return mdDropOptionsMapper.findByMasterCodeAndOrderId(masterCode,orderId);
} }
} }
...@@ -16,10 +16,11 @@ ...@@ -16,10 +16,11 @@
<result column="creator_type" jdbcType="INTEGER" property="creatorType" /> <result column="creator_type" jdbcType="INTEGER" property="creatorType" />
<result column="is_lasted" jdbcType="INTEGER" property="isLasted" /> <result column="is_lasted" jdbcType="INTEGER" property="isLasted" />
<result column="track_score" jdbcType="INTEGER" property="trackScore" /> <result column="track_score" jdbcType="INTEGER" property="trackScore" />
<result column="track_time" jdbcType="TIMESTAMP" property="trackTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, practitioner_potential_id, practitioner_assigned_id, track_status_id, track_score,notice, id, practitioner_potential_id, practitioner_assigned_id, track_status_id, track_score,notice,
is_active, created_at, created_by, updated_at, updated_by, creator_type, updator_type,is_lasted is_active, created_at, created_by, updated_at, updated_by, creator_type, updater_type,is_lasted,track_time
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
...@@ -63,11 +64,11 @@ ...@@ -63,11 +64,11 @@
insert into ag_acl_practitioner_potential_assigned_track (practitioner_potential_id, practitioner_assigned_id, insert into ag_acl_practitioner_potential_assigned_track (practitioner_potential_id, practitioner_assigned_id,
track_status_id, track_score,notice, is_active, track_status_id, track_score,notice, is_active,
created_at, created_by, updated_at, created_at, created_by, updated_at,
updated_by, updater_type,creator_type,is_lasted ) updated_by, updater_type,creator_type,is_lasted,track_time )
values (#{practitionerPotentialId,jdbcType=BIGINT}, #{practitionerAssignedId,jdbcType=BIGINT}, values (#{practitionerPotentialId,jdbcType=BIGINT}, #{practitionerAssignedId,jdbcType=BIGINT},
#{trackStatusId,jdbcType=BIGINT},#{trackScore,jdbcType=INTEGER}, #{notice,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER}, #{trackStatusId,jdbcType=BIGINT},#{trackScore,jdbcType=INTEGER}, #{notice,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT},#{updaterType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{isLasted,jdbcType=INTEGER}) #{updatedBy,jdbcType=BIGINT},#{updaterType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{isLasted,jdbcType=INTEGER},#{trackTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigned_track insert into ag_acl_practitioner_potential_assigned_track
...@@ -111,6 +112,9 @@ ...@@ -111,6 +112,9 @@
<if test="isLasted != null"> <if test="isLasted != null">
is_lasted, is_lasted,
</if> </if>
<if test="trackTime != null">
track_time,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="practitionerPotentialId != null"> <if test="practitionerPotentialId != null">
...@@ -152,13 +156,16 @@ ...@@ -152,13 +156,16 @@
<if test="isLasted != null"> <if test="isLasted != null">
#{isLasted,jdbcType=INTEGER}, #{isLasted,jdbcType=INTEGER},
</if> </if>
<if test="trackTime != null">
#{trackTime,jdbcType=TIMESTAMP},
</if>
</trim> </trim>
</insert> </insert>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" > <insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" >
insert into ag_acl_practitioner_potential_assigned_track(practitioner_potential_id, practitioner_assigned_id, insert into ag_acl_practitioner_potential_assigned_track(practitioner_potential_id, practitioner_assigned_id,
track_status_id, track_score,notice, is_active, track_status_id, track_score,notice, is_active,
created_at, created_by, updated_at, created_at, created_by, updated_at,
updated_by, updater_type,creator_type,is_lasted ) updated_by, updater_type,creator_type,is_lasted,track_time )
values values
<foreach collection="potentialAssignedTrackList" item="item" index="index" separator=","> <foreach collection="potentialAssignedTrackList" item="item" index="index" separator=",">
( (
...@@ -174,7 +181,8 @@ ...@@ -174,7 +181,8 @@
#{item.updatedBy}, #{item.updatedBy},
#{item.updaterType}, #{item.updaterType},
#{item.creatorType}, #{item.creatorType},
#{item.isLasted} #{item.isLasted},
#{item.trackTime}
) )
</foreach> </foreach>
</insert> </insert>
...@@ -220,6 +228,9 @@ ...@@ -220,6 +228,9 @@
<if test="isLasted != null"> <if test="isLasted != null">
is_lasted = #{isLasted,jdbcType=BIGINT}, is_lasted = #{isLasted,jdbcType=BIGINT},
</if> </if>
<if test="trackTime != null">
track_time = #{trackTime,jdbcType=TIMESTAMP},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -236,7 +247,8 @@ ...@@ -236,7 +247,8 @@
updated_by = #{updatedBy,jdbcType=BIGINT}, updated_by = #{updatedBy,jdbcType=BIGINT},
updater_type = #{updaterType,jdbcType=INTEGER}, updater_type = #{updaterType,jdbcType=INTEGER},
creator_type = #{creatorType,jdbcType=INTEGER}, creator_type = #{creatorType,jdbcType=INTEGER},
is_lasted = #{isLasted,jdbcType=INTEGER} is_lasted = #{isLasted,jdbcType=INTEGER},
track_time = #{trackTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateAll" parameterType="java.util.List"> <update id="updateAll" parameterType="java.util.List">
...@@ -282,6 +294,9 @@ ...@@ -282,6 +294,9 @@
<if test="item.isLasted != null"> <if test="item.isLasted != null">
is_lasted = #{item.isLasted,jdbcType=INTEGER}, is_lasted = #{item.isLasted,jdbcType=INTEGER},
</if> </if>
<if test="item.trackTime != null">
track_time = #{item.trackTime,jdbcType=TIMESTAMP},
</if>
</set> </set>
where id = #{item.id,jdbcType=BIGINT} where id = #{item.id,jdbcType=BIGINT}
</foreach> </foreach>
......
...@@ -291,4 +291,33 @@ ...@@ -291,4 +291,33 @@
where mobile_no = #{mobileNo,jdbcType=VARCHAR} where mobile_no = #{mobileNo,jdbcType=VARCHAR}
and is_active = #{isActive,jdbcType=INTEGER} and is_active = #{isActive,jdbcType=INTEGER}
</select> </select>
<select id="findByPractitionerIdAndLasted"
resultType="com.yd.api.practitioner.vo.recruit.PractitionerPotentialInfo">
SELECT
p.id potentialId,
p.`name` NAME,
p.gender gender,
p.age age,
p.mobile_no mobileNo,
p.wechat_id wechatId,
p.qq_id qqId,
p.others_contacts othersContacts,
p.education_level educationLevel,
p.resource_drop_master_id resourceDropMasterId,
p.introducer introducer,
p.tag tag,
p.remark remark,
p.oss_path_resume ossPathResume,
t.track_status_id trackStatusId,
t.id trackId,
date_format(p.created_at,'%Y-%m-%d') createdAt,
MAX(t.created_at) LastedUpdateDate
FROM
ag_acl_practitioner_potential p
INNER JOIN ag_acl_practitioner_potential_assigned_track t ON p.id = t.practitioner_potential_id
WHERE
t.practitioner_assigned_id = #{practitionerId,jdbcType=BIGINT}
GROUP BY
p.id;
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -23,11 +23,20 @@ ...@@ -23,11 +23,20 @@
from ag_md_drop_options from ag_md_drop_options
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</select> </select>
<select id="findByMasterId" resultMap="BaseResultMap"> <select id="findByMasterCode" resultType="com.yd.dal.entity.meta.MdDropOptions">
select select
<include refid="Base_Column_List" /> o.id id,
from ag_md_drop_options o.drop_master_id dropMasterId,
where drop_master_id = #{masterId,jdbcType=BIGINT} AND is_active = 1 o.drop_option_name dropOptionName,
o.drop_option_code dropOptionCode,
o.drop_option_order dropOptionOrder,
o.drop_option_score dropOptionScore,
o.drop_option_remark dropOptionRemark,
o.is_active isActive,
o.created_at createdAt,
o.created_by createdBy
from ag_md_drop_master m left join ag_md_drop_options o on m.id = o.drop_master_id and o.is_active = 1
where m.scenario_code = #{masterCode,jdbcType=BIGINT}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_md_drop_options delete from ag_md_drop_options
...@@ -150,12 +159,19 @@ ...@@ -150,12 +159,19 @@
created_by = #{createdBy,jdbcType=BIGINT} created_by = #{createdBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="findByMasterIdAndOrder" resultMap="BaseResultMap"> <select id="findByMasterCodeAndOrderId" resultType="com.yd.dal.entity.meta.MdDropOptions">
select select
<include refid="Base_Column_List" /> o.id id,
from ag_md_drop_options o.drop_master_id dropMasterId,
where drop_master_id = #{masterId,jdbcType=BIGINT} o.drop_option_name dropOptionName,
AND is_active = 1 o.drop_option_code dropOptionCode,
AND drop_option_order = #{orderId,jdbcType=INTEGER} o.drop_option_order dropOptionOrder,
o.drop_option_score dropOptionScore,
o.drop_option_remark dropOptionRemark,
o.is_active isActive,
o.created_at createdAt,
o.created_by createdBy
from ag_md_drop_master m left join ag_md_drop_options o on m.id = o.drop_master_id and o.is_active = 1 and o.drop_option_order = #{orderId,jdbcType=INTEGER}
where m.scenario_code = #{masterCode,jdbcType=BIGINT}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment