StaffApartmentSpareKeyMapper.xml 7.7 KB
<?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.tianbo.warehouse.dao.StaffApartmentSpareKeyMapper" >
  <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.StaffApartmentSpareKey" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="useDate" property="usedate" jdbcType="TIMESTAMP" />
    <result column="roomNum" property="roomnum" jdbcType="VARCHAR" />
    <result column="useTime" property="usetime" jdbcType="TIMESTAMP" />
    <result column="staffName" property="staffname" jdbcType="VARCHAR" />
    <result column="dept" property="dept" jdbcType="VARCHAR" />
    <result column="phone" property="phone" jdbcType="VARCHAR" />
    <result column="icType" property="ictype" jdbcType="VARCHAR" />
    <result column="icCard" property="iccard" jdbcType="VARCHAR" />
    <result column="roomDuty" property="roomduty" jdbcType="VARCHAR" />
    <result column="remark1" property="remark1" jdbcType="VARCHAR" />
    <result column="remark2" property="remark2" jdbcType="VARCHAR" />
    <result column="remark3" property="remark3" jdbcType="VARCHAR" />
    <result column="createBy" property="createby" jdbcType="INTEGER" />
    <result column="createTime" property="createtime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, useDate, roomNum, useTime, staffName, dept, phone, icType, icCard, roomDuty, 
    remark1, remark2, remark3, createBy, createTime
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from staff_apartment_spare_key
    where id = #{id,jdbcType=VARCHAR}
  </select>

  <select id="findAll" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select
    <include refid="Base_Column_List" />
    from staff_apartment_spare_key
    <if test="staffname != null and staffname!=''" >
      where staffname = #{staffname, jdbcType=VARCHAR}
    </if>
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from staff_apartment_spare_key
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.tianbo.warehouse.model.StaffApartmentSpareKey" >
    insert into staff_apartment_spare_key (id, useDate, roomNum, 
      useTime, staffName, dept, 
      phone, icType, icCard, 
      roomDuty, remark1, remark2, 
      remark3, createBy, createTime
      )
    values (#{id,jdbcType=VARCHAR}, #{usedate,jdbcType=TIMESTAMP}, #{roomnum,jdbcType=VARCHAR}, 
      #{usetime,jdbcType=TIMESTAMP}, #{staffname,jdbcType=VARCHAR}, #{dept,jdbcType=VARCHAR}, 
      #{phone,jdbcType=VARCHAR}, #{ictype,jdbcType=VARCHAR}, #{iccard,jdbcType=VARCHAR}, 
      #{roomduty,jdbcType=VARCHAR}, #{remark1,jdbcType=VARCHAR}, #{remark2,jdbcType=VARCHAR}, 
      #{remark3,jdbcType=VARCHAR}, #{createby,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.StaffApartmentSpareKey" >
    insert into staff_apartment_spare_key
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="usedate != null" >
        useDate,
      </if>
      <if test="roomnum != null" >
        roomNum,
      </if>
      <if test="usetime != null" >
        useTime,
      </if>
      <if test="staffname != null" >
        staffName,
      </if>
      <if test="dept != null" >
        dept,
      </if>
      <if test="phone != null" >
        phone,
      </if>
      <if test="ictype != null" >
        icType,
      </if>
      <if test="iccard != null" >
        icCard,
      </if>
      <if test="roomduty != null" >
        roomDuty,
      </if>
      <if test="remark1 != null" >
        remark1,
      </if>
      <if test="remark2 != null" >
        remark2,
      </if>
      <if test="remark3 != null" >
        remark3,
      </if>
      <if test="createby != null" >
        createBy,
      </if>
      <if test="createtime != null" >
        createTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="usedate != null" >
        #{usedate,jdbcType=TIMESTAMP},
      </if>
      <if test="roomnum != null" >
        #{roomnum,jdbcType=VARCHAR},
      </if>
      <if test="usetime != null" >
        #{usetime,jdbcType=TIMESTAMP},
      </if>
      <if test="staffname != null" >
        #{staffname,jdbcType=VARCHAR},
      </if>
      <if test="dept != null" >
        #{dept,jdbcType=VARCHAR},
      </if>
      <if test="phone != null" >
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="ictype != null" >
        #{ictype,jdbcType=VARCHAR},
      </if>
      <if test="iccard != null" >
        #{iccard,jdbcType=VARCHAR},
      </if>
      <if test="roomduty != null" >
        #{roomduty,jdbcType=VARCHAR},
      </if>
      <if test="remark1 != null" >
        #{remark1,jdbcType=VARCHAR},
      </if>
      <if test="remark2 != null" >
        #{remark2,jdbcType=VARCHAR},
      </if>
      <if test="remark3 != null" >
        #{remark3,jdbcType=VARCHAR},
      </if>
      <if test="createby != null" >
        #{createby,jdbcType=INTEGER},
      </if>
      <if test="createtime != null" >
        #{createtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.StaffApartmentSpareKey" >
    update staff_apartment_spare_key
    <set >
      <if test="usedate != null" >
        useDate = #{usedate,jdbcType=TIMESTAMP},
      </if>
      <if test="roomnum != null" >
        roomNum = #{roomnum,jdbcType=VARCHAR},
      </if>
      <if test="usetime != null" >
        useTime = #{usetime,jdbcType=TIMESTAMP},
      </if>
      <if test="staffname != null" >
        staffName = #{staffname,jdbcType=VARCHAR},
      </if>
      <if test="dept != null" >
        dept = #{dept,jdbcType=VARCHAR},
      </if>
      <if test="phone != null" >
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="ictype != null" >
        icType = #{ictype,jdbcType=VARCHAR},
      </if>
      <if test="iccard != null" >
        icCard = #{iccard,jdbcType=VARCHAR},
      </if>
      <if test="roomduty != null" >
        roomDuty = #{roomduty,jdbcType=VARCHAR},
      </if>
      <if test="remark1 != null" >
        remark1 = #{remark1,jdbcType=VARCHAR},
      </if>
      <if test="remark2 != null" >
        remark2 = #{remark2,jdbcType=VARCHAR},
      </if>
      <if test="remark3 != null" >
        remark3 = #{remark3,jdbcType=VARCHAR},
      </if>
      <if test="createby != null" >
        createBy = #{createby,jdbcType=INTEGER},
      </if>
      <if test="createtime != null" >
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.StaffApartmentSpareKey" >
    update staff_apartment_spare_key
    set useDate = #{usedate,jdbcType=TIMESTAMP},
      roomNum = #{roomnum,jdbcType=VARCHAR},
      useTime = #{usetime,jdbcType=TIMESTAMP},
      staffName = #{staffname,jdbcType=VARCHAR},
      dept = #{dept,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      icType = #{ictype,jdbcType=VARCHAR},
      icCard = #{iccard,jdbcType=VARCHAR},
      roomDuty = #{roomduty,jdbcType=VARCHAR},
      remark1 = #{remark1,jdbcType=VARCHAR},
      remark2 = #{remark2,jdbcType=VARCHAR},
      remark3 = #{remark3,jdbcType=VARCHAR},
      createBy = #{createby,jdbcType=INTEGER},
      createTime = #{createtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>