Commit 5238e759 by Water Wang

add

parent 6c812d91
......@@ -207,4 +207,19 @@ public class PractitionerController {
result.setData(responseVO);
return result;
}
/**
* 团队长--设置增员目标
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/potentialGoalsSetting")
public Object potentialGoalsSetting(@RequestBody PotentialGoalsSettingRequestVO requestVO){
JsonResult result = new JsonResult();
PotentialGoalsSettingResponseVO responseVO = practitionerService.potentialGoalsSetting(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
}
......@@ -109,4 +109,11 @@ public interface PractitionerService {
* @return
*/
OwnOpportunityRecordSaveResponseVO ownOpportunityRecordSave(OwnOpportunityRecordSaveRequestVO requestVO);
/**
* 保存增员目标
* @param requestVO
* @return
*/
PotentialGoalsSettingResponseVO potentialGoalsSetting(PotentialGoalsSettingRequestVO requestVO);
}
......@@ -114,6 +114,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private AclUserDALService aclUserDALService;
@Autowired
private AclPractitionerPotentialAssignedsDALService aclPractitionerPotentialAssignedsDALService;
@Autowired
private AclPractitionerPotentialGoalsDALService aclPractitionerPotentialGoalsDALService;
@Override
public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) {
......@@ -1253,6 +1255,101 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return resp;
}
@Override
public PotentialGoalsSettingResponseVO potentialGoalsSetting(PotentialGoalsSettingRequestVO requestVO) {
PotentialGoalsSettingResponseVO responseVO = new PotentialGoalsSettingResponseVO();
Long practitionerId = requestVO.getPractitionerId();
Integer numberRecruitsYear = requestVO.getNumberRecruitsYear();
Integer numberMDRTYear = requestVO.getNumberMDRTYear();
List<RecruitGoalForMonth> recruitGoalForMonthList = requestVO.getRecruitGoalForMonthList();
if(practitionerId != null && numberMDRTYear != null && numberRecruitsYear != null && !recruitGoalForMonthList.isEmpty()){
Integer month,numberRecruits,numberMDRT;
int numberRecruits1=0,numberMDRT1=0,numberRecruits2=0,numberMDRT2=0,numberRecruits3=0,numberMDRT3=0,numberRecruits4=0,numberMDRT4=0;
Calendar calendar = Calendar.getInstance();
Integer currentYear = calendar.get(Calendar.YEAR);
Date version = new Date();
List<AclPractitionerPotentialGoals> potentialGoalsUpdateList = new ArrayList<>();
List<AclPractitionerPotentialGoals> potentialGoalsOld = aclPractitionerPotentialGoalsDALService.findByPractitionerAndCurrentYear(practitionerId,currentYear);
if(potentialGoalsOld != null && !potentialGoalsOld.isEmpty()){
for(AclPractitionerPotentialGoals item : potentialGoalsOld){
item.setUpdatedAt(new Date());
item.setUpdatedBy(practitionerId);
item.setIsActive(0);
potentialGoalsUpdateList.add(item);
}
aclPractitionerPotentialGoalsDALService.updateList(potentialGoalsUpdateList);
}
//1、统计全年
List<AclPractitionerPotentialGoals> potentialGoalsList = new ArrayList<>();
getPotentialGoalsList(potentialGoalsList,practitionerId,1,null,numberRecruitsYear,numberMDRTYear,currentYear,version);
//2、统计每个月
for(RecruitGoalForMonth item : recruitGoalForMonthList){
month = item.getMonth();
numberRecruits = item.getNumberRecruits();
numberMDRT = item.getNumberMDRT();
if(month < 4){
numberRecruits1 = numberRecruits1 + numberRecruits;
numberMDRT1 = numberMDRT1 + numberMDRT;
}else if(month < 7){
numberRecruits2 = numberRecruits2 + numberRecruits;
numberMDRT2 = numberMDRT2 + numberMDRT;
}else if(month < 10){
numberRecruits3 = numberRecruits3 + numberRecruits;
numberMDRT3 = numberMDRT3 + numberMDRT;
}else {
numberRecruits4 = numberRecruits4 + numberRecruits;
numberMDRT4 = numberMDRT4 + numberMDRT;
}
getPotentialGoalsList(potentialGoalsList,practitionerId,3,month,numberRecruits,numberMDRT,currentYear,version);
}
//3、统计每个季度 -- 1-2-3,4-5-6,7-8-9,10-11-12
getPotentialGoalsList(potentialGoalsList,practitionerId,2,1,numberRecruits1,numberMDRT1,currentYear,version);
getPotentialGoalsList(potentialGoalsList,practitionerId,2,2,numberRecruits2,numberMDRT2,currentYear,version);
getPotentialGoalsList(potentialGoalsList,practitionerId,2,3,numberRecruits3,numberMDRT3,currentYear,version);
getPotentialGoalsList(potentialGoalsList,practitionerId,2,4,numberRecruits4,numberMDRT4,currentYear,version);
aclPractitionerPotentialGoalsDALService.saveAll(potentialGoalsList);
//4、根据年度总目标计算年度活动量M
savePotentialActions(numberRecruitsYear);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
String [] paras = {"practitionerId,numberMDRTYear,numberRecruitsYear,recruitGoalForMonthList"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
}
return responseVO;
}
/**
* 计算活动量
* @param numberRecruitsYear
*/
private void savePotentialActions(Integer numberRecruitsYear) {
}
/**
* 生成保存列表
* @param potentialGoalsList
* @param practitionerId
* @param timeType
* @param seq
* @param numberRecruitsYear
* @param numberMDRTYear
*/
private void getPotentialGoalsList(List<AclPractitionerPotentialGoals> potentialGoalsList, Long practitionerId, Integer timeType, Integer seq, Integer numberRecruitsYear, Integer numberMDRTYear,Integer currentYear,Date version) {
AclPractitionerPotentialGoals potentialGoals = new AclPractitionerPotentialGoals();
potentialGoals.setPractitionerId(practitionerId);
potentialGoals.setCurrentYear(currentYear);
potentialGoals.setStatisticTimeUnit(timeType);
potentialGoals.setSeqTime(seq);
potentialGoals.setNumberRecruits(numberRecruitsYear);
potentialGoals.setNumberMdrt(numberMDRTYear);
potentialGoals.setCurrentVersion(version);
potentialGoals.setIsActive(1);
potentialGoals.setCreatedAt(new Date());
potentialGoals.setCreatedBy(practitionerId);
potentialGoalsList.add(potentialGoals);
}
private CommonResult check(OwnOpportunityRecordSaveRequestVO requestVO) {
String noticeDate = requestVO.getNoticeDate();
if (CommonUtil.isNullOrBlank(noticeDate)){
......
package com.yd.api.practitioner.vo.recruit;
import java.util.List;
public class PotentialGoalsSettingRequestVO {
private Long practitionerId;
private Integer numberRecruitsYear;
private Integer numberMDRTYear;
private List<RecruitGoalForMonth> recruitGoalForMonthList;
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public Integer getNumberRecruitsYear() {
return numberRecruitsYear;
}
public void setNumberRecruitsYear(Integer numberRecruitsYear) {
this.numberRecruitsYear = numberRecruitsYear;
}
public Integer getNumberMDRTYear() {
return numberMDRTYear;
}
public void setNumberMDRTYear(Integer numberMDRTYear) {
this.numberMDRTYear = numberMDRTYear;
}
public List<RecruitGoalForMonth> getRecruitGoalForMonthList() {
return recruitGoalForMonthList;
}
public void setRecruitGoalForMonthList(List<RecruitGoalForMonth> recruitGoalForMonthList) {
this.recruitGoalForMonthList = recruitGoalForMonthList;
}
}
package com.yd.api.practitioner.vo.recruit;
import com.yd.api.result.CommonResult;
public class PotentialGoalsSettingResponseVO {
private CommonResult commonResult;
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.recruit;
public class RecruitGoalForMonth {
private Integer month;
private Integer numberRecruits;
private Integer numberMDRT;
public Integer getMonth() {
return month;
}
public void setMonth(Integer month) {
this.month = month;
}
public Integer getNumberRecruits() {
return numberRecruits;
}
public void setNumberRecruits(Integer numberRecruits) {
this.numberRecruits = numberRecruits;
}
public Integer getNumberMDRT() {
return numberMDRT;
}
public void setNumberMDRT(Integer numberMDRT) {
this.numberMDRT = numberMDRT;
}
}
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_acl_practitioner_potential_goals
* @author
*/
@Data
public class AclPractitionerPotentialGoals implements Serializable {
/**
* serial id
*/
private Long id;
/**
* FK ag_acl_practitioner.id 经纪人
*/
private Long practitionerId;
/**
* 目标所属年度
*/
private Integer currentYear;
/**
* 1:年度,2:季度,3:月度
*/
private Integer statisticTimeUnit;
/**
* 1:年度,3:月度
*/
private Integer seqTime;
/**
* 招聘增员数
*/
private Integer numberRecruits;
/**
* 百万圆桌成员数
*/
private Integer numberMdrt;
/**
* 版本控制
*/
private Date currentVersion;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 创建时间
*/
private Date createdAt;
/**
* 创建人
*/
private Long createdBy;
/**
* 修改时间
*/
private Date updatedAt;
private Long updatedBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_acl_practitioner_potential_goals_actions
* @author
*/
@Data
public class AclPractitionerPotentialGoalsActions implements Serializable {
/**
* serial id
*/
private Long id;
/**
* FK ag_acl_practitioner.id 经纪人
*/
private Long practitionerId;
/**
* 目标所属年度
*/
private Integer currentYear;
/**
* 2:季度,3:月度,4:周
*/
private Integer statisticTimeUnit;
/**
* FK ag_md_drop_options.id 团队长发掘活动drop_master id = 16
*/
private Integer potentialActionId;
/**
* FK ag_md_drop_options.drop_option_name 团队长发掘活动drop_master id = 16
*/
private Integer potentialActionName;
/**
* 报聘(a)= 年目标增员对象/12
报聘面谈 b = a
OPP创说会 c = b * 3
甄选面谈 d = c
增员面谈 e = d * 3
建立名单 f = e
*/
private Integer actionStandards;
/**
* 版本控制
*/
private Date currentVersion;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
/**
* 创建时间
*/
private Date createdAt;
/**
* 创建人
*/
private Long createdBy;
/**
* 修改时间
*/
private Date updatedAt;
private Long updatedBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions;
public interface AclPractitionerPotentialGoalsActionsMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerPotentialGoalsActions record);
int insertSelective(AclPractitionerPotentialGoalsActions record);
AclPractitionerPotentialGoalsActions selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerPotentialGoalsActions record);
int updateByPrimaryKey(AclPractitionerPotentialGoalsActions record);
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoals;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AclPractitionerPotentialGoalsMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerPotentialGoals record);
int insertSelective(AclPractitionerPotentialGoals record);
AclPractitionerPotentialGoals selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerPotentialGoals record);
int updateByPrimaryKey(AclPractitionerPotentialGoals record);
List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYear(@Param("practitionerId") Long practitionerId, @Param("currentYear") Integer currentYear);
void saveAll(@Param("potentialGoalsList")List<AclPractitionerPotentialGoals> potentialGoalsList);
}
\ No newline at end of file
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoals;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialGoalsDALService")
public interface AclPractitionerPotentialGoalsDALService {
List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYear(Long practitionerId, Integer currentYear);
void updateList(List<AclPractitionerPotentialGoals> potentialGoalsUpdateList);
void saveAll(List<AclPractitionerPotentialGoals> potentialGoalsList);
}
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoals;
import com.yd.dal.mapper.customer.AclPractitionerPotentialGoalsMapper;
import com.yd.dal.service.customer.AclPractitionerPotentialGoalsDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialGoalsDALService")
public class AclPractitionerPotentialGoalsDALServiceImpl implements AclPractitionerPotentialGoalsDALService {
@Autowired
private AclPractitionerPotentialGoalsMapper aclPractitionerPotentialGoalsMapper;
@Override
public List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYear(Long practitionerId, Integer currentYear) {
return aclPractitionerPotentialGoalsMapper.findByPractitionerAndCurrentYear(practitionerId,currentYear);
}
@Override
public void updateList(List<AclPractitionerPotentialGoals> potentialGoalsUpdateList) {
for(AclPractitionerPotentialGoals item : potentialGoalsUpdateList){
aclPractitionerPotentialGoalsMapper.updateByPrimaryKeySelective(item);
}
}
@Override
public void saveAll(List<AclPractitionerPotentialGoals> potentialGoalsList) {
aclPractitionerPotentialGoalsMapper.saveAll(potentialGoalsList);
}
}
......@@ -49,7 +49,7 @@
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},#{remark,jdbcType=VARCHER})
#{updaterType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssigneds" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigneds
......@@ -120,7 +120,7 @@
#{creatorType,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHER},
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
......@@ -158,7 +158,7 @@
creator_type = #{creatorType,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHER},
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
......@@ -175,7 +175,7 @@
updated_by = #{updatedBy,jdbcType=BIGINT},
updater_type = #{updaterType,jdbcType=INTEGER},
creator_type = #{creatorType,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHER}
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true">
......
<?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.AclPractitionerPotentialGoalsActionsMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="current_year" jdbcType="INTEGER" property="currentYear" />
<result column="statistic_time_unit" jdbcType="INTEGER" property="statisticTimeUnit" />
<result column="potential_action_id" jdbcType="INTEGER" property="potentialActionId" />
<result column="potential_action_name" jdbcType="INTEGER" property="potentialActionName" />
<result column="action_standards" jdbcType="INTEGER" property="actionStandards" />
<result column="current_version" jdbcType="TIMESTAMP" property="currentVersion" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<sql id="Base_Column_List">
id, practitioner_id, current_year, statistic_time_unit, potential_action_id, potential_action_name,
action_standards, current_version, is_active, 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_practitioner_potential_goals_actions
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_goals_actions
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_goals_actions (practitioner_id, current_year, statistic_time_unit,
potential_action_id, potential_action_name,
action_standards, current_version, is_active,
created_at, created_by, updated_at,
updated_by)
values (#{practitionerId,jdbcType=BIGINT}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER},
#{potentialActionId,jdbcType=INTEGER}, #{potentialActionName,jdbcType=INTEGER},
#{actionStandards,jdbcType=INTEGER}, #{currentVersion,jdbcType=TIMESTAMP}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_goals_actions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="practitionerId != null">
practitioner_id,
</if>
<if test="currentYear != null">
current_year,
</if>
<if test="statisticTimeUnit != null">
statistic_time_unit,
</if>
<if test="potentialActionId != null">
potential_action_id,
</if>
<if test="potentialActionName != null">
potential_action_name,
</if>
<if test="actionStandards != null">
action_standards,
</if>
<if test="currentVersion != null">
current_version,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="practitionerId != null">
#{practitionerId,jdbcType=BIGINT},
</if>
<if test="currentYear != null">
#{currentYear,jdbcType=INTEGER},
</if>
<if test="statisticTimeUnit != null">
#{statisticTimeUnit,jdbcType=INTEGER},
</if>
<if test="potentialActionId != null">
#{potentialActionId,jdbcType=INTEGER},
</if>
<if test="potentialActionName != null">
#{potentialActionName,jdbcType=INTEGER},
</if>
<if test="actionStandards != null">
#{actionStandards,jdbcType=INTEGER},
</if>
<if test="currentVersion != null">
#{currentVersion,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>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions">
update ag_acl_practitioner_potential_goals_actions
<set>
<if test="practitionerId != null">
practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if>
<if test="currentYear != null">
current_year = #{currentYear,jdbcType=INTEGER},
</if>
<if test="statisticTimeUnit != null">
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
</if>
<if test="potentialActionId != null">
potential_action_id = #{potentialActionId,jdbcType=INTEGER},
</if>
<if test="potentialActionName != null">
potential_action_name = #{potentialActionName,jdbcType=INTEGER},
</if>
<if test="actionStandards != null">
action_standards = #{actionStandards,jdbcType=INTEGER},
</if>
<if test="currentVersion != null">
current_version = #{currentVersion,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>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions">
update ag_acl_practitioner_potential_goals_actions
set practitioner_id = #{practitionerId,jdbcType=BIGINT},
current_year = #{currentYear,jdbcType=INTEGER},
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
potential_action_id = #{potentialActionId,jdbcType=INTEGER},
potential_action_name = #{potentialActionName,jdbcType=INTEGER},
action_standards = #{actionStandards,jdbcType=INTEGER},
current_version = #{currentVersion,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}
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.customer.AclPractitionerPotentialGoalsMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclPractitionerPotentialGoals">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="current_year" jdbcType="INTEGER" property="currentYear" />
<result column="statistic_time_unit" jdbcType="INTEGER" property="statisticTimeUnit" />
<result column="seq_time" jdbcType="INTEGER" property="seqTime" />
<result column="number_recruits" jdbcType="INTEGER" property="numberRecruits" />
<result column="number_mdrt" jdbcType="INTEGER" property="numberMdrt" />
<result column="current_version" jdbcType="TIMESTAMP" property="currentVersion" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<sql id="Base_Column_List">
id, practitioner_id, current_year, statistic_time_unit, seq_time, number_recruits,
number_mdrt, current_version, is_active, 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_practitioner_potential_goals
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_goals
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoals" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_goals (practitioner_id, current_year, statistic_time_unit,
seq_time, number_recruits, number_mdrt,
current_version, is_active, created_at,
created_by, updated_at, updated_by
)
values (#{practitionerId,jdbcType=BIGINT}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER},
#{seqTime,jdbcType=INTEGER}, #{numberRecruits,jdbcType=INTEGER}, #{numberMdrt,jdbcType=INTEGER},
#{currentVersion,jdbcType=TIMESTAMP}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoals" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_goals
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="practitionerId != null">
practitioner_id,
</if>
<if test="currentYear != null">
current_year,
</if>
<if test="statisticTimeUnit != null">
statistic_time_unit,
</if>
<if test="seqTime != null">
seq_time,
</if>
<if test="numberRecruits != null">
number_recruits,
</if>
<if test="numberMdrt != null">
number_mdrt,
</if>
<if test="currentVersion != null">
current_version,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="practitionerId != null">
#{practitionerId,jdbcType=BIGINT},
</if>
<if test="currentYear != null">
#{currentYear,jdbcType=INTEGER},
</if>
<if test="statisticTimeUnit != null">
#{statisticTimeUnit,jdbcType=INTEGER},
</if>
<if test="seqTime != null">
#{seqTime,jdbcType=INTEGER},
</if>
<if test="numberRecruits != null">
#{numberRecruits,jdbcType=INTEGER},
</if>
<if test="numberMdrt != null">
#{numberMdrt,jdbcType=INTEGER},
</if>
<if test="currentVersion != null">
#{currentVersion,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>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoals">
update ag_acl_practitioner_potential_goals
<set>
<if test="practitionerId != null">
practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if>
<if test="currentYear != null">
current_year = #{currentYear,jdbcType=INTEGER},
</if>
<if test="statisticTimeUnit != null">
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
</if>
<if test="seqTime != null">
seq_time = #{seqTime,jdbcType=INTEGER},
</if>
<if test="numberRecruits != null">
number_recruits = #{numberRecruits,jdbcType=INTEGER},
</if>
<if test="numberMdrt != null">
number_mdrt = #{numberMdrt,jdbcType=INTEGER},
</if>
<if test="currentVersion != null">
current_version = #{currentVersion,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>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialGoals">
update ag_acl_practitioner_potential_goals
set practitioner_id = #{practitionerId,jdbcType=BIGINT},
current_year = #{currentYear,jdbcType=INTEGER},
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
seq_time = #{seqTime,jdbcType=INTEGER},
number_recruits = #{numberRecruits,jdbcType=INTEGER},
number_mdrt = #{numberMdrt,jdbcType=INTEGER},
current_version = #{currentVersion,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}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="findByPractitionerAndCurrentYear" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_goals
where practitioner_id = #{practitionerId,jdbcType=BIGINT} and current_year = #{currentYear,jdbcType=INTEGER}
</select>
<insert id="saveAll" parameterType="java.util.List" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_goals (practitioner_id, current_year, statistic_time_unit,
seq_time, number_recruits, number_mdrt,
current_version, is_active, created_at,
created_by, updated_at, updated_by
)
values
<foreach collection="potentialGoalsList" item="item" index="index" separator=",">
(
#{item.practitionerId},
#{item.currentYear},
#{item.statisticTimeUnit},
#{item.seqTime},
#{item.numberRecruits},
#{item.numberMdrt},
#{item.currentVersion},
#{item.isActive},
#{item.createdAt},
#{item.createdBy},
#{item.updatedAt},
#{item.updatedBy}
)
</foreach>
</insert>
</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