<?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.younike.system.mapper.ServerTimeSectionMapper">
    
    <resultMap type="ServerTimeSectionVo" id="ServerTimeSectionResultVo" extends="ServerTimeSectionResult">

    </resultMap>

    <update id="updateServerTimeSectionVo">
        update server_time_section
        <trim prefix="SET" suffixOverrides=",">
            <if test="serverId != null and serverId != ''">server_id = #{serverId},</if>
            <if test="weeks != null">weeks = #{weeks},</if>
            <if test="hoursFromString != null">hours_from = #{hoursFromString},</if>
            <if test="hoursEndString != null">hours_end = #{hoursEndString},</if>
            <if test="isEnable != null">is_enable = #{isEnable},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</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="column1 != null">column1 = #{column1},</if>
            <if test="column2 != null">column2 = #{column2},</if>
            <if test="column3 != null">column3 = #{column3},</if>
        </trim>
        where section_id = #{sectionId}
    </update>
    <insert id="insertServerTimeSectionVo" >
        insert into server_time_section
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="sectionId != null">section_id,</if>
            <if test="serverId != null and serverId != ''">server_id,</if>
            <if test="weeks != null">weeks,</if>
            <if test="hoursFromString != null">hours_from,</if>
            <if test="hoursEndString != null">hours_end,</if>
            <if test="isEnable != null">is_enable,</if>
            <if test="delFlag != null">del_flag,</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="column1 != null">column1,</if>
            <if test="column2 != null">column2,</if>
            <if test="column3 != null">column3,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="sectionId != null">#{sectionId},</if>
            <if test="serverId != null and serverId != ''">#{serverId},</if>
            <if test="weeks != null">#{weeks},</if>
            <if test="hoursFromString != null">#{hoursFromString},</if>
            <if test="hoursEndString != null">#{hoursEndString},</if>
            <if test="isEnable != null">#{isEnable},</if>
            <if test="delFlag != null">#{delFlag},</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="column1 != null">#{column1},</if>
            <if test="column2 != null">#{column2},</if>
            <if test="column3 != null">#{column3},</if>
        </trim>
    </insert>

</mapper>