<?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.yinet.wsyy.mapper.WsyySettingMapper">

    <resultMap type="WsyySetting" id="WsyySettingResult">
        <result property="wsyysetId" column="wsyyset_id"/>
        <result property="timeScope" column="time_scope"/>
        <result property="holidayWork" column="holiday_work"/>
        <result property="timeQuantumNum" column="time_quantum_num"/>
    </resultMap>

    <sql id="selectWsyySettingVo">
        select wsyyset_id, time_scope, holiday_work, time_quantum_num from wsyy_setting
    </sql>

    <select id="selectWsyySetting" parameterType="String" resultMap="WsyySettingResult">
        <include refid="selectWsyySettingVo"/>
        where wsyyset_id = 1
    </select>

    <update id="updateWsyySetting" parameterType="WsyySetting">
        update wsyy_setting
        <trim prefix="SET" suffixOverrides=",">
            <if test="timeScope != null ">time_scope = #{timeScope},</if>
            <if test="holidayWork != null  and holidayWork != ''">holiday_work = #{holidayWork},</if>
            <if test="timeQuantumNum != null ">time_quantum_num = #{timeQuantumNum},</if>
        </trim>
        where wsyyset_id = #{wsyysetId}
    </update>


</mapper>