职等职级接口 表结构SQL更新
parent
97ac4e5cdf
commit
7bd87d4707
@ -0,0 +1,15 @@
|
|||||||
|
package com.api.organization.web;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @description: TODO
|
||||||
|
* @author:dxfeng
|
||||||
|
* @createTime: 2022/05/10
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Path("/bs/hrmorganization/level")
|
||||||
|
public class LevelController extends com.engine.organization.web.LevelController {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,82 @@
|
|||||||
|
package com.engine.organization.entity.scheme.dto;
|
||||||
|
|
||||||
|
import com.engine.organization.entity.scheme.param.LevelSearchParam;
|
||||||
|
import com.engine.organization.entity.scheme.po.LevelPO;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author dxfeng
|
||||||
|
* @Description: TODO
|
||||||
|
* @Date 2022/5/9
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LevelDTO {
|
||||||
|
/**
|
||||||
|
* 自增主键
|
||||||
|
*/
|
||||||
|
private long id;
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private String levelNo;
|
||||||
|
/**
|
||||||
|
* 方案名称
|
||||||
|
*/
|
||||||
|
private String levelName;
|
||||||
|
/**
|
||||||
|
* 方案说明
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 等级方案
|
||||||
|
*/
|
||||||
|
private Long schemeId;
|
||||||
|
/**
|
||||||
|
* 禁用标记
|
||||||
|
*/
|
||||||
|
private int forbiddenTag;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long creator;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private int deleteType;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
public static LevelPO convertParamToPO(LevelSearchParam param, Long employeeId) {
|
||||||
|
if (param == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return LevelPO.builder()
|
||||||
|
.id(param.getId() == null ? 0 : param.getId())
|
||||||
|
.levelNo(param.getLevelNo() == null ? null : param.getLevelNo())
|
||||||
|
.levelName(param.getLevelName() == null ? null : param.getLevelName())
|
||||||
|
.description(param.getDescription() == null ? null : param.getDescription())
|
||||||
|
.schemeId(param.getSchemeId() == null ? 0 : param.getSchemeId())
|
||||||
|
.forbiddenTag(param.getForbiddenTag() == null ? 0 : param.getForbiddenTag() ? 0 : 1)
|
||||||
|
.deleteType(0)
|
||||||
|
.createTime(new Date())
|
||||||
|
.updateTime(new Date())
|
||||||
|
.creator(employeeId)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.engine.organization.entity.scheme.param;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author dxfeng
|
||||||
|
* @Description: TODO
|
||||||
|
* @Date 2022/5/9
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LevelSearchParam {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private String levelNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String levelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方案说明
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 等级方案
|
||||||
|
*/
|
||||||
|
private Long schemeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 禁用标记
|
||||||
|
*/
|
||||||
|
private Boolean forbiddenTag;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
<?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.engine.organization.mapper.scheme.LevelMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.engine.organization.entity.scheme.po.LevelPO">
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="level_no" property="levelNo"/>
|
||||||
|
<result column="level_name" property="levelName"/>
|
||||||
|
<result column="description" property="description"/>
|
||||||
|
<result column="scheme_id" property="schemeId"/>
|
||||||
|
<result column="forbidden_tag" property="forbiddenTag"/>
|
||||||
|
<result column="creator" property="creator"/>
|
||||||
|
<result column="creator" property="deleteType"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 表字段 -->
|
||||||
|
<sql id="baseColumns">
|
||||||
|
t
|
||||||
|
.
|
||||||
|
id
|
||||||
|
, t.level_no
|
||||||
|
, t.level_name
|
||||||
|
, t.description
|
||||||
|
, t.scheme_id
|
||||||
|
, t.forbidden_tag
|
||||||
|
, t.creator
|
||||||
|
, t.delete_type
|
||||||
|
, t.create_time
|
||||||
|
, t.update_time
|
||||||
|
</sql>
|
||||||
|
<select id="getLevelByID" parameterType="com.engine.organization.entity.scheme.po.LevelPO"
|
||||||
|
resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
from jcl_org_level t where id = #{id} AND delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="listByNo" parameterType="com.engine.organization.entity.scheme.po.LevelPO" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
from jcl_org_level t where level_no = #{levelNo} AND delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateLevel" parameterType="com.engine.organization.entity.scheme.po.LevelPO">
|
||||||
|
update jcl_org_level
|
||||||
|
<set>
|
||||||
|
creator=#{creator},
|
||||||
|
update_time=#{updateTime},
|
||||||
|
level_no=#{levelNo},
|
||||||
|
level_name=#{levelName},
|
||||||
|
description=#{description},
|
||||||
|
scheme_id=#{schemeId},
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.scheme.po.LevelPO" keyProperty="id"
|
||||||
|
keyColumn="id" useGeneratedKeys="true">
|
||||||
|
INSERT INTO jcl_org_level
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="creator != null">
|
||||||
|
creator,
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
delete_type,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
<if test="levelNo != null ">
|
||||||
|
level_no,
|
||||||
|
</if>
|
||||||
|
<if test="levelName != null ">
|
||||||
|
level_name,
|
||||||
|
</if>
|
||||||
|
<if test="description != null ">
|
||||||
|
description,
|
||||||
|
</if>
|
||||||
|
<if test="schemeId != null ">
|
||||||
|
scheme_id,
|
||||||
|
</if>
|
||||||
|
forbidden_tag,
|
||||||
|
</trim>
|
||||||
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="creator != null">
|
||||||
|
#{creator},
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
#{deleteType},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
<if test="levelNo != null ">
|
||||||
|
#{levelNo},
|
||||||
|
</if>
|
||||||
|
<if test="levelName != null ">
|
||||||
|
#{levelName},
|
||||||
|
</if>
|
||||||
|
<if test="description != null ">
|
||||||
|
#{description},
|
||||||
|
</if>
|
||||||
|
<if test="schemeId != null ">
|
||||||
|
#{schemeId},
|
||||||
|
</if>
|
||||||
|
0,
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.scheme.po.LevelPO">
|
||||||
|
update jcl_org_level
|
||||||
|
<set>
|
||||||
|
forbidden_tag=#{forbiddenTag},
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteByIds">
|
||||||
|
UPDATE jcl_org_level
|
||||||
|
SET delete_type = 1
|
||||||
|
WHERE delete_type = 0
|
||||||
|
AND id IN
|
||||||
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue