Commit 746d6da4 by Water Wang

optimize

parent d7c661fc
......@@ -75,6 +75,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private MdDropOptionsDALService mdDropOptionsDALService;
@Autowired
private AclUserDALService aclUserDALService;
@Autowired
private AclPractitionerPotentialAssignedsDALService aclPractitionerPotentialAssignedsDALService;
@Override
......@@ -432,7 +434,6 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return mediaGetRespVO;
}
@Override
public RecruitResponseVO recruit(RecruitRequestVO requestVO) {
RecruitResponseVO responseVO = new RecruitResponseVO();
String name = requestVO.getName();
......@@ -497,6 +498,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
if (practitionerId != null && !practitionerPotentialIdList.isEmpty()) {
List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList = new ArrayList<>();
AclPractitionerPotentialAssignedTrack potentialAssignedTrack;
List<AclPractitionerPotentialAssigneds> potentialAssignedsList = new ArrayList<>();
AclPractitionerPotentialAssigneds potentialAssigneds;
Long trackStatusId = 107L;
int trackScore = 2;
List<MdDropOptions> optionsList = mdDropOptionsDALService.findByMasterCodeAndOrderId("team_building_track",1);
......@@ -516,9 +519,21 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
potentialAssignedTrack.setCreatedBy(practitionerId);
potentialAssignedTrack.setCreatorType(2);
potentialAssignedTrack.setTrackScore(trackScore);
potentialAssignedTrack.setTrackTime(new Date());
potentialAssignedTrackList.add(potentialAssignedTrack);
potentialAssigneds = new AclPractitionerPotentialAssigneds();
potentialAssigneds.setAssignedPractitionerId(practitionerId);
potentialAssigneds.setPractitionerPotentialId(potentialId);
potentialAssigneds.setIsActive(1);
potentialAssigneds.setCreatedAt(new Date());
potentialAssigneds.setCreatedBy(practitionerId);
potentialAssigneds.setCreatorType(2);
potentialAssignedsList.add(potentialAssigneds);
}
aclPractitionerPotentialAssignedTrackDALService.saveAll(potentialAssignedTrackList);
aclPractitionerPotentialAssignedsDALService.saveAll(potentialAssignedsList);
}
}
......@@ -530,7 +545,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
Long practitionerId = requestVO.getPractitionerId();
Long potentialId = requestVO.getPotentialId();
String trackTime = requestVO.getTrackTime();
if(trackStatusId != null && practitionerId != null && potentialId != null && Strings.isNullOrEmpty(trackTime)){
if(trackStatusId != null && practitionerId != null && potentialId != null && !Strings.isNullOrEmpty(trackTime)){
Date trackTimeDate = CommonUtil.stringParseDate(trackTime,"yyyy-MM-dd");
AclPractitionerPotentialAssignedTrack assignedTrack = new AclPractitionerPotentialAssignedTrack();
List<AclPractitionerPotentialAssignedTrack> assignedTrackIsLastedList = aclPractitionerPotentialAssignedTrackDALService.findByPotentialIdAndIsLasted(potentialId,1);
//1、更新最新的状态
......@@ -546,7 +562,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
aclPractitionerPotentialAssignedTrackDALService.updateAll(assignedTrackUpdateList);
}
//2、查询团队长对该增员所有增员状态
List<AclPractitionerPotentialAssignedTrack> assignedTrackList = aclPractitionerPotentialAssignedTrackDALService.findByPractitionerIdAndPotentialIdAndTrackStatusId(practitionerId,potentialId,trackStatusId);
List<AclPractitionerPotentialAssignedTrack> assignedTrackList = aclPractitionerPotentialAssignedTrackDALService.findByPractitionerIdAndPotentialIdAndTrackStatusId(practitionerId,potentialId,trackStatusId,trackTimeDate);
if(assignedTrackList == null || assignedTrackList.isEmpty()){//3、如果没有,获取增员状态对应的分值,
MdDropOptions options = mdDropOptionsDALService.findById(trackStatusId);
assignedTrack.setTrackScore(options.getDropOptionScore());
......@@ -557,7 +573,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
assignedTrack.setPractitionerPotentialId(potentialId);
assignedTrack.setTrackStatusId(trackStatusId);
assignedTrack.setNotice(requestVO.getNotice());
assignedTrack.setTrackTime(CommonUtil.stringParseDate(trackTime,"yyyy-MM-dd"));
assignedTrack.setTrackTime(trackTimeDate);
assignedTrack.setIsActive(1);
assignedTrack.setIsLasted(1);
assignedTrack.setCreatorType(2);
......@@ -654,7 +670,6 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
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()){
......@@ -671,11 +686,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
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){
if(status != null){
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);
}
}else{
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item);
}
}
......@@ -691,6 +710,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
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);
......
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_acl_practitioner_potential_assigneds
* @author
*/
@Data
public class AclPractitionerPotentialAssigneds implements Serializable {
/**
* serial id
*/
private Long id;
/**
* 经纪人id
*/
private Long assignedPractitionerId;
/**
* FK ag_acl_practitioner_potential.id潜在经纪人表id
*/
private Long practitionerPotentialId;
/**
* 预计报聘时间
*/
private Date timeToOnboarding;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 分析建置时间
*/
private Date createdAt;
/**
* 建置者 FK ag_acl_user.id
*/
private Long createdBy;
/**
* 更新时间
*/
private Date updatedAt;
/**
* 更新者 FK ag_acl_user.id
*/
private Long updatedBy;
/**
* 更新者类型:1为user id(AGMS),2为本人practitioner id(银盾经纪)
*/
private Integer updaterType;
/**
* 创建者类型:1为user id(AGMS),2为本人practitioner id(银盾经纪)
*/
private Integer creatorType;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -2,6 +2,8 @@ package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface AclPractitionerPotentialAssignedTrackMapper {
......@@ -19,7 +21,7 @@ public interface AclPractitionerPotentialAssignedTrackMapper {
void insertList(@Param("potentialAssignedTrackList") List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialIdAndTrackStatusId(@Param("practitionerId") Long practitionerId, @Param("potentialId")Long potentialId,@Param("trackStatusId")Long trackStatusId);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialIdAndTrackStatusId(@Param("practitionerId") Long practitionerId, @Param("potentialId")Long potentialId, @Param("trackStatusId")Long trackStatusId, @Param("trackDate")Date trackDate);
List<AclPractitionerPotentialAssignedTrack> findByPotentialIdAndIsLasted(@Param("potentialId")Long potentialId, @Param("isLasted")int isLasted);
......
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AclPractitionerPotentialAssignedsMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerPotentialAssigneds record);
int insertSelective(AclPractitionerPotentialAssigneds record);
AclPractitionerPotentialAssigneds selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerPotentialAssigneds record);
int updateByPrimaryKey(AclPractitionerPotentialAssigneds record);
void insertList(@Param("potentialAssignedsList") List<AclPractitionerPotentialAssigneds> potentialAssignedsList);
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service("aclPractitionerPotentialAssignedTrackDALService")
......@@ -10,7 +11,7 @@ public interface AclPractitionerPotentialAssignedTrackDALService {
void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialIdAndTrackStatusId(Long practitionerId, Long potentialId,Long trackStatusId);
List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialIdAndTrackStatusId(Long practitionerId, Long potentialId, Long trackStatusId, Date trackDate);
void save(AclPractitionerPotentialAssignedTrack assignedTrack);
......
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialAssignedsDALService")
public interface AclPractitionerPotentialAssignedsDALService {
void saveAll(List<AclPractitionerPotentialAssigneds> potentialAssignedsList);
}
......@@ -6,6 +6,7 @@ import com.yd.dal.service.customer.AclPractitionerPotentialAssignedTrackDALServi
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service("aclPractitionerPotentialAssignedTrackDALService")
......@@ -19,8 +20,8 @@ public class AclPractitionerPotentialAssignedTrackDALServiceImpl implements AclP
}
@Override
public List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialIdAndTrackStatusId(Long practitionerId, Long potentialId,Long trackStatusId) {
return aclPractitionerPotentialAssignedTrackMapper.findByPractitionerIdAndPotentialIdAndTrackStatusId(practitionerId,potentialId,trackStatusId);
public List<AclPractitionerPotentialAssignedTrack> findByPractitionerIdAndPotentialIdAndTrackStatusId(Long practitionerId, Long potentialId, Long trackStatusId, Date trackDate) {
return aclPractitionerPotentialAssignedTrackMapper.findByPractitionerIdAndPotentialIdAndTrackStatusId(practitionerId,potentialId,trackStatusId,trackDate);
}
@Override
......
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds;
import com.yd.dal.mapper.customer.AclPractitionerPotentialAssignedsMapper;
import com.yd.dal.service.customer.AclPractitionerPotentialAssignedsDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("aclPractitionerPotentialAssignedsDALService")
public class AclPractitionerPotentialAssignedsDALServiceImpl implements AclPractitionerPotentialAssignedsDALService {
@Resource
private AclPractitionerPotentialAssignedsMapper aclPractitionerPotentialAssignedsMapper;
@Override
public void saveAll(List<AclPractitionerPotentialAssigneds> potentialAssignedsList) {
aclPractitionerPotentialAssignedsMapper.insertList(potentialAssignedsList);
}
}
......@@ -23,7 +23,7 @@
is_active, created_at, created_by, updated_at, updated_by, creator_type, updater_type,is_lasted,track_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT}
......@@ -31,12 +31,12 @@
<select id="findByPractitionerIdAndPotentialIdAndTrackStatusId"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<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}
AND track_status_id = #{trackStatusId,jdbcType=BIGINT}
AND to_days(created_at) = to_days(now())
where practitioner_assigned_id = #{practitionerId,jdbcType=BIGINT}
AND practitioner_potential_id = #{potentialId,jdbcType=BIGINT}
AND track_status_id = #{trackStatusId,jdbcType=BIGINT}
AND to_days(track_time) = to_days(#{trackDate,jdbcType=TIMESTAMP})
</select>
<select id="findByPotentialIdAndIsLasted"
resultMap="BaseResultMap">
......@@ -47,13 +47,13 @@
AND is_lasted = #{isLasted,jdbcType=INTEGER}
</select>
<select id="findByPractitionerIdAndPotentialId"
resultMap="BaseResultMap">
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
order by track_time desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
......@@ -61,14 +61,14 @@
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigned_track (practitioner_potential_id, practitioner_assigned_id,
track_status_id, track_score,notice, is_active,
created_at, created_by, updated_at,
updated_by, updater_type,creator_type,is_lasted,track_time )
values (#{practitionerPotentialId,jdbcType=BIGINT}, #{practitionerAssignedId,jdbcType=BIGINT},
#{trackStatusId,jdbcType=BIGINT},#{trackScore,jdbcType=INTEGER}, #{notice,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT},#{updaterType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{isLasted,jdbcType=INTEGER},#{trackTime,jdbcType=TIMESTAMP})
insert into ag_acl_practitioner_potential_assigned_track (practitioner_potential_id, practitioner_assigned_id,
track_status_id, track_score,notice, is_active,
created_at, created_by, updated_at,
updated_by, updater_type,creator_type,is_lasted,track_time )
values (#{practitionerPotentialId,jdbcType=BIGINT}, #{practitionerAssignedId,jdbcType=BIGINT},
#{trackStatusId,jdbcType=BIGINT},#{trackScore,jdbcType=INTEGER}, #{notice,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT},#{updaterType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{isLasted,jdbcType=INTEGER},#{trackTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigned_track
......@@ -169,20 +169,20 @@
values
<foreach collection="potentialAssignedTrackList" item="item" index="index" separator=",">
(
#{item.practitionerPotentialId},
#{item.practitionerAssignedId},
#{item.trackStatusId},
#{item.trackScore},
#{item.notice},
#{item.isActive},
#{item.createdAt},
#{item.createdBy},
#{item.updatedAt},
#{item.updatedBy},
#{item.updaterType},
#{item.creatorType},
#{item.isLasted},
#{item.trackTime}
#{item.practitionerPotentialId},
#{item.practitionerAssignedId},
#{item.trackStatusId},
#{item.trackScore},
#{item.notice},
#{item.isActive},
#{item.createdAt},
#{item.createdBy},
#{item.updatedAt},
#{item.updatedBy},
#{item.updaterType},
#{item.creatorType},
#{item.isLasted},
#{item.trackTime}
)
</foreach>
</insert>
......@@ -237,18 +237,18 @@
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack">
update ag_acl_practitioner_potential_assigned_track
set practitioner_potential_id = #{practitionerPotentialId,jdbcType=BIGINT},
practitioner_assigned_id = #{practitionerAssignedId,jdbcType=BIGINT},
track_status_id = #{trackStatusId,jdbcType=BIGINT},
notice = #{notice,jdbcType=VARCHAR},
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},
updater_type = #{updaterType,jdbcType=INTEGER},
creator_type = #{creatorType,jdbcType=INTEGER},
is_lasted = #{isLasted,jdbcType=INTEGER},
track_time = #{trackTime,jdbcType=TIMESTAMP}
practitioner_assigned_id = #{practitionerAssignedId,jdbcType=BIGINT},
track_status_id = #{trackStatusId,jdbcType=BIGINT},
notice = #{notice,jdbcType=VARCHAR},
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},
updater_type = #{updaterType,jdbcType=INTEGER},
creator_type = #{creatorType,jdbcType=INTEGER},
is_lasted = #{isLasted,jdbcType=INTEGER},
track_time = #{trackTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateAll" parameterType="java.util.List">
......@@ -288,8 +288,8 @@
<if test="item.creatorType != null">
creator_type = #{item.creatorType,jdbcType=INTEGER},
</if>
<if test="item.updatorType != null">
updator_type = #{item.updatorType,jdbcType=INTEGER},
<if test="item.updaterType != null">
updater_type = #{item.updaterType,jdbcType=INTEGER},
</if>
<if test="item.isLasted != null">
is_lasted = #{item.isLasted,jdbcType=INTEGER},
......
<?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.AclPractitionerPotentialAssignedsMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="assigned_practitioner_id" jdbcType="BIGINT" property="assignedPractitionerId" />
<result column="practitioner_potential_id" jdbcType="BIGINT" property="practitionerPotentialId" />
<result column="time_to_onboarding" jdbcType="TIMESTAMP" property="timeToOnboarding" />
<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" />
<result column="updater_type" jdbcType="INTEGER" property="updaterType" />
<result column="creator_type" jdbcType="INTEGER" property="creatorType" />
</resultMap>
<sql id="Base_Column_List">
id, assigned_practitioner_id, practitioner_potential_id, time_to_onboarding, is_active,
created_at, created_by, updated_at, updated_by, updater_type, creator_type
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigneds
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_assigneds
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigneds (assigned_practitioner_id, practitioner_potential_id,
time_to_onboarding, is_active, created_at,
created_by, updated_at, updated_by,
updater_type, creator_type)
values (#{assignedPractitionerId,jdbcType=BIGINT}, #{practitionerPotentialId,jdbcType=BIGINT},
#{timeToOnboarding,jdbcType=TIMESTAMP}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT},
#{updaterType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigneds
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="assignedPractitionerId != null">
assigned_practitioner_id,
</if>
<if test="practitionerPotentialId != null">
practitioner_potential_id,
</if>
<if test="timeToOnboarding != null">
time_to_onboarding,
</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>
<if test="updaterType != null">
updater_type,
</if>
<if test="creatorType != null">
creator_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="assignedPractitionerId != null">
#{assignedPractitionerId,jdbcType=BIGINT},
</if>
<if test="practitionerPotentialId != null">
#{practitionerPotentialId,jdbcType=BIGINT},
</if>
<if test="timeToOnboarding != null">
#{timeToOnboarding,jdbcType=TIMESTAMP},
</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>
<if test="updaterType != null">
#{updaterType,jdbcType=INTEGER},
</if>
<if test="creatorType != null">
#{creatorType,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds">
update ag_acl_practitioner_potential_assigneds
<set>
<if test="assignedPractitionerId != null">
assigned_practitioner_id = #{assignedPractitionerId,jdbcType=BIGINT},
</if>
<if test="practitionerPotentialId != null">
practitioner_potential_id = #{practitionerPotentialId,jdbcType=BIGINT},
</if>
<if test="timeToOnboarding != null">
time_to_onboarding = #{timeToOnboarding,jdbcType=TIMESTAMP},
</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>
<if test="updaterType != null">
updater_type = #{updaterType,jdbcType=INTEGER},
</if>
<if test="creatorType != null">
creator_type = #{creatorType,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds">
update ag_acl_practitioner_potential_assigneds
set assigned_practitioner_id = #{assignedPractitionerId,jdbcType=BIGINT},
practitioner_potential_id = #{practitionerPotentialId,jdbcType=BIGINT},
time_to_onboarding = #{timeToOnboarding,jdbcType=TIMESTAMP},
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},
updater_type = #{updaterType,jdbcType=INTEGER},
creator_type = #{creatorType,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigneds (assigned_practitioner_id, practitioner_potential_id,
time_to_onboarding, is_active, created_at,
created_by, updated_at, updated_by,
updater_type, creator_type)
values
<foreach collection="potentialAssignedsList" item="item" index="index" separator=",">
(
#{item.assignedPractitionerId},
#{item.practitionerPotentialId},
#{item.timeToOnboarding},
#{item.isActive},
#{item.createdAt},
#{item.createdBy},
#{item.updatedAt},
#{item.updatedBy},
#{item.updaterType},
#{item.creatorType}
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
......@@ -318,6 +318,7 @@
WHERE
t.practitioner_assigned_id = #{practitionerId,jdbcType=BIGINT}
GROUP BY
p.id;
p.id
order by p.id desc;
</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