AttGroupBinPunchModeMapper.xml 4.77 KB
Newer Older
yuquan.zhu 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 44 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 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
<?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.kqgl.AttGroupBinPunchModeMapper" >
  <resultMap id="BaseResultMap" type="cn.timer.api.bean.kqgl.AttGroupBinPunchMode" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="dkfsid" property="dkfsid" jdbcType="INTEGER" />
    <result column="kqz_id" property="kqzId" jdbcType="INTEGER" />
    <result column="type" property="type" jdbcType="INTEGER" />
    <result column="qyid" property="qyid" jdbcType="INTEGER" />
    <result column="state" property="state" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, dkfsid, kqz_id, type, qyid, state
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from kqgl_asso_kqzdkfs
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from kqgl_asso_kqzdkfs
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="cn.timer.api.bean.kqgl.AttGroupBinPunchMode" useGeneratedKeys="true" keyProperty="id">
    insert into kqgl_asso_kqzdkfs (dkfsid, kqz_id, 
      type, qyid, state)
    values (#{dkfsid,jdbcType=INTEGER}, #{kqzId,jdbcType=INTEGER}, 
      #{type,jdbcType=INTEGER}, #{qyid,jdbcType=INTEGER}, #{state,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="cn.timer.api.bean.kqgl.AttGroupBinPunchMode" useGeneratedKeys="true" keyProperty="id">
    insert into kqgl_asso_kqzdkfs
    <trim prefix="(" suffix=")" suffixOverrides="," >
      
      <if test="dkfsid != null" >
        dkfsid,
      </if>
      <if test="kqzId != null" >
        kqz_id,
      </if>
      <if test="type != null" >
        type,
      </if>
      <if test="qyid != null" >
        qyid,
      </if>
      <if test="state != null" >
        state,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      
      <if test="dkfsid != null" >
        #{dkfsid,jdbcType=INTEGER},
      </if>
      <if test="kqzId != null" >
        #{kqzId,jdbcType=INTEGER},
      </if>
      <if test="type != null" >
        #{type,jdbcType=INTEGER},
      </if>
      <if test="qyid != null" >
        #{qyid,jdbcType=INTEGER},
      </if>
      <if test="state != null" >
        #{state,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.timer.api.bean.kqgl.AttGroupBinPunchMode" >
    update kqgl_asso_kqzdkfs
    <set >
      <if test="dkfsid != null" >
        dkfsid = #{dkfsid,jdbcType=INTEGER},
      </if>
      <if test="kqzId != null" >
        kqz_id = #{kqzId,jdbcType=INTEGER},
      </if>
      <if test="type != null" >
        type = #{type,jdbcType=INTEGER},
      </if>
      <if test="qyid != null" >
        qyid = #{qyid,jdbcType=INTEGER},
      </if>
      <if test="state != null" >
        state = #{state,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.timer.api.bean.kqgl.AttGroupBinPunchMode" >
    update kqgl_asso_kqzdkfs
    set dkfsid = #{dkfsid,jdbcType=INTEGER},
      kqz_id = #{kqzId,jdbcType=INTEGER},
      type = #{type,jdbcType=INTEGER},
      qyid = #{qyid,jdbcType=INTEGER},
      state = #{state,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
  
  
	<insert id="insertKqglAssokqzdKfsList" parameterType="java.util.List" >
	    insert into kqgl_asso_kqzdkfs (dkfsid, kqz_id, type, qyid, state)
	    <foreach collection="list" item="item" index="index" open="values " close="" separator=",">
	   	(
	      <if test="item.dkfsid != null" >
	        #{item.dkfsid,jdbcType=INTEGER},
	      </if>
	      <if test="item.kqzId != null" >
	        #{item.kqzId,jdbcType=INTEGER},
	      </if>
	      <if test="item.type != null" >
	        #{item.type,jdbcType=INTEGER},
	      </if>
	      <if test="item.qyid != null" >
	        #{item.qyid,jdbcType=INTEGER},
	      </if>
	      <if test="item.state != null" >
	        #{item.state,jdbcType=INTEGER}
	      </if>
	      )
	    </foreach>
   </insert>
   
   <delete id="deleteByPrimaryBykqzid" parameterType="java.lang.Integer" >
    delete from kqgl_asso_kqzdkfs
    where kqz_id = #{kqzId,jdbcType=INTEGER}
  </delete>
  
  <select id="selectByPrimaryByKqzId" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from kqgl_asso_kqzdkfs
    where kqz_id = #{kqzid,jdbcType=INTEGER}
  </select>
  
  <select id="selectMachineByKqzId" resultMap="BaseResultMap">
  	select * from kqgl_asso_kqzdkfs
    where kqz_id = #{kqzid}
	and type = 1
  </select>
  
  
</mapper>