<?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.BisEutrEqMapper">
    <resultMap type="com.goldenwater.slaj.eutr.domain.BisEutrEq" id="BisEutrEqResult">
        <result property="guid" column="guid"/>
        <result property="courGuid" column="cour_guid"/>
        <result property="eutrEqCode" column="eutr_eq_code"/>
        <result property="eutrEqName" column="eutr_eq_name"/>
        <result property="examType" column="exam_type"/>
        <result property="examDiffType" column="exam_diff_type"/>
        <result property="eqScore" column="eq_score"/>
        <result property="eqAnsw" column="eq_answ"/>
        <result property="isUse" column="is_use"/>
        <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="selectBisEutrEqVo">
        select guid, cour_guid, eutr_eq_code, eutr_eq_name, exam_type, exam_diff_type,
               eq_score, eq_answ, is_use, note, coll_time, upd_time, rec_pers
        from bis_eutr_eq
    </sql>
    <select id="selectBisEutrEqByGuid" parameterType="String" resultMap="BisEutrEqResult">
        <include refid="selectBisEutrEqVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisEutrEqList" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrEq" resultMap="BisEutrEqResult">
        <include refid="selectBisEutrEqVo"/>
        <where>
            <if test="eutrEqName != null and eutrEqName != ''">AND eutr_eq_name like '%' || #{eutrEqName} || '%'</if>
            <if test="examType != null and examType != ''">AND exam_type = #{examType}</if>
            <if test="examDiffType != null and examDiffType != ''">AND exam_diff_type = #{examDiffType}</if>
            <if test="isUse != null and isUse != ''">AND is_use = #{isUse}</if>
            <if test="courGuid != null and courGuid != ''">AND cour_guid = #{courGuid}</if>
        </where>
    </select>
    <insert id="insertBisEutrEq" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrEq">
        insert into bis_eutr_eq (
            guid, cour_guid, eutr_eq_code, eutr_eq_name, exam_type, exam_diff_type,
            eq_score, eq_answ, is_use, note, coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{courGuid}, #{eutrEqCode}, #{eutrEqName}, #{examType}, #{examDiffType},
            #{eqScore}, #{eqAnsw}, #{isUse}, #{note}, #{collTime}, #{updTime}, #{recPers}
        )
    </insert>
    <update id="updateBisEutrEq" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrEq">
        update bis_eutr_eq
        <set>
            <if test="courGuid != null">cour_guid = #{courGuid},</if>
            <if test="eutrEqCode != null">eutr_eq_code = #{eutrEqCode},</if>
            <if test="eutrEqName != null">eutr_eq_name = #{eutrEqName},</if>
            <if test="examType != null">exam_type = #{examType},</if>
            <if test="examDiffType != null">exam_diff_type = #{examDiffType},</if>
            <if test="eqScore != null">eq_score = #{eqScore},</if>
            <if test="eqAnsw != null">eq_answ = #{eqAnsw},</if>
            <if test="isUse != null">is_use = #{isUse},</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="deleteBisEutrEqByGuid" parameterType="String">
        delete from bis_eutr_eq where guid = #{guid}
    </delete>
    <delete id="deleteBisEutrEqByGuids" parameterType="String">
        delete from bis_eutr_eq where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
