<?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.ruoyi.model.mapper.ExamineConfigMapper">
    
    <resultMap type="ExamineConfig" id="ExamineConfigResult">
        <result property="id"    column="id"    />
        <result property="requireExamine"    column="require_examine"    />
        <result property="authenticityTips"    column="authenticity_tips"    />
        <result property="prompt"    column="prompt"    />
    </resultMap>

    <sql id="selectExamineConfigVo">
        select id, require_examine, authenticity_tips, prompt from examine_config
    </sql>

    <select id="selectExamineConfigList" parameterType="ExamineConfig" resultMap="ExamineConfigResult">
        <include refid="selectExamineConfigVo"/>
        <where>  
            <if test="requireExamine != null  and requireExamine != ''"> and require_examine = #{requireExamine}</if>
            <if test="authenticityTips != null  and authenticityTips != ''"> and authenticity_tips = #{authenticityTips}</if>
            <if test="prompt != null  and prompt != ''"> and prompt = #{prompt}</if>
        </where>
    </select>
    
    <select id="selectExamineConfigById" parameterType="Long" resultMap="ExamineConfigResult">
        <include refid="selectExamineConfigVo"/>
        where id = #{id}
    </select>
    <select id="getExamineConfigList" resultType="com.ruoyi.model.domain.ExamineConfig">
        <include refid="selectExamineConfigVo"/>
    </select>

    <insert id="insertExamineConfig" parameterType="ExamineConfig">
        insert into examine_config
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="requireExamine != null">require_examine,</if>
            <if test="authenticityTips != null">authenticity_tips,</if>
            <if test="prompt != null">prompt,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="requireExamine != null">#{requireExamine},</if>
            <if test="authenticityTips != null">#{authenticityTips},</if>
            <if test="prompt != null">#{prompt},</if>
         </trim>
    </insert>

    <update id="updateExamineConfig" parameterType="ExamineConfig">
        update examine_config
        <trim prefix="SET" suffixOverrides=",">
            <if test="requireExamine != null">require_examine = #{requireExamine},</if>
            <if test="authenticityTips != null">authenticity_tips = #{authenticityTips},</if>
            <if test="prompt != null">prompt = #{prompt},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteExamineConfigById" parameterType="Long">
        delete from examine_config where id = #{id}
    </delete>

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