<?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.goldenwater.slaj.stan.mapper.BisScenReviMapper">
    <resultMap type="com.goldenwater.slaj.stan.domain.BisScenRevi" id="BisScenReviResult">
        <result property="guid" column="guid"/>
        <result property="scenReviCode" column="scen_revi_code"/>
        <result property="applGuid" column="appl_guid"/>
        <result property="scenReviOpin" column="scen_revi_opin"/>
        <result property="veriOpin" column="veri_opin"/>
        <result property="apprOpin" column="appr_opin"/>
        <result property="apprStat" column="appr_stat"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
        <result property="veriStat" column="veri_stat"/>
    </resultMap>

    <sql id="selectBisScenReviVo">
        select guid, scen_revi_code, appl_guid, scen_revi_opin, veri_opin,
               appr_opin, appr_stat, note, coll_time, upd_time, rec_pers, veri_stat
        from bis_scen_revi
    </sql>

    <select id="selectBisScenReviByGuid" parameterType="String" resultMap="BisScenReviResult">
        <include refid="selectBisScenReviVo"/> where guid = #{guid}
    </select>

    <select id="selectBisScenReviList" parameterType="com.goldenwater.slaj.stan.domain.BisScenRevi" resultMap="BisScenReviResult">
        <include refid="selectBisScenReviVo"/>
        <where>
            <if test="scenReviCode != null and scenReviCode != ''">and scen_revi_code = #{scenReviCode}</if>
            <if test="apprStat != null and apprStat != ''">and appr_stat = #{apprStat}</if>
            <if test="veriStat != null and veriStat != ''">and veri_stat = #{veriStat}</if>
        </where>
    </select>

    <insert id="insertBisScenRevi" parameterType="com.goldenwater.slaj.stan.domain.BisScenRevi">
        insert into bis_scen_revi (
            guid, scen_revi_code, appl_guid, scen_revi_opin, veri_opin,
            appr_opin, appr_stat, note, coll_time, upd_time, rec_pers, veri_stat
        ) values (
            #{guid}, #{scenReviCode}, #{applGuid}, #{scenReviOpin}, #{veriOpin},
            #{apprOpin}, #{apprStat}, #{note}, #{collTime}, #{updTime}, #{recPers}, #{veriStat}
        )
    </insert>

    <update id="updateBisScenRevi" parameterType="com.goldenwater.slaj.stan.domain.BisScenRevi">
        update bis_scen_revi
        <set>
            <if test="scenReviCode != null">scen_revi_code = #{scenReviCode},</if>
            <if test="applGuid != null">appl_guid = #{applGuid},</if>
            <if test="scenReviOpin != null">scen_revi_opin = #{scenReviOpin},</if>
            <if test="veriOpin != null">veri_opin = #{veriOpin},</if>
            <if test="apprOpin != null">appr_opin = #{apprOpin},</if>
            <if test="apprStat != null">appr_stat = #{apprStat},</if>
            <if test="note != null">note = #{note},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
            <if test="veriStat != null">veri_stat = #{veriStat},</if>
        </set>
        where guid = #{guid}
    </update>

    <delete id="deleteBisScenReviByGuid" parameterType="String">
        delete from bis_scen_revi where guid = #{guid}
    </delete>

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