<?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.zm.order.tool.server.history.HistoryDataOrderDao">

    <resultMap id="OrderMap" type="com.zm.order.tool.server.model.Order">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="biz_type" jdbcType="INTEGER" property="bizType"/>
        <result column="biz_sub_type" jdbcType="INTEGER" property="bizSubType"/>
        <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
        <result column="order_type" jdbcType="INTEGER" property="orderType"/>
        <result column="order_sub_type" jdbcType="INTEGER" property="orderSubType"/>
        <result column="seller_id" jdbcType="BIGINT" property="sellerId"/>
        <result column="store_id" jdbcType="BIGINT" property="storeId"/>
        <result column="store_order_no" jdbcType="VARCHAR" property="storeOrderNo"/>
        <result column="user_id" jdbcType="BIGINT" property="userId"/>
        <result column="mobile" jdbcType="VARCHAR" property="mobile"/>
        <result column="addr_id" jdbcType="INTEGER" property="addrId"/>
        <result column="source" jdbcType="INTEGER" property="source"/>
        <result column="from_system" jdbcType="INTEGER" property="fromSystem"/>
        <result column="source_no" jdbcType="VARCHAR" property="sourceNo"/>
        <result column="total_amount" jdbcType="INTEGER" property="totalAmount"/>
        <result column="item_amount" jdbcType="INTEGER" property="itemAmount"/>
        <result column="pack_amount" jdbcType="INTEGER" property="packAmount"/>
        <result column="freight_amount" jdbcType="INTEGER" property="freightAmount"/>
        <result column="discount_amount" jdbcType="INTEGER" property="discountAmount"/>
        <result column="actual_amount" jdbcType="INTEGER" property="actualAmount"/>
        <result column="pay_amount" jdbcType="INTEGER" property="payAmount"/>
        <result column="change_amount" jdbcType="INTEGER" property="changeAmount"/>
        <result column="pay_type" jdbcType="INTEGER" property="payType"/>
        <result column="pay_model" jdbcType="INTEGER" property="payModel"/>
        <result column="payer" jdbcType="BIGINT" property="payer"/>
        <result column="pay_no" jdbcType="VARCHAR" property="payNo"/>
        <result column="third_pay_no" jdbcType="VARCHAR" property="thirdPayNo"/>
        <result column="pay_info" jdbcType="VARCHAR" property="payInfo"/>
        <result column="is_alone" jdbcType="INTEGER" property="isAlone"/>
        <result column="invoice_type" jdbcType="INTEGER" property="invoiceType"/>
        <result column="performance_type" jdbcType="INTEGER" property="performanceType"/>
        <result column="is_immediate_performance" jdbcType="INTEGER" property="isImmediatePerformance"/>
        <result column="performance_platform" jdbcType="VARCHAR" property="performancePlatform"/>
        <result column="performance_info" jdbcType="VARCHAR" property="performanceInfo"/>
        <result column="seller_remarks" jdbcType="VARCHAR" property="sellerRemarks"/>
        <result column="buyer_remarks" jdbcType="VARCHAR" property="buyerRemarks"/>
        <result column="is_receipt" jdbcType="INTEGER" property="isReceipt"/>
        <result column="receipt_terminal" jdbcType="VARCHAR" property="receiptTerminal"/>
        <result column="status" jdbcType="INTEGER" property="status"/>
        <result column="sub_status" jdbcType="INTEGER" property="subStatus"/>
        <result column="pay_status" jdbcType="INTEGER" property="payStatus"/>
        <result column="after_sale_status" jdbcType="INTEGER" property="afterSaleStatus"/>
        <result column="receive_status" jdbcType="INTEGER" property="receiveStatus"/>
        <result column="performance_status" jdbcType="INTEGER" property="performanceStatus"/>
        <result column="comment_status" jdbcType="INTEGER" property="commentStatus"/>
        <result column="refusal_reasons" jdbcType="VARCHAR" property="refusalReason"/>
        <result column="order_at" jdbcType="TIMESTAMP" property="orderAt"/>
        <result column="pay_at" jdbcType="TIMESTAMP" property="payAt"/>
        <result column="comment_at" jdbcType="TIMESTAMP" property="commentAt"/>
        <result column="completed_at" jdbcType="TIMESTAMP" property="completedAt"/>
        <result column="receive_at" jdbcType="TIMESTAMP" property="receiveAt"/>
        <result column="item_info" jdbcType="VARCHAR" property="itemInfo"/>
        <result column="discount_info" jdbcType="VARCHAR" property="discountInfo"/>
        <result column="features" jdbcType="VARCHAR" property="features"/>
        <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
        <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
        <result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
        <result column="sync_flag" jdbcType="INTEGER" property="syncFlag"/>
        <result column="version" jdbcType="INTEGER" property="version"/>
        <result column="pay_flag" jdbcType="INTEGER" property="payFlag"/>
        <result column="pay_detail_info" jdbcType="VARCHAR" property="payDetailInfo"/>
        <result column="addr_info" jdbcType="VARCHAR" property="addrInfo"/>
        <result column="refund_flag" jdbcType="VARCHAR" property="refundFlag"/>
        <result column="invoice_status" jdbcType="INTEGER" property="invoiceStatus"/>
    </resultMap>

    <sql id="tb">
        orders
    </sql>

    <sql id="cols_all">
        id,
        <include refid="cols_exclude_id"/>
    </sql>

    <sql id="cols_exclude_id">
        biz_type, biz_sub_type, order_no, order_type, order_sub_type,
        seller_id, store_id, store_order_no, user_id, mobile, addr_id, source, source_no, from_system,
        total_amount, item_amount, pack_amount, freight_amount, discount_amount, actual_amount, pay_amount,
        change_amount, pay_type, pay_model,  payer, pay_no, third_pay_no, pay_info, is_alone, invoice_type,
        performance_type, is_immediate_performance, performance_platform,
        performance_info, seller_remarks, buyer_remarks, is_receipt, receipt_terminal,
        status, sub_status, pay_status, after_sale_status, receive_status, performance_status, comment_status,
        refusal_reasons, order_at, pay_at, comment_at, completed_at, receive_at, features,
        item_info, discount_info,
        created_at, updated_at, is_deleted, sync_flag, version, pay_flag, pay_detail_info, addr_info, refund_flag, invoice_status,
        mobile_cipher
    </sql>

    <sql id="cols_concise_exclude">
        order_no, user_id
    </sql>

    <sql id="cols_seller_id_store_id">
        seller_id, store_id
    </sql>

    <sql id="cols_short_exclude">
        order_no, user_id, total_amount, actual_amount, source, status, seller_id, store_id, order_at, features,
        performance_type, performance_status, pay_amount, order_type, performance_platform
    </sql>

    <select id="selectByOrderNo" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        where order_no = #{orderNo}
        and user_id = #{userId}
        limit 1
    </select>

    <select id="selectList" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        <where>
            <if test="orderNo != null and orderNo != ''">
                AND order_no = #{orderNo}
            </if>
            <if test="orderNoList != null and orderNoList.size > 0">
                AND order_no in
                <foreach collection="orderNoList" item="orderNo" index="index" open="(" close=")" separator=",">
                    #{orderNo}
                </foreach>
            </if>
            <if test="statusList != null and statusList.size > 0">
                AND status in
                <foreach collection="statusList" item="status" index="index" open="(" close=")" separator=",">
                    #{status}
                </foreach>
            </if>
            <if test="sellerId != null">
                AND seller_id = #{sellerId}
            </if>
            <if test="storeId != null">
                AND store_id = #{storeId}
            </if>
            <if test="payStatus != null">
                AND pay_status = #{payStatus}
            </if>
            <if test="orderAtStart != null">
                <![CDATA[ AND order_at >= #{orderAtStart} ]]>
            </if>
            <if test="orderAtEnd != null">
                <![CDATA[ AND order_at <= #{orderAtEnd} ]]>
            </if>
            <choose>
                <when test="userIdList != null and userIdList.size > 0">
                    AND user_id in
                    <foreach collection="userIdList" item="userId" index="index" open="(" close=")" separator=",">
                        #{userId}
                    </foreach>
                </when>
                <otherwise>
                    AND user_id = #{userId}
                </otherwise>
            </choose>
            <if test="orderType != null">
                AND order_type = #{orderType}
            </if>
        </where>
        order by order_at desc
        <if test="start != null">
            limit ${start}, ${pageSize}
        </if>
    </select>

    <select id="selectOrderExist" parameterType="map" resultMap="OrderMap">
        select
        order_no, user_id, order_at
        from
        <include refid="tb"/>
        <where>
            user_id = #{userId}
            <if test="sellerId != null">
                and seller_id = #{sellerId}
            </if>
            <if test="storeIdList != null and storeIdList.size > 0">
                AND store_id in
                <foreach collection="storeIdList" item="storeId" index="index" open="(" close=")" separator=",">
                    #{storeId}
                </foreach>
            </if>
            <if test="orderAtStart != null">
                <![CDATA[ AND order_at >= #{orderAtStart} ]]>
            </if>
            <if test="orderAtEnd != null">
                <![CDATA[ AND order_at <= #{orderAtEnd} ]]>
            </if>
            <if test="payStatusList != null and payStatusList.size > 0">
                AND pay_status in
                <foreach collection="payStatusList" item="payStatus" index="index" open="(" close=")" separator=",">
                    #{payStatus}
                </foreach>
            </if>
            <if test="orderTypeList != null and orderTypeList.size > 0">
                AND order_type in
                <foreach collection="orderTypeList" item="orderType" index="index" open="(" close=")" separator=",">
                    #{orderType}
                </foreach>
            </if>
            <if test="sourceList != null and sourceList.size > 0">
                AND source in
                <foreach collection="sourceList" item="source" index="index" open="(" close=")" separator=",">
                    #{source}
                </foreach>
            </if>
            <if test="subStatus != null">
                AND sub_status = #{subStatus}
            </if>
            <if test="excludeStatusList != null and excludeStatusList.size > 0">
                AND status not in
                <foreach collection="excludeStatusList" item="status" index="index" open="(" close=")" separator=",">
                    #{status}
                </foreach>
            </if>
            <if test="statusConditionFlag != null and statusConditionFlag == 1">
                AND (pay_status = 1 or status = 1)
            </if>
            <if test="deleteTypeList != null and deleteTypeList.size > 0">
                AND is_deleted in
                <foreach collection="deleteTypeList" item="deleteType" index="index" open="(" close=")" separator=",">
                    #{deleteType}
                </foreach>
            </if>
        </where>
        limit 1
    </select>

    <select id="selectOne" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        <where>
            user_id = #{userId}
            <if test="orderNo != null and orderNo != ''">
                and order_no = #{orderNo}
            </if>
            <if test="sellerId != null">
                and seller_id = #{sellerId}
            </if>
            <if test="sourceNo != null and sourceNo != ''">
                and source_no = #{sourceNo}
            </if>
            <if test="payNo != null and payNo != ''">
                and pay_no = #{payNo}
            </if>
            <if test="storeId != null">
                and store_id = #{storeId}
            </if>
            <if test="thirdPayNo != null and thirdPayNo != ''">
                and third_pay_no = #{thirdPayNo}
            </if>
        </where>
        limit 1
    </select>

    <select id="selectConciseList" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_concise_exclude"/>
        from
        <include refid="tb"/>
        <where>
            <if test="orderNo != null and orderNo != ''">
                AND order_no = #{orderNo}
            </if>
            <if test="orderNoList != null and orderNoList.size > 0">
                AND order_no in
                <foreach collection="orderNoList" item="orderNo" index="index" open="(" close=")" separator=",">
                    #{orderNo}
                </foreach>
            </if>
            <if test="statusList != null and statusList.size > 0">
                AND status in
                <foreach collection="statusList" item="status" index="index" open="(" close=")" separator=",">
                    #{status}
                </foreach>
            </if>
            <if test="sellerId != null">
                AND seller_id = #{sellerId}
            </if>
            <if test="storeId != null">
                AND store_id = #{storeId}
            </if>
            <if test="payStatus != null">
                AND pay_status = #{payStatus}
            </if>
            <if test="performanceStatus != null">
                AND performance_status = #{performanceStatus}
            </if>
            <if test="orderAtStart != null">
                <![CDATA[ AND order_at >= #{orderAtStart} ]]>
            </if>
            <if test="orderAtEnd != null">
                <![CDATA[ AND order_at <= #{orderAtEnd} ]]>
            </if>
            <if test="commentStatus != null">
                AND comment_status = #{commentStatus}
            </if>

            <if test="receiveStatus != null">
                AND receive_status = #{receiveStatus}
            </if>
            <if test="deleteTypeList != null and deleteTypeList.size > 0">
                AND is_deleted in
                <foreach collection="deleteTypeList" item="deleteType" index="index" open="(" close=")" separator=",">
                    #{deleteType}
                </foreach>
            </if>
            <if test="source != null">
                AND source = #{source}
            </if>
            <if test="sourceList != null and sourceList.size > 0">
                AND source in
                <foreach collection="sourceList" item="source" index="index" open="(" close=")" separator=",">
                    #{source}
                </foreach>
            </if>
            <choose>
                <when test="userIdList != null and userIdList.size > 0">
                    AND user_id in
                    <foreach collection="userIdList" item="userId" index="index" open="(" close=")" separator=",">
                        #{userId}
                    </foreach>
                </when>
                <otherwise>
                    AND user_id = #{userId}
                </otherwise>
            </choose>
            <if test="lastId != null and lastId != 0">
                <![CDATA[ AND id < #{lastId} ]]>
            </if>
            <if test="orderTypeList != null and orderTypeList.size > 0">
                AND order_type in
                <foreach collection="orderTypeList" item="orderType" index="index" open="(" close=")" separator=",">
                    #{orderType}
                </foreach>
            </if>
            <if test="orderType != null">
                AND order_type = #{orderType}
            </if>
        </where>
        order by order_at desc
        <if test="start != null">
            limit ${start}, ${pageSize}
        </if>
        <if test="size != null">
            limit ${size}
        </if>
    </select>

    <select id="selectShortList" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_short_exclude"/>
        from
        <include refid="tb"/>
        <where>
            <choose>
                <when test="userIdList != null and userIdList.size > 0">
                    AND user_id in
                    <foreach collection="userIdList" item="userId" index="index" open="(" close=")" separator=",">
                        #{userId}
                    </foreach>
                </when>
                <otherwise>
                    AND user_id = #{userId}
                </otherwise>
            </choose>
            <if test="statusList != null and statusList.size > 0">
                AND status in
                <foreach collection="statusList" item="status" index="index" open="(" close=")" separator=",">
                    #{status}
                </foreach>
            </if>
            <if test="idList != null and idList.size > 0">
                AND id in
                <foreach collection="idList" item="orderId" index="index" open="(" close=")" separator=",">
                    #{orderId}
                </foreach>
            </if>
            <if test="sellerId != null">
                AND seller_id = #{sellerId}
            </if>
            <if test="storeId != null">
                AND store_id = #{storeId}
            </if>
            <if test="orderNo != null and orderNo != ''">
                AND order_no = #{orderNo}
            </if>
            <if test="orderNoList != null and orderNoList.size > 0">
                AND order_no in
                <foreach collection="orderNoList" item="orderNo" index="index" open="(" close=")" separator=",">
                    #{orderNo}
                </foreach>
            </if>
            <if test="payStatus != null">
                AND pay_status = #{payStatus}
            </if>
            <if test="orderAtStart != null">
                <![CDATA[ AND order_at >= #{orderAtStart} ]]>
            </if>
            <if test="orderAtEnd != null">
                <![CDATA[ AND order_at <= #{orderAtEnd} ]]>
            </if>
            <if test="actualAmountStart != null">
                <![CDATA[ AND actual_amount >= #{actualAmountStart} ]]>
            </if>
            <if test="actualAmountEnd != null">
                <![CDATA[ AND actual_amount <= #{actualAmountEnd} ]]>
            </if>
            <if test="deleteTypeList != null and deleteTypeList.size > 0">
                AND is_deleted in
                <foreach collection="deleteTypeList" item="deleteType" index="index" open="(" close=")" separator=",">
                    #{deleteType}
                </foreach>
            </if>
            <if test="source != null">
                AND source = #{source}
            </if>
            <if test="status != null">
                AND status = #{status}
            </if>
            <if test="sourceList != null and sourceList.size > 0">
                AND source in
                <foreach collection="sourceList" item="source" index="index" open="(" close=")" separator=",">
                    #{source}
                </foreach>
            </if>
            <if test="orderType != null">
                AND order_type = #{orderType}
            </if>
        </where>
        order by order_at desc
        <if test="start != null">
            limit ${start}, ${pageSize}
        </if>
    </select>

    <select id="scanList" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        <where>
            <if test="orderNo != null and orderNo != ''">
                AND order_no = #{orderNo}
            </if>
            <if test="orderNoList != null and orderNoList.size > 0">
                AND order_no in
                <foreach collection="orderNoList" item="orderNo" index="index" open="(" close=")" separator=",">
                    #{orderNo}
                </foreach>
            </if>
            <if test="bizTypeList != null and bizTypeList.size > 0">
                AND biz_type in
                <foreach collection="bizTypeList" item="bizType" index="index" open="(" close=")" separator=",">
                    #{bizType}
                </foreach>
            </if>
            <if test="statusList != null and statusList.size > 0">
                AND status in
                <foreach collection="statusList" item="status" index="index" open="(" close=")" separator=",">
                    #{status}
                </foreach>
            </if>
            <if test="sellerId != null">
                AND seller_id = #{sellerId}
            </if>
            <if test="storeId != null">
                AND store_id = #{storeId}
            </if>
            <if test="payStatus != null">
                AND pay_status = #{payStatus}
            </if>
            <if test="performanceStatus != null">
                AND performance_status = #{performanceStatus}
            </if>
            <if test="performanceStatusList != null and performanceStatusList.size > 0">
                AND performance_status in
                <foreach collection="performanceStatusList" item="performanceStatus" index="index" open="(" close=")" separator=",">
                    #{performanceStatus}
                </foreach>
            </if>
            <if test="orderAtStart != null">
                <![CDATA[ AND order_at >= #{orderAtStart} ]]>
            </if>
            <if test="orderAtEnd != null">
                <![CDATA[ AND order_at <= #{orderAtEnd} ]]>
            </if>
            <if test="commentStatus != null">
                AND comment_status = #{commentStatus}
            </if>
            <if test="receiveStatus != null">
                AND receive_status = #{receiveStatus}
            </if>
            <choose>
                <when test="orderSubTypeList != null and orderSubTypeList.size > 0">
                    AND order_sub_type in
                    <foreach collection="orderSubTypeList" item="orderSubType" index="index" open="(" close=")" separator=",">
                        #{orderSubType}
                    </foreach>
                </when>
                <otherwise>
                    <if test="orderSubType != null">
                        AND order_sub_type = #{orderSubType}
                    </if>
                </otherwise>
            </choose>
            <if test="deleteTypeList != null and deleteTypeList.size > 0">
                AND is_deleted in
                <foreach collection="deleteTypeList" item="deleteType" index="index" open="(" close=")" separator=",">
                    #{deleteType}
                </foreach>
            </if>
            <if test="idList != null and idList.size > 0">
                AND id in
                <foreach collection="idList" item="record" index="index" open="(" close=")" separator=",">
                    #{record}
                </foreach>
            </if>
            <if test="performanceTypeList != null and performanceTypeList.size > 0">
                AND performance_type in
                <foreach collection="performanceTypeList" item="performanceType" index="index" open="(" close=")" separator=",">
                    #{performanceType}
                </foreach>
            </if>
            <if test="source != null">
                AND source = #{source}
            </if>
            <if test="sourceList != null and sourceList.size > 0">
                AND source in
                <foreach collection="sourceList" item="source" index="index" open="(" close=")" separator=",">
                    #{source}
                </foreach>
            </if>
            <choose>
                <when test="userIdList != null and userIdList.size > 0">
                    AND user_id in
                    <foreach collection="userIdList" item="userId" index="index" open="(" close=")" separator=",">
                        #{userId}
                    </foreach>
                </when>
                <otherwise>
                    AND user_id = #{userId}
                </otherwise>
            </choose>
            <if test="lastId != null and lastId != 0">
                <![CDATA[ AND id < #{lastId} ]]>
            </if>
            <if test="orderType != null">
                AND order_type = #{orderType}
            </if>
        </where>
        order by id desc
        <if test="start != null">
            limit ${start}, ${pageSize}
        </if>
        <if test="size != null">
            limit ${size}
        </if>
    </select>

    <select id="selectStoreList" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_seller_id_store_id"/>
        from
        <include refid="tb"/>
        <where>
            <choose>
                <when test="userIdList != null and userIdList.size > 0">
                    AND user_id in
                    <foreach collection="userIdList" item="userId" index="index" open="(" close=")" separator=",">
                        #{userId}
                    </foreach>
                </when>
                <otherwise>
                    AND user_id = #{userId}
                </otherwise>
            </choose>
            <if test="sellerId != null">
                AND seller_id = #{sellerId}
            </if>
            <if test="storeId != null">
                AND store_id = #{storeId}
            </if>
            <if test="payStatus != null">
                AND pay_status = #{payStatus}
            </if>
            <if test="orderAtStart != null">
                <![CDATA[ AND order_at >= #{orderAtStart} ]]>
            </if>
            <if test="orderAtEnd != null">
                <![CDATA[ AND order_at <= #{orderAtEnd} ]]>
            </if>
            <if test="deleteTypeList != null and deleteTypeList.size > 0">
                AND is_deleted in
                <foreach collection="deleteTypeList" item="deleteType" index="index" open="(" close=")" separator=",">
                    #{deleteType}
                </foreach>
            </if>
        </where>
        order by order_at desc
        <if test="start != null">
            limit ${start}, ${pageSize}
        </if>
        <if test="size != null">
            limit ${size}
        </if>
    </select>

    <select id="selectStatus" parameterType="map" resultMap="OrderMap">
        select
        status
        from
        <include refid="tb"/>
        <where>
            user_id = #{userId} and order_no = #{orderNo}
        </where>
        limit 1
    </select>

    <select id="selectStoreByOne" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_short_exclude" />
        from
        <include refid="tb"/>
        <where>
            <if test="userId != null">
                AND user_id = #{userId}
            </if>
            <if test="payStatus != null">
                AND pay_status = #{payStatus}
            </if>
        </where>
        order by order_at limit 1
    </select>

    <insert id="replaceList" parameterType="list">
        replace into
        <include refid="tb"/>
        (<include refid="cols_all"/>)
        values
        <foreach collection="list" item="record" index="index" separator=",">
            (
            #{record.id}, #{record.bizType}, #{record.bizSubType}, #{record.orderNo}, #{record.orderType},
            #{record.orderSubType}, #{record.sellerId},
            #{record.storeId}, #{record.storeOrderNo}, #{record.userId}, #{record.mobile}, #{record.addrId},
            #{record.source}, #{record.sourceNo}, #{record.fromSystem},
            #{record.totalAmount}, #{record.itemAmount}, #{record.packAmount}, #{record.freightAmount},
            #{record.discountAmount}, #{record.actualAmount}, #{record.payAmount},
            #{record.changeAmount}, #{record.payType}, #{record.payModel}, #{record.payer}, #{record.payNo},
            #{record.thirdPayNo},
            #{record.payInfo}, #{record.isAlone}, #{record.invoiceType}, #{record.performanceType},
            #{record.isImmediatePerformance}, #{record.performancePlatform}, #{record.performanceInfo},
            #{record.sellerRemarks}, #{record.buyerRemarks}, #{record.isReceipt}, #{record.receiptTerminal},
            #{record.status}, #{record.subStatus}, #{record.payStatus},
            #{record.afterSaleStatus}, #{record.receiveStatus}, #{record.performanceStatus}, #{record.commentStatus},
            #{record.refusalReason},
            #{record.orderAt}, #{record.payAt}, #{record.commentAt}, #{record.completedAt}, #{record.receiveAt},
            #{record.features}, #{record.itemInfo}, #{record.discountInfo},
            #{record.createdAt},#{record.updatedAt}, #{record.isDeleted}, #{record.syncFlag},#{record.version},
            #{record.payFlag}, #{record.payDetailInfo}, #{record.addrInfo},
            #{record.refundFlag}, #{record.invoiceStatus}, #{record.mobileCipher}
            )
        </foreach>
    </insert>
</mapper>