<?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.BisEutrCourRecMapper">
    <resultMap type="com.goldenwater.slaj.eutr.domain.BisEutrCourRec" id="BisEutrCourRecResult">
        <result property="guid" column="guid"/>
        <result property="persGuid" column="pers_guid"/>
        <result property="courGuid" column="cour_guid"/>
        <result property="lastStuTime" column="last_stu_time"/>
        <result property="studyStartTime" column="study_start_time"/>
        <result property="studyCompTime" column="study_comp_time"/>
        <result property="eutrTime" column="eutr_time"/>
        <result property="eutrHuor" column="eutr_huor"/>
        <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="selectBisEutrCourRecVo">
        select guid, pers_guid, cour_guid, last_stu_time, study_start_time, study_comp_time,
               eutr_time, eutr_huor, note, coll_time, upd_time, rec_pers
        from bis_eutr_cour_rec
    </sql>
    <select id="selectBisEutrCourRecByGuid" parameterType="String" resultMap="BisEutrCourRecResult">
        <include refid="selectBisEutrCourRecVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisEutrCourRecList" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrCourRec" resultMap="BisEutrCourRecResult">
        <include refid="selectBisEutrCourRecVo"/>
        <where>
            <if test="persGuid != null and persGuid != ''">AND pers_guid = #{persGuid}</if>
            <if test="courGuid != null and courGuid != ''">AND cour_guid = #{courGuid}</if>
        </where>
    </select>
    <insert id="insertBisEutrCourRec" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrCourRec">
        insert into bis_eutr_cour_rec (
            guid, pers_guid, cour_guid, last_stu_time, study_start_time, study_comp_time,
            eutr_time, eutr_huor, note, coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{persGuid}, #{courGuid}, #{lastStuTime}, #{studyStartTime}, #{studyCompTime},
            #{eutrTime}, #{eutrHuor}, #{note}, #{collTime}, #{updTime}, #{recPers}
        )
    </insert>
    <update id="updateBisEutrCourRec" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrCourRec">
        update bis_eutr_cour_rec
        <set>
            <if test="persGuid != null">pers_guid = #{persGuid},</if>
            <if test="courGuid != null">cour_guid = #{courGuid},</if>
            <if test="lastStuTime != null">last_stu_time = #{lastStuTime},</if>
            <if test="studyStartTime != null">study_start_time = #{studyStartTime},</if>
            <if test="studyCompTime != null">study_comp_time = #{studyCompTime},</if>
            <if test="eutrTime != null">eutr_time = #{eutrTime},</if>
            <if test="eutrHuor != null">eutr_huor = #{eutrHuor},</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="deleteBisEutrCourRecByGuid" parameterType="String">
        delete from bis_eutr_cour_rec where guid = #{guid}
    </delete>
    <delete id="deleteBisEutrCourRecByGuids" parameterType="String">
        delete from bis_eutr_cour_rec where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
