<?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.BisEutrCourCateMapper">
    <resultMap type="com.goldenwater.slaj.eutr.domain.BisEutrCourCate" id="BisEutrCourCateResult">
        <result property="guid" column="guid"/>
        <result property="eutrCateName" column="eutr_cate_name"/>
        <result property="pGuid" column="p_guid"/>
        <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="selectBisEutrCourCateVo">
        select guid, eutr_cate_name, p_guid, note, coll_time, upd_time, rec_pers
        from bis_eutr_cour_cate
    </sql>
    <select id="selectBisEutrCourCateByGuid" parameterType="String" resultMap="BisEutrCourCateResult">
        <include refid="selectBisEutrCourCateVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisEutrCourCateList" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrCourCate" resultMap="BisEutrCourCateResult">
        <include refid="selectBisEutrCourCateVo"/>
        <where>
            <if test="eutrCateName != null and eutrCateName != ''">AND eutr_cate_name like '%' || #{eutrCateName} || '%'</if>
        </where>
    </select>
    <insert id="insertBisEutrCourCate" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrCourCate">
        insert into bis_eutr_cour_cate (
            guid, eutr_cate_name, p_guid, note, coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{eutrCateName}, #{pGuid}, #{note}, #{collTime}, #{updTime}, #{recPers}
        )
    </insert>
    <update id="updateBisEutrCourCate" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrCourCate">
        update bis_eutr_cour_cate
        <set>
            <if test="eutrCateName != null">eutr_cate_name = #{eutrCateName},</if>
            <if test="pGuid != null">p_guid = #{pGuid},</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="deleteBisEutrCourCateByGuid" parameterType="String">
        delete from bis_eutr_cour_cate where guid = #{guid}
    </delete>
    <delete id="deleteBisEutrCourCateByGuids" parameterType="String">
        delete from bis_eutr_cour_cate where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
