<?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.ruoyi.system.mapper.BomanReservatConfigTimeMapper">
    
    <resultMap type="BomanReservatConfigTime" id="BomanReservatConfigTimeResult">
        <result property="reservatConfigTimeId"    column="reservat_config_time_id"    />
        <result property="reservatConfigDate"    column="reservat_config_date"    />
        <result property="reservatConfigTimeBegin"    column="reservat_config_time_begin"    />
        <result property="reservatConfigTimeEnd"    column="reservat_config_time_end"    />
        <result property="reservatConfigNum"    column="reservat_config_num"    />
        <result property="reservatConfigType"    column="reservat_config_type"    />
        <result property="reservatConfigStatus"    column="reservat_config_status"    />
        <result property="createDept"    column="create_dept"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
    </resultMap>

    <sql id="selectBomanReservatConfigTimeVo">
        select reservat_config_time_id, reservat_config_date, reservat_config_time_begin, reservat_config_time_end, reservat_config_num, reservat_config_type, reservat_config_status, create_dept, create_by, create_time, update_by, update_time, remark from boman_reservat_config_time
    </sql>

    <select id="selectBomanReservatConfigTimeList" parameterType="BomanReservatConfigTime" resultMap="BomanReservatConfigTimeResult">
        <include refid="selectBomanReservatConfigTimeVo"/>
        <where>
            <if test="reservatConfigTimeBegin != null "> and reservat_config_time_begin = #{reservatConfigTimeBegin}</if>
            <if test="reservatConfigTimeEnd != null "> and reservat_config_time_end = #{reservatConfigTimeEnd}</if>
            <if test="reservatConfigNum != null "> and reservat_config_num = #{reservatConfigNum}</if>
            <if test="reservatConfigType != null  and reservatConfigType != ''"> and reservat_config_type = #{reservatConfigType}</if>
            <if test="reservatConfigStatus != null  and reservatConfigStatus != ''"> and reservat_config_status = #{reservatConfigStatus}</if>
        </where>
        order by create_time DESC
    </select>
    
    <select id="selectBomanReservatConfigTimeByReservatConfigTimeId" parameterType="Long" resultMap="BomanReservatConfigTimeResult">
        <include refid="selectBomanReservatConfigTimeVo"/>
        where reservat_config_time_id = #{reservatConfigTimeId}
    </select>
        
    <insert id="insertBomanReservatConfigTime" parameterType="BomanReservatConfigTime">
        insert into boman_reservat_config_time
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="reservatConfigTimeId != null">reservat_config_time_id,</if>
            <if test="reservatConfigDate != null">reservat_config_date,</if>
            <if test="reservatConfigTimeBegin != null">reservat_config_time_begin,</if>
            <if test="reservatConfigTimeEnd != null">reservat_config_time_end,</if>
            <if test="reservatConfigNum != null">reservat_config_num,</if>
            <if test="reservatConfigType != null">reservat_config_type,</if>
            <if test="reservatConfigStatus != null">reservat_config_status,</if>
            <if test="createDept != null">create_dept,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="reservatConfigTimeId != null">#{reservatConfigTimeId},</if>
            <if test="reservatConfigDate != null">#{reservatConfigDate},</if>
            <if test="reservatConfigTimeBegin != null">#{reservatConfigTimeBegin},</if>
            <if test="reservatConfigTimeEnd != null">#{reservatConfigTimeEnd},</if>
            <if test="reservatConfigNum != null">#{reservatConfigNum},</if>
            <if test="reservatConfigType != null">#{reservatConfigType},</if>
            <if test="reservatConfigStatus != null">#{reservatConfigStatus},</if>
            <if test="createDept != null">#{createDept},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
         </trim>
    </insert>

    <update id="updateBomanReservatConfigTime" parameterType="BomanReservatConfigTime">
        update boman_reservat_config_time
        <trim prefix="SET" suffixOverrides=",">
            <if test="reservatConfigDate != null">reservat_config_date = #{reservatConfigDate},</if>
            <if test="reservatConfigTimeBegin != null">reservat_config_time_begin = #{reservatConfigTimeBegin},</if>
            <if test="reservatConfigTimeEnd != null">reservat_config_time_end = #{reservatConfigTimeEnd},</if>
            <if test="reservatConfigNum != null">reservat_config_num = #{reservatConfigNum},</if>
            <if test="reservatConfigType != null">reservat_config_type = #{reservatConfigType},</if>
            <if test="reservatConfigStatus != null">reservat_config_status = #{reservatConfigStatus},</if>
            <if test="createDept != null">create_dept = #{createDept},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where reservat_config_time_id = #{reservatConfigTimeId}
    </update>

    <delete id="deleteBomanReservatConfigTimeByReservatConfigTimeId" parameterType="Long">
        delete from boman_reservat_config_time where reservat_config_time_id = #{reservatConfigTimeId}
    </delete>

    <delete id="deleteBomanReservatConfigTimeByReservatConfigTimeIds" parameterType="String">
        delete from boman_reservat_config_time where reservat_config_time_id in 
        <foreach item="reservatConfigTimeId" collection="array" open="(" separator="," close=")">
            #{reservatConfigTimeId}
        </foreach>
    </delete>
</mapper>