KqglAssOvertimeViceMapper.xml 4.44 KB
Newer Older
ilal committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<?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" >
ilal committed
44
	        #{item.overType,jdbcType=INTEGER}
ilal committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
	      </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>