137 lines
4.3 KiB
XML
137 lines
4.3 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="tech.unissense.pms.business.examine.remark.mapper.ExamineRemarkMapper">
|
|
|
|
<resultMap type="tech.unissense.pms.business.examine.remark.domain.ExamineRemark" id="ExamineRemarkMap">
|
|
<result property="id" column="id"/>
|
|
<result property="taskId" column="task_id"/>
|
|
<result property="userId" column="user_id"/>
|
|
<result property="reviewCategory" column="review_category"/>
|
|
<result property="remark" column="remark"/>
|
|
</resultMap>
|
|
|
|
<!-- 基本字段 -->
|
|
<sql id="Base_Column_List">
|
|
id, task_id, user_id, review_category, remark
|
|
</sql>
|
|
|
|
<!--通过实体作为筛选条件查询-->
|
|
<select id="queryAll" resultMap="ExamineRemarkMap">
|
|
select
|
|
<include refid="Base_Column_List"/>
|
|
from pms_examine_remark
|
|
<where>
|
|
<if test="id != null">
|
|
and id = #{id}
|
|
</if>
|
|
<if test="taskId != null">
|
|
and task_id = #{taskId}
|
|
</if>
|
|
<if test="userId != null">
|
|
and user_id = #{userId}
|
|
</if>
|
|
<if test="reviewCategory != null and reviewCategory != ''">
|
|
and review_category = #{reviewCategory}
|
|
</if>
|
|
<if test="remark != null and remark != ''">
|
|
and remark = #{remark}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
<!--根据ID查详情-->
|
|
<select id="queryById" parameterType="Integer" resultMap="ExamineRemarkMap">
|
|
SELECT id,
|
|
task_id,
|
|
user_id,
|
|
review_category,
|
|
remark
|
|
FROM pms_examine_remark
|
|
WHERE id = #{id}
|
|
LIMIT 1
|
|
</select>
|
|
|
|
|
|
<!--新增所有列-->
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
INSERT INTO pms_examine_remark
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="taskId != null">
|
|
task_id,
|
|
</if>
|
|
<if test="userId != null">
|
|
user_id,
|
|
</if>
|
|
<if test="reviewCategory != null and reviewCategory != ''">
|
|
review_category,
|
|
</if>
|
|
<if test="remark != null and remark != ''">
|
|
remark,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="taskId != null">
|
|
#{taskId},
|
|
</if>
|
|
<if test="userId != null">
|
|
#{userId},
|
|
</if>
|
|
<if test="reviewCategory != null and reviewCategory != ''">
|
|
#{reviewCategory},
|
|
</if>
|
|
<if test="remark != null and remark != ''">
|
|
#{remark},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<insert id="insertOrUpdateBatch">
|
|
insert into pms_examine_remark(task_id,user_id,review_category,remark)
|
|
values
|
|
<foreach collection="list" item="entity" separator=",">
|
|
(#{entity.taskId}, #{entity.userId}, #{entity.reviewCategory}, #{entity.remark})
|
|
</foreach>
|
|
on duplicate key update
|
|
remark = values(remark)
|
|
</insert>
|
|
|
|
<!--通过主键修改数据-->
|
|
<update id="update">
|
|
UPDATE pms_examine_remark
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="taskId != null">
|
|
task_id = #{taskId},
|
|
</if>
|
|
<if test="userId != null">
|
|
user_id = #{userId},
|
|
</if>
|
|
<if test="reviewCategory != null and reviewCategory != ''">
|
|
review_category = #{reviewCategory},
|
|
</if>
|
|
<if test="remark != null and remark != ''">
|
|
remark = #{remark},
|
|
</if>
|
|
</trim>
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
<!--通过主键删除-->
|
|
<delete id="deleteById">
|
|
DELETE
|
|
FROM pms_examine_remark
|
|
WHERE id = #{id}
|
|
</delete>
|
|
|
|
<!--通过id批量删除-->
|
|
<delete id="batchRemove">
|
|
delete from pms_examine_remark where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper>
|
|
|
|
|
|
|