<?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.DcBasePurchaseMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcBasePurchase">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
    <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
    <result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
    <result column="purchase_id" jdbcType="VARCHAR" property="purchaseId" />
    <result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode" />
    <result column="warehouse_name" jdbcType="VARCHAR" property="warehouseName" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="count" jdbcType="INTEGER" property="count" />
    <result column="has_transfer" jdbcType="TINYINT" property="hasTransfer" />
    <result column="sku_name" jdbcType="VARCHAR" property="skuName" />
    <result column="estimated_arrival_time" jdbcType="TIMESTAMP" property="estimatedArrivalTime" />
    <result column="supplier_id" jdbcType="INTEGER" property="supplierId" />
    <result column="supplier_name" jdbcType="VARCHAR" property="supplierName" />
    <result column="confirm_time" jdbcType="TIMESTAMP" property="confirmTime" />
    <result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
    <result column="pay_type" jdbcType="TINYINT" property="payType" />
    <result column="price" jdbcType="DECIMAL" property="price" />
    <result column="buy_status" jdbcType="TINYINT" property="buyStatus" />
    <result column="transport_type" jdbcType="TINYINT" property="transportType" />
    <result column="deliver_id" jdbcType="INTEGER" property="deliverId" />
    <result column="parent_id" jdbcType="INTEGER" property="parentId" />
    <result column="has_delete" jdbcType="TINYINT" property="hasDelete" />
  </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, gmt_create, gmt_modified, bailun_sku, purchase_id, warehouse_code, warehouse_name, 
    status, create_time, update_time, count, has_transfer, sku_name, estimated_arrival_time, 
    supplier_id, supplier_name, confirm_time, pay_time, pay_type, price, buy_status, 
    transport_type, deliver_id, parent_id, has_delete
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBasePurchaseExample" 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_base_purchase
    <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_base_purchase
    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_base_purchase
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcBasePurchaseExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_base_purchase
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcBasePurchase">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_purchase (id, gmt_create, gmt_modified, 
      bailun_sku, purchase_id, warehouse_code, 
      warehouse_name, status, create_time, 
      update_time, count, has_transfer, 
      sku_name, estimated_arrival_time, supplier_id, 
      supplier_name, confirm_time, pay_time, 
      pay_type, price, buy_status, 
      transport_type, deliver_id, parent_id, 
      has_delete)
    values (#{id,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
      #{bailunSku,jdbcType=VARCHAR}, #{purchaseId,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, 
      #{warehouseName,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
      #{updateTime,jdbcType=TIMESTAMP}, #{count,jdbcType=INTEGER}, #{hasTransfer,jdbcType=TINYINT},
      #{skuName,jdbcType=VARCHAR}, #{estimatedArrivalTime,jdbcType=TIMESTAMP}, #{supplierId,jdbcType=INTEGER},
      #{supplierName,jdbcType=VARCHAR}, #{confirmTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP},
      #{payType,jdbcType=TINYINT}, #{price,jdbcType=DECIMAL}, #{buyStatus,jdbcType=TINYINT}, 
      #{transportType,jdbcType=TINYINT}, #{deliverId,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER}, 
      #{hasDelete,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBasePurchase">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_purchase
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="purchaseId != null">
        purchase_id,
      </if>
      <if test="warehouseCode != null">
        warehouse_code,
      </if>
      <if test="warehouseName != null">
        warehouse_name,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="count != null">
        count,
      </if>
      <if test="hasTransfer != null">
        has_transfer,
      </if>
      <if test="skuName != null">
        sku_name,
      </if>
      <if test="estimatedArrivalTime != null">
        estimated_arrival_time,
      </if>
      <if test="supplierId != null">
        supplier_id,
      </if>
      <if test="supplierName != null">
        supplier_name,
      </if>
      <if test="confirmTime != null">
        confirm_time,
      </if>
      <if test="payTime != null">
        pay_time,
      </if>
      <if test="payType != null">
        pay_type,
      </if>
      <if test="price != null">
        price,
      </if>
      <if test="buyStatus != null">
        buy_status,
      </if>
      <if test="transportType != null">
        transport_type,
      </if>
      <if test="deliverId != null">
        deliver_id,
      </if>
      <if test="parentId != null">
        parent_id,
      </if>
      <if test="hasDelete != null">
        has_delete,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="purchaseId != null">
        #{purchaseId,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCode != null">
        #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="warehouseName != null">
        #{warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="count != null">
        #{count,jdbcType=INTEGER},
      </if>
      <if test="hasTransfer != null">
        #{hasTransfer,jdbcType=TINYINT},
      </if>
      <if test="skuName != null">
        #{skuName,jdbcType=VARCHAR},
      </if>
      <if test="estimatedArrivalTime != null">
        #{estimatedArrivalTime,jdbcType=TIMESTAMP},
      </if>
      <if test="supplierId != null">
        #{supplierId,jdbcType=INTEGER},
      </if>
      <if test="supplierName != null">
        #{supplierName,jdbcType=VARCHAR},
      </if>
      <if test="confirmTime != null">
        #{confirmTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payTime != null">
        #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payType != null">
        #{payType,jdbcType=TINYINT},
      </if>
      <if test="price != null">
        #{price,jdbcType=DECIMAL},
      </if>
      <if test="buyStatus != null">
        #{buyStatus,jdbcType=TINYINT},
      </if>
      <if test="transportType != null">
        #{transportType,jdbcType=TINYINT},
      </if>
      <if test="deliverId != null">
        #{deliverId,jdbcType=INTEGER},
      </if>
      <if test="parentId != null">
        #{parentId,jdbcType=INTEGER},
      </if>
      <if test="hasDelete != null">
        #{hasDelete,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcBasePurchaseExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_base_purchase
    <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_base_purchase
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.gmtCreate != null">
        gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.gmtModified != null">
        gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="record.bailunSku != null">
        bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseId != null">
        purchase_id = #{record.purchaseId,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.status != null">
        status = #{record.status,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.count != null">
        count = #{record.count,jdbcType=INTEGER},
      </if>
      <if test="record.hasTransfer != null">
        has_transfer = #{record.hasTransfer,jdbcType=TINYINT},
      </if>
      <if test="record.skuName != null">
        sku_name = #{record.skuName,jdbcType=VARCHAR},
      </if>
      <if test="record.estimatedArrivalTime != null">
        estimated_arrival_time = #{record.estimatedArrivalTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.supplierId != null">
        supplier_id = #{record.supplierId,jdbcType=INTEGER},
      </if>
      <if test="record.supplierName != null">
        supplier_name = #{record.supplierName,jdbcType=VARCHAR},
      </if>
      <if test="record.confirmTime != null">
        confirm_time = #{record.confirmTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.payTime != null">
        pay_time = #{record.payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.payType != null">
        pay_type = #{record.payType,jdbcType=TINYINT},
      </if>
      <if test="record.price != null">
        price = #{record.price,jdbcType=DECIMAL},
      </if>
      <if test="record.buyStatus != null">
        buy_status = #{record.buyStatus,jdbcType=TINYINT},
      </if>
      <if test="record.transportType != null">
        transport_type = #{record.transportType,jdbcType=TINYINT},
      </if>
      <if test="record.deliverId != null">
        deliver_id = #{record.deliverId,jdbcType=INTEGER},
      </if>
      <if test="record.parentId != null">
        parent_id = #{record.parentId,jdbcType=INTEGER},
      </if>
      <if test="record.hasDelete != null">
        has_delete = #{record.hasDelete,jdbcType=TINYINT},
      </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_base_purchase
    set id = #{record.id,jdbcType=INTEGER},
      gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
      gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
      bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      purchase_id = #{record.purchaseId,jdbcType=VARCHAR},
      warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
      warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      count = #{record.count,jdbcType=INTEGER},
      has_transfer = #{record.hasTransfer,jdbcType=TINYINT},
      sku_name = #{record.skuName,jdbcType=VARCHAR},
      estimated_arrival_time = #{record.estimatedArrivalTime,jdbcType=TIMESTAMP},
      supplier_id = #{record.supplierId,jdbcType=INTEGER},
      supplier_name = #{record.supplierName,jdbcType=VARCHAR},
      confirm_time = #{record.confirmTime,jdbcType=TIMESTAMP},
      pay_time = #{record.payTime,jdbcType=TIMESTAMP},
      pay_type = #{record.payType,jdbcType=TINYINT},
      price = #{record.price,jdbcType=DECIMAL},
      buy_status = #{record.buyStatus,jdbcType=TINYINT},
      transport_type = #{record.transportType,jdbcType=TINYINT},
      deliver_id = #{record.deliverId,jdbcType=INTEGER},
      parent_id = #{record.parentId,jdbcType=INTEGER},
      has_delete = #{record.hasDelete,jdbcType=TINYINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcBasePurchase">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_purchase
    <set>
      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="purchaseId != null">
        purchase_id = #{purchaseId,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="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="count != null">
        count = #{count,jdbcType=INTEGER},
      </if>
      <if test="hasTransfer != null">
        has_transfer = #{hasTransfer,jdbcType=TINYINT},
      </if>
      <if test="skuName != null">
        sku_name = #{skuName,jdbcType=VARCHAR},
      </if>
      <if test="estimatedArrivalTime != null">
        estimated_arrival_time = #{estimatedArrivalTime,jdbcType=TIMESTAMP},
      </if>
      <if test="supplierId != null">
        supplier_id = #{supplierId,jdbcType=INTEGER},
      </if>
      <if test="supplierName != null">
        supplier_name = #{supplierName,jdbcType=VARCHAR},
      </if>
      <if test="confirmTime != null">
        confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payTime != null">
        pay_time = #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payType != null">
        pay_type = #{payType,jdbcType=TINYINT},
      </if>
      <if test="price != null">
        price = #{price,jdbcType=DECIMAL},
      </if>
      <if test="buyStatus != null">
        buy_status = #{buyStatus,jdbcType=TINYINT},
      </if>
      <if test="transportType != null">
        transport_type = #{transportType,jdbcType=TINYINT},
      </if>
      <if test="deliverId != null">
        deliver_id = #{deliverId,jdbcType=INTEGER},
      </if>
      <if test="parentId != null">
        parent_id = #{parentId,jdbcType=INTEGER},
      </if>
      <if test="hasDelete != null">
        has_delete = #{hasDelete,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcBasePurchase">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_purchase
    set gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      purchase_id = #{purchaseId,jdbcType=VARCHAR},
      warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
      warehouse_name = #{warehouseName,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      count = #{count,jdbcType=INTEGER},
      has_transfer = #{hasTransfer,jdbcType=TINYINT},
      sku_name = #{skuName,jdbcType=VARCHAR},
      estimated_arrival_time = #{estimatedArrivalTime,jdbcType=TIMESTAMP},
      supplier_id = #{supplierId,jdbcType=INTEGER},
      supplier_name = #{supplierName,jdbcType=VARCHAR},
      confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
      pay_time = #{payTime,jdbcType=TIMESTAMP},
      pay_type = #{payType,jdbcType=TINYINT},
      price = #{price,jdbcType=DECIMAL},
      buy_status = #{buyStatus,jdbcType=TINYINT},
      transport_type = #{transportType,jdbcType=TINYINT},
      deliver_id = #{deliverId,jdbcType=INTEGER},
      parent_id = #{parentId,jdbcType=INTEGER},
      has_delete = #{hasDelete,jdbcType=TINYINT}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBasePurchase">
    <!--
      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_base_purchase
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="purchaseId != null">
        purchase_id,
      </if>
      <if test="warehouseCode != null">
        warehouse_code,
      </if>
      <if test="warehouseName != null">
        warehouse_name,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="count != null">
        count,
      </if>
      <if test="hasTransfer != null">
        has_transfer,
      </if>
      <if test="skuName != null">
        sku_name,
      </if>
      <if test="estimatedArrivalTime != null">
        estimated_arrival_time,
      </if>
      <if test="supplierId != null">
        supplier_id,
      </if>
      <if test="supplierName != null">
        supplier_name,
      </if>
      <if test="confirmTime != null">
        confirm_time,
      </if>
      <if test="payTime != null">
        pay_time,
      </if>
      <if test="payType != null">
        pay_type,
      </if>
      <if test="price != null">
        price,
      </if>
      <if test="buyStatus != null">
        buy_status,
      </if>
      <if test="transportType != null">
        transport_type,
      </if>
      <if test="deliverId != null">
        deliver_id,
      </if>
      <if test="parentId != null">
        parent_id,
      </if>
      <if test="hasDelete != null">
        has_delete,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="purchaseId != null">
        #{purchaseId,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCode != null">
        #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="warehouseName != null">
        #{warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="count != null">
        #{count,jdbcType=INTEGER},
      </if>
      <if test="hasTransfer != null">
        #{hasTransfer,jdbcType=TINYINT},
      </if>
      <if test="skuName != null">
        #{skuName,jdbcType=VARCHAR},
      </if>
      <if test="estimatedArrivalTime != null">
        #{estimatedArrivalTime,jdbcType=TIMESTAMP},
      </if>
      <if test="supplierId != null">
        #{supplierId,jdbcType=INTEGER},
      </if>
      <if test="supplierName != null">
        #{supplierName,jdbcType=VARCHAR},
      </if>
      <if test="confirmTime != null">
        #{confirmTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payTime != null">
        #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payType != null">
        #{payType,jdbcType=TINYINT},
      </if>
      <if test="price != null">
        #{price,jdbcType=DECIMAL},
      </if>
      <if test="buyStatus != null">
        #{buyStatus,jdbcType=TINYINT},
      </if>
      <if test="transportType != null">
        #{transportType,jdbcType=TINYINT},
      </if>
      <if test="deliverId != null">
        #{deliverId,jdbcType=INTEGER},
      </if>
      <if test="parentId != null">
        #{parentId,jdbcType=INTEGER},
      </if>
      <if test="hasDelete != null">
        #{hasDelete,jdbcType=TINYINT},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="purchaseId != null">
        purchase_id = #{purchaseId,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="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="count != null">
        count = #{count,jdbcType=INTEGER},
      </if>
      <if test="hasTransfer != null">
        has_transfer = #{hasTransfer,jdbcType=TINYINT},
      </if>
      <if test="skuName != null">
        sku_name = #{skuName,jdbcType=VARCHAR},
      </if>
      <if test="estimatedArrivalTime != null">
        estimated_arrival_time = #{estimatedArrivalTime,jdbcType=TIMESTAMP},
      </if>
      <if test="supplierId != null">
        supplier_id = #{supplierId,jdbcType=INTEGER},
      </if>
      <if test="supplierName != null">
        supplier_name = #{supplierName,jdbcType=VARCHAR},
      </if>
      <if test="confirmTime != null">
        confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payTime != null">
        pay_time = #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="payType != null">
        pay_type = #{payType,jdbcType=TINYINT},
      </if>
      <if test="price != null">
        price = #{price,jdbcType=DECIMAL},
      </if>
      <if test="buyStatus != null">
        buy_status = #{buyStatus,jdbcType=TINYINT},
      </if>
      <if test="transportType != null">
        transport_type = #{transportType,jdbcType=TINYINT},
      </if>
      <if test="deliverId != null">
        deliver_id = #{deliverId,jdbcType=INTEGER},
      </if>
      <if test="parentId != null">
        parent_id = #{parentId,jdbcType=INTEGER},
      </if>
      <if test="hasDelete != null">
        has_delete = #{hasDelete,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBasePurchase">
    <!--
      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_base_purchase
    (id, gmt_create, gmt_modified, bailun_sku, purchase_id, warehouse_code, warehouse_name, 
      status, create_time, update_time, count, has_transfer, sku_name, estimated_arrival_time, 
      supplier_id, supplier_name, confirm_time, pay_time, pay_type, price, buy_status, 
      transport_type, deliver_id, parent_id, has_delete)
    values
    (#{id,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
      #{bailunSku,jdbcType=VARCHAR}, #{purchaseId,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, 
      #{warehouseName,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
      #{updateTime,jdbcType=TIMESTAMP}, #{count,jdbcType=INTEGER}, #{hasTransfer,jdbcType=TINYINT},
      #{skuName,jdbcType=VARCHAR}, #{estimatedArrivalTime,jdbcType=TIMESTAMP}, #{supplierId,jdbcType=INTEGER},
      #{supplierName,jdbcType=VARCHAR}, #{confirmTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP},
      #{payType,jdbcType=TINYINT}, #{price,jdbcType=DECIMAL}, #{buyStatus,jdbcType=TINYINT}, 
      #{transportType,jdbcType=TINYINT}, #{deliverId,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER}, 
      #{hasDelete,jdbcType=TINYINT})
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
    gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
    bailun_sku = #{bailunSku,jdbcType=VARCHAR}, 
    purchase_id = #{purchaseId,jdbcType=VARCHAR}, 
    warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, 
    warehouse_name = #{warehouseName,jdbcType=VARCHAR}, 
    status = #{status,jdbcType=VARCHAR}, 
    create_time = #{createTime,jdbcType=TIMESTAMP},
    update_time = #{updateTime,jdbcType=TIMESTAMP},
    count = #{count,jdbcType=INTEGER}, 
    has_transfer = #{hasTransfer,jdbcType=TINYINT}, 
    sku_name = #{skuName,jdbcType=VARCHAR}, 
    estimated_arrival_time = #{estimatedArrivalTime,jdbcType=TIMESTAMP},
    supplier_id = #{supplierId,jdbcType=INTEGER}, 
    supplier_name = #{supplierName,jdbcType=VARCHAR}, 
    confirm_time = #{confirmTime,jdbcType=TIMESTAMP},
    pay_time = #{payTime,jdbcType=TIMESTAMP},
    pay_type = #{payType,jdbcType=TINYINT}, 
    price = #{price,jdbcType=DECIMAL}, 
    buy_status = #{buyStatus,jdbcType=TINYINT}, 
    transport_type = #{transportType,jdbcType=TINYINT}, 
    deliver_id = #{deliverId,jdbcType=INTEGER}, 
    parent_id = #{parentId,jdbcType=INTEGER}, 
    has_delete = #{hasDelete,jdbcType=TINYINT}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBasePurchaseExample" 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_base_purchase
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
</mapper>