<?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.reptileclient.jlifeapp.dao.hm.HmSalesOrderMapper" >
  <resultMap id="BaseResultMap" type="com.reptileclient.jlifeapp.entity.hm.HmSalesOrder" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="biz_order_id" property="bizOrderId" jdbcType="VARCHAR" />
    <result column="supplier_no" property="supplierNo" jdbcType="VARCHAR" />
    <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
    <result column="store_name" property="storeName" jdbcType="VARCHAR" />
    <result column="pay_time" property="payTime" jdbcType="TIMESTAMP" />
    <result column="sku_code" property="skuCode" jdbcType="VARCHAR" />
    <result column="auction_title" property="auctionTitle" jdbcType="VARCHAR" />
    <result column="order_channel" property="orderChannel" jdbcType="VARCHAR" />
    <result column="stock_unit" property="stockUnit" jdbcType="VARCHAR" />
    <result column="buy_amount" property="buyAmount" jdbcType="DECIMAL" />
    <result column="auction_price" property="auctionPrice" jdbcType="DECIMAL" />
    <result column="pay_fee" property="payFee" jdbcType="DECIMAL" />
    <result column="pay_fee_old" property="payFeeOld" jdbcType="DECIMAL" />
    <result column="refund_fee" property="refundFee" jdbcType="DECIMAL" />
    <result column="refund_time" property="refundTime" jdbcType="VARCHAR" />
    <result column="discount_info" property="discountInfo" jdbcType="VARCHAR" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="remark" property="remark" jdbcType="VARCHAR" />
    <result column="attr1" property="attr1" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, biz_order_id, supplier_no, supplier_name, store_name, pay_time, sku_code, auction_title, 
    order_channel, stock_unit, buy_amount, auction_price, pay_fee, pay_fee_old, refund_fee, 
    refund_time, discount_info, create_time, remark, attr1
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from hm_sales_order
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from hm_sales_order
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.reptileclient.jlifeapp.entity.hm.HmSalesOrder" >
    insert into hm_sales_order (id, biz_order_id, supplier_no, 
      supplier_name, store_name, pay_time, 
      sku_code, auction_title, order_channel, 
      stock_unit, buy_amount, auction_price, 
      pay_fee, pay_fee_old, refund_fee, 
      refund_time, discount_info, create_time, 
      remark, attr1)
    values (#{id,jdbcType=BIGINT}, #{bizOrderId,jdbcType=VARCHAR}, #{supplierNo,jdbcType=VARCHAR}, 
      #{supplierName,jdbcType=VARCHAR}, #{storeName,jdbcType=VARCHAR}, #{payTime,jdbcType=TIMESTAMP}, 
      #{skuCode,jdbcType=VARCHAR}, #{auctionTitle,jdbcType=VARCHAR}, #{orderChannel,jdbcType=VARCHAR}, 
      #{stockUnit,jdbcType=VARCHAR}, #{buyAmount,jdbcType=DECIMAL}, #{auctionPrice,jdbcType=DECIMAL}, 
      #{payFee,jdbcType=DECIMAL}, #{payFeeOld,jdbcType=DECIMAL}, #{refundFee,jdbcType=DECIMAL}, 
      #{refundTime,jdbcType=VARCHAR}, #{discountInfo,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{remark,jdbcType=VARCHAR}, #{attr1,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.reptileclient.jlifeapp.entity.hm.HmSalesOrder" >
    insert into hm_sales_order
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="bizOrderId != null" >
        biz_order_id,
      </if>
      <if test="supplierNo != null" >
        supplier_no,
      </if>
      <if test="supplierName != null" >
        supplier_name,
      </if>
      <if test="storeName != null" >
        store_name,
      </if>
      <if test="payTime != null" >
        pay_time,
      </if>
      <if test="skuCode != null" >
        sku_code,
      </if>
      <if test="auctionTitle != null" >
        auction_title,
      </if>
      <if test="orderChannel != null" >
        order_channel,
      </if>
      <if test="stockUnit != null" >
        stock_unit,
      </if>
      <if test="buyAmount != null" >
        buy_amount,
      </if>
      <if test="auctionPrice != null" >
        auction_price,
      </if>
      <if test="payFee != null" >
        pay_fee,
      </if>
      <if test="payFeeOld != null" >
        pay_fee_old,
      </if>
      <if test="refundFee != null" >
        refund_fee,
      </if>
      <if test="refundTime != null" >
        refund_time,
      </if>
      <if test="discountInfo != null" >
        discount_info,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="remark != null" >
        remark,
      </if>
      <if test="attr1 != null" >
        attr1,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="bizOrderId != null" >
        #{bizOrderId,jdbcType=VARCHAR},
      </if>
      <if test="supplierNo != null" >
        #{supplierNo,jdbcType=VARCHAR},
      </if>
      <if test="supplierName != null" >
        #{supplierName,jdbcType=VARCHAR},
      </if>
      <if test="storeName != null" >
        #{storeName,jdbcType=VARCHAR},
      </if>
      <if test="payTime != null" >
        #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="skuCode != null" >
        #{skuCode,jdbcType=VARCHAR},
      </if>
      <if test="auctionTitle != null" >
        #{auctionTitle,jdbcType=VARCHAR},
      </if>
      <if test="orderChannel != null" >
        #{orderChannel,jdbcType=VARCHAR},
      </if>
      <if test="stockUnit != null" >
        #{stockUnit,jdbcType=VARCHAR},
      </if>
      <if test="buyAmount != null" >
        #{buyAmount,jdbcType=DECIMAL},
      </if>
      <if test="auctionPrice != null" >
        #{auctionPrice,jdbcType=DECIMAL},
      </if>
      <if test="payFee != null" >
        #{payFee,jdbcType=DECIMAL},
      </if>
      <if test="payFeeOld != null" >
        #{payFeeOld,jdbcType=DECIMAL},
      </if>
      <if test="refundFee != null" >
        #{refundFee,jdbcType=DECIMAL},
      </if>
      <if test="refundTime != null" >
        #{refundTime,jdbcType=VARCHAR},
      </if>
      <if test="discountInfo != null" >
        #{discountInfo,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="attr1 != null" >
        #{attr1,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.reptileclient.jlifeapp.entity.hm.HmSalesOrder" >
    update hm_sales_order
    <set >
      <if test="bizOrderId != null" >
        biz_order_id = #{bizOrderId,jdbcType=VARCHAR},
      </if>
      <if test="supplierNo != null" >
        supplier_no = #{supplierNo,jdbcType=VARCHAR},
      </if>
      <if test="supplierName != null" >
        supplier_name = #{supplierName,jdbcType=VARCHAR},
      </if>
      <if test="storeName != null" >
        store_name = #{storeName,jdbcType=VARCHAR},
      </if>
      <if test="payTime != null" >
        pay_time = #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="skuCode != null" >
        sku_code = #{skuCode,jdbcType=VARCHAR},
      </if>
      <if test="auctionTitle != null" >
        auction_title = #{auctionTitle,jdbcType=VARCHAR},
      </if>
      <if test="orderChannel != null" >
        order_channel = #{orderChannel,jdbcType=VARCHAR},
      </if>
      <if test="stockUnit != null" >
        stock_unit = #{stockUnit,jdbcType=VARCHAR},
      </if>
      <if test="buyAmount != null" >
        buy_amount = #{buyAmount,jdbcType=DECIMAL},
      </if>
      <if test="auctionPrice != null" >
        auction_price = #{auctionPrice,jdbcType=DECIMAL},
      </if>
      <if test="payFee != null" >
        pay_fee = #{payFee,jdbcType=DECIMAL},
      </if>
      <if test="payFeeOld != null" >
        pay_fee_old = #{payFeeOld,jdbcType=DECIMAL},
      </if>
      <if test="refundFee != null" >
        refund_fee = #{refundFee,jdbcType=DECIMAL},
      </if>
      <if test="refundTime != null" >
        refund_time = #{refundTime,jdbcType=VARCHAR},
      </if>
      <if test="discountInfo != null" >
        discount_info = #{discountInfo,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null" >
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="attr1 != null" >
        attr1 = #{attr1,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.reptileclient.jlifeapp.entity.hm.HmSalesOrder" >
    update hm_sales_order
    set biz_order_id = #{bizOrderId,jdbcType=VARCHAR},
      supplier_no = #{supplierNo,jdbcType=VARCHAR},
      supplier_name = #{supplierName,jdbcType=VARCHAR},
      store_name = #{storeName,jdbcType=VARCHAR},
      pay_time = #{payTime,jdbcType=TIMESTAMP},
      sku_code = #{skuCode,jdbcType=VARCHAR},
      auction_title = #{auctionTitle,jdbcType=VARCHAR},
      order_channel = #{orderChannel,jdbcType=VARCHAR},
      stock_unit = #{stockUnit,jdbcType=VARCHAR},
      buy_amount = #{buyAmount,jdbcType=DECIMAL},
      auction_price = #{auctionPrice,jdbcType=DECIMAL},
      pay_fee = #{payFee,jdbcType=DECIMAL},
      pay_fee_old = #{payFeeOld,jdbcType=DECIMAL},
      refund_fee = #{refundFee,jdbcType=DECIMAL},
      refund_time = #{refundTime,jdbcType=VARCHAR},
      discount_info = #{discountInfo,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      remark = #{remark,jdbcType=VARCHAR},
      attr1 = #{attr1,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  
  <insert id="batcInsert" >
    insert into hm_sales_order (biz_order_id, supplier_no, 
      supplier_name, store_name, pay_time, 
      sku_code, auction_title, order_channel, 
      stock_unit, buy_amount, auction_price, 
      pay_fee, pay_fee_old, refund_fee, 
      refund_time, discount_info  )
    values 
    <foreach collection="list" item="item" index="index" separator=",">
    (
      #{item.bizOrderId,jdbcType=VARCHAR},  #{item.supplierNo,jdbcType=VARCHAR}, 
       #{item.supplierName,jdbcType=VARCHAR},  #{item.storeName,jdbcType=VARCHAR},  #{item.payTime,jdbcType=TIMESTAMP}, 
       #{item.skuCode,jdbcType=VARCHAR},  #{item.auctionTitle,jdbcType=VARCHAR},  #{item.orderChannel,jdbcType=VARCHAR}, 
       #{item.stockUnit,jdbcType=VARCHAR},  #{item.buyAmount,jdbcType=DECIMAL},  #{item.auctionPrice,jdbcType=DECIMAL}, 
       #{item.payFee,jdbcType=DECIMAL},  #{item.payFeeOld,jdbcType=DECIMAL},  #{item.refundFee,jdbcType=DECIMAL}, 
       #{item.refundTime,jdbcType=VARCHAR},  #{item.discountInfo,jdbcType=VARCHAR} 
       )
       </foreach>
  </insert>
  
</mapper>