<?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.BisEutrTqueOptMapper">
    <resultMap type="com.goldenwater.slaj.eutr.domain.BisEutrTqueOpt" id="BisEutrTqueOptResult">
        <result property="guid" column="guid"/>
        <result property="eqGuid" column="eq_guid"/>
        <result property="optLabel" column="opt_label"/>
        <result property="optCont" column="opt_cont"/>
        <result property="isCorr" column="is_corr"/>
        <result property="optSort" column="opt_sort"/>
        <result property="note" column="note"/>
    </resultMap>
    <sql id="selectBisEutrTqueOptVo">
        select guid, eq_guid, opt_label, opt_cont, is_corr, opt_sort, note
        from bis_eutr_tque_opt
    </sql>
    <select id="selectBisEutrTqueOptByGuid" parameterType="String" resultMap="BisEutrTqueOptResult">
        <include refid="selectBisEutrTqueOptVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisEutrTqueOptList" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrTqueOpt" resultMap="BisEutrTqueOptResult">
        <include refid="selectBisEutrTqueOptVo"/>
        <where>
            <if test="eqGuid != null and eqGuid != ''">AND eq_guid = #{eqGuid}</if>
        </where>
        order by opt_sort
    </select>
    <insert id="insertBisEutrTqueOpt" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrTqueOpt">
        insert into bis_eutr_tque_opt (
            guid, eq_guid, opt_label, opt_cont, is_corr, opt_sort, note
        ) values (
            #{guid}, #{eqGuid}, #{optLabel}, #{optCont}, #{isCorr}, #{optSort}, #{note}
        )
    </insert>
    <update id="updateBisEutrTqueOpt" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrTqueOpt">
        update bis_eutr_tque_opt
        <set>
            <if test="eqGuid != null">eq_guid = #{eqGuid},</if>
            <if test="optLabel != null">opt_label = #{optLabel},</if>
            <if test="optCont != null">opt_cont = #{optCont},</if>
            <if test="isCorr != null">is_corr = #{isCorr},</if>
            <if test="optSort != null">opt_sort = #{optSort},</if>
            <if test="note != null">note = #{note},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBisEutrTqueOptByGuid" parameterType="String">
        delete from bis_eutr_tque_opt where guid = #{guid}
    </delete>
    <delete id="deleteBisEutrTqueOptByGuids" parameterType="String">
        delete from bis_eutr_tque_opt where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
