MallBizOrderItemDao.xml 9.14 KB
<?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.diligrp.cashier.mall.dao.MallBizOrderItemDao">
  <resultMap id="BaseResultMap" type="com.diligrp.cashier.mall.model.MallBizOrderItem">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="biz_order_id" jdbcType="BIGINT" property="bizOrderId" />
    <result column="order_id" jdbcType="VARCHAR" property="orderId" />
    <result column="sub_order_id" jdbcType="VARCHAR" property="subOrderId" />
    <result column="shop_code" jdbcType="VARCHAR" property="shopCode" />
    <result column="shop_name" jdbcType="VARCHAR" property="shopName" />
    <result column="item_bn" jdbcType="VARCHAR" property="itemBn" />
    <result column="item_name" jdbcType="VARCHAR" property="itemName" />
    <result column="num" jdbcType="INTEGER" property="num" />
    <result column="price" jdbcType="BIGINT" property="price" />
    <result column="amount" jdbcType="BIGINT" property="amount" />
    <result column="discount_fee" jdbcType="BIGINT" property="discountFee" />
    <result column="pic" jdbcType="VARCHAR" property="pic" />
    <result column="tax_output_rate" jdbcType="VARCHAR" property="taxOutputRate" />
    <result column="tax_classification_code" jdbcType="VARCHAR" property="taxClassificationCode" />
    <result column="tax_classification_name" jdbcType="VARCHAR" property="taxClassificationName" />
  </resultMap>
  <sql id="Base_Column_List">
    id, biz_order_id, order_id, sub_order_id, shop_code, shop_name, item_bn, item_name,
    num, price, amount, discount_fee, pic, tax_output_rate,
    tax_classification_code, tax_classification_name
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from mall_biz_order_item
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from mall_biz_order_item
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.diligrp.cashier.mall.model.MallBizOrderItem">
    insert into mall_biz_order_item (id, biz_order_id, order_id,
      sub_order_id, shop_code, shop_name,
      item_bn, item_name, num,
      price, amount, discount_fee, pic, tax_output_rate,
      tax_classification_code, tax_classification_name
      )
    values (#{id,jdbcType=BIGINT}, #{bizOrderId,jdbcType=BIGINT}, #{orderId,jdbcType=VARCHAR},
      #{subOrderId,jdbcType=VARCHAR}, #{shopCode,jdbcType=VARCHAR}, #{shopName,jdbcType=VARCHAR},
      #{itemBn,jdbcType=VARCHAR}, #{itemName,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER},
      #{price,jdbcType=BIGINT}, #{amount,jdbcType=BIGINT}, #{discountFee,jdbcType=BIGINT}, #{pic,jdbcType=VARCHAR}, #{taxOutputRate,jdbcType=VARCHAR},
      #{taxClassificationCode,jdbcType=VARCHAR}, #{taxClassificationName,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.diligrp.cashier.mall.model.MallBizOrderItem">
    insert into mall_biz_order_item
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bizOrderId != null">
        biz_order_id,
      </if>
      <if test="orderId != null">
        order_id,
      </if>
      <if test="subOrderId != null">
        sub_order_id,
      </if>
      <if test="shopCode != null">
        shop_code,
      </if>
      <if test="shopName != null">
        shop_name,
      </if>
      <if test="itemBn != null">
        item_bn,
      </if>
      <if test="itemName != null">
        item_name,
      </if>
      <if test="num != null">
        num,
      </if>
      <if test="price != null">
        price,
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="pic != null">
        pic,
      </if>
      <if test="taxOutputRate != null">
        tax_output_rate,
      </if>
      <if test="taxClassificationCode != null">
        tax_classification_code,
      </if>
      <if test="taxClassificationName != null">
        tax_classification_name,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="bizOrderId != null">
        #{bizOrderId,jdbcType=BIGINT},
      </if>
      <if test="orderId != null">
        #{orderId,jdbcType=VARCHAR},
      </if>
      <if test="subOrderId != null">
        #{subOrderId,jdbcType=VARCHAR},
      </if>
      <if test="shopCode != null">
        #{shopCode,jdbcType=VARCHAR},
      </if>
      <if test="shopName != null">
        #{shopName,jdbcType=VARCHAR},
      </if>
      <if test="itemBn != null">
        #{itemBn,jdbcType=VARCHAR},
      </if>
      <if test="itemName != null">
        #{itemName,jdbcType=VARCHAR},
      </if>
      <if test="num != null">
        #{num,jdbcType=INTEGER},
      </if>
      <if test="price != null">
        #{price,jdbcType=BIGINT},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=BIGINT},
      </if>
      <if test="pic != null">
        #{pic,jdbcType=VARCHAR},
      </if>
      <if test="taxOutputRate != null">
        #{taxOutputRate,jdbcType=VARCHAR},
      </if>
      <if test="taxClassificationCode != null">
        #{taxClassificationCode,jdbcType=VARCHAR},
      </if>
      <if test="taxClassificationName != null">
        #{taxClassificationName,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.cashier.mall.model.MallBizOrderItem">
    update mall_biz_order_item
    <set>
      <if test="bizOrderId != null">
        biz_order_id = #{bizOrderId,jdbcType=BIGINT},
      </if>
      <if test="orderId != null">
        order_id = #{orderId,jdbcType=VARCHAR},
      </if>
      <if test="subOrderId != null">
        sub_order_id = #{subOrderId,jdbcType=VARCHAR},
      </if>
      <if test="shopCode != null">
        shop_code = #{shopCode,jdbcType=VARCHAR},
      </if>
      <if test="shopName != null">
        shop_name = #{shopName,jdbcType=VARCHAR},
      </if>
      <if test="itemBn != null">
        item_bn = #{itemBn,jdbcType=VARCHAR},
      </if>
      <if test="itemName != null">
        item_name = #{itemName,jdbcType=VARCHAR},
      </if>
      <if test="num != null">
        num = #{num,jdbcType=INTEGER},
      </if>
      <if test="price != null">
        price = #{price,jdbcType=BIGINT},
      </if>
      <if test="amount != null">
        amount = #{amount,jdbcType=BIGINT},
      </if>
      <if test="pic != null">
        pic = #{pic,jdbcType=VARCHAR},
      </if>
      <if test="taxOutputRate != null">
        tax_output_rate = #{taxOutputRate,jdbcType=VARCHAR},
      </if>
      <if test="taxClassificationCode != null">
        tax_classification_code = #{taxClassificationCode,jdbcType=VARCHAR},
      </if>
      <if test="taxClassificationName != null">
        tax_classification_name = #{taxClassificationName,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.diligrp.cashier.mall.model.MallBizOrderItem">
    update mall_biz_order_item
    set biz_order_id = #{bizOrderId,jdbcType=BIGINT},
      order_id = #{orderId,jdbcType=VARCHAR},
      sub_order_id = #{subOrderId,jdbcType=VARCHAR},
      shop_code = #{shopCode,jdbcType=VARCHAR},
      shop_name = #{shopName,jdbcType=VARCHAR},
      item_bn = #{itemBn,jdbcType=VARCHAR},
      item_name = #{itemName,jdbcType=VARCHAR},
      num = #{num,jdbcType=INTEGER},
      price = #{price,jdbcType=BIGINT},
      amount = #{amount,jdbcType=BIGINT},
      pic = #{pic,jdbcType=VARCHAR},
      tax_output_rate = #{taxOutputRate,jdbcType=VARCHAR},
      tax_classification_code = #{taxClassificationCode,jdbcType=VARCHAR},
      tax_classification_name = #{taxClassificationName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>

    <insert id="batchInsert">
      insert into mall_biz_order_item (
        id,
        biz_order_id,
        order_id,
        trade_id,
        sub_order_id,
        shop_code,
        shop_name,
        item_bn,
        item_name,
        num,
        price,
        amount,
        discount_fee,
        pic,
        tax_output_rate,
        tax_classification_code,
        tax_classification_name)
      values
      <foreach collection="list" item="item" separator=",">
        (#{item.id,jdbcType=BIGINT},
        #{item.bizOrderId,jdbcType=BIGINT},
        #{item.orderId,jdbcType=VARCHAR},
        #{item.tradeId,jdbcType=VARCHAR},
        #{item.subOrderId,jdbcType=VARCHAR},
        #{item.shopCode,jdbcType=VARCHAR},
        #{item.shopName,jdbcType=VARCHAR},
        #{item.itemBn,jdbcType=VARCHAR},
        #{item.itemName,jdbcType=VARCHAR},
        #{item.num,jdbcType=INTEGER},
        #{item.price,jdbcType=BIGINT},
        #{item.amount,jdbcType=BIGINT},
        #{item.discountFee,jdbcType=BIGINT},
        #{item.pic,jdbcType=VARCHAR},
        #{item.taxOutputRate,jdbcType=VARCHAR},
        #{item.taxClassificationCode,jdbcType=VARCHAR},
        #{item.taxClassificationName,jdbcType=VARCHAR})
      </foreach>
    </insert>
</mapper>