<?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="cn.timer.api.dao.kqmk.KqglAssOvertimeViceMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssOvertimeVice" >
                <id column="id" property="id" />
                <result column="overtime_rules_id" property="overtimeRulesId" />
                <result column="break_start_time" property="breakStartTime" />
                <result column="break_end_time" property="breakEndTime" />
                <result column="over_type" property="overType" />
    </resultMap>

    <sql id="Base_Column_List">
                id,
                overtime_rules_id,
                break_start_time,
                break_end_time,
                over_type
    </sql>
    
    <sql id="Base_Column_List_Alias">
                id KqglAssOvertimeVice_id,
                overtime_rules_id KqglAssOvertimeVice_overtime_rules_id,
                break_start_time KqglAssOvertimeVice_break_start_time,
                break_end_time KqglAssOvertimeVice_break_end_time,
                over_type KqglAssOvertimeVice_over_type
    </sql>

	<insert id="insertovertimeviceList" parameterType="java.util.List" >
	    insert into kqgl_ass_overtime_vice (overtime_rules_id, break_start_time, break_end_time,over_type)
	    <foreach collection="list" item="item" index="index" open="values " close="" separator=",">
	   	(
	      <if test="item.overtimeRulesId != null" >
	        #{item.overtimeRulesId,jdbcType=INTEGER},
	      </if>
	      <if test="item.breakStartTime != null" >
	        #{item.breakStartTime,jdbcType=VARCHAR},
	      </if>
	      <if test="item.breakEndTime != null" >
	        #{item.breakEndTime,jdbcType=VARCHAR},
	      </if>
	      <if test="item.overType != null" >
	        #{item.overType,jdbcType=INTEGER}
	      </if>
	      )
	    </foreach>
  	 </insert>
	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssOvertimeVice">
        INSERT INTO kqgl_ass_overtime_vice
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != overtimeRulesId'>
                        overtime_rules_id,
                        </if>
                        <if test ='null != breakStartTime'>
                        break_start_time,
                        </if>
                        <if test ='null != breakEndTime'>
                        break_end_time,
                        </if>
                        <if test ='null != overType'>
                        over_type
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != overtimeRulesId'>
                        #{overtimeRulesId},
                        </if>
                        <if test ='null != breakStartTime'>
                        #{breakStartTime},
                        </if>
                        <if test ='null != breakEndTime'>
                        #{breakEndTime},
                        </if>
                        <if test ='null != overType'>
                        #{overType}
                        </if>
        </trim>
    </insert>

    <delete id="delete" >
        DELETE FROM kqgl_ass_overtime_vice
        WHERE id = #{id}
    </delete>

    <update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssOvertimeVice">
        UPDATE kqgl_ass_overtime_vice
        <set>
                    <if test ='null != overtimeRulesId'>overtime_rules_id = #{overtimeRulesId},</if>
                    <if test ='null != breakStartTime'>break_start_time = #{breakStartTime},</if>
                    <if test ='null != breakEndTime'>break_end_time = #{breakEndTime},</if>
                    <if test ='null != overType'>over_type = #{overType}</if>
        </set>
        WHERE id = #{id}
    </update>


    <select id="load" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM kqgl_ass_overtime_vice
        WHERE id = #{id}
    </select>

    <select id="pageList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM kqgl_ass_overtime_vice
        LIMIT #{offset}, #{pageSize}
    </select>

    <select id="pageListCount" resultType="java.lang.Integer">
        SELECT count(1)
        FROM kqgl_ass_overtime_vice
    </select>

	 -->

</mapper>