89 lines
3.1 KiB
XML
89 lines
3.1 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.third.dao.TaskRespMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="BaseResultMap" type="com.lz.modules.third.entity.TaskResp">
|
|
<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="index" property="index"/>
|
|
<result column="user_id" property="userId"/>
|
|
<result column="result_id" property="resultId"/>
|
|
<result column="content" property="content"/>
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, index AS index, user_id AS userId, result_id AS resultId, content AS content
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectTaskRespById" resultType="TaskResp" >
|
|
select * from lz_task_resp where id=#{id} and is_delete = 0 limit 1
|
|
</select>
|
|
|
|
|
|
<insert id="insertTaskResp" parameterType="TaskResp" useGeneratedKeys="true" keyProperty="id" >
|
|
insert into lz_task_resp(
|
|
<if test="index != null">index, </if>
|
|
<if test="userId != null">user_id, </if>
|
|
<if test="resultId != null">result_id, </if>
|
|
<if test="content != null">content, </if>
|
|
is_delete,
|
|
gmt_create,
|
|
gmt_modified
|
|
)values(
|
|
<if test="index != null">#{ index}, </if>
|
|
<if test="userId != null">#{ userId}, </if>
|
|
<if test="resultId != null">#{ resultId}, </if>
|
|
<if test="content != null">#{ content}, </if>
|
|
0,
|
|
now(),
|
|
now()
|
|
)
|
|
</insert>
|
|
|
|
|
|
<update id="updateTaskRespById" parameterType="TaskResp" >
|
|
update
|
|
lz_task_resp
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
|
<if test="index != null">index = #{index},</if>
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
<if test="resultId != null">result_id = #{resultId},</if>
|
|
<if test="content != null">content = #{content}</if>
|
|
</trim>
|
|
,gmt_modified = now()
|
|
where id = #{id}
|
|
</update>
|
|
|
|
|
|
<update id="updateCoverTaskRespById" parameterType="TaskResp" >
|
|
update
|
|
lz_task_resp
|
|
set
|
|
is_delete = #{isDelete},
|
|
gmt_create = #{gmtCreate},
|
|
index = #{index},
|
|
user_id = #{userId},
|
|
result_id = #{resultId},
|
|
content = #{content}
|
|
,gmt_modified = now()
|
|
where id = #{id}
|
|
</update>
|
|
|
|
|
|
<update id="deleteTaskRespById" parameterType="java.lang.Long">
|
|
update lz_task_resp set is_delete = 1 where id=#{id} limit 1
|
|
</update>
|
|
|
|
</mapper>
|
|
|