MallBizRefundItemDao.xml 4.7 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.MallBizRefundItemDao">
  <resultMap id="BaseResultMap" type="com.diligrp.cashier.mall.model.MallBizRefundItem">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="biz_refund_id" jdbcType="BIGINT" property="bizRefundId" />
    <result column="sub_order_id" jdbcType="BIGINT" property="subOrderId" />
    <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="refund_fee" jdbcType="BIGINT" property="refundFee" />
  </resultMap>
  <sql id="Base_Column_List">
    id, biz_refund_id, sub_order_id, item_bn, item_name, num, refund_fee
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from mall_biz_refund_item
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from mall_biz_refund_item
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.diligrp.cashier.mall.model.MallBizRefundItem">
    insert into mall_biz_refund_item (id, biz_refund_id, sub_order_id,
      item_bn, item_name, num,
      refund_fee)
    values (#{id,jdbcType=BIGINT}, #{bizRefundId,jdbcType=BIGINT}, #{subOrderId,jdbcType=BIGINT},
      #{itemBn,jdbcType=VARCHAR}, #{itemName,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER},
      #{refundFee,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="com.diligrp.cashier.mall.model.MallBizRefundItem">
    insert into mall_biz_refund_item
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bizRefundId != null">
        biz_refund_id,
      </if>
      <if test="subOrderId != null">
        sub_order_id,
      </if>
      <if test="itemBn != null">
        item_bn,
      </if>
      <if test="itemName != null">
        item_name,
      </if>
      <if test="num != null">
        num,
      </if>
      <if test="refundFee != null">
        refund_fee,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="bizRefundId != null">
        #{bizRefundId,jdbcType=BIGINT},
      </if>
      <if test="subOrderId != null">
        #{subOrderId,jdbcType=BIGINT},
      </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="refundFee != null">
        #{refundFee,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.cashier.mall.model.MallBizRefundItem">
    update mall_biz_refund_item
    <set>
      <if test="bizRefundId != null">
        biz_refund_id = #{bizRefundId,jdbcType=BIGINT},
      </if>
      <if test="subOrderId != null">
        sub_order_id = #{subOrderId,jdbcType=BIGINT},
      </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="refundFee != null">
        refund_fee = #{refundFee,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.diligrp.cashier.mall.model.MallBizRefundItem">
    update mall_biz_refund_item
    set biz_refund_id = #{bizRefundId,jdbcType=BIGINT},
      sub_order_id = #{subOrderId,jdbcType=BIGINT},
      item_bn = #{itemBn,jdbcType=VARCHAR},
      item_name = #{itemName,jdbcType=VARCHAR},
      num = #{num,jdbcType=INTEGER},
      refund_fee = #{refundFee,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>

  <insert id="batchInsert">
      insert into mall_biz_refund_item (biz_refund_id, sub_order_id,
        item_bn, item_name, num,
        refund_fee)
      values
      <foreach collection="list" item="item" index="index" separator=",">
        (#{item.bizRefundId,jdbcType=BIGINT}, #{item.subOrderId,jdbcType=BIGINT},
        #{item.itemBn,jdbcType=VARCHAR}, #{item.itemName,jdbcType=VARCHAR}, #{item.num,jdbcType=INTEGER},
        #{item.refundFee,jdbcType=BIGINT})
      </foreach>
  </insert>

</mapper>