Commit cc8bec4d by Water Wang

optimize

parent 5238e759
package com.yd.api.practitioner;
import com.yd.api.result.CommonResult;
public class PotentialGoalsActionsUpdateResponseVO {
private CommonResult commonResult;
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner;
import com.yd.api.practitioner.vo.recruit.RecruitGoalForMonth;
import com.yd.api.result.CommonResult;
import java.util.List;
public class PotentialGoalsQueryResponseVO {
private Integer numberRecruitsYear;
private Integer numberMDRTYear;
private List<RecruitGoalForMonth> recruitGoalForMonthList;
private CommonResult commonResult;
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;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
...@@ -222,4 +222,46 @@ public class PractitionerController { ...@@ -222,4 +222,46 @@ public class PractitionerController {
return result; return result;
} }
/**
* 团队长--查询增员目标
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/potentialGoalsQuery")
public Object potentialGoalsQuery(@RequestBody PotentialGoalsQueryRequestVO requestVO){
JsonResult result = new JsonResult();
PotentialGoalsQueryResponseVO responseVO = practitionerService.potentialGoalsQuery(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/**
* 团队长--查询增员目标活动量
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/potentialGoalsActionsQuery")
public Object potentialGoalsActionsQuery(@RequestBody PotentialGoalsActionsQueryRequestVO requestVO){
JsonResult result = new JsonResult();
PotentialGoalsActionsQueryResponseVO responseVO = practitionerService.potentialGoalsActionsQuery(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/**
* 团队长--更新增员目标活动量
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/potentialGoalsActionsUpdate")
public Object potentialGoalsActionsUpdate(@RequestBody PotentialGoalsActionsUpdateRequestVO requestVO){
JsonResult result = new JsonResult();
PotentialGoalsActionsUpdateResponseVO responseVO = practitionerService.potentialGoalsActionsUpdate(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
} }
package com.yd.api.practitioner.service; package com.yd.api.practitioner.service;
import com.yd.api.practitioner.PotentialGoalsActionsUpdateResponseVO;
import com.yd.api.practitioner.PotentialGoalsQueryResponseVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO; import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO;
import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO; import com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO;
import com.yd.api.practitioner.vo.media.MediaGetReqVO; import com.yd.api.practitioner.vo.media.MediaGetReqVO;
...@@ -112,8 +114,28 @@ public interface PractitionerService { ...@@ -112,8 +114,28 @@ public interface PractitionerService {
/** /**
* 保存增员目标 * 保存增员目标
* @param requestVO * @param requestVO 请求数据
* @return * @return 响应数据
*/ */
PotentialGoalsSettingResponseVO potentialGoalsSetting(PotentialGoalsSettingRequestVO requestVO); PotentialGoalsSettingResponseVO potentialGoalsSetting(PotentialGoalsSettingRequestVO requestVO);
/**
* 查询增员目标
* @param requestVO 请求数据
* @return 响应数据
*/
PotentialGoalsQueryResponseVO potentialGoalsQuery(PotentialGoalsQueryRequestVO requestVO);
/**
* 查询增员目标活动量
* @param requestVO 请求数据
* @return 响应数据
*/
PotentialGoalsActionsQueryResponseVO potentialGoalsActionsQuery(PotentialGoalsActionsQueryRequestVO requestVO);
/**
* 团队长--更新增员目标活动量
* @param requestVO 请求数据
* @return 响应数据
*/
PotentialGoalsActionsUpdateResponseVO potentialGoalsActionsUpdate(PotentialGoalsActionsUpdateRequestVO requestVO);
} }
package com.yd.api.practitioner.vo.recruit;
public class PotentialGoalsActionsInfo {
private Long id;
private Long practitionerId;
private Integer currentYear;
private Integer statisticTimeUnit;
private Long potentialActionId;
private String potentialActionName;
private Integer actionStandards;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public Integer getCurrentYear() {
return currentYear;
}
public void setCurrentYear(Integer currentYear) {
this.currentYear = currentYear;
}
public Integer getStatisticTimeUnit() {
return statisticTimeUnit;
}
public void setStatisticTimeUnit(Integer statisticTimeUnit) {
this.statisticTimeUnit = statisticTimeUnit;
}
public Long getPotentialActionId() {
return potentialActionId;
}
public void setPotentialActionId(Long potentialActionId) {
this.potentialActionId = potentialActionId;
}
public String getPotentialActionName() {
return potentialActionName;
}
public void setPotentialActionName(String potentialActionName) {
this.potentialActionName = potentialActionName;
}
public Integer getActionStandards() {
return actionStandards;
}
public void setActionStandards(Integer actionStandards) {
this.actionStandards = actionStandards;
}
}
package com.yd.api.practitioner.vo.recruit;
public class PotentialGoalsActionsQueryRequestVO {
private Long practitionerId;
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
}
package com.yd.api.practitioner.vo.recruit;
import com.yd.api.result.CommonResult;
import java.util.List;
public class PotentialGoalsActionsQueryResponseVO {
private List<PotentialGoalsActionsInfo> goalsActionsInfoList;
private CommonResult commonResult;
public List<PotentialGoalsActionsInfo> getGoalsActionsInfoList() {
return goalsActionsInfoList;
}
public void setGoalsActionsInfoList(List<PotentialGoalsActionsInfo> goalsActionsInfoList) {
this.goalsActionsInfoList = goalsActionsInfoList;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.recruit;
import java.util.List;
public class PotentialGoalsActionsUpdateRequestVO {
private Long practitionerId;
private List<PotentialGoalsActionsInfo> goalsActionsInfoList;
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public List<PotentialGoalsActionsInfo> getGoalsActionsInfoList() {
return goalsActionsInfoList;
}
public void setGoalsActionsInfoList(List<PotentialGoalsActionsInfo> goalsActionsInfoList) {
this.goalsActionsInfoList = goalsActionsInfoList;
}
}
package com.yd.api.practitioner.vo.recruit;
public class PotentialGoalsQueryRequestVO {
private Long practitionerId;
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
}
...@@ -33,19 +33,19 @@ public class AclPractitionerPotentialGoalsActions implements Serializable { ...@@ -33,19 +33,19 @@ public class AclPractitionerPotentialGoalsActions implements Serializable {
/** /**
* FK ag_md_drop_options.id 团队长发掘活动drop_master id = 16 * FK ag_md_drop_options.id 团队长发掘活动drop_master id = 16
*/ */
private Integer potentialActionId; private Long potentialActionId;
/** /**
* FK ag_md_drop_options.drop_option_name 团队长发掘活动drop_master id = 16 * FK ag_md_drop_options.drop_option_name 团队长发掘活动drop_master id = 16
*/ */
private Integer potentialActionName; private String potentialActionName;
/** /**
* 报聘(a)= 年目标增员对象/12 * 报聘(a)= 年目标增员对象/12
报聘面谈 b = a 报聘面谈 b = a
OPP创说会 c = b * 3 OPP创说会 c = b * 3
甄选面谈 d = c 甄选面谈 d = c
增员面谈 e = d * 3 增员面谈 e = d * 3
建立名单 f = e 建立名单 f = e
*/ */
private Integer actionStandards; private Integer actionStandards;
......
package com.yd.dal.entity.meta;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_md_goals_calculate_expression
* @author
*/
@Data
public class MdGoalsCalculateExpression implements Serializable {
/**
* serial id
*/
private Long id;
/**
* 目标所属年度
*/
private Integer currentYear;
/**
* FK ag_md_drop_master.id 商机销售行动drop_master id = 14 or 经纪人增员活动16
*/
private Long dropMasterId;
/**
* 商机销售行动 or 团队长发掘活动
*/
private String dropMasterName;
/**
* FK ag_md_drop_options.id 商机销售行动drop_master id = 14 or 16
*/
private Long actionId;
/**
* 商机销售行动 or 团队长发掘活动名称
*/
private String dropOptionName;
/**
* javascript计算公式,参数:成交件数,
成交件数a
建议书数量b = a * 3
见面沟通次数c = a * 3
电话/微信沟通次数d = a * 9
安排见面次数f = a * 27
获取商机次数g = a * 27
报聘(a)= 年目标增员对象/12
报聘面谈 b = a
OPP创说会 c = a * 3
甄选面谈 d = a * 3
增员面谈 e = a * 9
建立名单 f = a * 9
*/
private String calculateScriptExpression;
/**
* 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; package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions; import com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AclPractitionerPotentialGoalsActionsMapper { public interface AclPractitionerPotentialGoalsActionsMapper {
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
...@@ -14,4 +17,8 @@ public interface AclPractitionerPotentialGoalsActionsMapper { ...@@ -14,4 +17,8 @@ public interface AclPractitionerPotentialGoalsActionsMapper {
int updateByPrimaryKeySelective(AclPractitionerPotentialGoalsActions record); int updateByPrimaryKeySelective(AclPractitionerPotentialGoalsActions record);
int updateByPrimaryKey(AclPractitionerPotentialGoalsActions record); int updateByPrimaryKey(AclPractitionerPotentialGoalsActions record);
List<AclPractitionerPotentialGoalsActions> findByPractitionerIdAndCurrentYearAndIsActive(@Param("practitionerId")Long practitionerId, @Param("currentYear") Integer currentYear, @Param("isActive") Integer isActive);
void saveAll(@Param("potentialGoalsActionsList") List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsList);
} }
\ No newline at end of file
...@@ -21,4 +21,6 @@ public interface AclPractitionerPotentialGoalsMapper { ...@@ -21,4 +21,6 @@ public interface AclPractitionerPotentialGoalsMapper {
List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYear(@Param("practitionerId") Long practitionerId, @Param("currentYear") Integer currentYear); List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYear(@Param("practitionerId") Long practitionerId, @Param("currentYear") Integer currentYear);
void saveAll(@Param("potentialGoalsList")List<AclPractitionerPotentialGoals> potentialGoalsList); void saveAll(@Param("potentialGoalsList")List<AclPractitionerPotentialGoals> potentialGoalsList);
List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYearAndTimeUnit(@Param("practitionerId")Long practitionerId, @Param("currentYear")Integer currentYear, @Param("timeTypeList")List<Integer> timeTypeList);
} }
\ No newline at end of file
package com.yd.dal.mapper.meta;
import com.yd.dal.entity.meta.MdGoalsCalculateExpression;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MdGoalsCalculateExpressionMapper {
int deleteByPrimaryKey(Long id);
int insert(MdGoalsCalculateExpression record);
int insertSelective(MdGoalsCalculateExpression record);
MdGoalsCalculateExpression selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(MdGoalsCalculateExpression record);
int updateByPrimaryKey(MdGoalsCalculateExpression record);
List<MdGoalsCalculateExpression> findByMasterCodeAndIsActive(@Param("masterCode") String masterCode, @Param("isActive") Integer isActive);
}
\ No newline at end of file
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialGoalsActionsDALService")
public interface AclPractitionerPotentialGoalsActionsDALService {
List<AclPractitionerPotentialGoalsActions> findByPractitionerIdAndCurrentYearAndIsActive(Long practitionerId, Integer currentYear, Integer isActive);
void updateAll(List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsListUpdate);
void saveAll(List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsList);
}
...@@ -13,4 +13,6 @@ public interface AclPractitionerPotentialGoalsDALService { ...@@ -13,4 +13,6 @@ public interface AclPractitionerPotentialGoalsDALService {
void updateList(List<AclPractitionerPotentialGoals> potentialGoalsUpdateList); void updateList(List<AclPractitionerPotentialGoals> potentialGoalsUpdateList);
void saveAll(List<AclPractitionerPotentialGoals> potentialGoalsList); void saveAll(List<AclPractitionerPotentialGoals> potentialGoalsList);
List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYearAndTimeUnit(Long practitionerId, Integer currentYear, List<Integer> timeTypeList);
} }
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclPractitionerPotentialGoalsActions;
import com.yd.dal.mapper.customer.AclPractitionerPotentialGoalsActionsMapper;
import com.yd.dal.service.customer.AclPractitionerPotentialGoalsActionsDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("aclPractitionerPotentialGoalsActionsDALService")
public class AclPractitionerPotentialGoalsActionsDALServiceImpl implements AclPractitionerPotentialGoalsActionsDALService {
@Resource
private AclPractitionerPotentialGoalsActionsMapper aclPractitionerPotentialGoalsActionsMapper;
@Override
public List<AclPractitionerPotentialGoalsActions> findByPractitionerIdAndCurrentYearAndIsActive(Long practitionerId, Integer currentYear, Integer isActive) {
return aclPractitionerPotentialGoalsActionsMapper.findByPractitionerIdAndCurrentYearAndIsActive(practitionerId,currentYear,isActive);
}
@Override
public void updateAll(List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsListUpdate) {
for(AclPractitionerPotentialGoalsActions item : potentialGoalsActionsListUpdate){
aclPractitionerPotentialGoalsActionsMapper.updateByPrimaryKeySelective(item);
}
}
@Override
public void saveAll(List<AclPractitionerPotentialGoalsActions> potentialGoalsActionsList) {
aclPractitionerPotentialGoalsActionsMapper.saveAll(potentialGoalsActionsList);
}
}
...@@ -30,4 +30,9 @@ public class AclPractitionerPotentialGoalsDALServiceImpl implements AclPractitio ...@@ -30,4 +30,9 @@ public class AclPractitionerPotentialGoalsDALServiceImpl implements AclPractitio
public void saveAll(List<AclPractitionerPotentialGoals> potentialGoalsList) { public void saveAll(List<AclPractitionerPotentialGoals> potentialGoalsList) {
aclPractitionerPotentialGoalsMapper.saveAll(potentialGoalsList); aclPractitionerPotentialGoalsMapper.saveAll(potentialGoalsList);
} }
@Override
public List<AclPractitionerPotentialGoals> findByPractitionerAndCurrentYearAndTimeUnit(Long practitionerId, Integer currentYear, List<Integer> timeTypeList) {
return aclPractitionerPotentialGoalsMapper.findByPractitionerAndCurrentYearAndTimeUnit(practitionerId,currentYear,timeTypeList);
}
} }
package com.yd.dal.service.meta;
import com.yd.dal.entity.meta.MdGoalsCalculateExpression;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("mdGoalsCalculateExpressionDALService")
public interface MdGoalsCalculateExpressionDALService {
List<MdGoalsCalculateExpression> findByMasterCodeAndIsActive(String masterCode, Integer isActive);
}
package com.yd.dal.service.meta.impl;
import com.yd.dal.entity.meta.MdGoalsCalculateExpression;
import com.yd.dal.mapper.meta.MdGoalsCalculateExpressionMapper;
import com.yd.dal.service.meta.MdGoalsCalculateExpressionDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("MdGoalsCalculateExpressionDALService")
public class MdGoalsCalculateExpressionDALServiceImpl implements MdGoalsCalculateExpressionDALService {
@Resource
private MdGoalsCalculateExpressionMapper mdGoalsCalculateExpressionMapper;
@Override
public List<MdGoalsCalculateExpression> findByMasterCodeAndIsActive(String masterCode, Integer isActive) {
return mdGoalsCalculateExpressionMapper.findByMasterCodeAndIsActive(masterCode,isActive);
}
}
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" /> <result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="current_year" jdbcType="INTEGER" property="currentYear" /> <result column="current_year" jdbcType="INTEGER" property="currentYear" />
<result column="statistic_time_unit" jdbcType="INTEGER" property="statisticTimeUnit" /> <result column="statistic_time_unit" jdbcType="INTEGER" property="statisticTimeUnit" />
<result column="potential_action_id" jdbcType="INTEGER" property="potentialActionId" /> <result column="potential_action_id" jdbcType="BIGINT" property="potentialActionId" />
<result column="potential_action_name" jdbcType="INTEGER" property="potentialActionName" /> <result column="potential_action_name" jdbcType="VARCHAR" property="potentialActionName" />
<result column="action_standards" jdbcType="INTEGER" property="actionStandards" /> <result column="action_standards" jdbcType="INTEGER" property="actionStandards" />
<result column="current_version" jdbcType="TIMESTAMP" property="currentVersion" /> <result column="current_version" jdbcType="TIMESTAMP" property="currentVersion" />
<result column="is_active" jdbcType="INTEGER" property="isActive" /> <result column="is_active" jdbcType="INTEGER" property="isActive" />
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
created_at, created_by, updated_at, created_at, created_by, updated_at,
updated_by) updated_by)
values (#{practitionerId,jdbcType=BIGINT}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER}, values (#{practitionerId,jdbcType=BIGINT}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER},
#{potentialActionId,jdbcType=INTEGER}, #{potentialActionName,jdbcType=INTEGER}, #{potentialActionId,jdbcType=BIGINT}, #{potentialActionName,jdbcType=VARCHAR},
#{actionStandards,jdbcType=INTEGER}, #{currentVersion,jdbcType=TIMESTAMP}, #{isActive,jdbcType=INTEGER}, #{actionStandards,jdbcType=INTEGER}, #{currentVersion,jdbcType=TIMESTAMP}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT}) #{updatedBy,jdbcType=BIGINT})
...@@ -94,10 +94,10 @@ ...@@ -94,10 +94,10 @@
#{statisticTimeUnit,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER},
</if> </if>
<if test="potentialActionId != null"> <if test="potentialActionId != null">
#{potentialActionId,jdbcType=INTEGER}, #{potentialActionId,jdbcType=BIGINT},
</if> </if>
<if test="potentialActionName != null"> <if test="potentialActionName != null">
#{potentialActionName,jdbcType=INTEGER}, #{potentialActionName,jdbcType=VARCHAR},
</if> </if>
<if test="actionStandards != null"> <if test="actionStandards != null">
#{actionStandards,jdbcType=INTEGER}, #{actionStandards,jdbcType=INTEGER},
...@@ -135,10 +135,10 @@ ...@@ -135,10 +135,10 @@
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER}, statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
</if> </if>
<if test="potentialActionId != null"> <if test="potentialActionId != null">
potential_action_id = #{potentialActionId,jdbcType=INTEGER}, potential_action_id = #{potentialActionId,jdbcType=BIGINT},
</if> </if>
<if test="potentialActionName != null"> <if test="potentialActionName != null">
potential_action_name = #{potentialActionName,jdbcType=INTEGER}, potential_action_name = #{potentialActionName,jdbcType=VARCHAR},
</if> </if>
<if test="actionStandards != null"> <if test="actionStandards != null">
action_standards = #{actionStandards,jdbcType=INTEGER}, action_standards = #{actionStandards,jdbcType=INTEGER},
...@@ -169,8 +169,8 @@ ...@@ -169,8 +169,8 @@
set practitioner_id = #{practitionerId,jdbcType=BIGINT}, set practitioner_id = #{practitionerId,jdbcType=BIGINT},
current_year = #{currentYear,jdbcType=INTEGER}, current_year = #{currentYear,jdbcType=INTEGER},
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER}, statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
potential_action_id = #{potentialActionId,jdbcType=INTEGER}, potential_action_id = #{potentialActionId,jdbcType=BIGINT},
potential_action_name = #{potentialActionName,jdbcType=INTEGER}, potential_action_name = #{potentialActionName,jdbcType=VARCHAR},
action_standards = #{actionStandards,jdbcType=INTEGER}, action_standards = #{actionStandards,jdbcType=INTEGER},
current_version = #{currentVersion,jdbcType=TIMESTAMP}, current_version = #{currentVersion,jdbcType=TIMESTAMP},
is_active = #{isActive,jdbcType=INTEGER}, is_active = #{isActive,jdbcType=INTEGER},
...@@ -180,4 +180,35 @@ ...@@ -180,4 +180,35 @@
updated_by = #{updatedBy,jdbcType=BIGINT} updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="findByPractitionerIdAndCurrentYearAndIsActive" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_goals_actions
where practitioner_id = #{practitionerId,jdbcType=BIGINT} and is_active = #{isActive,jdbcType=INTEGER} and current_year = #{currentYear,jdbcType=INTEGER}
</select>
<insert id="saveAll" parameterType="java.util.List" 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
<foreach collection="potentialGoalsActionsList" item="item" index="index" separator=",">
(
#{item.practitionerId},
#{item.currentYear},
#{item.statisticTimeUnit},
#{item.potentialActionId},
#{item.potentialActionName},
#{item.actionStandards},
#{item.currentVersion},
#{item.isActive},
#{item.createdAt},
#{item.createdBy},
#{item.updatedAt},
#{item.updatedBy}
)
</foreach>
</insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from ag_acl_practitioner_potential_goals from ag_acl_practitioner_potential_goals
where practitioner_id = #{practitionerId,jdbcType=BIGINT} and current_year = #{currentYear,jdbcType=INTEGER} where practitioner_id = #{practitionerId,jdbcType=BIGINT} and current_year = #{currentYear,jdbcType=INTEGER} and is_active = 1
</select> </select>
<insert id="saveAll" parameterType="java.util.List" useGeneratedKeys="true"> <insert id="saveAll" parameterType="java.util.List" useGeneratedKeys="true">
...@@ -210,4 +210,14 @@ ...@@ -210,4 +210,14 @@
) )
</foreach> </foreach>
</insert> </insert>
<select id="findByPractitionerAndCurrentYearAndTimeUnit" 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} and is_active = 1 and statistic_time_unit in
<foreach collection="timeTypeList" item="timeType" open="(" separator="," close=")">
#{timeType}
</foreach>
</select>
</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.meta.MdGoalsCalculateExpressionMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.meta.MdGoalsCalculateExpression">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="current_year" jdbcType="INTEGER" property="currentYear" />
<result column="drop_master_id" jdbcType="BIGINT" property="dropMasterId" />
<result column="drop_master_name" jdbcType="VARCHAR" property="dropMasterName" />
<result column="action_id" jdbcType="BIGINT" property="actionId" />
<result column="drop_option_name" jdbcType="VARCHAR" property="dropOptionName" />
<result column="calculate_script_expression" jdbcType="VARCHAR" property="calculateScriptExpression" />
<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, current_year, drop_master_id, drop_master_name, action_id, drop_option_name,
calculate_script_expression, 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_md_goals_calculate_expression
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_md_goals_calculate_expression
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression" useGeneratedKeys="true">
insert into ag_md_goals_calculate_expression (current_year, drop_master_id, drop_master_name,
action_id, drop_option_name, calculate_script_expression,
is_active, created_at, created_by,
updated_at, updated_by)
values (#{currentYear,jdbcType=INTEGER}, #{dropMasterId,jdbcType=BIGINT}, #{dropMasterName,jdbcType=VARCHAR},
#{actionId,jdbcType=BIGINT}, #{dropOptionName,jdbcType=VARCHAR}, #{calculateScriptExpression,jdbcType=VARCHAR},
#{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT},
#{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression" useGeneratedKeys="true">
insert into ag_md_goals_calculate_expression
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="currentYear != null">
current_year,
</if>
<if test="dropMasterId != null">
drop_master_id,
</if>
<if test="dropMasterName != null">
drop_master_name,
</if>
<if test="actionId != null">
action_id,
</if>
<if test="dropOptionName != null">
drop_option_name,
</if>
<if test="calculateScriptExpression != null">
calculate_script_expression,
</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="currentYear != null">
#{currentYear,jdbcType=INTEGER},
</if>
<if test="dropMasterId != null">
#{dropMasterId,jdbcType=BIGINT},
</if>
<if test="dropMasterName != null">
#{dropMasterName,jdbcType=VARCHAR},
</if>
<if test="actionId != null">
#{actionId,jdbcType=BIGINT},
</if>
<if test="dropOptionName != null">
#{dropOptionName,jdbcType=VARCHAR},
</if>
<if test="calculateScriptExpression != null">
#{calculateScriptExpression,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>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression">
update ag_md_goals_calculate_expression
<set>
<if test="currentYear != null">
current_year = #{currentYear,jdbcType=INTEGER},
</if>
<if test="dropMasterId != null">
drop_master_id = #{dropMasterId,jdbcType=BIGINT},
</if>
<if test="dropMasterName != null">
drop_master_name = #{dropMasterName,jdbcType=VARCHAR},
</if>
<if test="actionId != null">
action_id = #{actionId,jdbcType=BIGINT},
</if>
<if test="dropOptionName != null">
drop_option_name = #{dropOptionName,jdbcType=VARCHAR},
</if>
<if test="calculateScriptExpression != null">
calculate_script_expression = #{calculateScriptExpression,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>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.meta.MdGoalsCalculateExpression">
update ag_md_goals_calculate_expression
set current_year = #{currentYear,jdbcType=INTEGER},
drop_master_id = #{dropMasterId,jdbcType=BIGINT},
drop_master_name = #{dropMasterName,jdbcType=VARCHAR},
action_id = #{actionId,jdbcType=BIGINT},
drop_option_name = #{dropOptionName,jdbcType=VARCHAR},
calculate_script_expression = #{calculateScriptExpression,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}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="findByMasterCodeAndIsActive" resultType="com.yd.dal.entity.meta.MdGoalsCalculateExpression">
select
e.id id,
e.current_year currentYear,
e.drop_master_id dropMasterId,
e.drop_master_name dropMasterName,
e.action_id actionId,
e.drop_option_name dropOptionName,
e.calculate_script_expression calculateScriptExpression,
e.is_active isActive,
e.created_at createdAt,
e.created_by createdBy,
e.updated_at updatedAt,
e.updated_by updatedBy
from ag_md_drop_master m left join ag_md_goals_calculate_expression e on m.id = e.drop_master_id and e.is_active = #{isActive,jdbcType=INTEGER}
where m.scenario_code = #{masterCode,jdbcType=VARCHAR}
</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