<?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.BisStanSelfEvaRepMapper">
    <resultMap type="com.goldenwater.slaj.stan.domain.BisStanSelfEvaRep" id="BisStanSelfEvaRepResult">
        <result property="guid" column="guid"/>
        <result property="elfEvaScor" column="elf_eva_scor"/>
        <result property="year" column="year"/>
        <result property="repWiunCode" column="rep_wiun_code"/>
        <result property="stanGrad" column="stan_grad"/>
        <result property="repTime" column="rep_time"/>
        <result property="reviOpin" column="revi_opin"/>
        <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="selectBisStanSelfEvaRepVo">
        select guid, elf_eva_scor, year, rep_wiun_code, stan_grad, rep_time,
               revi_opin, note, coll_time, upd_time, rec_pers
        from bis_stan_self_eva_rep
    </sql>

    <select id="selectBisStanSelfEvaRepByGuid" parameterType="String" resultMap="BisStanSelfEvaRepResult">
        <include refid="selectBisStanSelfEvaRepVo"/> where guid = #{guid}
    </select>

    <select id="selectBisStanSelfEvaRepList" parameterType="com.goldenwater.slaj.stan.domain.BisStanSelfEvaRep" resultMap="BisStanSelfEvaRepResult">
        <include refid="selectBisStanSelfEvaRepVo"/>
        <where>
            <if test="repWiunCode != null and repWiunCode != ''">and rep_wiun_code = #{repWiunCode}</if>
            <if test="stanGrad != null and stanGrad != ''">and stan_grad = #{stanGrad}</if>
            <if test="year != null and year != ''">and year = #{year}</if>
        </where>
    </select>

    <insert id="insertBisStanSelfEvaRep" parameterType="com.goldenwater.slaj.stan.domain.BisStanSelfEvaRep">
        insert into bis_stan_self_eva_rep (
            guid, elf_eva_scor, year, rep_wiun_code, stan_grad, rep_time,
            revi_opin, note, coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{elfEvaScor}, #{year}, #{repWiunCode}, #{stanGrad}, #{repTime},
            #{reviOpin}, #{note}, #{collTime}, #{updTime}, #{recPers}
        )
    </insert>

    <update id="updateBisStanSelfEvaRep" parameterType="com.goldenwater.slaj.stan.domain.BisStanSelfEvaRep">
        update bis_stan_self_eva_rep
        <set>
            <if test="elfEvaScor != null">elf_eva_scor = #{elfEvaScor},</if>
            <if test="year != null">year = #{year},</if>
            <if test="repWiunCode != null">rep_wiun_code = #{repWiunCode},</if>
            <if test="stanGrad != null">stan_grad = #{stanGrad},</if>
            <if test="repTime != null">rep_time = #{repTime},</if>
            <if test="reviOpin != null">revi_opin = #{reviOpin},</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="deleteBisStanSelfEvaRepByGuid" parameterType="String">
        delete from bis_stan_self_eva_rep where guid = #{guid}
    </delete>

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