<?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.BisFromFirsttriaMapper">
    <resultMap type="com.goldenwater.slaj.stan.domain.BisFromFirsttria" id="BisFromFirsttriaResult">
        <result property="guid" column="guid"/>
        <result property="fromFirsttriaCode" column="from_firsttria_code"/>
        <result property="applGuid" column="appl_guid"/>
        <result property="veriOpin" column="veri_opin"/>
        <result property="veriResu" column="veri_resu"/>
        <result property="veriPers" column="veri_pers"/>
        <result property="veriDate" column="veri_date"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
    </resultMap>

    <sql id="selectBisFromFirsttriaVo">
        select guid, from_firsttria_code, appl_guid, veri_opin, veri_resu,
               veri_pers, veri_date, note, coll_time, upd_time, rec_pers
        from bis_from_firsttria
    </sql>

    <select id="selectBisFromFirsttriaByGuid" parameterType="String" resultMap="BisFromFirsttriaResult">
        <include refid="selectBisFromFirsttriaVo"/> where guid = #{guid}
    </select>

    <select id="selectBisFromFirsttriaList" parameterType="com.goldenwater.slaj.stan.domain.BisFromFirsttria" resultMap="BisFromFirsttriaResult">
        <include refid="selectBisFromFirsttriaVo"/>
        <where>
            <if test="fromFirsttriaCode != null and fromFirsttriaCode != ''">and from_firsttria_code = #{fromFirsttriaCode}</if>
            <if test="veriResu != null and veriResu != ''">and veri_resu = #{veriResu}</if>
            <if test="applGuid != null and applGuid != ''">and appl_guid = #{applGuid}</if>
        </where>
    </select>

    <insert id="insertBisFromFirsttria" parameterType="com.goldenwater.slaj.stan.domain.BisFromFirsttria">
        insert into bis_from_firsttria (
            guid, from_firsttria_code, appl_guid, veri_opin, veri_resu,
            veri_pers, veri_date, note, coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{fromFirsttriaCode}, #{applGuid}, #{veriOpin}, #{veriResu},
            #{veriPers}, #{veriDate}, #{note}, #{collTime}, #{updTime}, #{recPers}
        )
    </insert>

    <update id="updateBisFromFirsttria" parameterType="com.goldenwater.slaj.stan.domain.BisFromFirsttria">
        update bis_from_firsttria
        <set>
            <if test="fromFirsttriaCode != null">from_firsttria_code = #{fromFirsttriaCode},</if>
            <if test="applGuid != null">appl_guid = #{applGuid},</if>
            <if test="veriOpin != null">veri_opin = #{veriOpin},</if>
            <if test="veriResu != null">veri_resu = #{veriResu},</if>
            <if test="veriPers != null">veri_pers = #{veriPers},</if>
            <if test="veriDate != null">veri_date = #{veriDate},</if>
            <if test="note != null">note = #{note},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
        </set>
        where guid = #{guid}
    </update>

    <delete id="deleteBisFromFirsttriaByGuid" parameterType="String">
        delete from bis_from_firsttria where guid = #{guid}
    </delete>

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