<?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.hidd.mapper.BisSinsScheMapper">
    <resultMap type="com.goldenwater.slaj.hidd.domain.BisSinsSche" id="BisSinsScheResult">
        <result property="guid" column="guid"/>
        <result property="sinsGuid" column="sins_guid"/>
        <result property="scheName" column="sche_name"/>
        <result property="scheStartTime" column="sche_start_time"/>
        <result property="scheCompTime" column="sche_comp_time"/>
        <result property="scheCont" column="sche_cont"/>
        <result property="scheMakeTime" column="sche_make_time"/>
        <result property="scheIsComp" column="sche_is_comp"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
        <result property="scheMakeGuid" column="sche_make_guid"/>
    </resultMap>
    <sql id="selectBisSinsScheVo">
        select guid, sins_guid, sche_name, sche_start_time, sche_comp_time, sche_cont,
               sche_make_time, sche_is_comp, note, coll_time, upd_time, rec_pers,
               sche_make_guid
        from bis_sins_sche
    </sql>
    <select id="selectBisSinsScheByGuid" parameterType="String" resultMap="BisSinsScheResult">
        <include refid="selectBisSinsScheVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisSinsScheList" parameterType="com.goldenwater.slaj.hidd.domain.BisSinsSche" resultMap="BisSinsScheResult">
        <include refid="selectBisSinsScheVo"/>
        <where>
            <if test="sinsGuid != null and sinsGuid != ''">AND sins_guid = #{sinsGuid}</if>
            <if test="scheName != null and scheName != ''">AND sche_name like '%' || #{scheName} || '%'</if>
        </where>
    </select>
    <insert id="insertBisSinsSche" parameterType="com.goldenwater.slaj.hidd.domain.BisSinsSche">
        insert into bis_sins_sche (guid, sins_guid, sche_name, sche_start_time, sche_comp_time, sche_cont, sche_make_time, sche_is_comp, note, coll_time, upd_time, rec_pers, sche_make_guid)
        values (#{guid}, #{sinsGuid}, #{scheName}, #{scheStartTime}, #{scheCompTime}, #{scheCont}, #{scheMakeTime}, #{scheIsComp}, #{note}, #{collTime}, #{updTime}, #{recPers}, #{scheMakeGuid})
    </insert>
    <update id="updateBisSinsSche" parameterType="com.goldenwater.slaj.hidd.domain.BisSinsSche">
        update bis_sins_sche
        <set>
            <if test="sinsGuid != null">sins_guid = #{sinsGuid},</if>
            <if test="scheName != null">sche_name = #{scheName},</if>
            <if test="scheStartTime != null">sche_start_time = #{scheStartTime},</if>
            <if test="scheCompTime != null">sche_comp_time = #{scheCompTime},</if>
            <if test="scheCont != null">sche_cont = #{scheCont},</if>
            <if test="scheMakeTime != null">sche_make_time = #{scheMakeTime},</if>
            <if test="scheIsComp != null">sche_is_comp = #{scheIsComp},</if>
            <if test="note != null">note = #{note},</if>
            <if test="collTime != null">coll_time = #{collTime},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
            <if test="scheMakeGuid != null">sche_make_guid = #{scheMakeGuid},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBisSinsScheByGuid" parameterType="String">
        delete from bis_sins_sche where guid = #{guid}
    </delete>
    <delete id="deleteBisSinsScheByGuids" parameterType="String">
        delete from bis_sins_sche where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
