wl_management/src/main/resources/mapper/flow/EvaluationStartStaffMapper.xml
2020-10-22 09:51:51 +08:00

107 lines
4.2 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.lz.modules.flow.dao.EvaluationStartStaffMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.lz.modules.flow.entity.EvaluationStartStaff">
<id column="id" property="id"/>
<result column="is_delete" property="isDelete"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="evaluation_id" property="evaluationId"/>
<result column="start_id" property="startId"/>
<result column="staff_id" property="staffId"/>
<result column="type" property="type"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, evaluation_id AS evaluationId, start_id AS startId, staff_id AS staffId, type AS type
</sql>
<select id="selectEvaluationStartStaffById" resultType="EvaluationStartStaff" >
select * from lz_evaluation_start_staff where id=#{id} and is_delete = 0 limit 1
</select>
<insert id="insertEvaluationStartStaff" parameterType="EvaluationStartStaff" useGeneratedKeys="true" keyProperty="id" >
insert into lz_evaluation_start_staff(
<if test="evaluationId != null">evaluation_id, </if>
<if test="startId != null">start_id, </if>
<if test="staffId != null">staff_id, </if>
<if test="type != null">type, </if>
is_delete,
gmt_create,
gmt_modified
)values(
<if test="evaluationId != null">#{ evaluationId}, </if>
<if test="startId != null">#{ startId}, </if>
<if test="staffId != null">#{ staffId}, </if>
<if test="type != null">#{ type}, </if>
0,
now(),
now()
)
</insert>
<update id="updateEvaluationStartStaffById" parameterType="EvaluationStartStaff" >
update
lz_evaluation_start_staff
<trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="evaluationId != null">evaluation_id = #{evaluationId},</if>
<if test="startId != null">start_id = #{startId},</if>
<if test="staffId != null">staff_id = #{staffId},</if>
<if test="type != null">type = #{type}</if>
</trim>
,gmt_modified = now()
where id = #{id}
</update>
<update id="updateCoverEvaluationStartStaffById" parameterType="EvaluationStartStaff" >
update
lz_evaluation_start_staff
set
is_delete = #{isDelete},
gmt_create = #{gmtCreate},
evaluation_id = #{evaluationId},
start_id = #{startId},
staff_id = #{staffId},
type = #{type}
,gmt_modified = now()
where id = #{id}
</update>
<update id="deleteEvaluationStartStaffById" parameterType="java.lang.Long">
update lz_evaluation_start_staff set is_delete = 1 where id=#{id} limit 1
</update>
<insert id="insertEvaluationStartStaffs" parameterType="EvaluationStartStaff" useGeneratedKeys="true" keyProperty="id" >
<foreach collection="list" item="item" separator=";">
insert into lz_evaluation_start_staff(
<if test="item.evaluationId != null">evaluation_id, </if>
<if test="item.startId != null">start_id, </if>
<if test="item.staffId != null">staff_id, </if>
<if test="item.type != null">type, </if>
is_delete
)values(
<if test="item.evaluationId != null">#{ item.evaluationId}, </if>
<if test="item.startId != null">#{ item.startId}, </if>
<if test="item.staffId != null">#{ item.staffId}, </if>
<if test="item.type != null">#{ item.type}, </if>
0
)
</foreach>
</insert>
</mapper>