<?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.chaozhanggui.dao.system.dao.TbPlussOfficialGoodsExchangeMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoodsExchange">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="goodId" jdbcType="INTEGER" property="goodid" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="userName" jdbcType="VARCHAR" property="username" />
    <result column="price" jdbcType="DECIMAL" property="price" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="orderNumber" jdbcType="VARCHAR" property="ordernumber" />
    <result column="expressNo" jdbcType="VARCHAR" property="expressno" />
    <result column="deliveryStatus" jdbcType="INTEGER" property="deliverystatus" />
    <result column="deliveryTime" jdbcType="TIMESTAMP" property="deliverytime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, goodId, createTime, address, phone, userName, price, name, status, orderNumber, 
    expressNo, deliveryStatus, deliveryTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_official_goods_exchange
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_official_goods_exchange
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoodsExchange">
    insert into tb_pluss_official_goods_exchange (id, userId, goodId, 
      createTime, address, phone, 
      userName, price, name, 
      status, orderNumber, expressNo, 
      deliveryStatus, deliveryTime)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{goodid,jdbcType=INTEGER}, 
      #{createtime,jdbcType=TIMESTAMP}, #{address,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, 
      #{username,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{name,jdbcType=VARCHAR}, 
      #{status,jdbcType=INTEGER}, #{ordernumber,jdbcType=VARCHAR}, #{expressno,jdbcType=VARCHAR}, 
      #{deliverystatus,jdbcType=INTEGER}, #{deliverytime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoodsExchange">
    insert into tb_pluss_official_goods_exchange
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="goodid != null">
        goodId,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="username != null">
        userName,
      </if>
      <if test="price != null">
        price,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="ordernumber != null">
        orderNumber,
      </if>
      <if test="expressno != null">
        expressNo,
      </if>
      <if test="deliverystatus != null">
        deliveryStatus,
      </if>
      <if test="deliverytime != null">
        deliveryTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=INTEGER},
      </if>
      <if test="goodid != null">
        #{goodid,jdbcType=INTEGER},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="username != null">
        #{username,jdbcType=VARCHAR},
      </if>
      <if test="price != null">
        #{price,jdbcType=DECIMAL},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="ordernumber != null">
        #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="expressno != null">
        #{expressno,jdbcType=VARCHAR},
      </if>
      <if test="deliverystatus != null">
        #{deliverystatus,jdbcType=INTEGER},
      </if>
      <if test="deliverytime != null">
        #{deliverytime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoodsExchange">
    update tb_pluss_official_goods_exchange
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="goodid != null">
        goodId = #{goodid,jdbcType=INTEGER},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="username != null">
        userName = #{username,jdbcType=VARCHAR},
      </if>
      <if test="price != null">
        price = #{price,jdbcType=DECIMAL},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="ordernumber != null">
        orderNumber = #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="expressno != null">
        expressNo = #{expressno,jdbcType=VARCHAR},
      </if>
      <if test="deliverystatus != null">
        deliveryStatus = #{deliverystatus,jdbcType=INTEGER},
      </if>
      <if test="deliverytime != null">
        deliveryTime = #{deliverytime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoodsExchange">
    update tb_pluss_official_goods_exchange
    set userId = #{userid,jdbcType=INTEGER},
      goodId = #{goodid,jdbcType=INTEGER},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      address = #{address,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      userName = #{username,jdbcType=VARCHAR},
      price = #{price,jdbcType=DECIMAL},
      name = #{name,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      orderNumber = #{ordernumber,jdbcType=VARCHAR},
      expressNo = #{expressno,jdbcType=VARCHAR},
      deliveryStatus = #{deliverystatus,jdbcType=INTEGER},
      deliveryTime = #{deliverytime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>