ReplyApprovalProcessMapper.xml 4.29 KB
<?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.trash.casefile.mapper.ReplyApprovalProcessMapper">
    
    <resultMap type="ReplyApprovalProcess" id="ReplyApprovalProcessResult">
        <result property="id"    column="id"    />
        <result property="tableName"    column="table_name"    />
        <result property="tableId"    column="table_id"    />
        <result property="instanceId"    column="instance_id"    />
        <result property="reply"    column="reply"    />
        <result property="replyTime"    column="reply_time"    />
        <result property="replyImg"    column="reply_img"    />
        <result property="replyPeople"    column="reply_people"    />
    </resultMap>

    <sql id="selectReplyApprovalProcessVo">
        select id, table_name, table_id, instance_id, reply, reply_time, reply_img, reply_people from reply_approval_process
    </sql>

    <select id="selectReplyApprovalProcessList" parameterType="ReplyApprovalProcess" resultMap="ReplyApprovalProcessResult">
        <include refid="selectReplyApprovalProcessVo"/>
        <where>  
            <if test="tableName != null  and tableName != ''"> and table_name = #{tableName}</if>
            <if test="tableId != null  and tableId != ''"> and table_id = #{tableId}</if>
            <if test="instanceId != null  and instanceId != ''"> and instance_id = #{instanceId}</if>
            <if test="reply != null  and reply != ''"> and reply = #{reply}</if>
            <if test="replyTime != null "> and reply_time = #{replyTime}</if>
            <if test="replyImg != null  and replyImg != ''"> and reply_img = #{replyImg}</if>
            <if test="replyPeople != null  and replyPeople != ''"> and reply_people = #{replyPeople}</if>
        </where>
    </select>
    
    <select id="selectReplyApprovalProcessById" parameterType="Long" resultMap="ReplyApprovalProcessResult">
        <include refid="selectReplyApprovalProcessVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertReplyApprovalProcess" parameterType="ReplyApprovalProcess" useGeneratedKeys="true" keyProperty="id">
        insert into reply_approval_process
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="tableName != null">table_name,</if>
            <if test="tableId != null">table_id,</if>
            <if test="instanceId != null">instance_id,</if>
            <if test="reply != null">reply,</if>
            <if test="replyTime != null">reply_time,</if>
            <if test="replyImg != null">reply_img,</if>
            <if test="replyPeople != null">reply_people,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="tableName != null">#{tableName},</if>
            <if test="tableId != null">#{tableId},</if>
            <if test="instanceId != null">#{instanceId},</if>
            <if test="reply != null">#{reply},</if>
            <if test="replyTime != null">#{replyTime},</if>
            <if test="replyImg != null">#{replyImg},</if>
            <if test="replyPeople != null">#{replyPeople},</if>
         </trim>
    </insert>

    <update id="updateReplyApprovalProcess" parameterType="ReplyApprovalProcess">
        update reply_approval_process
        <trim prefix="SET" suffixOverrides=",">
            <if test="tableName != null">table_name = #{tableName},</if>
            <if test="tableId != null">table_id = #{tableId},</if>
            <if test="instanceId != null">instance_id = #{instanceId},</if>
            <if test="reply != null">reply = #{reply},</if>
            <if test="replyTime != null">reply_time = #{replyTime},</if>
            <if test="replyImg != null">reply_img = #{replyImg},</if>
            <if test="replyPeople != null">reply_people = #{replyPeople},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteReplyApprovalProcessById" parameterType="Long">
        delete from reply_approval_process where id = #{id}
    </delete>

    <delete id="deleteReplyApprovalProcessByIds" parameterType="String">
        delete from reply_approval_process where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>