You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
weaver-hrm-organization/src/com/engine/organization/mapper/scheme/GradeMapper.xml

167 lines
5.6 KiB
XML

<?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.GradeMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.scheme.po.GradePO">
<result column="id" property="id"/>
<result column="grade_no" property="gradeNo"/>
<result column="grade_name" property="gradeName"/>
<result column="description" property="description"/>
<result column="scheme_id" property="schemeId"/>
<result column="level_id" property="levelId"/>
<result column="forbidden_tag" property="forbiddenTag"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
id
, t.grade_no
, t.grade_name
, t.description
, t.scheme_id
, t.level_id
, t.forbidden_tag
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<select id="getGradeByID" parameterType="com.engine.organization.entity.scheme.po.GradePO"
resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_grade t where id = #{id} AND delete_type = 0
</select>
<select id="listByNo" parameterType="com.engine.organization.entity.scheme.po.GradePO" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_grade t where grade_no = #{gradeNo} AND delete_type = 0
</select>
<select id="getCountByTag" resultType="java.lang.Integer">
3 years ago
select count(1) from jcl_org_grade where 1=1 AND delete_type = 0
<if test=" tag != -1 ">
and forbidden_tag = #{tag}
</if>
</select>
<select id="listGradesBySchemeId" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_grade t where delete_type = 0 and scheme_id = #{schemeId}
</select>
<select id="listUsedId" resultType="java.lang.String">
select grade_id
from JCL_ORG_JOBDT
where delete_type = 0
</select>
<select id="getGradeNameByIds" resultType="java.lang.String">
select grade_name from jcl_org_grade where delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<update id="updateGrade" parameterType="com.engine.organization.entity.scheme.po.GradePO">
update jcl_org_grade
<set>
creator=#{creator},
update_time=#{updateTime},
grade_no=#{gradeNo},
grade_name=#{gradeName},
description=#{description},
scheme_id=#{schemeId},
level_id=#{levelId},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.scheme.po.GradePO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_grade
<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="gradeNo != null ">
grade_no,
</if>
<if test="gradeName != null ">
grade_name,
</if>
<if test="description != null ">
description,
</if>
<if test="schemeId != null ">
scheme_id,
</if>
<if test="levelId != null ">
level_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="gradeNo != null ">
#{gradeNo},
</if>
<if test="gradeName != null ">
#{gradeName},
</if>
<if test="description != null ">
#{description},
</if>
<if test="schemeId != null ">
#{schemeId},
</if>
<if test="levelId != null ">
#{levelId},
</if>
0,
</trim>
</insert>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.scheme.po.GradePO">
update jcl_org_grade
<set>
forbidden_tag=#{forbiddenTag},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<update id="deleteByIds">
UPDATE jcl_org_grade
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>