<?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.BisEutrCourToEqMapper">
    <resultMap type="com.goldenwater.slaj.eutr.domain.BisEutrCourToEq" id="BisEutrCourToEqResult">
        <result property="guid" column="guid"/>
        <result property="courGuid" column="cour_guid"/>
        <result property="eqGuid" column="eq_guid"/>
        <result property="sort" column="sort"/>
        <result property="note" column="note"/>
    </resultMap>
    <sql id="selectBisEutrCourToEqVo">
        select guid, cour_guid, eq_guid, sort, note
        from bis_eutr_cour_to_eq
    </sql>
    <select id="selectBisEutrCourToEqByGuid" parameterType="String" resultMap="BisEutrCourToEqResult">
        <include refid="selectBisEutrCourToEqVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisEutrCourToEqList" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrCourToEq" resultMap="BisEutrCourToEqResult">
        <include refid="selectBisEutrCourToEqVo"/>
        <where>
            <if test="courGuid != null and courGuid != ''">AND cour_guid = #{courGuid}</if>
            <if test="eqGuid != null and eqGuid != ''">AND eq_guid = #{eqGuid}</if>
        </where>
        order by sort
    </select>
    <insert id="insertBisEutrCourToEq" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrCourToEq">
        insert into bis_eutr_cour_to_eq (
            guid, cour_guid, eq_guid, sort, note
        ) values (
            #{guid}, #{courGuid}, #{eqGuid}, #{sort}, #{note}
        )
    </insert>
    <update id="updateBisEutrCourToEq" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrCourToEq">
        update bis_eutr_cour_to_eq
        <set>
            <if test="courGuid != null">cour_guid = #{courGuid},</if>
            <if test="eqGuid != null">eq_guid = #{eqGuid},</if>
            <if test="sort != null">sort = #{sort},</if>
            <if test="note != null">note = #{note},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBisEutrCourToEqByGuid" parameterType="String">
        delete from bis_eutr_cour_to_eq where guid = #{guid}
    </delete>
    <delete id="deleteBisEutrCourToEqByGuids" parameterType="String">
        delete from bis_eutr_cour_to_eq where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
