<?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.UnifiedOrderReturnMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturn">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="order_dim" jdbcType="TINYINT" property="orderDim" />
    <result column="order_sn" jdbcType="VARCHAR" property="orderSn" />
    <result column="return_sn" jdbcType="VARCHAR" property="returnSn" />
    <result column="project_id" jdbcType="BIGINT" property="projectId" />
    <result column="project_name" jdbcType="VARCHAR" property="projectName" />
    <result column="amount" jdbcType="DECIMAL" property="amount" />
    <result column="cost_amount" jdbcType="DECIMAL" property="costAmount" />
    <result column="transport_amount" jdbcType="DECIMAL" property="transportAmount" />
    <result column="transport_amount_source" jdbcType="TINYINT" property="transportAmountSource" />
    <result column="transport_merchant_assume_amount" jdbcType="DECIMAL" property="transportMerchantAssumeAmount" />
    <result column="complet_state" jdbcType="TINYINT" property="completState" />
    <result column="accounting_state_customer" jdbcType="TINYINT" property="accountingStateCustomer" />
    <result column="accounting_state_supplier" jdbcType="TINYINT" property="accountingStateSupplier" />
    <result column="pay_type" jdbcType="TINYINT" property="payType" />
    <result column="pay_type_name" jdbcType="VARCHAR" property="payTypeName" />
    <result column="pay_state" jdbcType="TINYINT" property="payState" />
    <result column="pay_state_name" jdbcType="VARCHAR" property="payStateName" />
    <result column="order_state" jdbcType="TINYINT" property="orderState" />
    <result column="order_state_name" jdbcType="VARCHAR" property="orderStateName" />
    <result column="user_type" jdbcType="VARCHAR" property="userType" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <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="pay_time" jdbcType="TIMESTAMP" property="payTime" />
    <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
    <result column="finish_time" jdbcType="TIMESTAMP" property="finishTime" />
    <result column="service_name" jdbcType="VARCHAR" property="serviceName" />
    <result column="service_no" jdbcType="VARCHAR" property="serviceNo" />
    <result column="purchase_virt_id" jdbcType="BIGINT" property="purchaseVirtId" />
    <result column="purchase_virt_name" jdbcType="VARCHAR" property="purchaseVirtName" />
    <result column="purchase_department_name" jdbcType="VARCHAR" property="purchaseDepartmentName" />
    <result column="purchase_user_id" jdbcType="BIGINT" property="purchaseUserId" />
    <result column="purchase_user_name" jdbcType="VARCHAR" property="purchaseUserName" />
    <result column="purchase_phone" jdbcType="VARCHAR" property="purchasePhone" />
    <result column="sale_id" jdbcType="BIGINT" property="saleId" />
    <result column="sale_name" jdbcType="VARCHAR" property="saleName" />
    <result column="goods_amount" jdbcType="DECIMAL" property="goodsAmount" />
    <result column="goods_cost_amount" jdbcType="DECIMAL" property="goodsCostAmount" />
    <result column="refund_goods_amount" jdbcType="DECIMAL" property="refundGoodsAmount" />
    <result column="refund_goods_cost_amount" jdbcType="DECIMAL" property="refundGoodsCostAmount" />
    <result column="order_locking_customer" jdbcType="TINYINT" property="orderLockingCustomer" />
    <result column="order_locking_supplier" jdbcType="TINYINT" property="orderLockingSupplier" />
    <result column="settlement_type" jdbcType="TINYINT" property="settlementType" />
    <result column="appraise_state" jdbcType="TINYINT" property="appraiseState" />
    <result column="source_channel" jdbcType="TINYINT" property="sourceChannel" />
    <result column="other_params" jdbcType="VARCHAR" property="otherParams" />
    <result column="rec_user_name" jdbcType="VARCHAR" property="recUserName" />
    <result column="rec_user_id" jdbcType="BIGINT" property="recUserId" />
    <result column="rec_user_phone" jdbcType="VARCHAR" property="recUserPhone" />
    <result column="rec_address" jdbcType="VARCHAR" property="recAddress" />
    <result column="express_sn" jdbcType="VARCHAR" property="expressSn" />
    <result column="express" jdbcType="VARCHAR" property="express" />
    <result column="express_company" jdbcType="VARCHAR" property="expressCompany" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="oper_account" jdbcType="VARCHAR" property="operAccount" />
    <result column="oper_name" jdbcType="VARCHAR" property="operName" />
  </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, order_dim, order_sn, return_sn, project_id, project_name, amount, cost_amount, 
    transport_amount, transport_amount_source, transport_merchant_assume_amount, complet_state, 
    accounting_state_customer, accounting_state_supplier, pay_type, pay_type_name, pay_state, 
    pay_state_name, order_state, order_state_name, user_type, user_name, create_time, 
    create_user_id, update_time, update_user_id, pay_time, send_time, finish_time, service_name, 
    service_no, purchase_virt_id, purchase_virt_name, purchase_department_name, purchase_user_id, 
    purchase_user_name, purchase_phone, sale_id, sale_name, goods_amount, goods_cost_amount, 
    refund_goods_amount, refund_goods_cost_amount, order_locking_customer, order_locking_supplier, 
    settlement_type, appraise_state, source_channel, other_params, rec_user_name, rec_user_id, 
    rec_user_phone, rec_address, express_sn, express, express_company, remarks, oper_account, 
    oper_name
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from unified_order_return
    <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
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from unified_order_return
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnExample">
    delete from unified_order_return
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturn">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into unified_order_return (order_dim, order_sn, return_sn, 
      project_id, project_name, amount, 
      cost_amount, transport_amount, transport_amount_source, 
      transport_merchant_assume_amount, complet_state, 
      accounting_state_customer, accounting_state_supplier, 
      pay_type, pay_type_name, pay_state, 
      pay_state_name, order_state, order_state_name, 
      user_type, user_name, create_time, 
      create_user_id, update_time, update_user_id, 
      pay_time, send_time, finish_time, 
      service_name, service_no, purchase_virt_id, 
      purchase_virt_name, purchase_department_name, 
      purchase_user_id, purchase_user_name, purchase_phone, 
      sale_id, sale_name, goods_amount, 
      goods_cost_amount, refund_goods_amount, refund_goods_cost_amount, 
      order_locking_customer, order_locking_supplier, 
      settlement_type, appraise_state, source_channel, 
      other_params, rec_user_name, rec_user_id, 
      rec_user_phone, rec_address, express_sn, 
      express, express_company, remarks, 
      oper_account, oper_name)
    values (#{orderDim,jdbcType=TINYINT}, #{orderSn,jdbcType=VARCHAR}, #{returnSn,jdbcType=VARCHAR}, 
      #{projectId,jdbcType=BIGINT}, #{projectName,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, 
      #{costAmount,jdbcType=DECIMAL}, #{transportAmount,jdbcType=DECIMAL}, #{transportAmountSource,jdbcType=TINYINT}, 
      #{transportMerchantAssumeAmount,jdbcType=DECIMAL}, #{completState,jdbcType=TINYINT}, 
      #{accountingStateCustomer,jdbcType=TINYINT}, #{accountingStateSupplier,jdbcType=TINYINT}, 
      #{payType,jdbcType=TINYINT}, #{payTypeName,jdbcType=VARCHAR}, #{payState,jdbcType=TINYINT}, 
      #{payStateName,jdbcType=VARCHAR}, #{orderState,jdbcType=TINYINT}, #{orderStateName,jdbcType=VARCHAR}, 
      #{userType,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createUserId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=BIGINT}, 
      #{payTime,jdbcType=TIMESTAMP}, #{sendTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, 
      #{serviceName,jdbcType=VARCHAR}, #{serviceNo,jdbcType=VARCHAR}, #{purchaseVirtId,jdbcType=BIGINT}, 
      #{purchaseVirtName,jdbcType=VARCHAR}, #{purchaseDepartmentName,jdbcType=VARCHAR}, 
      #{purchaseUserId,jdbcType=BIGINT}, #{purchaseUserName,jdbcType=VARCHAR}, #{purchasePhone,jdbcType=VARCHAR}, 
      #{saleId,jdbcType=BIGINT}, #{saleName,jdbcType=VARCHAR}, #{goodsAmount,jdbcType=DECIMAL}, 
      #{goodsCostAmount,jdbcType=DECIMAL}, #{refundGoodsAmount,jdbcType=DECIMAL}, #{refundGoodsCostAmount,jdbcType=DECIMAL}, 
      #{orderLockingCustomer,jdbcType=TINYINT}, #{orderLockingSupplier,jdbcType=TINYINT}, 
      #{settlementType,jdbcType=TINYINT}, #{appraiseState,jdbcType=TINYINT}, #{sourceChannel,jdbcType=TINYINT}, 
      #{otherParams,jdbcType=VARCHAR}, #{recUserName,jdbcType=VARCHAR}, #{recUserId,jdbcType=BIGINT}, 
      #{recUserPhone,jdbcType=VARCHAR}, #{recAddress,jdbcType=VARCHAR}, #{expressSn,jdbcType=VARCHAR}, 
      #{express,jdbcType=VARCHAR}, #{expressCompany,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, 
      #{operAccount,jdbcType=VARCHAR}, #{operName,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturn">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into unified_order_return
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="orderDim != null">
        order_dim,
      </if>
      <if test="orderSn != null">
        order_sn,
      </if>
      <if test="returnSn != null">
        return_sn,
      </if>
      <if test="projectId != null">
        project_id,
      </if>
      <if test="projectName != null">
        project_name,
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="costAmount != null">
        cost_amount,
      </if>
      <if test="transportAmount != null">
        transport_amount,
      </if>
      <if test="transportAmountSource != null">
        transport_amount_source,
      </if>
      <if test="transportMerchantAssumeAmount != null">
        transport_merchant_assume_amount,
      </if>
      <if test="completState != null">
        complet_state,
      </if>
      <if test="accountingStateCustomer != null">
        accounting_state_customer,
      </if>
      <if test="accountingStateSupplier != null">
        accounting_state_supplier,
      </if>
      <if test="payType != null">
        pay_type,
      </if>
      <if test="payTypeName != null">
        pay_type_name,
      </if>
      <if test="payState != null">
        pay_state,
      </if>
      <if test="payStateName != null">
        pay_state_name,
      </if>
      <if test="orderState != null">
        order_state,
      </if>
      <if test="orderStateName != null">
        order_state_name,
      </if>
      <if test="userType != null">
        user_type,
      </if>
      <if test="userName != null">
        user_name,
      </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="payTime != null">
        pay_time,
      </if>
      <if test="sendTime != null">
        send_time,
      </if>
      <if test="finishTime != null">
        finish_time,
      </if>
      <if test="serviceName != null">
        service_name,
      </if>
      <if test="serviceNo != null">
        service_no,
      </if>
      <if test="purchaseVirtId != null">
        purchase_virt_id,
      </if>
      <if test="purchaseVirtName != null">
        purchase_virt_name,
      </if>
      <if test="purchaseDepartmentName != null">
        purchase_department_name,
      </if>
      <if test="purchaseUserId != null">
        purchase_user_id,
      </if>
      <if test="purchaseUserName != null">
        purchase_user_name,
      </if>
      <if test="purchasePhone != null">
        purchase_phone,
      </if>
      <if test="saleId != null">
        sale_id,
      </if>
      <if test="saleName != null">
        sale_name,
      </if>
      <if test="goodsAmount != null">
        goods_amount,
      </if>
      <if test="goodsCostAmount != null">
        goods_cost_amount,
      </if>
      <if test="refundGoodsAmount != null">
        refund_goods_amount,
      </if>
      <if test="refundGoodsCostAmount != null">
        refund_goods_cost_amount,
      </if>
      <if test="orderLockingCustomer != null">
        order_locking_customer,
      </if>
      <if test="orderLockingSupplier != null">
        order_locking_supplier,
      </if>
      <if test="settlementType != null">
        settlement_type,
      </if>
      <if test="appraiseState != null">
        appraise_state,
      </if>
      <if test="sourceChannel != null">
        source_channel,
      </if>
      <if test="otherParams != null">
        other_params,
      </if>
      <if test="recUserName != null">
        rec_user_name,
      </if>
      <if test="recUserId != null">
        rec_user_id,
      </if>
      <if test="recUserPhone != null">
        rec_user_phone,
      </if>
      <if test="recAddress != null">
        rec_address,
      </if>
      <if test="expressSn != null">
        express_sn,
      </if>
      <if test="express != null">
        express,
      </if>
      <if test="expressCompany != null">
        express_company,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="operAccount != null">
        oper_account,
      </if>
      <if test="operName != null">
        oper_name,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="orderDim != null">
        #{orderDim,jdbcType=TINYINT},
      </if>
      <if test="orderSn != null">
        #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="returnSn != null">
        #{returnSn,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        #{projectId,jdbcType=BIGINT},
      </if>
      <if test="projectName != null">
        #{projectName,jdbcType=VARCHAR},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DECIMAL},
      </if>
      <if test="costAmount != null">
        #{costAmount,jdbcType=DECIMAL},
      </if>
      <if test="transportAmount != null">
        #{transportAmount,jdbcType=DECIMAL},
      </if>
      <if test="transportAmountSource != null">
        #{transportAmountSource,jdbcType=TINYINT},
      </if>
      <if test="transportMerchantAssumeAmount != null">
        #{transportMerchantAssumeAmount,jdbcType=DECIMAL},
      </if>
      <if test="completState != null">
        #{completState,jdbcType=TINYINT},
      </if>
      <if test="accountingStateCustomer != null">
        #{accountingStateCustomer,jdbcType=TINYINT},
      </if>
      <if test="accountingStateSupplier != null">
        #{accountingStateSupplier,jdbcType=TINYINT},
      </if>
      <if test="payType != null">
        #{payType,jdbcType=TINYINT},
      </if>
      <if test="payTypeName != null">
        #{payTypeName,jdbcType=VARCHAR},
      </if>
      <if test="payState != null">
        #{payState,jdbcType=TINYINT},
      </if>
      <if test="payStateName != null">
        #{payStateName,jdbcType=VARCHAR},
      </if>
      <if test="orderState != null">
        #{orderState,jdbcType=TINYINT},
      </if>
      <if test="orderStateName != null">
        #{orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="userType != null">
        #{userType,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </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="payTime != null">
        #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sendTime != null">
        #{sendTime,jdbcType=TIMESTAMP},
      </if>
      <if test="finishTime != null">
        #{finishTime,jdbcType=TIMESTAMP},
      </if>
      <if test="serviceName != null">
        #{serviceName,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtId != null">
        #{purchaseVirtId,jdbcType=BIGINT},
      </if>
      <if test="purchaseVirtName != null">
        #{purchaseVirtName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseDepartmentName != null">
        #{purchaseDepartmentName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserId != null">
        #{purchaseUserId,jdbcType=BIGINT},
      </if>
      <if test="purchaseUserName != null">
        #{purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="purchasePhone != null">
        #{purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="saleId != null">
        #{saleId,jdbcType=BIGINT},
      </if>
      <if test="saleName != null">
        #{saleName,jdbcType=VARCHAR},
      </if>
      <if test="goodsAmount != null">
        #{goodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsCostAmount != null">
        #{goodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="refundGoodsAmount != null">
        #{refundGoodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="refundGoodsCostAmount != null">
        #{refundGoodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="orderLockingCustomer != null">
        #{orderLockingCustomer,jdbcType=TINYINT},
      </if>
      <if test="orderLockingSupplier != null">
        #{orderLockingSupplier,jdbcType=TINYINT},
      </if>
      <if test="settlementType != null">
        #{settlementType,jdbcType=TINYINT},
      </if>
      <if test="appraiseState != null">
        #{appraiseState,jdbcType=TINYINT},
      </if>
      <if test="sourceChannel != null">
        #{sourceChannel,jdbcType=TINYINT},
      </if>
      <if test="otherParams != null">
        #{otherParams,jdbcType=VARCHAR},
      </if>
      <if test="recUserName != null">
        #{recUserName,jdbcType=VARCHAR},
      </if>
      <if test="recUserId != null">
        #{recUserId,jdbcType=BIGINT},
      </if>
      <if test="recUserPhone != null">
        #{recUserPhone,jdbcType=VARCHAR},
      </if>
      <if test="recAddress != null">
        #{recAddress,jdbcType=VARCHAR},
      </if>
      <if test="expressSn != null">
        #{expressSn,jdbcType=VARCHAR},
      </if>
      <if test="express != null">
        #{express,jdbcType=VARCHAR},
      </if>
      <if test="expressCompany != null">
        #{expressCompany,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="operAccount != null">
        #{operAccount,jdbcType=VARCHAR},
      </if>
      <if test="operName != null">
        #{operName,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnExample" resultType="java.lang.Long">
    select count(*) from unified_order_return
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update unified_order_return
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.orderDim != null">
        order_dim = #{record.orderDim,jdbcType=TINYINT},
      </if>
      <if test="record.orderSn != null">
        order_sn = #{record.orderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.returnSn != null">
        return_sn = #{record.returnSn,jdbcType=VARCHAR},
      </if>
      <if test="record.projectId != null">
        project_id = #{record.projectId,jdbcType=BIGINT},
      </if>
      <if test="record.projectName != null">
        project_name = #{record.projectName,jdbcType=VARCHAR},
      </if>
      <if test="record.amount != null">
        amount = #{record.amount,jdbcType=DECIMAL},
      </if>
      <if test="record.costAmount != null">
        cost_amount = #{record.costAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.transportAmount != null">
        transport_amount = #{record.transportAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.transportAmountSource != null">
        transport_amount_source = #{record.transportAmountSource,jdbcType=TINYINT},
      </if>
      <if test="record.transportMerchantAssumeAmount != null">
        transport_merchant_assume_amount = #{record.transportMerchantAssumeAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.completState != null">
        complet_state = #{record.completState,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.payType != null">
        pay_type = #{record.payType,jdbcType=TINYINT},
      </if>
      <if test="record.payTypeName != null">
        pay_type_name = #{record.payTypeName,jdbcType=VARCHAR},
      </if>
      <if test="record.payState != null">
        pay_state = #{record.payState,jdbcType=TINYINT},
      </if>
      <if test="record.payStateName != null">
        pay_state_name = #{record.payStateName,jdbcType=VARCHAR},
      </if>
      <if test="record.orderState != null">
        order_state = #{record.orderState,jdbcType=TINYINT},
      </if>
      <if test="record.orderStateName != null">
        order_state_name = #{record.orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="record.userType != null">
        user_type = #{record.userType,jdbcType=VARCHAR},
      </if>
      <if test="record.userName != null">
        user_name = #{record.userName,jdbcType=VARCHAR},
      </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.payTime != null">
        pay_time = #{record.payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.sendTime != null">
        send_time = #{record.sendTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.finishTime != null">
        finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.serviceName != null">
        service_name = #{record.serviceName,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceNo != null">
        service_no = #{record.serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseVirtId != null">
        purchase_virt_id = #{record.purchaseVirtId,jdbcType=BIGINT},
      </if>
      <if test="record.purchaseVirtName != null">
        purchase_virt_name = #{record.purchaseVirtName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseDepartmentName != null">
        purchase_department_name = #{record.purchaseDepartmentName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseUserId != null">
        purchase_user_id = #{record.purchaseUserId,jdbcType=BIGINT},
      </if>
      <if test="record.purchaseUserName != null">
        purchase_user_name = #{record.purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchasePhone != null">
        purchase_phone = #{record.purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="record.saleId != null">
        sale_id = #{record.saleId,jdbcType=BIGINT},
      </if>
      <if test="record.saleName != null">
        sale_name = #{record.saleName,jdbcType=VARCHAR},
      </if>
      <if test="record.goodsAmount != null">
        goods_amount = #{record.goodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.goodsCostAmount != null">
        goods_cost_amount = #{record.goodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.refundGoodsAmount != null">
        refund_goods_amount = #{record.refundGoodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.refundGoodsCostAmount != null">
        refund_goods_cost_amount = #{record.refundGoodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.orderLockingCustomer != null">
        order_locking_customer = #{record.orderLockingCustomer,jdbcType=TINYINT},
      </if>
      <if test="record.orderLockingSupplier != null">
        order_locking_supplier = #{record.orderLockingSupplier,jdbcType=TINYINT},
      </if>
      <if test="record.settlementType != null">
        settlement_type = #{record.settlementType,jdbcType=TINYINT},
      </if>
      <if test="record.appraiseState != null">
        appraise_state = #{record.appraiseState,jdbcType=TINYINT},
      </if>
      <if test="record.sourceChannel != null">
        source_channel = #{record.sourceChannel,jdbcType=TINYINT},
      </if>
      <if test="record.otherParams != null">
        other_params = #{record.otherParams,jdbcType=VARCHAR},
      </if>
      <if test="record.recUserName != null">
        rec_user_name = #{record.recUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.recUserId != null">
        rec_user_id = #{record.recUserId,jdbcType=BIGINT},
      </if>
      <if test="record.recUserPhone != null">
        rec_user_phone = #{record.recUserPhone,jdbcType=VARCHAR},
      </if>
      <if test="record.recAddress != null">
        rec_address = #{record.recAddress,jdbcType=VARCHAR},
      </if>
      <if test="record.expressSn != null">
        express_sn = #{record.expressSn,jdbcType=VARCHAR},
      </if>
      <if test="record.express != null">
        express = #{record.express,jdbcType=VARCHAR},
      </if>
      <if test="record.expressCompany != null">
        express_company = #{record.expressCompany,jdbcType=VARCHAR},
      </if>
      <if test="record.remarks != null">
        remarks = #{record.remarks,jdbcType=VARCHAR},
      </if>
      <if test="record.operAccount != null">
        oper_account = #{record.operAccount,jdbcType=VARCHAR},
      </if>
      <if test="record.operName != null">
        oper_name = #{record.operName,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
    set id = #{record.id,jdbcType=BIGINT},
      order_dim = #{record.orderDim,jdbcType=TINYINT},
      order_sn = #{record.orderSn,jdbcType=VARCHAR},
      return_sn = #{record.returnSn,jdbcType=VARCHAR},
      project_id = #{record.projectId,jdbcType=BIGINT},
      project_name = #{record.projectName,jdbcType=VARCHAR},
      amount = #{record.amount,jdbcType=DECIMAL},
      cost_amount = #{record.costAmount,jdbcType=DECIMAL},
      transport_amount = #{record.transportAmount,jdbcType=DECIMAL},
      transport_amount_source = #{record.transportAmountSource,jdbcType=TINYINT},
      transport_merchant_assume_amount = #{record.transportMerchantAssumeAmount,jdbcType=DECIMAL},
      complet_state = #{record.completState,jdbcType=TINYINT},
      accounting_state_customer = #{record.accountingStateCustomer,jdbcType=TINYINT},
      accounting_state_supplier = #{record.accountingStateSupplier,jdbcType=TINYINT},
      pay_type = #{record.payType,jdbcType=TINYINT},
      pay_type_name = #{record.payTypeName,jdbcType=VARCHAR},
      pay_state = #{record.payState,jdbcType=TINYINT},
      pay_state_name = #{record.payStateName,jdbcType=VARCHAR},
      order_state = #{record.orderState,jdbcType=TINYINT},
      order_state_name = #{record.orderStateName,jdbcType=VARCHAR},
      user_type = #{record.userType,jdbcType=VARCHAR},
      user_name = #{record.userName,jdbcType=VARCHAR},
      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},
      pay_time = #{record.payTime,jdbcType=TIMESTAMP},
      send_time = #{record.sendTime,jdbcType=TIMESTAMP},
      finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
      service_name = #{record.serviceName,jdbcType=VARCHAR},
      service_no = #{record.serviceNo,jdbcType=VARCHAR},
      purchase_virt_id = #{record.purchaseVirtId,jdbcType=BIGINT},
      purchase_virt_name = #{record.purchaseVirtName,jdbcType=VARCHAR},
      purchase_department_name = #{record.purchaseDepartmentName,jdbcType=VARCHAR},
      purchase_user_id = #{record.purchaseUserId,jdbcType=BIGINT},
      purchase_user_name = #{record.purchaseUserName,jdbcType=VARCHAR},
      purchase_phone = #{record.purchasePhone,jdbcType=VARCHAR},
      sale_id = #{record.saleId,jdbcType=BIGINT},
      sale_name = #{record.saleName,jdbcType=VARCHAR},
      goods_amount = #{record.goodsAmount,jdbcType=DECIMAL},
      goods_cost_amount = #{record.goodsCostAmount,jdbcType=DECIMAL},
      refund_goods_amount = #{record.refundGoodsAmount,jdbcType=DECIMAL},
      refund_goods_cost_amount = #{record.refundGoodsCostAmount,jdbcType=DECIMAL},
      order_locking_customer = #{record.orderLockingCustomer,jdbcType=TINYINT},
      order_locking_supplier = #{record.orderLockingSupplier,jdbcType=TINYINT},
      settlement_type = #{record.settlementType,jdbcType=TINYINT},
      appraise_state = #{record.appraiseState,jdbcType=TINYINT},
      source_channel = #{record.sourceChannel,jdbcType=TINYINT},
      other_params = #{record.otherParams,jdbcType=VARCHAR},
      rec_user_name = #{record.recUserName,jdbcType=VARCHAR},
      rec_user_id = #{record.recUserId,jdbcType=BIGINT},
      rec_user_phone = #{record.recUserPhone,jdbcType=VARCHAR},
      rec_address = #{record.recAddress,jdbcType=VARCHAR},
      express_sn = #{record.expressSn,jdbcType=VARCHAR},
      express = #{record.express,jdbcType=VARCHAR},
      express_company = #{record.expressCompany,jdbcType=VARCHAR},
      remarks = #{record.remarks,jdbcType=VARCHAR},
      oper_account = #{record.operAccount,jdbcType=VARCHAR},
      oper_name = #{record.operName,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.UnifiedOrderReturn">
    update unified_order_return
    <set>
      <if test="orderDim != null">
        order_dim = #{orderDim,jdbcType=TINYINT},
      </if>
      <if test="orderSn != null">
        order_sn = #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="returnSn != null">
        return_sn = #{returnSn,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        project_id = #{projectId,jdbcType=BIGINT},
      </if>
      <if test="projectName != null">
        project_name = #{projectName,jdbcType=VARCHAR},
      </if>
      <if test="amount != null">
        amount = #{amount,jdbcType=DECIMAL},
      </if>
      <if test="costAmount != null">
        cost_amount = #{costAmount,jdbcType=DECIMAL},
      </if>
      <if test="transportAmount != null">
        transport_amount = #{transportAmount,jdbcType=DECIMAL},
      </if>
      <if test="transportAmountSource != null">
        transport_amount_source = #{transportAmountSource,jdbcType=TINYINT},
      </if>
      <if test="transportMerchantAssumeAmount != null">
        transport_merchant_assume_amount = #{transportMerchantAssumeAmount,jdbcType=DECIMAL},
      </if>
      <if test="completState != null">
        complet_state = #{completState,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="payType != null">
        pay_type = #{payType,jdbcType=TINYINT},
      </if>
      <if test="payTypeName != null">
        pay_type_name = #{payTypeName,jdbcType=VARCHAR},
      </if>
      <if test="payState != null">
        pay_state = #{payState,jdbcType=TINYINT},
      </if>
      <if test="payStateName != null">
        pay_state_name = #{payStateName,jdbcType=VARCHAR},
      </if>
      <if test="orderState != null">
        order_state = #{orderState,jdbcType=TINYINT},
      </if>
      <if test="orderStateName != null">
        order_state_name = #{orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="userType != null">
        user_type = #{userType,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        user_name = #{userName,jdbcType=VARCHAR},
      </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="payTime != null">
        pay_time = #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sendTime != null">
        send_time = #{sendTime,jdbcType=TIMESTAMP},
      </if>
      <if test="finishTime != null">
        finish_time = #{finishTime,jdbcType=TIMESTAMP},
      </if>
      <if test="serviceName != null">
        service_name = #{serviceName,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        service_no = #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtId != null">
        purchase_virt_id = #{purchaseVirtId,jdbcType=BIGINT},
      </if>
      <if test="purchaseVirtName != null">
        purchase_virt_name = #{purchaseVirtName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseDepartmentName != null">
        purchase_department_name = #{purchaseDepartmentName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserId != null">
        purchase_user_id = #{purchaseUserId,jdbcType=BIGINT},
      </if>
      <if test="purchaseUserName != null">
        purchase_user_name = #{purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="purchasePhone != null">
        purchase_phone = #{purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="saleId != null">
        sale_id = #{saleId,jdbcType=BIGINT},
      </if>
      <if test="saleName != null">
        sale_name = #{saleName,jdbcType=VARCHAR},
      </if>
      <if test="goodsAmount != null">
        goods_amount = #{goodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsCostAmount != null">
        goods_cost_amount = #{goodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="refundGoodsAmount != null">
        refund_goods_amount = #{refundGoodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="refundGoodsCostAmount != null">
        refund_goods_cost_amount = #{refundGoodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="orderLockingCustomer != null">
        order_locking_customer = #{orderLockingCustomer,jdbcType=TINYINT},
      </if>
      <if test="orderLockingSupplier != null">
        order_locking_supplier = #{orderLockingSupplier,jdbcType=TINYINT},
      </if>
      <if test="settlementType != null">
        settlement_type = #{settlementType,jdbcType=TINYINT},
      </if>
      <if test="appraiseState != null">
        appraise_state = #{appraiseState,jdbcType=TINYINT},
      </if>
      <if test="sourceChannel != null">
        source_channel = #{sourceChannel,jdbcType=TINYINT},
      </if>
      <if test="otherParams != null">
        other_params = #{otherParams,jdbcType=VARCHAR},
      </if>
      <if test="recUserName != null">
        rec_user_name = #{recUserName,jdbcType=VARCHAR},
      </if>
      <if test="recUserId != null">
        rec_user_id = #{recUserId,jdbcType=BIGINT},
      </if>
      <if test="recUserPhone != null">
        rec_user_phone = #{recUserPhone,jdbcType=VARCHAR},
      </if>
      <if test="recAddress != null">
        rec_address = #{recAddress,jdbcType=VARCHAR},
      </if>
      <if test="expressSn != null">
        express_sn = #{expressSn,jdbcType=VARCHAR},
      </if>
      <if test="express != null">
        express = #{express,jdbcType=VARCHAR},
      </if>
      <if test="expressCompany != null">
        express_company = #{expressCompany,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="operAccount != null">
        oper_account = #{operAccount,jdbcType=VARCHAR},
      </if>
      <if test="operName != null">
        oper_name = #{operName,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturn">
    update unified_order_return
    set order_dim = #{orderDim,jdbcType=TINYINT},
      order_sn = #{orderSn,jdbcType=VARCHAR},
      return_sn = #{returnSn,jdbcType=VARCHAR},
      project_id = #{projectId,jdbcType=BIGINT},
      project_name = #{projectName,jdbcType=VARCHAR},
      amount = #{amount,jdbcType=DECIMAL},
      cost_amount = #{costAmount,jdbcType=DECIMAL},
      transport_amount = #{transportAmount,jdbcType=DECIMAL},
      transport_amount_source = #{transportAmountSource,jdbcType=TINYINT},
      transport_merchant_assume_amount = #{transportMerchantAssumeAmount,jdbcType=DECIMAL},
      complet_state = #{completState,jdbcType=TINYINT},
      accounting_state_customer = #{accountingStateCustomer,jdbcType=TINYINT},
      accounting_state_supplier = #{accountingStateSupplier,jdbcType=TINYINT},
      pay_type = #{payType,jdbcType=TINYINT},
      pay_type_name = #{payTypeName,jdbcType=VARCHAR},
      pay_state = #{payState,jdbcType=TINYINT},
      pay_state_name = #{payStateName,jdbcType=VARCHAR},
      order_state = #{orderState,jdbcType=TINYINT},
      order_state_name = #{orderStateName,jdbcType=VARCHAR},
      user_type = #{userType,jdbcType=VARCHAR},
      user_name = #{userName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=BIGINT},
      pay_time = #{payTime,jdbcType=TIMESTAMP},
      send_time = #{sendTime,jdbcType=TIMESTAMP},
      finish_time = #{finishTime,jdbcType=TIMESTAMP},
      service_name = #{serviceName,jdbcType=VARCHAR},
      service_no = #{serviceNo,jdbcType=VARCHAR},
      purchase_virt_id = #{purchaseVirtId,jdbcType=BIGINT},
      purchase_virt_name = #{purchaseVirtName,jdbcType=VARCHAR},
      purchase_department_name = #{purchaseDepartmentName,jdbcType=VARCHAR},
      purchase_user_id = #{purchaseUserId,jdbcType=BIGINT},
      purchase_user_name = #{purchaseUserName,jdbcType=VARCHAR},
      purchase_phone = #{purchasePhone,jdbcType=VARCHAR},
      sale_id = #{saleId,jdbcType=BIGINT},
      sale_name = #{saleName,jdbcType=VARCHAR},
      goods_amount = #{goodsAmount,jdbcType=DECIMAL},
      goods_cost_amount = #{goodsCostAmount,jdbcType=DECIMAL},
      refund_goods_amount = #{refundGoodsAmount,jdbcType=DECIMAL},
      refund_goods_cost_amount = #{refundGoodsCostAmount,jdbcType=DECIMAL},
      order_locking_customer = #{orderLockingCustomer,jdbcType=TINYINT},
      order_locking_supplier = #{orderLockingSupplier,jdbcType=TINYINT},
      settlement_type = #{settlementType,jdbcType=TINYINT},
      appraise_state = #{appraiseState,jdbcType=TINYINT},
      source_channel = #{sourceChannel,jdbcType=TINYINT},
      other_params = #{otherParams,jdbcType=VARCHAR},
      rec_user_name = #{recUserName,jdbcType=VARCHAR},
      rec_user_id = #{recUserId,jdbcType=BIGINT},
      rec_user_phone = #{recUserPhone,jdbcType=VARCHAR},
      rec_address = #{recAddress,jdbcType=VARCHAR},
      express_sn = #{expressSn,jdbcType=VARCHAR},
      express = #{express,jdbcType=VARCHAR},
      express_company = #{expressCompany,jdbcType=VARCHAR},
      remarks = #{remarks,jdbcType=VARCHAR},
      oper_account = #{operAccount,jdbcType=VARCHAR},
      oper_name = #{operName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>