<?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.bailuntec.mapper.DcAutoOrderMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcAutoOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
    <result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode" />
    <result column="warehouse_name" jdbcType="VARCHAR" property="warehouseName" />
    <result column="warehouse_code_to" jdbcType="VARCHAR" property="warehouseCodeTo" />
    <result column="warehouse_name_to" jdbcType="VARCHAR" property="warehouseNameTo" />
    <result column="type" jdbcType="INTEGER" property="type" />
    <result column="buycount" jdbcType="INTEGER" property="buycount" />
    <result column="price" jdbcType="DECIMAL" property="price" />
    <result column="supplierid" jdbcType="INTEGER" property="supplierid" />
    <result column="suppliername" jdbcType="VARCHAR" property="suppliername" />
    <result column="arrivaltime" jdbcType="TIMESTAMP" property="arrivaltime" />
    <result column="buyer" jdbcType="VARCHAR" property="buyer" />
    <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="createusername" jdbcType="VARCHAR" property="createusername" />
    <result column="note" jdbcType="VARCHAR" property="note" />
    <result column="buyid" jdbcType="INTEGER" property="buyid" />
    <result column="buyno" jdbcType="VARCHAR" property="buyno" />
    <result column="status" jdbcType="INTEGER" property="status" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, bailun_sku, warehouse_code, warehouse_name, warehouse_code_to, warehouse_name_to, 
    type, buycount, price, supplierid, suppliername, arrivaltime, buyer, createtime, 
    createusername, note, buyid, buyno, status
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcAutoOrderExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from dc_auto_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="rows != null">
      <if test="offset != null">
        limit ${offset}, ${rows}
      </if>
      <if test="offset == null">
        limit ${rows}
      </if>
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from dc_auto_order
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_auto_order
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcAutoOrderExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_auto_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcAutoOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_auto_order (id, bailun_sku, warehouse_code, 
      warehouse_name, warehouse_code_to, warehouse_name_to, 
      type, buycount, price, 
      supplierid, suppliername, arrivaltime, 
      buyer, createtime, createusername, 
      note, buyid, buyno, 
      status)
    values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, 
      #{warehouseName,jdbcType=VARCHAR}, #{warehouseCodeTo,jdbcType=VARCHAR}, #{warehouseNameTo,jdbcType=VARCHAR}, 
      #{type,jdbcType=INTEGER}, #{buycount,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, 
      #{supplierid,jdbcType=INTEGER}, #{suppliername,jdbcType=VARCHAR}, #{arrivaltime,jdbcType=TIMESTAMP},
      #{buyer,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{createusername,jdbcType=VARCHAR},
      #{note,jdbcType=VARCHAR}, #{buyid,jdbcType=INTEGER}, #{buyno,jdbcType=VARCHAR}, 
      #{status,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcAutoOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_auto_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="warehouseCode != null">
        warehouse_code,
      </if>
      <if test="warehouseName != null">
        warehouse_name,
      </if>
      <if test="warehouseCodeTo != null">
        warehouse_code_to,
      </if>
      <if test="warehouseNameTo != null">
        warehouse_name_to,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="buycount != null">
        buycount,
      </if>
      <if test="price != null">
        price,
      </if>
      <if test="supplierid != null">
        supplierid,
      </if>
      <if test="suppliername != null">
        suppliername,
      </if>
      <if test="arrivaltime != null">
        arrivaltime,
      </if>
      <if test="buyer != null">
        buyer,
      </if>
      <if test="createtime != null">
        createtime,
      </if>
      <if test="createusername != null">
        createusername,
      </if>
      <if test="note != null">
        note,
      </if>
      <if test="buyid != null">
        buyid,
      </if>
      <if test="buyno != null">
        buyno,
      </if>
      <if test="status != null">
        status,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCode != null">
        #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="warehouseName != null">
        #{warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCodeTo != null">
        #{warehouseCodeTo,jdbcType=VARCHAR},
      </if>
      <if test="warehouseNameTo != null">
        #{warehouseNameTo,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="buycount != null">
        #{buycount,jdbcType=INTEGER},
      </if>
      <if test="price != null">
        #{price,jdbcType=DECIMAL},
      </if>
      <if test="supplierid != null">
        #{supplierid,jdbcType=INTEGER},
      </if>
      <if test="suppliername != null">
        #{suppliername,jdbcType=VARCHAR},
      </if>
      <if test="arrivaltime != null">
        #{arrivaltime,jdbcType=TIMESTAMP},
      </if>
      <if test="buyer != null">
        #{buyer,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createusername != null">
        #{createusername,jdbcType=VARCHAR},
      </if>
      <if test="note != null">
        #{note,jdbcType=VARCHAR},
      </if>
      <if test="buyid != null">
        #{buyid,jdbcType=INTEGER},
      </if>
      <if test="buyno != null">
        #{buyno,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcAutoOrderExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_auto_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_auto_order
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.bailunSku != null">
        bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="record.warehouseCode != null">
        warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="record.warehouseName != null">
        warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="record.warehouseCodeTo != null">
        warehouse_code_to = #{record.warehouseCodeTo,jdbcType=VARCHAR},
      </if>
      <if test="record.warehouseNameTo != null">
        warehouse_name_to = #{record.warehouseNameTo,jdbcType=VARCHAR},
      </if>
      <if test="record.type != null">
        type = #{record.type,jdbcType=INTEGER},
      </if>
      <if test="record.buycount != null">
        buycount = #{record.buycount,jdbcType=INTEGER},
      </if>
      <if test="record.price != null">
        price = #{record.price,jdbcType=DECIMAL},
      </if>
      <if test="record.supplierid != null">
        supplierid = #{record.supplierid,jdbcType=INTEGER},
      </if>
      <if test="record.suppliername != null">
        suppliername = #{record.suppliername,jdbcType=VARCHAR},
      </if>
      <if test="record.arrivaltime != null">
        arrivaltime = #{record.arrivaltime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.buyer != null">
        buyer = #{record.buyer,jdbcType=VARCHAR},
      </if>
      <if test="record.createtime != null">
        createtime = #{record.createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createusername != null">
        createusername = #{record.createusername,jdbcType=VARCHAR},
      </if>
      <if test="record.note != null">
        note = #{record.note,jdbcType=VARCHAR},
      </if>
      <if test="record.buyid != null">
        buyid = #{record.buyid,jdbcType=INTEGER},
      </if>
      <if test="record.buyno != null">
        buyno = #{record.buyno,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        status = #{record.status,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_auto_order
    set id = #{record.id,jdbcType=INTEGER},
      bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
      warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
      warehouse_code_to = #{record.warehouseCodeTo,jdbcType=VARCHAR},
      warehouse_name_to = #{record.warehouseNameTo,jdbcType=VARCHAR},
      type = #{record.type,jdbcType=INTEGER},
      buycount = #{record.buycount,jdbcType=INTEGER},
      price = #{record.price,jdbcType=DECIMAL},
      supplierid = #{record.supplierid,jdbcType=INTEGER},
      suppliername = #{record.suppliername,jdbcType=VARCHAR},
      arrivaltime = #{record.arrivaltime,jdbcType=TIMESTAMP},
      buyer = #{record.buyer,jdbcType=VARCHAR},
      createtime = #{record.createtime,jdbcType=TIMESTAMP},
      createusername = #{record.createusername,jdbcType=VARCHAR},
      note = #{record.note,jdbcType=VARCHAR},
      buyid = #{record.buyid,jdbcType=INTEGER},
      buyno = #{record.buyno,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcAutoOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_auto_order
    <set>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCode != null">
        warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="warehouseName != null">
        warehouse_name = #{warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCodeTo != null">
        warehouse_code_to = #{warehouseCodeTo,jdbcType=VARCHAR},
      </if>
      <if test="warehouseNameTo != null">
        warehouse_name_to = #{warehouseNameTo,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=INTEGER},
      </if>
      <if test="buycount != null">
        buycount = #{buycount,jdbcType=INTEGER},
      </if>
      <if test="price != null">
        price = #{price,jdbcType=DECIMAL},
      </if>
      <if test="supplierid != null">
        supplierid = #{supplierid,jdbcType=INTEGER},
      </if>
      <if test="suppliername != null">
        suppliername = #{suppliername,jdbcType=VARCHAR},
      </if>
      <if test="arrivaltime != null">
        arrivaltime = #{arrivaltime,jdbcType=TIMESTAMP},
      </if>
      <if test="buyer != null">
        buyer = #{buyer,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createtime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createusername != null">
        createusername = #{createusername,jdbcType=VARCHAR},
      </if>
      <if test="note != null">
        note = #{note,jdbcType=VARCHAR},
      </if>
      <if test="buyid != null">
        buyid = #{buyid,jdbcType=INTEGER},
      </if>
      <if test="buyno != null">
        buyno = #{buyno,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcAutoOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_auto_order
    set bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
      warehouse_name = #{warehouseName,jdbcType=VARCHAR},
      warehouse_code_to = #{warehouseCodeTo,jdbcType=VARCHAR},
      warehouse_name_to = #{warehouseNameTo,jdbcType=VARCHAR},
      type = #{type,jdbcType=INTEGER},
      buycount = #{buycount,jdbcType=INTEGER},
      price = #{price,jdbcType=DECIMAL},
      supplierid = #{supplierid,jdbcType=INTEGER},
      suppliername = #{suppliername,jdbcType=VARCHAR},
      arrivaltime = #{arrivaltime,jdbcType=TIMESTAMP},
      buyer = #{buyer,jdbcType=VARCHAR},
      createtime = #{createtime,jdbcType=TIMESTAMP},
      createusername = #{createusername,jdbcType=VARCHAR},
      note = #{note,jdbcType=VARCHAR},
      buyid = #{buyid,jdbcType=INTEGER},
      buyno = #{buyno,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcAutoOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    insert into dc_auto_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="warehouseCode != null">
        warehouse_code,
      </if>
      <if test="warehouseName != null">
        warehouse_name,
      </if>
      <if test="warehouseCodeTo != null">
        warehouse_code_to,
      </if>
      <if test="warehouseNameTo != null">
        warehouse_name_to,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="buycount != null">
        buycount,
      </if>
      <if test="price != null">
        price,
      </if>
      <if test="supplierid != null">
        supplierid,
      </if>
      <if test="suppliername != null">
        suppliername,
      </if>
      <if test="arrivaltime != null">
        arrivaltime,
      </if>
      <if test="buyer != null">
        buyer,
      </if>
      <if test="createtime != null">
        createtime,
      </if>
      <if test="createusername != null">
        createusername,
      </if>
      <if test="note != null">
        note,
      </if>
      <if test="buyid != null">
        buyid,
      </if>
      <if test="buyno != null">
        buyno,
      </if>
      <if test="status != null">
        status,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCode != null">
        #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="warehouseName != null">
        #{warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCodeTo != null">
        #{warehouseCodeTo,jdbcType=VARCHAR},
      </if>
      <if test="warehouseNameTo != null">
        #{warehouseNameTo,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="buycount != null">
        #{buycount,jdbcType=INTEGER},
      </if>
      <if test="price != null">
        #{price,jdbcType=DECIMAL},
      </if>
      <if test="supplierid != null">
        #{supplierid,jdbcType=INTEGER},
      </if>
      <if test="suppliername != null">
        #{suppliername,jdbcType=VARCHAR},
      </if>
      <if test="arrivaltime != null">
        #{arrivaltime,jdbcType=TIMESTAMP},
      </if>
      <if test="buyer != null">
        #{buyer,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createusername != null">
        #{createusername,jdbcType=VARCHAR},
      </if>
      <if test="note != null">
        #{note,jdbcType=VARCHAR},
      </if>
      <if test="buyid != null">
        #{buyid,jdbcType=INTEGER},
      </if>
      <if test="buyno != null">
        #{buyno,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCode != null">
        warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="warehouseName != null">
        warehouse_name = #{warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCodeTo != null">
        warehouse_code_to = #{warehouseCodeTo,jdbcType=VARCHAR},
      </if>
      <if test="warehouseNameTo != null">
        warehouse_name_to = #{warehouseNameTo,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=INTEGER},
      </if>
      <if test="buycount != null">
        buycount = #{buycount,jdbcType=INTEGER},
      </if>
      <if test="price != null">
        price = #{price,jdbcType=DECIMAL},
      </if>
      <if test="supplierid != null">
        supplierid = #{supplierid,jdbcType=INTEGER},
      </if>
      <if test="suppliername != null">
        suppliername = #{suppliername,jdbcType=VARCHAR},
      </if>
      <if test="arrivaltime != null">
        arrivaltime = #{arrivaltime,jdbcType=TIMESTAMP},
      </if>
      <if test="buyer != null">
        buyer = #{buyer,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createtime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createusername != null">
        createusername = #{createusername,jdbcType=VARCHAR},
      </if>
      <if test="note != null">
        note = #{note,jdbcType=VARCHAR},
      </if>
      <if test="buyid != null">
        buyid = #{buyid,jdbcType=INTEGER},
      </if>
      <if test="buyno != null">
        buyno = #{buyno,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcAutoOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    insert into dc_auto_order
    (id, bailun_sku, warehouse_code, warehouse_name, warehouse_code_to, warehouse_name_to, 
      type, buycount, price, supplierid, suppliername, arrivaltime, buyer, createtime, 
      createusername, note, buyid, buyno, status)
    values
    (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, 
      #{warehouseName,jdbcType=VARCHAR}, #{warehouseCodeTo,jdbcType=VARCHAR}, #{warehouseNameTo,jdbcType=VARCHAR}, 
      #{type,jdbcType=INTEGER}, #{buycount,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, 
      #{supplierid,jdbcType=INTEGER}, #{suppliername,jdbcType=VARCHAR}, #{arrivaltime,jdbcType=TIMESTAMP},
      #{buyer,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{createusername,jdbcType=VARCHAR},
      #{note,jdbcType=VARCHAR}, #{buyid,jdbcType=INTEGER}, #{buyno,jdbcType=VARCHAR}, 
      #{status,jdbcType=INTEGER})
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    bailun_sku = #{bailunSku,jdbcType=VARCHAR}, 
    warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, 
    warehouse_name = #{warehouseName,jdbcType=VARCHAR}, 
    warehouse_code_to = #{warehouseCodeTo,jdbcType=VARCHAR}, 
    warehouse_name_to = #{warehouseNameTo,jdbcType=VARCHAR}, 
    type = #{type,jdbcType=INTEGER}, 
    buycount = #{buycount,jdbcType=INTEGER}, 
    price = #{price,jdbcType=DECIMAL}, 
    supplierid = #{supplierid,jdbcType=INTEGER}, 
    suppliername = #{suppliername,jdbcType=VARCHAR}, 
    arrivaltime = #{arrivaltime,jdbcType=TIMESTAMP},
    buyer = #{buyer,jdbcType=VARCHAR}, 
    createtime = #{createtime,jdbcType=TIMESTAMP},
    createusername = #{createusername,jdbcType=VARCHAR}, 
    note = #{note,jdbcType=VARCHAR}, 
    buyid = #{buyid,jdbcType=INTEGER}, 
    buyno = #{buyno,jdbcType=VARCHAR}, 
    status = #{status,jdbcType=INTEGER}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcAutoOrderExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    select
    <include refid="Base_Column_List" />
    from dc_auto_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
</mapper>