<?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.eutr.mapper.BisEutrEqAnswMapper">
    <resultMap type="com.goldenwater.slaj.eutr.domain.BisEutrEqAnsw" id="BisEutrEqAnswResult">
        <result property="guid" column="guid"/>
        <result property="eqGuid" column="eq_guid"/>
        <result property="answA" column="answ_a"/>
        <result property="answC" column="answ_c"/>
        <result property="answB" column="answ_b"/>
        <result property="answD" column="answ_d"/>
        <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="selectBisEutrEqAnswVo">
        select guid, eq_guid, answ_a, answ_c, answ_b, answ_d,
               note, coll_time, upd_time, rec_pers
        from bis_eutr_eq_answ
    </sql>
    <select id="selectBisEutrEqAnswByGuid" parameterType="String" resultMap="BisEutrEqAnswResult">
        <include refid="selectBisEutrEqAnswVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisEutrEqAnswList" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrEqAnsw" resultMap="BisEutrEqAnswResult">
        <include refid="selectBisEutrEqAnswVo"/>
        <where>
            <if test="eqGuid != null and eqGuid != ''">AND eq_guid = #{eqGuid}</if>
        </where>
    </select>
    <insert id="insertBisEutrEqAnsw" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrEqAnsw">
        insert into bis_eutr_eq_answ (
            guid, eq_guid, answ_a, answ_c, answ_b, answ_d,
            note, coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{eqGuid}, #{answA}, #{answC}, #{answB}, #{answD},
            #{note}, #{collTime}, #{updTime}, #{recPers}
        )
    </insert>
    <update id="updateBisEutrEqAnsw" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrEqAnsw">
        update bis_eutr_eq_answ
        <set>
            <if test="eqGuid != null">eq_guid = #{eqGuid},</if>
            <if test="answA != null">answ_a = #{answA},</if>
            <if test="answC != null">answ_c = #{answC},</if>
            <if test="answB != null">answ_b = #{answB},</if>
            <if test="answD != null">answ_d = #{answD},</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="deleteBisEutrEqAnswByGuid" parameterType="String">
        delete from bis_eutr_eq_answ where guid = #{guid}
    </delete>
    <delete id="deleteBisEutrEqAnswByGuids" parameterType="String">
        delete from bis_eutr_eq_answ where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
