StaffApartmentComeCarMapper.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.StaffApartmentComeCarMapper" >
  <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.StaffApartmentComeCar" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="dateTime" property="datetime" jdbcType="TIMESTAMP" />
    <result column="comeToVisitDate" property="cometovisitdate" jdbcType="TIMESTAMP" />
    <result column="leaveDate" property="leavedate" jdbcType="TIMESTAMP" />
    <result column="comeToVisitName" property="cometovisitname" jdbcType="VARCHAR" />
    <result column="carNumber" property="carnumber" jdbcType="VARCHAR" />
    <result column="phone" property="phone" jdbcType="VARCHAR" />
    <result column="comeMatter" property="comematter" jdbcType="VARCHAR" />
    <result column="warchkeeper" property="warchkeeper" 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="userId" property="userid" jdbcType="INTEGER" />
    <result column="createTime" property="createtime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, dateTime, comeToVisitDate, leaveDate, comeToVisitName, carNumber, phone, comeMatter, 
    warchkeeper, remark1, remark2, remark3, userId, createTime
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from staff_aparment_come_car
    where id = #{id,jdbcType=VARCHAR}
  </select>

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

  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from staff_aparment_come_car
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.tianbo.warehouse.model.StaffApartmentComeCar" >
    insert into staff_aparment_come_car (id, dateTime, comeToVisitDate, 
      leaveDate, comeToVisitName, carNumber, 
      phone, comeMatter, warchkeeper, 
      remark1, remark2, remark3, 
      userId, createTime)
    values (#{id,jdbcType=VARCHAR}, #{datetime,jdbcType=TIMESTAMP}, #{cometovisitdate,jdbcType=TIMESTAMP}, 
      #{leavedate,jdbcType=TIMESTAMP}, #{cometovisitname,jdbcType=VARCHAR}, #{carnumber,jdbcType=VARCHAR}, 
      #{phone,jdbcType=VARCHAR}, #{comematter,jdbcType=VARCHAR}, #{warchkeeper,jdbcType=VARCHAR}, 
      #{remark1,jdbcType=VARCHAR}, #{remark2,jdbcType=VARCHAR}, #{remark3,jdbcType=VARCHAR}, 
      #{userid,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.StaffApartmentComeCar" >
    insert into staff_aparment_come_car
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="datetime != null" >
        dateTime,
      </if>
      <if test="cometovisitdate != null" >
        comeToVisitDate,
      </if>
      <if test="leavedate != null" >
        leaveDate,
      </if>
      <if test="cometovisitname != null" >
        comeToVisitName,
      </if>
      <if test="carnumber != null" >
        carNumber,
      </if>
      <if test="phone != null" >
        phone,
      </if>
      <if test="comematter != null" >
        comeMatter,
      </if>
      <if test="warchkeeper != null" >
        warchkeeper,
      </if>
      <if test="remark1 != null" >
        remark1,
      </if>
      <if test="remark2 != null" >
        remark2,
      </if>
      <if test="remark3 != null" >
        remark3,
      </if>
      <if test="userid != null" >
        userId,
      </if>
      <if test="createtime != null" >
        createTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="datetime != null" >
        #{datetime,jdbcType=TIMESTAMP},
      </if>
      <if test="cometovisitdate != null" >
        #{cometovisitdate,jdbcType=TIMESTAMP},
      </if>
      <if test="leavedate != null" >
        #{leavedate,jdbcType=TIMESTAMP},
      </if>
      <if test="cometovisitname != null" >
        #{cometovisitname,jdbcType=VARCHAR},
      </if>
      <if test="carnumber != null" >
        #{carnumber,jdbcType=VARCHAR},
      </if>
      <if test="phone != null" >
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="comematter != null" >
        #{comematter,jdbcType=VARCHAR},
      </if>
      <if test="warchkeeper != null" >
        #{warchkeeper,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="userid != null" >
        #{userid,jdbcType=INTEGER},
      </if>
      <if test="createtime != null" >
        #{createtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.StaffApartmentComeCar" >
    update staff_aparment_come_car
    <set >
      <if test="datetime != null" >
        dateTime = #{datetime,jdbcType=TIMESTAMP},
      </if>
      <if test="cometovisitdate != null" >
        comeToVisitDate = #{cometovisitdate,jdbcType=TIMESTAMP},
      </if>
      <if test="leavedate != null" >
        leaveDate = #{leavedate,jdbcType=TIMESTAMP},
      </if>
      <if test="cometovisitname != null" >
        comeToVisitName = #{cometovisitname,jdbcType=VARCHAR},
      </if>
      <if test="carnumber != null" >
        carNumber = #{carnumber,jdbcType=VARCHAR},
      </if>
      <if test="phone != null" >
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="comematter != null" >
        comeMatter = #{comematter,jdbcType=VARCHAR},
      </if>
      <if test="warchkeeper != null" >
        warchkeeper = #{warchkeeper,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="userid != null" >
        userId = #{userid,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.StaffApartmentComeCar" >
    update staff_aparment_come_car
    set dateTime = #{datetime,jdbcType=TIMESTAMP},
      comeToVisitDate = #{cometovisitdate,jdbcType=TIMESTAMP},
      leaveDate = #{leavedate,jdbcType=TIMESTAMP},
      comeToVisitName = #{cometovisitname,jdbcType=VARCHAR},
      carNumber = #{carnumber,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      comeMatter = #{comematter,jdbcType=VARCHAR},
      warchkeeper = #{warchkeeper,jdbcType=VARCHAR},
      remark1 = #{remark1,jdbcType=VARCHAR},
      remark2 = #{remark2,jdbcType=VARCHAR},
      remark3 = #{remark3,jdbcType=VARCHAR},
      userId = #{userid,jdbcType=INTEGER},
      createTime = #{createtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>