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/staff/StaffPlanMapper.xml

174 lines
5.7 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.staff.StaffPlanMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.staff.po.StaffPlanPO">
<result column="id" property="id"/>
<result column="plan_no" property="planNo"/>
<result column="plan_name" property="planName"/>
<result column="plan_year" property="planYear"/>
<result column="time_start" property="timeStart"/>
<result column="time_end" property="timeEnd"/>
<result column="company_id" property="companyId"/>
<result column="description" property="description"/>
<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.plan_no
, t.plan_name
, t.plan_year
, t.time_start
, t.time_end
, t.company_id
, t.description
, t.forbidden_tag
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<select id="getStaffPlanByID" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO"
resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_staffplan t where id = #{id} AND delete_type = 0
</select>
<select id="listByNo" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO"
resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_staffplan t where plan_no = #{planNo} AND delete_type = 0
</select>
<select id="listPlansByIds" resultType="java.util.Map">
select
id,
plan_name as name
from jcl_org_staffplan t
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<update id="updateStaffPlan" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO">
update jcl_org_staffplan
<set>
creator=#{creator},
update_time=#{updateTime},
plan_no=#{planNo},
plan_name=#{planName},
plan_year=#{planYear},
time_start=#{timeStart},
time_end=#{timeEnd},
company_id=#{companyId},
description=#{description},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_staffplan
<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="planNo != null ">
plan_no,
</if>
<if test="planName != null ">
plan_name,
</if>
<if test="planYear != null ">
plan_year,
</if>
<if test="timeStart != null ">
time_start,
</if>
<if test="timeEnd != null ">
time_end,
</if>
<if test="companyId != null ">
company_id,
</if>
<if test="description != null ">
description,
</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="planNo != null ">
#{planNo},
</if>
<if test="planName != null ">
#{planName},
</if>
<if test="planYear != null ">
#{planYear},
</if>
<if test="timeStart != null ">
#{timeStart},
</if>
<if test="timeEnd != null ">
#{timeEnd},
</if>
<if test="companyId != null ">
#{companyId},
</if>
<if test="description != null ">
#{description},
</if>
0,
</trim>
</insert>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO">
update jcl_org_staffplan
<set>
forbidden_tag=#{forbiddenTag},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<update id="deleteByIds">
UPDATE jcl_org_staffplan
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>