Commit 61ab114c authored by 赵啸非's avatar 赵啸非

规则添加编码字段

parent e9f02046
...@@ -8,11 +8,11 @@ import com.mortals.framework.model.BaseEntityLong; ...@@ -8,11 +8,11 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.vo.PerformRulesVo; import com.mortals.xhx.module.perform.model.vo.PerformRulesVo;
import lombok.Data; import lombok.Data;
/** /**
* 绩效规则信息实体对象 * 绩效规则信息实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-05-16 * @date 2023-07-10
*/ */
@Data @Data
public class PerformRulesEntity extends PerformRulesVo { public class PerformRulesEntity extends PerformRulesVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -57,6 +57,10 @@ public class PerformRulesEntity extends PerformRulesVo { ...@@ -57,6 +57,10 @@ public class PerformRulesEntity extends PerformRulesVo {
* 规则类型(1.考勤绩效,2.评价绩效指标,3.办件绩效指标,4.效能绩效指标,5.其它绩效指标) * 规则类型(1.考勤绩效,2.评价绩效指标,3.办件绩效指标,4.效能绩效指标,5.其它绩效指标)
*/ */
private Integer type; private Integer type;
/**
* 规则编码,唯一,默认规则类型内容简称拼音首字母。
*/
private String ruleCode;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -75,7 +79,7 @@ public class PerformRulesEntity extends PerformRulesVo { ...@@ -75,7 +79,7 @@ public class PerformRulesEntity extends PerformRulesVo {
public void initAttrValue(){ public void initAttrValue(){
this.categoryId = null; this.categoryId = -1L;
this.categoryName = ""; this.categoryName = "";
...@@ -93,6 +97,8 @@ public class PerformRulesEntity extends PerformRulesVo { ...@@ -93,6 +97,8 @@ public class PerformRulesEntity extends PerformRulesVo {
this.remark = ""; this.remark = "";
this.type = null; this.type = 1;
this.ruleCode = "";
} }
} }
\ No newline at end of file
...@@ -4,11 +4,11 @@ import java.math.BigDecimal; ...@@ -4,11 +4,11 @@ import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.perform.model.PerformRulesEntity; import com.mortals.xhx.module.perform.model.PerformRulesEntity;
/** /**
* 绩效规则信息查询对象 * 绩效规则信息查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-05-16 * @date 2023-07-10
*/ */
public class PerformRulesQuery extends PerformRulesEntity { public class PerformRulesQuery extends PerformRulesEntity {
/** 开始 序号,主键,自增长 */ /** 开始 序号,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -177,6 +177,11 @@ public class PerformRulesQuery extends PerformRulesEntity { ...@@ -177,6 +177,11 @@ public class PerformRulesQuery extends PerformRulesEntity {
/** 结束 更新时间 */ /** 结束 更新时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 规则编码,唯一,默认规则类型内容简称拼音首字母。 */
private List<String> ruleCodeList;
/** 规则编码,唯一,默认规则类型内容简称拼音首字母。排除列表 */
private List <String> ruleCodeNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<PerformRulesQuery> orConditionList; private List<PerformRulesQuery> orConditionList;
...@@ -1106,6 +1111,38 @@ public class PerformRulesQuery extends PerformRulesEntity { ...@@ -1106,6 +1111,38 @@ public class PerformRulesQuery extends PerformRulesEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 规则编码,唯一,默认规则类型内容简称拼音首字母。
* @return ruleCodeList
*/
public List<String> getRuleCodeList(){
return this.ruleCodeList;
}
/**
* 设置 规则编码,唯一,默认规则类型内容简称拼音首字母。
* @param ruleCodeList
*/
public void setRuleCodeList(List<String> ruleCodeList){
this.ruleCodeList = ruleCodeList;
}
/**
* 获取 规则编码,唯一,默认规则类型内容简称拼音首字母。
* @return ruleCodeNotList
*/
public List<String> getRuleCodeNotList(){
return this.ruleCodeNotList;
}
/**
* 设置 规则编码,唯一,默认规则类型内容简称拼音首字母。
* @param ruleCodeNotList
*/
public void setRuleCodeNotList(List<String> ruleCodeNotList){
this.ruleCodeNotList = ruleCodeNotList;
}
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -1670,6 +1707,25 @@ public class PerformRulesQuery extends PerformRulesEntity { ...@@ -1670,6 +1707,25 @@ public class PerformRulesQuery extends PerformRulesEntity {
} }
/**
* 设置 规则编码,唯一,默认规则类型内容简称拼音首字母。
* @param ruleCode
*/
public PerformRulesQuery ruleCode(String ruleCode){
setRuleCode(ruleCode);
return this;
}
/**
* 设置 规则编码,唯一,默认规则类型内容简称拼音首字母。
* @param ruleCodeList
*/
public PerformRulesQuery ruleCodeList(List<String> ruleCodeList){
this.ruleCodeList = ruleCodeList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.perform.dao.ibatis.PerformRulesDaoImpl"> <mapper namespace="com.mortals.xhx.module.perform.dao.ibatis.PerformRulesDaoImpl">
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" /> <result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="ruleCode" column="ruleCode" />
</resultMap> </resultMap>
...@@ -72,23 +73,26 @@ ...@@ -72,23 +73,26 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime, a.updateTime,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ruleCode') or colPickMode == 1 and data.containsKey('ruleCode')))">
a.ruleCode,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="PerformRulesEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="PerformRulesEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_perform_rules insert into mortals_xhx_perform_rules
(categoryId,categoryName,name,content,subAddType,score,assoOwner,ownerScore,remark,type,createUserId,createTime,updateUserId,updateTime) (categoryId,categoryName,name,content,subAddType,score,assoOwner,ownerScore,remark,type,createUserId,createTime,updateUserId,updateTime,ruleCode)
VALUES VALUES
(#{categoryId},#{categoryName},#{name},#{content},#{subAddType},#{score},#{assoOwner},#{ownerScore},#{remark},#{type},#{createUserId},#{createTime},#{updateUserId},#{updateTime}) (#{categoryId},#{categoryName},#{name},#{content},#{subAddType},#{score},#{assoOwner},#{ownerScore},#{remark},#{type},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{ruleCode})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_perform_rules insert into mortals_xhx_perform_rules
(categoryId,categoryName,name,content,subAddType,score,assoOwner,ownerScore,remark,type,createUserId,createTime,updateUserId,updateTime) (categoryId,categoryName,name,content,subAddType,score,assoOwner,ownerScore,remark,type,createUserId,createTime,updateUserId,updateTime,ruleCode)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.categoryId},#{item.categoryName},#{item.name},#{item.content},#{item.subAddType},#{item.score},#{item.assoOwner},#{item.ownerScore},#{item.remark},#{item.type},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime}) (#{item.categoryId},#{item.categoryName},#{item.name},#{item.content},#{item.subAddType},#{item.score},#{item.assoOwner},#{item.ownerScore},#{item.remark},#{item.type},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.ruleCode})
</foreach> </foreach>
</insert> </insert>
...@@ -164,6 +168,9 @@ ...@@ -164,6 +168,9 @@
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))"> <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime}, a.updateTime=#{data.updateTime},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('ruleCode')) or (colPickMode==1 and !data.containsKey('ruleCode'))">
a.ruleCode=#{data.ruleCode},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -314,6 +321,13 @@ ...@@ -314,6 +321,13 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="ruleCode=(case" suffix="ELSE ruleCode end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('ruleCode')) or (colPickMode==1 and !item.containsKey('ruleCode'))">
when a.id=#{item.id} then #{item.ruleCode}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -787,6 +801,27 @@ ...@@ -787,6 +801,27 @@
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''"> <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if> </if>
<if test="conditionParamRef.containsKey('ruleCode')">
<if test="conditionParamRef.ruleCode != null and conditionParamRef.ruleCode != ''">
${_conditionType_} a.ruleCode like #{${_conditionParam_}.ruleCode}
</if>
<if test="conditionParamRef.ruleCode == null">
${_conditionType_} a.ruleCode is null
</if>
</if>
<if test="conditionParamRef.containsKey('ruleCodeList') and conditionParamRef.ruleCodeList.size() > 0">
${_conditionType_} a.ruleCode in
<foreach collection="conditionParamRef.ruleCodeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleCodeNotList') and conditionParamRef.ruleCodeNotList.size() > 0">
${_conditionType_} a.ruleCode not in
<foreach collection="conditionParamRef.ruleCodeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -875,6 +910,11 @@ ...@@ -875,6 +910,11 @@
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if> <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('ruleCode')">
a.ruleCode
<if test='orderCol.ruleCode != null and "DESC".equalsIgnoreCase(orderCol.ruleCode)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
......
...@@ -381,3 +381,6 @@ ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `categoryId` bigint(20) ...@@ -381,3 +381,6 @@ ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `categoryId` bigint(20)
ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `categoryName` varchar(128) COMMENT '规则名称' AFTER categoryId; ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `categoryName` varchar(128) COMMENT '规则名称' AFTER categoryId;
ALTER TABLE mortals_xhx_perform_rules ADD COLUMN `ruleCode` varchar(64) COMMENT '规则编码,唯一,默认规则类型内容简称拼音首字母。'AFTER id;
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