<?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.TbPlussDeviceOrderInfoMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussDeviceOrderInfo">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="orderNo" jdbcType="VARCHAR" property="orderno" />
    <result column="transNo" jdbcType="VARCHAR" property="transno" />
    <result column="userId" jdbcType="VARCHAR" property="userid" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="deviceType" jdbcType="VARCHAR" property="devicetype" />
    <result column="orderType" jdbcType="VARCHAR" property="ordertype" />
    <result column="groupNo" jdbcType="VARCHAR" property="groupno" />
    <result column="num" jdbcType="INTEGER" property="num" />
    <result column="sumPrice" jdbcType="DECIMAL" property="sumprice" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
    <result column="status" jdbcType="VARCHAR" property="status" />
  </resultMap>
  <sql id="Base_Column_List">
    id, orderNo, transNo, userId, code, deviceType, orderType, groupNo, num, sumPrice, 
    createTime, updateTime, status
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_device_order_info
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_device_order_info
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceOrderInfo">
    insert into tb_pluss_device_order_info (id, orderNo, transNo, 
      userId, code, deviceType, 
      orderType, groupNo, num, 
      sumPrice, createTime, updateTime, 
      status)
    values (#{id,jdbcType=INTEGER}, #{orderno,jdbcType=VARCHAR}, #{transno,jdbcType=VARCHAR}, 
      #{userid,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{devicetype,jdbcType=VARCHAR}, 
      #{ordertype,jdbcType=VARCHAR}, #{groupno,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, 
      #{sumprice,jdbcType=DECIMAL}, #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}, 
      #{status,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceOrderInfo">
    insert into tb_pluss_device_order_info
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="orderno != null">
        orderNo,
      </if>
      <if test="transno != null">
        transNo,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="code != null">
        code,
      </if>
      <if test="devicetype != null">
        deviceType,
      </if>
      <if test="ordertype != null">
        orderType,
      </if>
      <if test="groupno != null">
        groupNo,
      </if>
      <if test="num != null">
        num,
      </if>
      <if test="sumprice != null">
        sumPrice,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="updatetime != null">
        updateTime,
      </if>
      <if test="status != null">
        status,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="orderno != null">
        #{orderno,jdbcType=VARCHAR},
      </if>
      <if test="transno != null">
        #{transno,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="devicetype != null">
        #{devicetype,jdbcType=VARCHAR},
      </if>
      <if test="ordertype != null">
        #{ordertype,jdbcType=VARCHAR},
      </if>
      <if test="groupno != null">
        #{groupno,jdbcType=VARCHAR},
      </if>
      <if test="num != null">
        #{num,jdbcType=INTEGER},
      </if>
      <if test="sumprice != null">
        #{sumprice,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceOrderInfo">
    update tb_pluss_device_order_info
    <set>
      <if test="orderno != null">
        orderNo = #{orderno,jdbcType=VARCHAR},
      </if>
      <if test="transno != null">
        transNo = #{transno,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        userId = #{userid,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="devicetype != null">
        deviceType = #{devicetype,jdbcType=VARCHAR},
      </if>
      <if test="ordertype != null">
        orderType = #{ordertype,jdbcType=VARCHAR},
      </if>
      <if test="groupno != null">
        groupNo = #{groupno,jdbcType=VARCHAR},
      </if>
      <if test="num != null">
        num = #{num,jdbcType=INTEGER},
      </if>
      <if test="sumprice != null">
        sumPrice = #{sumprice,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        updateTime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceOrderInfo">
    update tb_pluss_device_order_info
    set orderNo = #{orderno,jdbcType=VARCHAR},
      transNo = #{transno,jdbcType=VARCHAR},
      userId = #{userid,jdbcType=VARCHAR},
      code = #{code,jdbcType=VARCHAR},
      deviceType = #{devicetype,jdbcType=VARCHAR},
      orderType = #{ordertype,jdbcType=VARCHAR},
      groupNo = #{groupno,jdbcType=VARCHAR},
      num = #{num,jdbcType=INTEGER},
      sumPrice = #{sumprice,jdbcType=DECIMAL},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP},
      status = #{status,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>