<?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.slodon.b2b2c.dao.write.integral.IntegralOrderWriteMapper">
  <resultMap id="resultMap" type="com.slodon.b2b2c.integral.pojo.IntegralOrder">
    <id column="order_id" property="orderId" />
    <result column="order_sn" property="orderSn" />
    <result column="pay_sn" property="paySn" />
    <result column="store_id" property="storeId" />
    <result column="store_name" property="storeName" />
    <result column="member_id" property="memberId" />
    <result column="member_name" property="memberName" />
    <result column="pay_time" property="payTime" />
    <result column="create_time" property="createTime" />
    <result column="finish_time" property="finishTime" />
    <result column="order_state" property="orderState" />
    <result column="payment_name" property="paymentName" />
    <result column="payment_code" property="paymentCode" />
    <result column="order_amount" property="orderAmount" />
    <result column="balance_amount" property="balanceAmount" />
    <result column="pay_amount" property="payAmount" />
    <result column="integral_cash_amount" property="integralCashAmount" />
    <result column="integral" property="integral" />
    <result column="receiver_name" property="receiverName" />
    <result column="receiver_area_info" property="receiverAreaInfo" />
    <result column="receiver_address" property="receiverAddress" />
    <result column="receiver_mobile" property="receiverMobile" />
    <result column="order_remark" property="orderRemark" />
    <result column="order_from" property="orderFrom" />
    <result column="invoice_info" property="invoiceInfo" />
    <result column="deliver_type" property="deliverType" />
    <result column="deliver_mobile" property="deliverMobile" />
    <result column="deliver_name" property="deliverName" />
    <result column="express_id" property="expressId" />
    <result column="express_code" property="expressCode" />
    <result column="express_name" property="expressName" />
    <result column="express_number" property="expressNumber" />
    <result column="deliver_address_id" property="deliverAddressId" />
    <result column="deliver_time" property="deliverTime" />
    <result column="refuse_reason" property="refuseReason" />
    <result column="refuse_remark" property="refuseRemark" />
    <result column="delete_state" property="deleteState" />
    <result column="is_settlement" property="isSettlement" />
    <result column="is_generate_facesheet" property="isGenerateFacesheet" />
    <result column="receiver_province_code" property="receiverProvinceCode" />
    <result column="receiver_city_code" property="receiverCityCode" />
    <result column="receiver_district_code" property="receiverDistrictCode" />
    <result column="is_virtual_goods" property="isVirtualGoods" />
    <result column="deliver_remark" property="deliverRemark" />
    <result column="task_id" property="taskId" />
  </resultMap>
  <!--除主键外的所有字段，用于插入操作-->
  <sql id="columns">
    <trim suffixOverrides=",">
      <if test="orderSn != null">
        `order_sn`,
      </if>
      <if test="paySn != null">
        `pay_sn`,
      </if>
      <if test="storeId != null">
        `store_id`,
      </if>
      <if test="storeName != null">
        `store_name`,
      </if>
      <if test="memberId != null">
        `member_id`,
      </if>
      <if test="memberName != null">
        `member_name`,
      </if>
      <if test="payTime != null">
        `pay_time`,
      </if>
      <if test="createTime != null">
        `create_time`,
      </if>
      <if test="finishTime != null">
        `finish_time`,
      </if>
      <if test="orderState != null">
        `order_state`,
      </if>
      <if test="paymentName != null">
        `payment_name`,
      </if>
      <if test="paymentCode != null">
        `payment_code`,
      </if>
      <if test="orderAmount != null">
        `order_amount`,
      </if>
      <if test="balanceAmount != null">
        `balance_amount`,
      </if>
      <if test="payAmount != null">
        `pay_amount`,
      </if>
      <if test="integralCashAmount != null">
        `integral_cash_amount`,
      </if>
      <if test="integral != null">
        `integral`,
      </if>
      <if test="receiverName != null">
        `receiver_name`,
      </if>
      <if test="receiverAreaInfo != null">
        `receiver_area_info`,
      </if>
      <if test="receiverAddress != null">
        `receiver_address`,
      </if>
      <if test="receiverMobile != null">
        `receiver_mobile`,
      </if>
      <if test="orderRemark != null">
        `order_remark`,
      </if>
      <if test="orderFrom != null">
        `order_from`,
      </if>
      <if test="invoiceInfo != null">
        `invoice_info`,
      </if>
      <if test="deliverType != null">
        `deliver_type`,
      </if>
      <if test="deliverMobile != null">
        `deliver_mobile`,
      </if>
      <if test="deliverName != null">
        `deliver_name`,
      </if>
      <if test="expressId != null">
        `express_id`,
      </if>
      <if test="expressCode != null">
        `express_code`,
      </if>
      <if test="expressName != null">
        `express_name`,
      </if>
      <if test="expressNumber != null">
        `express_number`,
      </if>
      <if test="deliverAddressId != null">
        `deliver_address_id`,
      </if>
      <if test="deliverTime != null">
        `deliver_time`,
      </if>
      <if test="refuseReason != null">
        `refuse_reason`,
      </if>
      <if test="refuseRemark != null">
        `refuse_remark`,
      </if>
      <if test="deleteState != null">
        `delete_state`,
      </if>
      <if test="isSettlement != null">
        `is_settlement`,
      </if>
      <if test="isGenerateFacesheet != null">
        `is_generate_facesheet`,
      </if>
      <if test="receiverProvinceCode != null">
        `receiver_province_code`,
      </if>
      <if test="receiverCityCode != null">
        `receiver_city_code`,
      </if>
      <if test="receiverDistrictCode != null">
        `receiver_district_code`,
      </if>
      <if test="isVirtualGoods != null">
        `is_virtual_goods`,
      </if>
      <if test="deliverRemark != null">
        `deliver_remark`,
      </if>
      <if test="taskId != null">
        `task_id`,
      </if>
    </trim>
  </sql>
  <!--按照主键值进行操作-->
  <sql id="pkWhere">
    WHERE `order_id` = #{primaryKey}
  </sql>
  <!--操作条件-->
  <sql id="whereCondition">
    <if test="example != null">
      <trim prefix="WHERE" prefixOverrides="AND|OR">
        <if test="example.orderIdNotEquals != null">
          AND `order_id` != #{example.orderIdNotEquals}
        </if>
        <if test="example.orderIdIn != null">
          AND `order_id` in (${example.orderIdIn})
        </if>
        <if test="example.orderSn != null">
          AND `order_sn` = #{example.orderSn}
        </if>
        <if test="example.orderSnLike != null">
          AND `order_sn` like concat('%',#{example.orderSnLike},'%')
        </if>
        <if test="example.paySn != null">
          AND `pay_sn` = #{example.paySn}
        </if>
        <if test="example.paySnLike != null">
          AND `pay_sn` like concat('%',#{example.paySnLike},'%')
        </if>
        <if test="example.storeId != null">
          AND `store_id` = #{example.storeId}
        </if>
        <if test="example.storeName != null">
          AND `store_name` = #{example.storeName}
        </if>
        <if test="example.storeNameLike != null">
          AND `store_name` like concat('%',#{example.storeNameLike},'%')
        </if>
        <if test="example.memberId != null">
          AND `member_id` = #{example.memberId}
        </if>
        <if test="example.memberName != null">
          AND `member_name` = #{example.memberName}
        </if>
        <if test="example.memberNameLike != null">
          AND `member_name` like concat('%',#{example.memberNameLike},'%')
        </if>
        <if test="example.payTimeAfter != null">
          AND `pay_time` <![CDATA[ >= ]]> #{example.payTimeAfter}
        </if>
        <if test="example.payTimeBefore != null">
          AND `pay_time` <![CDATA[ <= ]]> #{example.payTimeBefore}
        </if>
        <if test="example.createTimeAfter != null">
          AND `create_time` <![CDATA[ >= ]]> #{example.createTimeAfter}
        </if>
        <if test="example.createTimeBefore != null">
          AND `create_time` <![CDATA[ <= ]]> #{example.createTimeBefore}
        </if>
        <if test="example.finishTimeAfter != null">
          AND `finish_time` <![CDATA[ >= ]]> #{example.finishTimeAfter}
        </if>
        <if test="example.finishTimeBefore != null">
          AND `finish_time` <![CDATA[ <= ]]> #{example.finishTimeBefore}
        </if>
        <if test="example.orderState != null">
          AND `order_state` = #{example.orderState}
        </if>
        <if test="example.orderStateIn != null">
          AND `order_state` in (${example.orderStateIn})
        </if>
        <if test="example.orderStateNotIn != null">
          AND `order_state` not in (${example.orderStateNotIn})
        </if>
        <if test="example.orderStateNotEquals != null">
          AND `order_state` != #{example.orderStateNotEquals}
        </if>
        <if test="example.paymentName != null">
          AND `payment_name` = #{example.paymentName}
        </if>
        <if test="example.paymentNameLike != null">
          AND `payment_name` like concat('%',#{example.paymentNameLike},'%')
        </if>
        <if test="example.paymentCode != null">
          AND `payment_code` = #{example.paymentCode}
        </if>
        <if test="example.orderAmount != null">
          AND `order_amount` = #{example.orderAmount}
        </if>
        <if test="example.balanceAmount != null">
          AND `balance_amount` = #{example.balanceAmount}
        </if>
        <if test="example.payAmount != null">
          AND `pay_amount` = #{example.payAmount}
        </if>
        <if test="example.integralCashAmount != null">
          AND `integral_cash_amount` = #{example.integralCashAmount}
        </if>
        <if test="example.integral != null">
          AND `integral` = #{example.integral}
        </if>
        <if test="example.receiverName != null">
          AND `receiver_name` = #{example.receiverName}
        </if>
        <if test="example.receiverNameLike != null">
          AND `receiver_name` like concat('%',#{example.receiverNameLike},'%')
        </if>
        <if test="example.receiverAreaInfo != null">
          AND `receiver_area_info` = #{example.receiverAreaInfo}
        </if>
        <if test="example.receiverAddress != null">
          AND `receiver_address` = #{example.receiverAddress}
        </if>
        <if test="example.receiverMobile != null">
          AND `receiver_mobile` = #{example.receiverMobile}
        </if>
        <if test="example.orderRemark != null">
          AND `order_remark` = #{example.orderRemark}
        </if>
        <if test="example.orderFrom != null">
          AND `order_from` = #{example.orderFrom}
        </if>
        <if test="example.invoiceInfo != null">
          AND `invoice_info` = #{example.invoiceInfo}
        </if>
        <if test="example.deliverType != null">
          AND `deliver_type` = #{example.deliverType}
        </if>
        <if test="example.deliverMobile != null">
          AND `deliver_mobile` = #{example.deliverMobile}
        </if>
        <if test="example.deliverName != null">
          AND `deliver_name` = #{example.deliverName}
        </if>
        <if test="example.deliverNameLike != null">
          AND `deliver_name` like concat('%',#{example.deliverNameLike},'%')
        </if>
        <if test="example.expressId != null">
          AND `express_id` = #{example.expressId}
        </if>
        <if test="example.expressCode != null">
          AND `express_code` = #{example.expressCode}
        </if>
        <if test="example.expressName != null">
          AND `express_name` = #{example.expressName}
        </if>
        <if test="example.expressNameLike != null">
          AND `express_name` like concat('%',#{example.expressNameLike},'%')
        </if>
        <if test="example.expressNumber != null">
          AND `express_number` = #{example.expressNumber}
        </if>
        <if test="example.expressNumberLike != null">
          AND `express_number` like concat('%',#{example.expressNumberLike},'%')
        </if>
        <if test="example.deliverAddressId != null">
          AND `deliver_address_id` = #{example.deliverAddressId}
        </if>
        <if test="example.deliverTimeAfter != null">
          AND `deliver_time` <![CDATA[ >= ]]> #{example.deliverTimeAfter}
        </if>
        <if test="example.deliverTimeBefore != null">
          AND `deliver_time` <![CDATA[ <= ]]> #{example.deliverTimeBefore}
        </if>
        <if test="example.refuseReason != null">
          AND `refuse_reason` = #{example.refuseReason}
        </if>
        <if test="example.refuseReasonLike != null">
          AND `refuse_reason` like concat('%',#{example.refuseReasonLike},'%')
        </if>
        <if test="example.refuseRemark != null">
          AND `refuse_remark` = #{example.refuseRemark}
        </if>
        <if test="example.deleteState != null">
          AND `delete_state` = #{example.deleteState}
        </if>
        <if test="example.deleteStateIn != null">
          AND `delete_state` in (${example.deleteStateIn})
        </if>
        <if test="example.deleteStateNotIn != null">
          AND `delete_state` not in (${example.deleteStateNotIn})
        </if>
        <if test="example.deleteStateNotEquals != null">
          AND `delete_state` != #{example.deleteStateNotEquals}
        </if>
        <if test="example.isSettlement != null">
          AND `is_settlement` = #{example.isSettlement}
        </if>
        <if test="example.isGenerateFacesheet != null">
          AND `is_generate_facesheet` = #{example.isGenerateFacesheet}
        </if>
        <if test="example.receiverProvinceCode != null">
          AND `receiver_province_code` = #{example.receiverProvinceCode}
        </if>
        <if test="example.receiverCityCode != null">
          AND `receiver_city_code` = #{example.receiverCityCode}
        </if>
        <if test="example.receiverDistrictCode != null">
          AND `receiver_district_code` = #{example.receiverDistrictCode}
        </if>
        <if test="example.isVirtualGoods != null">
          AND `is_virtual_goods` = #{example.isVirtualGoods}
        </if>
        <if test="example.deliverRemark != null">
          AND `deliver_remark` = #{example.deliverRemark}
        </if>
        <if test="example.taskId != null">
          AND `task_id` = #{example.taskId}
        </if>
      </trim>
    </if>
  </sql>
  <!--排序条件-->
  <sql id="orderBy">
    ORDER BY `order_id` DESC
  </sql>
  <sql id="orderByOther">
    order by ${example.orderBy}
  </sql>
  <!--分组条件-->
  <sql id="groupBy">
    group by ${example.groupBy}
  </sql>
  <!--分页条件-->
  <sql id="limit">
    <if test="size != null and size &gt; 0">
      limit #{startRow},#{size}
    </if>
  </sql>
  <!--查询符合条件的记录数-->
  <select id="countByExample" parameterType="com.slodon.b2b2c.integral.example.IntegralOrderExample" resultType="java.lang.Integer">
    SELECT
      COUNT(*)
    FROM `integral_order`
    <include refid="whereCondition" />
  </select>
  <!--根据主键查询记录-->
  <select id="getByPrimaryKey" resultMap="resultMap">
    SELECT
      *
    FROM `integral_order`
    <include refid="pkWhere" />
  </select>
  <!--查询符合条件的记录(所有字段)-->
  <select id="listByExample" resultMap="resultMap">
    SELECT
      *
    FROM `integral_order`
    <include refid="whereCondition" />
    <if test="example.groupBy != null">
      <include refid="groupBy" />
    </if>
    <choose>
      <when test="example.orderBy != null">
        <include refid="orderByOther" />
      </when>
      <otherwise>
        <include refid="orderBy" />
      </otherwise>
    </choose>
  </select>
  <!--分页查询符合条件的记录(所有字段)-->
  <select id="listPageByExample" resultMap="resultMap">
    SELECT
      *
    FROM `integral_order`
    <include refid="whereCondition" />
    <if test="example.groupBy != null">
      <include refid="groupBy" />
    </if>
    <choose>
      <when test="example.orderBy != null">
        <include refid="orderByOther" />
      </when>
      <otherwise>
        <include refid="orderBy" />
      </otherwise>
    </choose>
    <include refid="limit" />
  </select>
  <!--查询符合条件的记录(指定字段)-->
  <select id="listFieldsByExample" resultMap="resultMap">
    SELECT
      ${fields}
    FROM `integral_order`
    <include refid="whereCondition" />
    <if test="example.groupBy != null">
      <include refid="groupBy" />
    </if>
    <choose>
      <when test="example.orderBy != null">
        <include refid="orderByOther" />
      </when>
      <otherwise>
        <include refid="orderBy" />
      </otherwise>
    </choose>
  </select>
  <!--分页查询符合条件的记录(指定字段)-->
  <select id="listFieldsPageByExample" resultMap="resultMap">
    SELECT
      ${fields}
    FROM `integral_order`
    <include refid="whereCondition" />
    <if test="example.groupBy != null">
      <include refid="groupBy" />
    </if>
    <choose>
      <when test="example.orderBy != null">
        <include refid="orderByOther" />
      </when>
      <otherwise>
        <include refid="orderBy" />
      </otherwise>
    </choose>
    <include refid="limit" />
  </select>
  <!--根据条件删除记录，可多条删除-->
  <delete id="deleteByExample">
    DELETE FROM `integral_order`
    <include refid="whereCondition" />
  </delete>
  <!--根据主键删除记录-->
  <delete id="deleteByPrimaryKey">
    DELETE FROM `integral_order`
    <include refid="pkWhere" />
  </delete>
  <!--插入一条记录-->
  <insert id="insert" keyColumn="order_id" keyProperty="orderId" parameterType="com.slodon.b2b2c.integral.pojo.IntegralOrder" useGeneratedKeys="true">
    INSERT INTO `integral_order`(
    <include refid="columns" />
    )
    VALUES(
    <trim suffixOverrides=",">
      <if test="orderSn != null">
        #{orderSn},
      </if>
      <if test="paySn != null">
        #{paySn},
      </if>
      <if test="storeId != null">
        #{storeId},
      </if>
      <if test="storeName != null">
        #{storeName},
      </if>
      <if test="memberId != null">
        #{memberId},
      </if>
      <if test="memberName != null">
        #{memberName},
      </if>
      <if test="payTime != null">
        #{payTime},
      </if>
      <if test="createTime != null">
        #{createTime},
      </if>
      <if test="finishTime != null">
        #{finishTime},
      </if>
      <if test="orderState != null">
        #{orderState},
      </if>
      <if test="paymentName != null">
        #{paymentName},
      </if>
      <if test="paymentCode != null">
        #{paymentCode},
      </if>
      <if test="orderAmount != null">
        #{orderAmount},
      </if>
      <if test="balanceAmount != null">
        #{balanceAmount},
      </if>
      <if test="payAmount != null">
        #{payAmount},
      </if>
      <if test="integralCashAmount != null">
        #{integralCashAmount},
      </if>
      <if test="integral != null">
        #{integral},
      </if>
      <if test="receiverName != null">
        #{receiverName},
      </if>
      <if test="receiverAreaInfo != null">
        #{receiverAreaInfo},
      </if>
      <if test="receiverAddress != null">
        #{receiverAddress},
      </if>
      <if test="receiverMobile != null">
        #{receiverMobile},
      </if>
      <if test="orderRemark != null">
        #{orderRemark},
      </if>
      <if test="orderFrom != null">
        #{orderFrom},
      </if>
      <if test="invoiceInfo != null">
        #{invoiceInfo},
      </if>
      <if test="deliverType != null">
        #{deliverType},
      </if>
      <if test="deliverMobile != null">
        #{deliverMobile},
      </if>
      <if test="deliverName != null">
        #{deliverName},
      </if>
      <if test="expressId != null">
        #{expressId},
      </if>
      <if test="expressCode != null">
        #{expressCode},
      </if>
      <if test="expressName != null">
        #{expressName},
      </if>
      <if test="expressNumber != null">
        #{expressNumber},
      </if>
      <if test="deliverAddressId != null">
        #{deliverAddressId},
      </if>
      <if test="deliverTime != null">
        #{deliverTime},
      </if>
      <if test="refuseReason != null">
        #{refuseReason},
      </if>
      <if test="refuseRemark != null">
        #{refuseRemark},
      </if>
      <if test="deleteState != null">
        #{deleteState},
      </if>
      <if test="isSettlement != null">
        #{isSettlement},
      </if>
      <if test="isGenerateFacesheet != null">
        #{isGenerateFacesheet},
      </if>
      <if test="receiverProvinceCode != null">
        #{receiverProvinceCode},
      </if>
      <if test="receiverCityCode != null">
        #{receiverCityCode},
      </if>
      <if test="receiverDistrictCode != null">
        #{receiverDistrictCode},
      </if>
      <if test="isVirtualGoods != null">
        #{isVirtualGoods},
      </if>
      <if test="deliverRemark != null">
        #{deliverRemark},
      </if>
      <if test="taskId != null">
        #{taskId},
      </if>
    </trim>
    )
  </insert>
  <!--按条件更新记录中不为空的字段-->
  <update id="updateByExampleSelective">
    UPDATE `integral_order`
    <trim prefix="SET" suffixOverrides=",">
      <if test="record.orderSn != null">
        `order_sn` = #{record.orderSn},
      </if>
      <if test="record.paySn != null">
        `pay_sn` = #{record.paySn},
      </if>
      <if test="record.storeId != null">
        `store_id` = #{record.storeId},
      </if>
      <if test="record.storeName != null">
        `store_name` = #{record.storeName},
      </if>
      <if test="record.memberId != null">
        `member_id` = #{record.memberId},
      </if>
      <if test="record.memberName != null">
        `member_name` = #{record.memberName},
      </if>
      <if test="record.payTime != null">
        `pay_time` = #{record.payTime},
      </if>
      <if test="record.createTime != null">
        `create_time` = #{record.createTime},
      </if>
      <if test="record.finishTime != null">
        `finish_time` = #{record.finishTime},
      </if>
      <if test="record.orderState != null">
        `order_state` = #{record.orderState},
      </if>
      <if test="record.paymentName != null">
        `payment_name` = #{record.paymentName},
      </if>
      <if test="record.paymentCode != null">
        `payment_code` = #{record.paymentCode},
      </if>
      <if test="record.orderAmount != null">
        `order_amount` = #{record.orderAmount},
      </if>
      <if test="record.balanceAmount != null">
        `balance_amount` = #{record.balanceAmount},
      </if>
      <if test="record.payAmount != null">
        `pay_amount` = #{record.payAmount},
      </if>
      <if test="record.integralCashAmount != null">
        `integral_cash_amount` = #{record.integralCashAmount},
      </if>
      <if test="record.integral != null">
        `integral` = #{record.integral},
      </if>
      <if test="record.receiverName != null">
        `receiver_name` = #{record.receiverName},
      </if>
      <if test="record.receiverAreaInfo != null">
        `receiver_area_info` = #{record.receiverAreaInfo},
      </if>
      <if test="record.receiverAddress != null">
        `receiver_address` = #{record.receiverAddress},
      </if>
      <if test="record.receiverMobile != null">
        `receiver_mobile` = #{record.receiverMobile},
      </if>
      <if test="record.orderRemark != null">
        `order_remark` = #{record.orderRemark},
      </if>
      <if test="record.orderFrom != null">
        `order_from` = #{record.orderFrom},
      </if>
      <if test="record.invoiceInfo != null">
        `invoice_info` = #{record.invoiceInfo},
      </if>
      <if test="record.deliverType != null">
        `deliver_type` = #{record.deliverType},
      </if>
      <if test="record.deliverMobile != null">
        `deliver_mobile` = #{record.deliverMobile},
      </if>
      <if test="record.deliverName != null">
        `deliver_name` = #{record.deliverName},
      </if>
      <if test="record.expressId != null">
        `express_id` = #{record.expressId},
      </if>
      <if test="record.expressCode != null">
        `express_code` = #{record.expressCode},
      </if>
      <if test="record.expressName != null">
        `express_name` = #{record.expressName},
      </if>
      <if test="record.expressNumber != null">
        `express_number` = #{record.expressNumber},
      </if>
      <if test="record.deliverAddressId != null">
        `deliver_address_id` = #{record.deliverAddressId},
      </if>
      <if test="record.deliverTime != null">
        `deliver_time` = #{record.deliverTime},
      </if>
      <if test="record.refuseReason != null">
        `refuse_reason` = #{record.refuseReason},
      </if>
      <if test="record.refuseRemark != null">
        `refuse_remark` = #{record.refuseRemark},
      </if>
      <if test="record.deleteState != null">
        `delete_state` = #{record.deleteState},
      </if>
      <if test="record.isSettlement != null">
        `is_settlement` = #{record.isSettlement},
      </if>
      <if test="record.isGenerateFacesheet != null">
        `is_generate_facesheet` = #{record.isGenerateFacesheet},
      </if>
      <if test="record.receiverProvinceCode != null">
        `receiver_province_code` = #{record.receiverProvinceCode},
      </if>
      <if test="record.receiverCityCode != null">
        `receiver_city_code` = #{record.receiverCityCode},
      </if>
      <if test="record.receiverDistrictCode != null">
        `receiver_district_code` = #{record.receiverDistrictCode},
      </if>
      <if test="record.isVirtualGoods != null">
        `is_virtual_goods` = #{record.isVirtualGoods},
      </if>
      <if test="record.deliverRemark != null">
        `deliver_remark` = #{record.deliverRemark},
      </if>
      <if test="record.taskId != null">
        `task_id` = #{record.taskId},
      </if>
    </trim>
    <include refid="whereCondition" />
  </update>
  <!--按照主键更新记录中不为空的字段-->
  <update id="updateByPrimaryKeySelective">
    UPDATE `integral_order`
    <trim prefix="SET" suffixOverrides=",">
      <if test="orderSn != null">
        `order_sn` = #{orderSn},
      </if>
      <if test="paySn != null">
        `pay_sn` = #{paySn},
      </if>
      <if test="storeId != null">
        `store_id` = #{storeId},
      </if>
      <if test="storeName != null">
        `store_name` = #{storeName},
      </if>
      <if test="memberId != null">
        `member_id` = #{memberId},
      </if>
      <if test="memberName != null">
        `member_name` = #{memberName},
      </if>
      <if test="payTime != null">
        `pay_time` = #{payTime},
      </if>
      <if test="createTime != null">
        `create_time` = #{createTime},
      </if>
      <if test="finishTime != null">
        `finish_time` = #{finishTime},
      </if>
      <if test="orderState != null">
        `order_state` = #{orderState},
      </if>
      <if test="paymentName != null">
        `payment_name` = #{paymentName},
      </if>
      <if test="paymentCode != null">
        `payment_code` = #{paymentCode},
      </if>
      <if test="orderAmount != null">
        `order_amount` = #{orderAmount},
      </if>
      <if test="balanceAmount != null">
        `balance_amount` = #{balanceAmount},
      </if>
      <if test="payAmount != null">
        `pay_amount` = #{payAmount},
      </if>
      <if test="integralCashAmount != null">
        `integral_cash_amount` = #{integralCashAmount},
      </if>
      <if test="integral != null">
        `integral` = #{integral},
      </if>
      <if test="receiverName != null">
        `receiver_name` = #{receiverName},
      </if>
      <if test="receiverAreaInfo != null">
        `receiver_area_info` = #{receiverAreaInfo},
      </if>
      <if test="receiverAddress != null">
        `receiver_address` = #{receiverAddress},
      </if>
      <if test="receiverMobile != null">
        `receiver_mobile` = #{receiverMobile},
      </if>
      <if test="orderRemark != null">
        `order_remark` = #{orderRemark},
      </if>
      <if test="orderFrom != null">
        `order_from` = #{orderFrom},
      </if>
      <if test="invoiceInfo != null">
        `invoice_info` = #{invoiceInfo},
      </if>
      <if test="deliverType != null">
        `deliver_type` = #{deliverType},
      </if>
      <if test="deliverMobile != null">
        `deliver_mobile` = #{deliverMobile},
      </if>
      <if test="deliverName != null">
        `deliver_name` = #{deliverName},
      </if>
      <if test="expressId != null">
        `express_id` = #{expressId},
      </if>
      <if test="expressCode != null">
        `express_code` = #{expressCode},
      </if>
      <if test="expressName != null">
        `express_name` = #{expressName},
      </if>
      <if test="expressNumber != null">
        `express_number` = #{expressNumber},
      </if>
      <if test="deliverAddressId != null">
        `deliver_address_id` = #{deliverAddressId},
      </if>
      <if test="deliverTime != null">
        `deliver_time` = #{deliverTime},
      </if>
      <if test="refuseReason != null">
        `refuse_reason` = #{refuseReason},
      </if>
      <if test="refuseRemark != null">
        `refuse_remark` = #{refuseRemark},
      </if>
      <if test="deleteState != null">
        `delete_state` = #{deleteState},
      </if>
      <if test="isSettlement != null">
        `is_settlement` = #{isSettlement},
      </if>
      <if test="isGenerateFacesheet != null">
        `is_generate_facesheet` = #{isGenerateFacesheet},
      </if>
      <if test="receiverProvinceCode != null">
        `receiver_province_code` = #{receiverProvinceCode},
      </if>
      <if test="receiverCityCode != null">
        `receiver_city_code` = #{receiverCityCode},
      </if>
      <if test="receiverDistrictCode != null">
        `receiver_district_code` = #{receiverDistrictCode},
      </if>
      <if test="isVirtualGoods != null">
        `is_virtual_goods` = #{isVirtualGoods},
      </if>
      <if test="deliverRemark != null">
        `deliver_remark` = #{deliverRemark},
      </if>
      <if test="taskId != null">
        `task_id` = #{taskId},
      </if>
    </trim>
    WHERE `order_id` = #{orderId}
  </update>
</mapper>