<?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.BisEutrExamMapper">
    <resultMap type="com.goldenwater.slaj.eutr.domain.BisEutrExam" id="BisEutrExamResult">
        <result property="guid" column="guid"/>
        <result property="courGuid" column="cour_guid"/>
        <result property="eutrExamGuid" column="eutr_exam_guid"/>
        <result property="eutrExamName" column="eutr_exam_name"/>
        <result property="examHours" column="exam_hours"/>
        <result property="passGetHours" column="pass_get_hours"/>
        <result property="examTotalScore" column="exam_total_score"/>
        <result property="passMark" column="pass_mark"/>
        <result property="examMakePers" column="exam_make_pers"/>
        <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="selectBisEutrExamVo">
        select guid, cour_guid, eutr_exam_guid, eutr_exam_name, exam_hours,
               pass_get_hours, exam_total_score, pass_mark, exam_make_pers, note,
               coll_time, upd_time, rec_pers
        from bis_eutr_exam
    </sql>
    <select id="selectBisEutrExamByGuid" parameterType="String" resultMap="BisEutrExamResult">
        <include refid="selectBisEutrExamVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisEutrExamList" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrExam" resultMap="BisEutrExamResult">
        <include refid="selectBisEutrExamVo"/>
        <where>
            <if test="eutrExamName != null and eutrExamName != ''">AND eutr_exam_name like '%' || #{eutrExamName} || '%'</if>
            <if test="courGuid != null and courGuid != ''">AND cour_guid = #{courGuid}</if>
        </where>
    </select>
    <insert id="insertBisEutrExam" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrExam">
        insert into bis_eutr_exam (
            guid, cour_guid, eutr_exam_guid, eutr_exam_name, exam_hours,
            pass_get_hours, exam_total_score, pass_mark, exam_make_pers, note,
            coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{courGuid}, #{eutrExamGuid}, #{eutrExamName}, #{examHours},
            #{passGetHours}, #{examTotalScore}, #{passMark}, #{examMakePers}, #{note},
            #{collTime}, #{updTime}, #{recPers}
        )
    </insert>
    <update id="updateBisEutrExam" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrExam">
        update bis_eutr_exam
        <set>
            <if test="courGuid != null">cour_guid = #{courGuid},</if>
            <if test="eutrExamGuid != null">eutr_exam_guid = #{eutrExamGuid},</if>
            <if test="eutrExamName != null">eutr_exam_name = #{eutrExamName},</if>
            <if test="examHours != null">exam_hours = #{examHours},</if>
            <if test="passGetHours != null">pass_get_hours = #{passGetHours},</if>
            <if test="examTotalScore != null">exam_total_score = #{examTotalScore},</if>
            <if test="passMark != null">pass_mark = #{passMark},</if>
            <if test="examMakePers != null">exam_make_pers = #{examMakePers},</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="deleteBisEutrExamByGuid" parameterType="String">
        delete from bis_eutr_exam where guid = #{guid}
    </delete>
    <delete id="deleteBisEutrExamByGuids" parameterType="String">
        delete from bis_eutr_exam where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
