<?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="cn.superdesk.uniorder.dao.mapper.base.UnifiedOrderReturnGoodsMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnGoods">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="return_sn" jdbcType="VARCHAR" property="returnSn" />
    <result column="refund_order_sn" jdbcType="VARCHAR" property="refundOrderSn" />
    <result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
    <result column="goods_alias" jdbcType="VARCHAR" property="goodsAlias" />
    <result column="goods_id" jdbcType="BIGINT" property="goodsId" />
    <result column="out_snapshot_order_goods_id" jdbcType="BIGINT" property="outSnapshotOrderGoodsId" />
    <result column="goods_type" jdbcType="TINYINT" property="goodsType" />
    <result column="quantity" jdbcType="INTEGER" property="quantity" />
    <result column="unit" jdbcType="VARCHAR" property="unit" />
    <result column="price" jdbcType="DECIMAL" property="price" />
    <result column="cost_price" jdbcType="DECIMAL" property="costPrice" />
    <result column="fiscal_code" jdbcType="VARCHAR" property="fiscalCode" />
    <result column="tax_code" jdbcType="VARCHAR" property="taxCode" />
    <result column="tax_rate" jdbcType="DECIMAL" property="taxRate" />
    <result column="merch_tax_id" jdbcType="BIGINT" property="merchTaxId" />
    <result column="merch_tax_code" jdbcType="VARCHAR" property="merchTaxCode" />
    <result column="merch_tax_rate" jdbcType="DECIMAL" property="merchTaxRate" />
    <result column="operation_tax_id" jdbcType="BIGINT" property="operationTaxId" />
    <result column="operation_tax_code" jdbcType="VARCHAR" property="operationTaxCode" />
    <result column="operation_tax_rate" jdbcType="DECIMAL" property="operationTaxRate" />
    <result column="cate_id_lv1" jdbcType="BIGINT" property="cateIdLv1" />
    <result column="cate_name_lv1" jdbcType="VARCHAR" property="cateNameLv1" />
    <result column="cate_id_lv2" jdbcType="BIGINT" property="cateIdLv2" />
    <result column="cate_name_lv2" jdbcType="VARCHAR" property="cateNameLv2" />
    <result column="cate_id_lv3" jdbcType="BIGINT" property="cateIdLv3" />
    <result column="cate_name_lv3" jdbcType="VARCHAR" property="cateNameLv3" />
    <result column="self_option" jdbcType="VARCHAR" property="selfOption" />
    <result column="direction" jdbcType="TINYINT" property="direction" />
    <result column="goods_locking_customer" jdbcType="TINYINT" property="goodsLockingCustomer" />
    <result column="goods_locking_supplier" jdbcType="TINYINT" property="goodsLockingSupplier" />
    <result column="accounting_state_customer" jdbcType="TINYINT" property="accountingStateCustomer" />
    <result column="accounting_state_supplier" jdbcType="TINYINT" property="accountingStateSupplier" />
    <result column="back_account_status" jdbcType="TINYINT" property="backAccountStatus" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_user_id" jdbcType="BIGINT" property="updateUserId" />
    <result column="goods_params" jdbcType="VARCHAR" property="goodsParams" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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">
    <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">
    id, return_sn, refund_order_sn, goods_name, goods_alias, goods_id, out_snapshot_order_goods_id, 
    goods_type, quantity, unit, price, cost_price, fiscal_code, tax_code, tax_rate, merch_tax_id, 
    merch_tax_code, merch_tax_rate, operation_tax_id, operation_tax_code, operation_tax_rate, 
    cate_id_lv1, cate_name_lv1, cate_id_lv2, cate_name_lv2, cate_id_lv3, cate_name_lv3, 
    self_option, direction, goods_locking_customer, goods_locking_supplier, accounting_state_customer, 
    accounting_state_supplier, back_account_status, create_time, create_user_id, update_time, 
    update_user_id, goods_params
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnGoodsExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from unified_order_return_goods
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from unified_order_return_goods
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from unified_order_return_goods
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnGoodsExample">
    delete from unified_order_return_goods
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnGoods">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into unified_order_return_goods (return_sn, refund_order_sn, goods_name, 
      goods_alias, goods_id, out_snapshot_order_goods_id, 
      goods_type, quantity, unit, 
      price, cost_price, fiscal_code, 
      tax_code, tax_rate, merch_tax_id, 
      merch_tax_code, merch_tax_rate, operation_tax_id, 
      operation_tax_code, operation_tax_rate, cate_id_lv1, 
      cate_name_lv1, cate_id_lv2, cate_name_lv2, 
      cate_id_lv3, cate_name_lv3, self_option, 
      direction, goods_locking_customer, goods_locking_supplier, 
      accounting_state_customer, accounting_state_supplier, 
      back_account_status, create_time, create_user_id, 
      update_time, update_user_id, goods_params
      )
    values (#{returnSn,jdbcType=VARCHAR}, #{refundOrderSn,jdbcType=VARCHAR}, #{goodsName,jdbcType=VARCHAR}, 
      #{goodsAlias,jdbcType=VARCHAR}, #{goodsId,jdbcType=BIGINT}, #{outSnapshotOrderGoodsId,jdbcType=BIGINT}, 
      #{goodsType,jdbcType=TINYINT}, #{quantity,jdbcType=INTEGER}, #{unit,jdbcType=VARCHAR}, 
      #{price,jdbcType=DECIMAL}, #{costPrice,jdbcType=DECIMAL}, #{fiscalCode,jdbcType=VARCHAR}, 
      #{taxCode,jdbcType=VARCHAR}, #{taxRate,jdbcType=DECIMAL}, #{merchTaxId,jdbcType=BIGINT}, 
      #{merchTaxCode,jdbcType=VARCHAR}, #{merchTaxRate,jdbcType=DECIMAL}, #{operationTaxId,jdbcType=BIGINT}, 
      #{operationTaxCode,jdbcType=VARCHAR}, #{operationTaxRate,jdbcType=DECIMAL}, #{cateIdLv1,jdbcType=BIGINT}, 
      #{cateNameLv1,jdbcType=VARCHAR}, #{cateIdLv2,jdbcType=BIGINT}, #{cateNameLv2,jdbcType=VARCHAR}, 
      #{cateIdLv3,jdbcType=BIGINT}, #{cateNameLv3,jdbcType=VARCHAR}, #{selfOption,jdbcType=VARCHAR}, 
      #{direction,jdbcType=TINYINT}, #{goodsLockingCustomer,jdbcType=TINYINT}, #{goodsLockingSupplier,jdbcType=TINYINT}, 
      #{accountingStateCustomer,jdbcType=TINYINT}, #{accountingStateSupplier,jdbcType=TINYINT}, 
      #{backAccountStatus,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=BIGINT}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=BIGINT}, #{goodsParams,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnGoods">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into unified_order_return_goods
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="returnSn != null">
        return_sn,
      </if>
      <if test="refundOrderSn != null">
        refund_order_sn,
      </if>
      <if test="goodsName != null">
        goods_name,
      </if>
      <if test="goodsAlias != null">
        goods_alias,
      </if>
      <if test="goodsId != null">
        goods_id,
      </if>
      <if test="outSnapshotOrderGoodsId != null">
        out_snapshot_order_goods_id,
      </if>
      <if test="goodsType != null">
        goods_type,
      </if>
      <if test="quantity != null">
        quantity,
      </if>
      <if test="unit != null">
        unit,
      </if>
      <if test="price != null">
        price,
      </if>
      <if test="costPrice != null">
        cost_price,
      </if>
      <if test="fiscalCode != null">
        fiscal_code,
      </if>
      <if test="taxCode != null">
        tax_code,
      </if>
      <if test="taxRate != null">
        tax_rate,
      </if>
      <if test="merchTaxId != null">
        merch_tax_id,
      </if>
      <if test="merchTaxCode != null">
        merch_tax_code,
      </if>
      <if test="merchTaxRate != null">
        merch_tax_rate,
      </if>
      <if test="operationTaxId != null">
        operation_tax_id,
      </if>
      <if test="operationTaxCode != null">
        operation_tax_code,
      </if>
      <if test="operationTaxRate != null">
        operation_tax_rate,
      </if>
      <if test="cateIdLv1 != null">
        cate_id_lv1,
      </if>
      <if test="cateNameLv1 != null">
        cate_name_lv1,
      </if>
      <if test="cateIdLv2 != null">
        cate_id_lv2,
      </if>
      <if test="cateNameLv2 != null">
        cate_name_lv2,
      </if>
      <if test="cateIdLv3 != null">
        cate_id_lv3,
      </if>
      <if test="cateNameLv3 != null">
        cate_name_lv3,
      </if>
      <if test="selfOption != null">
        self_option,
      </if>
      <if test="direction != null">
        direction,
      </if>
      <if test="goodsLockingCustomer != null">
        goods_locking_customer,
      </if>
      <if test="goodsLockingSupplier != null">
        goods_locking_supplier,
      </if>
      <if test="accountingStateCustomer != null">
        accounting_state_customer,
      </if>
      <if test="accountingStateSupplier != null">
        accounting_state_supplier,
      </if>
      <if test="backAccountStatus != null">
        back_account_status,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
      <if test="goodsParams != null">
        goods_params,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="returnSn != null">
        #{returnSn,jdbcType=VARCHAR},
      </if>
      <if test="refundOrderSn != null">
        #{refundOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="goodsName != null">
        #{goodsName,jdbcType=VARCHAR},
      </if>
      <if test="goodsAlias != null">
        #{goodsAlias,jdbcType=VARCHAR},
      </if>
      <if test="goodsId != null">
        #{goodsId,jdbcType=BIGINT},
      </if>
      <if test="outSnapshotOrderGoodsId != null">
        #{outSnapshotOrderGoodsId,jdbcType=BIGINT},
      </if>
      <if test="goodsType != null">
        #{goodsType,jdbcType=TINYINT},
      </if>
      <if test="quantity != null">
        #{quantity,jdbcType=INTEGER},
      </if>
      <if test="unit != null">
        #{unit,jdbcType=VARCHAR},
      </if>
      <if test="price != null">
        #{price,jdbcType=DECIMAL},
      </if>
      <if test="costPrice != null">
        #{costPrice,jdbcType=DECIMAL},
      </if>
      <if test="fiscalCode != null">
        #{fiscalCode,jdbcType=VARCHAR},
      </if>
      <if test="taxCode != null">
        #{taxCode,jdbcType=VARCHAR},
      </if>
      <if test="taxRate != null">
        #{taxRate,jdbcType=DECIMAL},
      </if>
      <if test="merchTaxId != null">
        #{merchTaxId,jdbcType=BIGINT},
      </if>
      <if test="merchTaxCode != null">
        #{merchTaxCode,jdbcType=VARCHAR},
      </if>
      <if test="merchTaxRate != null">
        #{merchTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="operationTaxId != null">
        #{operationTaxId,jdbcType=BIGINT},
      </if>
      <if test="operationTaxCode != null">
        #{operationTaxCode,jdbcType=VARCHAR},
      </if>
      <if test="operationTaxRate != null">
        #{operationTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="cateIdLv1 != null">
        #{cateIdLv1,jdbcType=BIGINT},
      </if>
      <if test="cateNameLv1 != null">
        #{cateNameLv1,jdbcType=VARCHAR},
      </if>
      <if test="cateIdLv2 != null">
        #{cateIdLv2,jdbcType=BIGINT},
      </if>
      <if test="cateNameLv2 != null">
        #{cateNameLv2,jdbcType=VARCHAR},
      </if>
      <if test="cateIdLv3 != null">
        #{cateIdLv3,jdbcType=BIGINT},
      </if>
      <if test="cateNameLv3 != null">
        #{cateNameLv3,jdbcType=VARCHAR},
      </if>
      <if test="selfOption != null">
        #{selfOption,jdbcType=VARCHAR},
      </if>
      <if test="direction != null">
        #{direction,jdbcType=TINYINT},
      </if>
      <if test="goodsLockingCustomer != null">
        #{goodsLockingCustomer,jdbcType=TINYINT},
      </if>
      <if test="goodsLockingSupplier != null">
        #{goodsLockingSupplier,jdbcType=TINYINT},
      </if>
      <if test="accountingStateCustomer != null">
        #{accountingStateCustomer,jdbcType=TINYINT},
      </if>
      <if test="accountingStateSupplier != null">
        #{accountingStateSupplier,jdbcType=TINYINT},
      </if>
      <if test="backAccountStatus != null">
        #{backAccountStatus,jdbcType=TINYINT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=BIGINT},
      </if>
      <if test="goodsParams != null">
        #{goodsParams,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnGoodsExample" resultType="java.lang.Long">
    select count(*) from unified_order_return_goods
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update unified_order_return_goods
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.returnSn != null">
        return_sn = #{record.returnSn,jdbcType=VARCHAR},
      </if>
      <if test="record.refundOrderSn != null">
        refund_order_sn = #{record.refundOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.goodsName != null">
        goods_name = #{record.goodsName,jdbcType=VARCHAR},
      </if>
      <if test="record.goodsAlias != null">
        goods_alias = #{record.goodsAlias,jdbcType=VARCHAR},
      </if>
      <if test="record.goodsId != null">
        goods_id = #{record.goodsId,jdbcType=BIGINT},
      </if>
      <if test="record.outSnapshotOrderGoodsId != null">
        out_snapshot_order_goods_id = #{record.outSnapshotOrderGoodsId,jdbcType=BIGINT},
      </if>
      <if test="record.goodsType != null">
        goods_type = #{record.goodsType,jdbcType=TINYINT},
      </if>
      <if test="record.quantity != null">
        quantity = #{record.quantity,jdbcType=INTEGER},
      </if>
      <if test="record.unit != null">
        unit = #{record.unit,jdbcType=VARCHAR},
      </if>
      <if test="record.price != null">
        price = #{record.price,jdbcType=DECIMAL},
      </if>
      <if test="record.costPrice != null">
        cost_price = #{record.costPrice,jdbcType=DECIMAL},
      </if>
      <if test="record.fiscalCode != null">
        fiscal_code = #{record.fiscalCode,jdbcType=VARCHAR},
      </if>
      <if test="record.taxCode != null">
        tax_code = #{record.taxCode,jdbcType=VARCHAR},
      </if>
      <if test="record.taxRate != null">
        tax_rate = #{record.taxRate,jdbcType=DECIMAL},
      </if>
      <if test="record.merchTaxId != null">
        merch_tax_id = #{record.merchTaxId,jdbcType=BIGINT},
      </if>
      <if test="record.merchTaxCode != null">
        merch_tax_code = #{record.merchTaxCode,jdbcType=VARCHAR},
      </if>
      <if test="record.merchTaxRate != null">
        merch_tax_rate = #{record.merchTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="record.operationTaxId != null">
        operation_tax_id = #{record.operationTaxId,jdbcType=BIGINT},
      </if>
      <if test="record.operationTaxCode != null">
        operation_tax_code = #{record.operationTaxCode,jdbcType=VARCHAR},
      </if>
      <if test="record.operationTaxRate != null">
        operation_tax_rate = #{record.operationTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="record.cateIdLv1 != null">
        cate_id_lv1 = #{record.cateIdLv1,jdbcType=BIGINT},
      </if>
      <if test="record.cateNameLv1 != null">
        cate_name_lv1 = #{record.cateNameLv1,jdbcType=VARCHAR},
      </if>
      <if test="record.cateIdLv2 != null">
        cate_id_lv2 = #{record.cateIdLv2,jdbcType=BIGINT},
      </if>
      <if test="record.cateNameLv2 != null">
        cate_name_lv2 = #{record.cateNameLv2,jdbcType=VARCHAR},
      </if>
      <if test="record.cateIdLv3 != null">
        cate_id_lv3 = #{record.cateIdLv3,jdbcType=BIGINT},
      </if>
      <if test="record.cateNameLv3 != null">
        cate_name_lv3 = #{record.cateNameLv3,jdbcType=VARCHAR},
      </if>
      <if test="record.selfOption != null">
        self_option = #{record.selfOption,jdbcType=VARCHAR},
      </if>
      <if test="record.direction != null">
        direction = #{record.direction,jdbcType=TINYINT},
      </if>
      <if test="record.goodsLockingCustomer != null">
        goods_locking_customer = #{record.goodsLockingCustomer,jdbcType=TINYINT},
      </if>
      <if test="record.goodsLockingSupplier != null">
        goods_locking_supplier = #{record.goodsLockingSupplier,jdbcType=TINYINT},
      </if>
      <if test="record.accountingStateCustomer != null">
        accounting_state_customer = #{record.accountingStateCustomer,jdbcType=TINYINT},
      </if>
      <if test="record.accountingStateSupplier != null">
        accounting_state_supplier = #{record.accountingStateSupplier,jdbcType=TINYINT},
      </if>
      <if test="record.backAccountStatus != null">
        back_account_status = #{record.backAccountStatus,jdbcType=TINYINT},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=BIGINT},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      </if>
      <if test="record.goodsParams != null">
        goods_params = #{record.goodsParams,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update unified_order_return_goods
    set id = #{record.id,jdbcType=BIGINT},
      return_sn = #{record.returnSn,jdbcType=VARCHAR},
      refund_order_sn = #{record.refundOrderSn,jdbcType=VARCHAR},
      goods_name = #{record.goodsName,jdbcType=VARCHAR},
      goods_alias = #{record.goodsAlias,jdbcType=VARCHAR},
      goods_id = #{record.goodsId,jdbcType=BIGINT},
      out_snapshot_order_goods_id = #{record.outSnapshotOrderGoodsId,jdbcType=BIGINT},
      goods_type = #{record.goodsType,jdbcType=TINYINT},
      quantity = #{record.quantity,jdbcType=INTEGER},
      unit = #{record.unit,jdbcType=VARCHAR},
      price = #{record.price,jdbcType=DECIMAL},
      cost_price = #{record.costPrice,jdbcType=DECIMAL},
      fiscal_code = #{record.fiscalCode,jdbcType=VARCHAR},
      tax_code = #{record.taxCode,jdbcType=VARCHAR},
      tax_rate = #{record.taxRate,jdbcType=DECIMAL},
      merch_tax_id = #{record.merchTaxId,jdbcType=BIGINT},
      merch_tax_code = #{record.merchTaxCode,jdbcType=VARCHAR},
      merch_tax_rate = #{record.merchTaxRate,jdbcType=DECIMAL},
      operation_tax_id = #{record.operationTaxId,jdbcType=BIGINT},
      operation_tax_code = #{record.operationTaxCode,jdbcType=VARCHAR},
      operation_tax_rate = #{record.operationTaxRate,jdbcType=DECIMAL},
      cate_id_lv1 = #{record.cateIdLv1,jdbcType=BIGINT},
      cate_name_lv1 = #{record.cateNameLv1,jdbcType=VARCHAR},
      cate_id_lv2 = #{record.cateIdLv2,jdbcType=BIGINT},
      cate_name_lv2 = #{record.cateNameLv2,jdbcType=VARCHAR},
      cate_id_lv3 = #{record.cateIdLv3,jdbcType=BIGINT},
      cate_name_lv3 = #{record.cateNameLv3,jdbcType=VARCHAR},
      self_option = #{record.selfOption,jdbcType=VARCHAR},
      direction = #{record.direction,jdbcType=TINYINT},
      goods_locking_customer = #{record.goodsLockingCustomer,jdbcType=TINYINT},
      goods_locking_supplier = #{record.goodsLockingSupplier,jdbcType=TINYINT},
      accounting_state_customer = #{record.accountingStateCustomer,jdbcType=TINYINT},
      accounting_state_supplier = #{record.accountingStateSupplier,jdbcType=TINYINT},
      back_account_status = #{record.backAccountStatus,jdbcType=TINYINT},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      goods_params = #{record.goodsParams,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnGoods">
    update unified_order_return_goods
    <set>
      <if test="returnSn != null">
        return_sn = #{returnSn,jdbcType=VARCHAR},
      </if>
      <if test="refundOrderSn != null">
        refund_order_sn = #{refundOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="goodsName != null">
        goods_name = #{goodsName,jdbcType=VARCHAR},
      </if>
      <if test="goodsAlias != null">
        goods_alias = #{goodsAlias,jdbcType=VARCHAR},
      </if>
      <if test="goodsId != null">
        goods_id = #{goodsId,jdbcType=BIGINT},
      </if>
      <if test="outSnapshotOrderGoodsId != null">
        out_snapshot_order_goods_id = #{outSnapshotOrderGoodsId,jdbcType=BIGINT},
      </if>
      <if test="goodsType != null">
        goods_type = #{goodsType,jdbcType=TINYINT},
      </if>
      <if test="quantity != null">
        quantity = #{quantity,jdbcType=INTEGER},
      </if>
      <if test="unit != null">
        unit = #{unit,jdbcType=VARCHAR},
      </if>
      <if test="price != null">
        price = #{price,jdbcType=DECIMAL},
      </if>
      <if test="costPrice != null">
        cost_price = #{costPrice,jdbcType=DECIMAL},
      </if>
      <if test="fiscalCode != null">
        fiscal_code = #{fiscalCode,jdbcType=VARCHAR},
      </if>
      <if test="taxCode != null">
        tax_code = #{taxCode,jdbcType=VARCHAR},
      </if>
      <if test="taxRate != null">
        tax_rate = #{taxRate,jdbcType=DECIMAL},
      </if>
      <if test="merchTaxId != null">
        merch_tax_id = #{merchTaxId,jdbcType=BIGINT},
      </if>
      <if test="merchTaxCode != null">
        merch_tax_code = #{merchTaxCode,jdbcType=VARCHAR},
      </if>
      <if test="merchTaxRate != null">
        merch_tax_rate = #{merchTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="operationTaxId != null">
        operation_tax_id = #{operationTaxId,jdbcType=BIGINT},
      </if>
      <if test="operationTaxCode != null">
        operation_tax_code = #{operationTaxCode,jdbcType=VARCHAR},
      </if>
      <if test="operationTaxRate != null">
        operation_tax_rate = #{operationTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="cateIdLv1 != null">
        cate_id_lv1 = #{cateIdLv1,jdbcType=BIGINT},
      </if>
      <if test="cateNameLv1 != null">
        cate_name_lv1 = #{cateNameLv1,jdbcType=VARCHAR},
      </if>
      <if test="cateIdLv2 != null">
        cate_id_lv2 = #{cateIdLv2,jdbcType=BIGINT},
      </if>
      <if test="cateNameLv2 != null">
        cate_name_lv2 = #{cateNameLv2,jdbcType=VARCHAR},
      </if>
      <if test="cateIdLv3 != null">
        cate_id_lv3 = #{cateIdLv3,jdbcType=BIGINT},
      </if>
      <if test="cateNameLv3 != null">
        cate_name_lv3 = #{cateNameLv3,jdbcType=VARCHAR},
      </if>
      <if test="selfOption != null">
        self_option = #{selfOption,jdbcType=VARCHAR},
      </if>
      <if test="direction != null">
        direction = #{direction,jdbcType=TINYINT},
      </if>
      <if test="goodsLockingCustomer != null">
        goods_locking_customer = #{goodsLockingCustomer,jdbcType=TINYINT},
      </if>
      <if test="goodsLockingSupplier != null">
        goods_locking_supplier = #{goodsLockingSupplier,jdbcType=TINYINT},
      </if>
      <if test="accountingStateCustomer != null">
        accounting_state_customer = #{accountingStateCustomer,jdbcType=TINYINT},
      </if>
      <if test="accountingStateSupplier != null">
        accounting_state_supplier = #{accountingStateSupplier,jdbcType=TINYINT},
      </if>
      <if test="backAccountStatus != null">
        back_account_status = #{backAccountStatus,jdbcType=TINYINT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=BIGINT},
      </if>
      <if test="goodsParams != null">
        goods_params = #{goodsParams,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnGoods">
    update unified_order_return_goods
    set return_sn = #{returnSn,jdbcType=VARCHAR},
      refund_order_sn = #{refundOrderSn,jdbcType=VARCHAR},
      goods_name = #{goodsName,jdbcType=VARCHAR},
      goods_alias = #{goodsAlias,jdbcType=VARCHAR},
      goods_id = #{goodsId,jdbcType=BIGINT},
      out_snapshot_order_goods_id = #{outSnapshotOrderGoodsId,jdbcType=BIGINT},
      goods_type = #{goodsType,jdbcType=TINYINT},
      quantity = #{quantity,jdbcType=INTEGER},
      unit = #{unit,jdbcType=VARCHAR},
      price = #{price,jdbcType=DECIMAL},
      cost_price = #{costPrice,jdbcType=DECIMAL},
      fiscal_code = #{fiscalCode,jdbcType=VARCHAR},
      tax_code = #{taxCode,jdbcType=VARCHAR},
      tax_rate = #{taxRate,jdbcType=DECIMAL},
      merch_tax_id = #{merchTaxId,jdbcType=BIGINT},
      merch_tax_code = #{merchTaxCode,jdbcType=VARCHAR},
      merch_tax_rate = #{merchTaxRate,jdbcType=DECIMAL},
      operation_tax_id = #{operationTaxId,jdbcType=BIGINT},
      operation_tax_code = #{operationTaxCode,jdbcType=VARCHAR},
      operation_tax_rate = #{operationTaxRate,jdbcType=DECIMAL},
      cate_id_lv1 = #{cateIdLv1,jdbcType=BIGINT},
      cate_name_lv1 = #{cateNameLv1,jdbcType=VARCHAR},
      cate_id_lv2 = #{cateIdLv2,jdbcType=BIGINT},
      cate_name_lv2 = #{cateNameLv2,jdbcType=VARCHAR},
      cate_id_lv3 = #{cateIdLv3,jdbcType=BIGINT},
      cate_name_lv3 = #{cateNameLv3,jdbcType=VARCHAR},
      self_option = #{selfOption,jdbcType=VARCHAR},
      direction = #{direction,jdbcType=TINYINT},
      goods_locking_customer = #{goodsLockingCustomer,jdbcType=TINYINT},
      goods_locking_supplier = #{goodsLockingSupplier,jdbcType=TINYINT},
      accounting_state_customer = #{accountingStateCustomer,jdbcType=TINYINT},
      accounting_state_supplier = #{accountingStateSupplier,jdbcType=TINYINT},
      back_account_status = #{backAccountStatus,jdbcType=TINYINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=BIGINT},
      goods_params = #{goodsParams,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>