<?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.hzya.frame.plugin.lets.dao.impl.BusidataTocsalesDaoImpl">

    <resultMap id="get-BusidataTocsalesEntity-result" type="com.hzya.frame.plugin.lets.entity.BusidataTocsalesEntity" >
       <result property="badReason" column="bad_reason" jdbcType="VARCHAR"/>
           <result property="blockReason" column="block_reason" jdbcType="VARCHAR"/>
           <result property="buyerMessage" column="buyer_message" jdbcType="VARCHAR"/>
           <result property="codAmount" column="cod_amount" jdbcType="VARCHAR"/>
           <result property="consignTime" column="consign_time" jdbcType="VARCHAR"/>
           <result property="created" column="created" jdbcType="VARCHAR"/>
           <result property="csRemark" column="cs_remark" jdbcType="VARCHAR"/>
           <result property="currency" column="currency" jdbcType="VARCHAR"/>
           <result property="customerNo" column="customer_no" jdbcType="VARCHAR"/>
           <result property="deliveryTerm" column="delivery_term" jdbcType="VARCHAR"/>
           <result property="discount" column="discount" jdbcType="VARCHAR"/>
           <result property="fenxiaoNick" column="fenxiao_nick" jdbcType="VARCHAR"/>
           <result property="flagName" column="flag_name" jdbcType="VARCHAR"/>
           <result property="goodsCount" column="goods_count" jdbcType="VARCHAR"/>
           <result property="goodsTotalAmount" column="goods_total_amount" jdbcType="VARCHAR"/>
           <result property="goodsTotalCost" column="goods_total_cost" jdbcType="VARCHAR"/>
           <result property="idCardType" column="id_card_type" jdbcType="VARCHAR"/>
           <result property="invoiceContent" column="invoice_content" jdbcType="VARCHAR"/>
           <result property="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
           <result property="invoiceTitle" column="invoice_title" jdbcType="VARCHAR"/>
           <result property="invoiceType" column="invoice_type" jdbcType="VARCHAR"/>
           <result property="logisticsCode" column="logistics_code" jdbcType="VARCHAR"/>
           <result property="logisticsId" column="logistics_id" jdbcType="VARCHAR"/>
           <result property="logisticsName" column="logistics_name" jdbcType="VARCHAR"/>
           <result property="logisticsNo" column="logistics_no" jdbcType="VARCHAR"/>
           <result property="logisticsPrintStatus" column="logistics_print_status" jdbcType="VARCHAR"/>
           <result property="logisticsType" column="logistics_type" jdbcType="VARCHAR"/>
           <result property="modified" column="modified" jdbcType="VARCHAR"/>
           <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
           <result property="orderType" column="order_type" jdbcType="VARCHAR"/>
           <result property="packageFee" column="package_fee" jdbcType="VARCHAR"/>
           <result property="paid" column="paid" jdbcType="VARCHAR"/>
           <result property="payTime" column="pay_time" jdbcType="VARCHAR"/>
           <result property="picklistNo" column="picklist_no" jdbcType="VARCHAR"/>
           <result property="picklistSeq" column="picklist_seq" jdbcType="VARCHAR"/>
           <result property="platformId" column="platform_id" jdbcType="VARCHAR"/>
           <result property="postAmount" column="post_amount" jdbcType="VARCHAR"/>
           <result property="postFee" column="post_fee" jdbcType="VARCHAR"/>
           <result property="printRemark" column="print_remark" jdbcType="VARCHAR"/>
           <result property="receivable" column="receivable" jdbcType="VARCHAR"/>
           <result property="receiverArea" column="receiver_area" jdbcType="VARCHAR"/>
           <result property="receiverCity" column="receiver_city" jdbcType="VARCHAR"/>
           <result property="receiverCountry" column="receiver_country" jdbcType="VARCHAR"/>
           <result property="receiverDistrict" column="receiver_district" jdbcType="VARCHAR"/>
           <result property="receiverDtb" column="receiver_dtb" jdbcType="VARCHAR"/>
           <result property="receiverProvince" column="receiver_province" jdbcType="VARCHAR"/>
           <result property="receiverZip" column="receiver_zip" jdbcType="VARCHAR"/>
           <result property="refundStatus" column="refund_status" jdbcType="VARCHAR"/>
           <result property="remark" column="remark" jdbcType="VARCHAR"/>
           <result property="seqNo" column="seq_no" jdbcType="VARCHAR"/>
           <result property="shopId" column="shop_id" jdbcType="VARCHAR"/>
           <result property="shopName" column="shop_name" jdbcType="VARCHAR"/>
           <result property="shopNo" column="shop_no" jdbcType="VARCHAR"/>
           <result property="shopPlatformId" column="shop_platform_id" jdbcType="VARCHAR"/>
           <result property="shopRemark" column="shop_remark" jdbcType="VARCHAR"/>
           <result property="srcOrderNo" column="src_order_no" jdbcType="VARCHAR"/>
           <result property="srcTradeNo" column="src_trade_no" jdbcType="VARCHAR"/>
           <result property="status" column="status" jdbcType="VARCHAR"/>
           <result property="stockCheckTime" column="stock_check_time" jdbcType="VARCHAR"/>
           <result property="stockoutId" column="stockout_id" jdbcType="VARCHAR"/>
           <result property="subPlatformId" column="sub_platform_id" jdbcType="VARCHAR"/>
           <result property="tax" column="tax" jdbcType="VARCHAR"/>
           <result property="taxRate" column="tax_rate" jdbcType="VARCHAR"/>
           <result property="tradeFrom" column="trade_from" jdbcType="VARCHAR"/>
           <result property="tradeId" column="trade_id" jdbcType="VARCHAR"/>
           <result property="tradeLabel" column="trade_label" jdbcType="VARCHAR"/>
           <result property="tradeNo" column="trade_no" jdbcType="VARCHAR"/>
           <result property="tradeStatus" column="trade_status" jdbcType="VARCHAR"/>
           <result property="tradeTime" column="trade_time" jdbcType="VARCHAR"/>
           <result property="tradeType" column="trade_type" jdbcType="VARCHAR"/>
           <result property="warehouseId" column="warehouse_id" jdbcType="VARCHAR"/>
           <result property="warehouseMappingCode" column="warehouse_mapping_code" jdbcType="VARCHAR"/>
           <result property="warehouseName" column="warehouse_name" jdbcType="VARCHAR"/>
           <result property="warehouseNo" column="warehouse_no" jdbcType="VARCHAR"/>
           <result property="weight" column="weight" jdbcType="VARCHAR"/>
           <result property="id" column="id" jdbcType="INTEGER"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "BusidataTocsalesEntity_Base_Column_List">
        bad_reason
       ,block_reason 
        ,buyer_message 
        ,cod_amount 
        ,consign_time 
        ,created 
        ,cs_remark 
        ,currency 
        ,customer_no 
        ,delivery_term 
        ,discount 
        ,fenxiao_nick 
        ,flag_name 
        ,goods_count 
        ,goods_total_amount 
        ,goods_total_cost 
        ,id_card_type 
        ,invoice_content 
        ,invoice_id 
        ,invoice_title 
        ,invoice_type 
        ,logistics_code 
        ,logistics_id 
        ,logistics_name 
        ,logistics_no 
        ,logistics_print_status 
        ,logistics_type 
        ,modified 
        ,order_no 
        ,order_type 
        ,package_fee 
        ,paid 
        ,pay_time 
        ,picklist_no 
        ,picklist_seq 
        ,platform_id 
        ,post_amount 
        ,post_fee 
        ,print_remark 
        ,receivable 
        ,receiver_area 
        ,receiver_city 
        ,receiver_country 
        ,receiver_district 
        ,receiver_dtb 
        ,receiver_province 
        ,receiver_zip 
        ,refund_status 
        ,remark 
        ,seq_no 
        ,shop_id 
        ,shop_name 
        ,shop_no 
        ,shop_platform_id 
        ,shop_remark 
        ,src_order_no 
        ,src_trade_no 
        ,status 
        ,stock_check_time 
        ,stockout_id 
        ,sub_platform_id 
        ,tax 
        ,tax_rate 
        ,trade_from 
        ,trade_id 
        ,trade_label 
        ,trade_no 
        ,trade_status 
        ,trade_time 
        ,trade_type 
        ,warehouse_id 
        ,warehouse_mapping_code 
        ,warehouse_name 
        ,warehouse_no 
        ,weight 
        ,id 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-BusidataTocsalesEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesEntity">
    select
    <include refid="BusidataTocsalesEntity_Base_Column_List" />
    from busidata_tocsales
    <trim prefix="where" prefixOverrides="and"> 
        <if test="badReason != null and badReason != ''"> and bad_reason = #{badReason} </if>
            <if test="blockReason != null and blockReason != ''"> and block_reason = #{blockReason} </if>
            <if test="buyerMessage != null and buyerMessage != ''"> and buyer_message = #{buyerMessage} </if>
            <if test="codAmount != null and codAmount != ''"> and cod_amount = #{codAmount} </if>
            <if test="consignTime != null and consignTime != ''"> and consign_time = #{consignTime} </if>
            <if test="created != null and created != ''"> and created = #{created} </if>
            <if test="csRemark != null and csRemark != ''"> and cs_remark = #{csRemark} </if>
            <if test="currency != null and currency != ''"> and currency = #{currency} </if>
            <if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo} </if>
            <if test="deliveryTerm != null and deliveryTerm != ''"> and delivery_term = #{deliveryTerm} </if>
            <if test="discount != null and discount != ''"> and discount = #{discount} </if>
            <if test="fenxiaoNick != null and fenxiaoNick != ''"> and fenxiao_nick = #{fenxiaoNick} </if>
            <if test="flagName != null and flagName != ''"> and flag_name = #{flagName} </if>
            <if test="goodsCount != null and goodsCount != ''"> and goods_count = #{goodsCount} </if>
            <if test="goodsTotalAmount != null and goodsTotalAmount != ''"> and goods_total_amount = #{goodsTotalAmount} </if>
            <if test="goodsTotalCost != null and goodsTotalCost != ''"> and goods_total_cost = #{goodsTotalCost} </if>
            <if test="idCardType != null and idCardType != ''"> and id_card_type = #{idCardType} </if>
            <if test="invoiceContent != null and invoiceContent != ''"> and invoice_content = #{invoiceContent} </if>
            <if test="invoiceId != null and invoiceId != ''"> and invoice_id = #{invoiceId} </if>
            <if test="invoiceTitle != null and invoiceTitle != ''"> and invoice_title = #{invoiceTitle} </if>
            <if test="invoiceType != null and invoiceType != ''"> and invoice_type = #{invoiceType} </if>
            <if test="logisticsCode != null and logisticsCode != ''"> and logistics_code = #{logisticsCode} </if>
            <if test="logisticsId != null and logisticsId != ''"> and logistics_id = #{logisticsId} </if>
            <if test="logisticsName != null and logisticsName != ''"> and logistics_name = #{logisticsName} </if>
            <if test="logisticsNo != null and logisticsNo != ''"> and logistics_no = #{logisticsNo} </if>
            <if test="logisticsPrintStatus != null and logisticsPrintStatus != ''"> and logistics_print_status = #{logisticsPrintStatus} </if>
            <if test="logisticsType != null and logisticsType != ''"> and logistics_type = #{logisticsType} </if>
            <if test="modified != null and modified != ''"> and modified = #{modified} </if>
            <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo} </if>
            <if test="orderType != null and orderType != ''"> and order_type = #{orderType} </if>
            <if test="packageFee != null and packageFee != ''"> and package_fee = #{packageFee} </if>
            <if test="paid != null and paid != ''"> and paid = #{paid} </if>
            <if test="payTime != null and payTime != ''"> and pay_time = #{payTime} </if>
            <if test="picklistNo != null and picklistNo != ''"> and picklist_no = #{picklistNo} </if>
            <if test="picklistSeq != null and picklistSeq != ''"> and picklist_seq = #{picklistSeq} </if>
            <if test="platformId != null and platformId != ''"> and platform_id = #{platformId} </if>
            <if test="postAmount != null and postAmount != ''"> and post_amount = #{postAmount} </if>
            <if test="postFee != null and postFee != ''"> and post_fee = #{postFee} </if>
            <if test="printRemark != null and printRemark != ''"> and print_remark = #{printRemark} </if>
            <if test="receivable != null and receivable != ''"> and receivable = #{receivable} </if>
            <if test="receiverArea != null and receiverArea != ''"> and receiver_area = #{receiverArea} </if>
            <if test="receiverCity != null and receiverCity != ''"> and receiver_city = #{receiverCity} </if>
            <if test="receiverCountry != null and receiverCountry != ''"> and receiver_country = #{receiverCountry} </if>
            <if test="receiverDistrict != null and receiverDistrict != ''"> and receiver_district = #{receiverDistrict} </if>
            <if test="receiverDtb != null and receiverDtb != ''"> and receiver_dtb = #{receiverDtb} </if>
            <if test="receiverProvince != null and receiverProvince != ''"> and receiver_province = #{receiverProvince} </if>
            <if test="receiverZip != null and receiverZip != ''"> and receiver_zip = #{receiverZip} </if>
            <if test="refundStatus != null and refundStatus != ''"> and refund_status = #{refundStatus} </if>
            <if test="remark != null and remark != ''"> and remark = #{remark} </if>
            <if test="seqNo != null and seqNo != ''"> and seq_no = #{seqNo} </if>
            <if test="shopId != null and shopId != ''"> and shop_id = #{shopId} </if>
            <if test="shopName != null and shopName != ''"> and shop_name = #{shopName} </if>
            <if test="shopNo != null and shopNo != ''"> and shop_no = #{shopNo} </if>
            <if test="shopPlatformId != null and shopPlatformId != ''"> and shop_platform_id = #{shopPlatformId} </if>
            <if test="shopRemark != null and shopRemark != ''"> and shop_remark = #{shopRemark} </if>
            <if test="srcOrderNo != null and srcOrderNo != ''"> and src_order_no = #{srcOrderNo} </if>
            <if test="srcTradeNo != null and srcTradeNo != ''"> and src_trade_no = #{srcTradeNo} </if>
            <if test="status != null and status != ''"> and status = #{status} </if>
            <if test="stockCheckTime != null and stockCheckTime != ''"> and stock_check_time = #{stockCheckTime} </if>
            <if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId} </if>
            <if test="subPlatformId != null and subPlatformId != ''"> and sub_platform_id = #{subPlatformId} </if>
            <if test="tax != null and tax != ''"> and tax = #{tax} </if>
            <if test="taxRate != null and taxRate != ''"> and tax_rate = #{taxRate} </if>
            <if test="tradeFrom != null and tradeFrom != ''"> and trade_from = #{tradeFrom} </if>
            <if test="tradeId != null and tradeId != ''"> and trade_id = #{tradeId} </if>
            <if test="tradeLabel != null and tradeLabel != ''"> and trade_label = #{tradeLabel} </if>
            <if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo} </if>
            <if test="tradeStatus != null and tradeStatus != ''"> and trade_status = #{tradeStatus} </if>
            <if test="tradeTime != null and tradeTime != ''"> and trade_time = #{tradeTime} </if>
            <if test="tradeType != null and tradeType != ''"> and trade_type = #{tradeType} </if>
            <if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId} </if>
            <if test="warehouseMappingCode != null and warehouseMappingCode != ''"> and warehouse_mapping_code = #{warehouseMappingCode} </if>
            <if test="warehouseName != null and warehouseName != ''"> and warehouse_name = #{warehouseName} </if>
            <if test="warehouseNo != null and warehouseNo != ''"> and warehouse_no = #{warehouseNo} </if>
            <if test="weight != null and weight != ''"> and weight = #{weight} </if>
            <if test="id != null"> and id = #{id} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
    
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesEntity">
        select  count(1)   from busidata_tocsales
    <trim prefix="where" prefixOverrides="and"> 
        <if test="badReason != null and badReason != ''"> and bad_reason = #{badReason} </if>
            <if test="blockReason != null and blockReason != ''"> and block_reason = #{blockReason} </if>
            <if test="buyerMessage != null and buyerMessage != ''"> and buyer_message = #{buyerMessage} </if>
            <if test="codAmount != null and codAmount != ''"> and cod_amount = #{codAmount} </if>
            <if test="consignTime != null and consignTime != ''"> and consign_time = #{consignTime} </if>
            <if test="created != null and created != ''"> and created = #{created} </if>
            <if test="csRemark != null and csRemark != ''"> and cs_remark = #{csRemark} </if>
            <if test="currency != null and currency != ''"> and currency = #{currency} </if>
            <if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo} </if>
            <if test="deliveryTerm != null and deliveryTerm != ''"> and delivery_term = #{deliveryTerm} </if>
            <if test="discount != null and discount != ''"> and discount = #{discount} </if>
            <if test="fenxiaoNick != null and fenxiaoNick != ''"> and fenxiao_nick = #{fenxiaoNick} </if>
            <if test="flagName != null and flagName != ''"> and flag_name = #{flagName} </if>
            <if test="goodsCount != null and goodsCount != ''"> and goods_count = #{goodsCount} </if>
            <if test="goodsTotalAmount != null and goodsTotalAmount != ''"> and goods_total_amount = #{goodsTotalAmount} </if>
            <if test="goodsTotalCost != null and goodsTotalCost != ''"> and goods_total_cost = #{goodsTotalCost} </if>
            <if test="idCardType != null and idCardType != ''"> and id_card_type = #{idCardType} </if>
            <if test="invoiceContent != null and invoiceContent != ''"> and invoice_content = #{invoiceContent} </if>
            <if test="invoiceId != null and invoiceId != ''"> and invoice_id = #{invoiceId} </if>
            <if test="invoiceTitle != null and invoiceTitle != ''"> and invoice_title = #{invoiceTitle} </if>
            <if test="invoiceType != null and invoiceType != ''"> and invoice_type = #{invoiceType} </if>
            <if test="logisticsCode != null and logisticsCode != ''"> and logistics_code = #{logisticsCode} </if>
            <if test="logisticsId != null and logisticsId != ''"> and logistics_id = #{logisticsId} </if>
            <if test="logisticsName != null and logisticsName != ''"> and logistics_name = #{logisticsName} </if>
            <if test="logisticsNo != null and logisticsNo != ''"> and logistics_no = #{logisticsNo} </if>
            <if test="logisticsPrintStatus != null and logisticsPrintStatus != ''"> and logistics_print_status = #{logisticsPrintStatus} </if>
            <if test="logisticsType != null and logisticsType != ''"> and logistics_type = #{logisticsType} </if>
            <if test="modified != null and modified != ''"> and modified = #{modified} </if>
            <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo} </if>
            <if test="orderType != null and orderType != ''"> and order_type = #{orderType} </if>
            <if test="packageFee != null and packageFee != ''"> and package_fee = #{packageFee} </if>
            <if test="paid != null and paid != ''"> and paid = #{paid} </if>
            <if test="payTime != null and payTime != ''"> and pay_time = #{payTime} </if>
            <if test="picklistNo != null and picklistNo != ''"> and picklist_no = #{picklistNo} </if>
            <if test="picklistSeq != null and picklistSeq != ''"> and picklist_seq = #{picklistSeq} </if>
            <if test="platformId != null and platformId != ''"> and platform_id = #{platformId} </if>
            <if test="postAmount != null and postAmount != ''"> and post_amount = #{postAmount} </if>
            <if test="postFee != null and postFee != ''"> and post_fee = #{postFee} </if>
            <if test="printRemark != null and printRemark != ''"> and print_remark = #{printRemark} </if>
            <if test="receivable != null and receivable != ''"> and receivable = #{receivable} </if>
            <if test="receiverArea != null and receiverArea != ''"> and receiver_area = #{receiverArea} </if>
            <if test="receiverCity != null and receiverCity != ''"> and receiver_city = #{receiverCity} </if>
            <if test="receiverCountry != null and receiverCountry != ''"> and receiver_country = #{receiverCountry} </if>
            <if test="receiverDistrict != null and receiverDistrict != ''"> and receiver_district = #{receiverDistrict} </if>
            <if test="receiverDtb != null and receiverDtb != ''"> and receiver_dtb = #{receiverDtb} </if>
            <if test="receiverProvince != null and receiverProvince != ''"> and receiver_province = #{receiverProvince} </if>
            <if test="receiverZip != null and receiverZip != ''"> and receiver_zip = #{receiverZip} </if>
            <if test="refundStatus != null and refundStatus != ''"> and refund_status = #{refundStatus} </if>
            <if test="remark != null and remark != ''"> and remark = #{remark} </if>
            <if test="seqNo != null and seqNo != ''"> and seq_no = #{seqNo} </if>
            <if test="shopId != null and shopId != ''"> and shop_id = #{shopId} </if>
            <if test="shopName != null and shopName != ''"> and shop_name = #{shopName} </if>
            <if test="shopNo != null and shopNo != ''"> and shop_no = #{shopNo} </if>
            <if test="shopPlatformId != null and shopPlatformId != ''"> and shop_platform_id = #{shopPlatformId} </if>
            <if test="shopRemark != null and shopRemark != ''"> and shop_remark = #{shopRemark} </if>
            <if test="srcOrderNo != null and srcOrderNo != ''"> and src_order_no = #{srcOrderNo} </if>
            <if test="srcTradeNo != null and srcTradeNo != ''"> and src_trade_no = #{srcTradeNo} </if>
            <if test="status != null and status != ''"> and status = #{status} </if>
            <if test="stockCheckTime != null and stockCheckTime != ''"> and stock_check_time = #{stockCheckTime} </if>
            <if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId} </if>
            <if test="subPlatformId != null and subPlatformId != ''"> and sub_platform_id = #{subPlatformId} </if>
            <if test="tax != null and tax != ''"> and tax = #{tax} </if>
            <if test="taxRate != null and taxRate != ''"> and tax_rate = #{taxRate} </if>
            <if test="tradeFrom != null and tradeFrom != ''"> and trade_from = #{tradeFrom} </if>
            <if test="tradeId != null and tradeId != ''"> and trade_id = #{tradeId} </if>
            <if test="tradeLabel != null and tradeLabel != ''"> and trade_label = #{tradeLabel} </if>
            <if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo} </if>
            <if test="tradeStatus != null and tradeStatus != ''"> and trade_status = #{tradeStatus} </if>
            <if test="tradeTime != null and tradeTime != ''"> and trade_time = #{tradeTime} </if>
            <if test="tradeType != null and tradeType != ''"> and trade_type = #{tradeType} </if>
            <if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId} </if>
            <if test="warehouseMappingCode != null and warehouseMappingCode != ''"> and warehouse_mapping_code = #{warehouseMappingCode} </if>
            <if test="warehouseName != null and warehouseName != ''"> and warehouse_name = #{warehouseName} </if>
            <if test="warehouseNo != null and warehouseNo != ''"> and warehouse_no = #{warehouseNo} </if>
            <if test="weight != null and weight != ''"> and weight = #{weight} </if>
            <if test="id != null"> and id = #{id} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
    </select>

    <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-BusidataTocsalesEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesEntity">
    select
    <include refid="BusidataTocsalesEntity_Base_Column_List" />
    from busidata_tocsales
    <trim prefix="where" prefixOverrides="and"> 
        <if test="badReason != null and badReason != ''"> and bad_reason like concat('%',#{badReason},'%') </if>
            <if test="blockReason != null and blockReason != ''"> and block_reason like concat('%',#{blockReason},'%') </if>
            <if test="buyerMessage != null and buyerMessage != ''"> and buyer_message like concat('%',#{buyerMessage},'%') </if>
            <if test="codAmount != null and codAmount != ''"> and cod_amount like concat('%',#{codAmount},'%') </if>
            <if test="consignTime != null and consignTime != ''"> and consign_time like concat('%',#{consignTime},'%') </if>
            <if test="created != null and created != ''"> and created like concat('%',#{created},'%') </if>
            <if test="csRemark != null and csRemark != ''"> and cs_remark like concat('%',#{csRemark},'%') </if>
            <if test="currency != null and currency != ''"> and currency like concat('%',#{currency},'%') </if>
            <if test="customerNo != null and customerNo != ''"> and customer_no like concat('%',#{customerNo},'%') </if>
            <if test="deliveryTerm != null and deliveryTerm != ''"> and delivery_term like concat('%',#{deliveryTerm},'%') </if>
            <if test="discount != null and discount != ''"> and discount like concat('%',#{discount},'%') </if>
            <if test="fenxiaoNick != null and fenxiaoNick != ''"> and fenxiao_nick like concat('%',#{fenxiaoNick},'%') </if>
            <if test="flagName != null and flagName != ''"> and flag_name like concat('%',#{flagName},'%') </if>
            <if test="goodsCount != null and goodsCount != ''"> and goods_count like concat('%',#{goodsCount},'%') </if>
            <if test="goodsTotalAmount != null and goodsTotalAmount != ''"> and goods_total_amount like concat('%',#{goodsTotalAmount},'%') </if>
            <if test="goodsTotalCost != null and goodsTotalCost != ''"> and goods_total_cost like concat('%',#{goodsTotalCost},'%') </if>
            <if test="idCardType != null and idCardType != ''"> and id_card_type like concat('%',#{idCardType},'%') </if>
            <if test="invoiceContent != null and invoiceContent != ''"> and invoice_content like concat('%',#{invoiceContent},'%') </if>
            <if test="invoiceId != null and invoiceId != ''"> and invoice_id like concat('%',#{invoiceId},'%') </if>
            <if test="invoiceTitle != null and invoiceTitle != ''"> and invoice_title like concat('%',#{invoiceTitle},'%') </if>
            <if test="invoiceType != null and invoiceType != ''"> and invoice_type like concat('%',#{invoiceType},'%') </if>
            <if test="logisticsCode != null and logisticsCode != ''"> and logistics_code like concat('%',#{logisticsCode},'%') </if>
            <if test="logisticsId != null and logisticsId != ''"> and logistics_id like concat('%',#{logisticsId},'%') </if>
            <if test="logisticsName != null and logisticsName != ''"> and logistics_name like concat('%',#{logisticsName},'%') </if>
            <if test="logisticsNo != null and logisticsNo != ''"> and logistics_no like concat('%',#{logisticsNo},'%') </if>
            <if test="logisticsPrintStatus != null and logisticsPrintStatus != ''"> and logistics_print_status like concat('%',#{logisticsPrintStatus},'%') </if>
            <if test="logisticsType != null and logisticsType != ''"> and logistics_type like concat('%',#{logisticsType},'%') </if>
            <if test="modified != null and modified != ''"> and modified like concat('%',#{modified},'%') </if>
            <if test="orderNo != null and orderNo != ''"> and order_no like concat('%',#{orderNo},'%') </if>
            <if test="orderType != null and orderType != ''"> and order_type like concat('%',#{orderType},'%') </if>
            <if test="packageFee != null and packageFee != ''"> and package_fee like concat('%',#{packageFee},'%') </if>
            <if test="paid != null and paid != ''"> and paid like concat('%',#{paid},'%') </if>
            <if test="payTime != null and payTime != ''"> and pay_time like concat('%',#{payTime},'%') </if>
            <if test="picklistNo != null and picklistNo != ''"> and picklist_no like concat('%',#{picklistNo},'%') </if>
            <if test="picklistSeq != null and picklistSeq != ''"> and picklist_seq like concat('%',#{picklistSeq},'%') </if>
            <if test="platformId != null and platformId != ''"> and platform_id like concat('%',#{platformId},'%') </if>
            <if test="postAmount != null and postAmount != ''"> and post_amount like concat('%',#{postAmount},'%') </if>
            <if test="postFee != null and postFee != ''"> and post_fee like concat('%',#{postFee},'%') </if>
            <if test="printRemark != null and printRemark != ''"> and print_remark like concat('%',#{printRemark},'%') </if>
            <if test="receivable != null and receivable != ''"> and receivable like concat('%',#{receivable},'%') </if>
            <if test="receiverArea != null and receiverArea != ''"> and receiver_area like concat('%',#{receiverArea},'%') </if>
            <if test="receiverCity != null and receiverCity != ''"> and receiver_city like concat('%',#{receiverCity},'%') </if>
            <if test="receiverCountry != null and receiverCountry != ''"> and receiver_country like concat('%',#{receiverCountry},'%') </if>
            <if test="receiverDistrict != null and receiverDistrict != ''"> and receiver_district like concat('%',#{receiverDistrict},'%') </if>
            <if test="receiverDtb != null and receiverDtb != ''"> and receiver_dtb like concat('%',#{receiverDtb},'%') </if>
            <if test="receiverProvince != null and receiverProvince != ''"> and receiver_province like concat('%',#{receiverProvince},'%') </if>
            <if test="receiverZip != null and receiverZip != ''"> and receiver_zip like concat('%',#{receiverZip},'%') </if>
            <if test="refundStatus != null and refundStatus != ''"> and refund_status like concat('%',#{refundStatus},'%') </if>
            <if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
            <if test="seqNo != null and seqNo != ''"> and seq_no like concat('%',#{seqNo},'%') </if>
            <if test="shopId != null and shopId != ''"> and shop_id like concat('%',#{shopId},'%') </if>
            <if test="shopName != null and shopName != ''"> and shop_name like concat('%',#{shopName},'%') </if>
            <if test="shopNo != null and shopNo != ''"> and shop_no like concat('%',#{shopNo},'%') </if>
            <if test="shopPlatformId != null and shopPlatformId != ''"> and shop_platform_id like concat('%',#{shopPlatformId},'%') </if>
            <if test="shopRemark != null and shopRemark != ''"> and shop_remark like concat('%',#{shopRemark},'%') </if>
            <if test="srcOrderNo != null and srcOrderNo != ''"> and src_order_no like concat('%',#{srcOrderNo},'%') </if>
            <if test="srcTradeNo != null and srcTradeNo != ''"> and src_trade_no like concat('%',#{srcTradeNo},'%') </if>
            <if test="status != null and status != ''"> and status like concat('%',#{status},'%') </if>
            <if test="stockCheckTime != null and stockCheckTime != ''"> and stock_check_time like concat('%',#{stockCheckTime},'%') </if>
            <if test="stockoutId != null and stockoutId != ''"> and stockout_id like concat('%',#{stockoutId},'%') </if>
            <if test="subPlatformId != null and subPlatformId != ''"> and sub_platform_id like concat('%',#{subPlatformId},'%') </if>
            <if test="tax != null and tax != ''"> and tax like concat('%',#{tax},'%') </if>
            <if test="taxRate != null and taxRate != ''"> and tax_rate like concat('%',#{taxRate},'%') </if>
            <if test="tradeFrom != null and tradeFrom != ''"> and trade_from like concat('%',#{tradeFrom},'%') </if>
            <if test="tradeId != null and tradeId != ''"> and trade_id like concat('%',#{tradeId},'%') </if>
            <if test="tradeLabel != null and tradeLabel != ''"> and trade_label like concat('%',#{tradeLabel},'%') </if>
            <if test="tradeNo != null and tradeNo != ''"> and trade_no like concat('%',#{tradeNo},'%') </if>
            <if test="tradeStatus != null and tradeStatus != ''"> and trade_status like concat('%',#{tradeStatus},'%') </if>
            <if test="tradeTime != null and tradeTime != ''"> and trade_time like concat('%',#{tradeTime},'%') </if>
            <if test="tradeType != null and tradeType != ''"> and trade_type like concat('%',#{tradeType},'%') </if>
            <if test="warehouseId != null and warehouseId != ''"> and warehouse_id like concat('%',#{warehouseId},'%') </if>
            <if test="warehouseMappingCode != null and warehouseMappingCode != ''"> and warehouse_mapping_code like concat('%',#{warehouseMappingCode},'%') </if>
            <if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%',#{warehouseName},'%') </if>
            <if test="warehouseNo != null and warehouseNo != ''"> and warehouse_no like concat('%',#{warehouseNo},'%') </if>
            <if test="weight != null and weight != ''"> and weight like concat('%',#{weight},'%') </if>
            <if test="id != null"> and id like concat('%',#{id},'%') </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>

<!-- 查询列表 字段采用or格式 -->
<select id="BusidataTocsalesentity_list_or" resultMap="get-BusidataTocsalesEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesEntity">
    select
    <include refid="BusidataTocsalesEntity_Base_Column_List" />
    from busidata_tocsales
    <trim prefix="where" prefixOverrides="and"> 
         <if test="badReason != null and badReason != ''"> or bad_reason = #{badReason} </if>
             <if test="blockReason != null and blockReason != ''"> or block_reason = #{blockReason} </if>
             <if test="buyerMessage != null and buyerMessage != ''"> or buyer_message = #{buyerMessage} </if>
             <if test="codAmount != null and codAmount != ''"> or cod_amount = #{codAmount} </if>
             <if test="consignTime != null and consignTime != ''"> or consign_time = #{consignTime} </if>
             <if test="created != null and created != ''"> or created = #{created} </if>
             <if test="csRemark != null and csRemark != ''"> or cs_remark = #{csRemark} </if>
             <if test="currency != null and currency != ''"> or currency = #{currency} </if>
             <if test="customerNo != null and customerNo != ''"> or customer_no = #{customerNo} </if>
             <if test="deliveryTerm != null and deliveryTerm != ''"> or delivery_term = #{deliveryTerm} </if>
             <if test="discount != null and discount != ''"> or discount = #{discount} </if>
             <if test="fenxiaoNick != null and fenxiaoNick != ''"> or fenxiao_nick = #{fenxiaoNick} </if>
             <if test="flagName != null and flagName != ''"> or flag_name = #{flagName} </if>
             <if test="goodsCount != null and goodsCount != ''"> or goods_count = #{goodsCount} </if>
             <if test="goodsTotalAmount != null and goodsTotalAmount != ''"> or goods_total_amount = #{goodsTotalAmount} </if>
             <if test="goodsTotalCost != null and goodsTotalCost != ''"> or goods_total_cost = #{goodsTotalCost} </if>
             <if test="idCardType != null and idCardType != ''"> or id_card_type = #{idCardType} </if>
             <if test="invoiceContent != null and invoiceContent != ''"> or invoice_content = #{invoiceContent} </if>
             <if test="invoiceId != null and invoiceId != ''"> or invoice_id = #{invoiceId} </if>
             <if test="invoiceTitle != null and invoiceTitle != ''"> or invoice_title = #{invoiceTitle} </if>
             <if test="invoiceType != null and invoiceType != ''"> or invoice_type = #{invoiceType} </if>
             <if test="logisticsCode != null and logisticsCode != ''"> or logistics_code = #{logisticsCode} </if>
             <if test="logisticsId != null and logisticsId != ''"> or logistics_id = #{logisticsId} </if>
             <if test="logisticsName != null and logisticsName != ''"> or logistics_name = #{logisticsName} </if>
             <if test="logisticsNo != null and logisticsNo != ''"> or logistics_no = #{logisticsNo} </if>
             <if test="logisticsPrintStatus != null and logisticsPrintStatus != ''"> or logistics_print_status = #{logisticsPrintStatus} </if>
             <if test="logisticsType != null and logisticsType != ''"> or logistics_type = #{logisticsType} </if>
             <if test="modified != null and modified != ''"> or modified = #{modified} </if>
             <if test="orderNo != null and orderNo != ''"> or order_no = #{orderNo} </if>
             <if test="orderType != null and orderType != ''"> or order_type = #{orderType} </if>
             <if test="packageFee != null and packageFee != ''"> or package_fee = #{packageFee} </if>
             <if test="paid != null and paid != ''"> or paid = #{paid} </if>
             <if test="payTime != null and payTime != ''"> or pay_time = #{payTime} </if>
             <if test="picklistNo != null and picklistNo != ''"> or picklist_no = #{picklistNo} </if>
             <if test="picklistSeq != null and picklistSeq != ''"> or picklist_seq = #{picklistSeq} </if>
             <if test="platformId != null and platformId != ''"> or platform_id = #{platformId} </if>
             <if test="postAmount != null and postAmount != ''"> or post_amount = #{postAmount} </if>
             <if test="postFee != null and postFee != ''"> or post_fee = #{postFee} </if>
             <if test="printRemark != null and printRemark != ''"> or print_remark = #{printRemark} </if>
             <if test="receivable != null and receivable != ''"> or receivable = #{receivable} </if>
             <if test="receiverArea != null and receiverArea != ''"> or receiver_area = #{receiverArea} </if>
             <if test="receiverCity != null and receiverCity != ''"> or receiver_city = #{receiverCity} </if>
             <if test="receiverCountry != null and receiverCountry != ''"> or receiver_country = #{receiverCountry} </if>
             <if test="receiverDistrict != null and receiverDistrict != ''"> or receiver_district = #{receiverDistrict} </if>
             <if test="receiverDtb != null and receiverDtb != ''"> or receiver_dtb = #{receiverDtb} </if>
             <if test="receiverProvince != null and receiverProvince != ''"> or receiver_province = #{receiverProvince} </if>
             <if test="receiverZip != null and receiverZip != ''"> or receiver_zip = #{receiverZip} </if>
             <if test="refundStatus != null and refundStatus != ''"> or refund_status = #{refundStatus} </if>
             <if test="remark != null and remark != ''"> or remark = #{remark} </if>
             <if test="seqNo != null and seqNo != ''"> or seq_no = #{seqNo} </if>
             <if test="shopId != null and shopId != ''"> or shop_id = #{shopId} </if>
             <if test="shopName != null and shopName != ''"> or shop_name = #{shopName} </if>
             <if test="shopNo != null and shopNo != ''"> or shop_no = #{shopNo} </if>
             <if test="shopPlatformId != null and shopPlatformId != ''"> or shop_platform_id = #{shopPlatformId} </if>
             <if test="shopRemark != null and shopRemark != ''"> or shop_remark = #{shopRemark} </if>
             <if test="srcOrderNo != null and srcOrderNo != ''"> or src_order_no = #{srcOrderNo} </if>
             <if test="srcTradeNo != null and srcTradeNo != ''"> or src_trade_no = #{srcTradeNo} </if>
             <if test="status != null and status != ''"> or status = #{status} </if>
             <if test="stockCheckTime != null and stockCheckTime != ''"> or stock_check_time = #{stockCheckTime} </if>
             <if test="stockoutId != null and stockoutId != ''"> or stockout_id = #{stockoutId} </if>
             <if test="subPlatformId != null and subPlatformId != ''"> or sub_platform_id = #{subPlatformId} </if>
             <if test="tax != null and tax != ''"> or tax = #{tax} </if>
             <if test="taxRate != null and taxRate != ''"> or tax_rate = #{taxRate} </if>
             <if test="tradeFrom != null and tradeFrom != ''"> or trade_from = #{tradeFrom} </if>
             <if test="tradeId != null and tradeId != ''"> or trade_id = #{tradeId} </if>
             <if test="tradeLabel != null and tradeLabel != ''"> or trade_label = #{tradeLabel} </if>
             <if test="tradeNo != null and tradeNo != ''"> or trade_no = #{tradeNo} </if>
             <if test="tradeStatus != null and tradeStatus != ''"> or trade_status = #{tradeStatus} </if>
             <if test="tradeTime != null and tradeTime != ''"> or trade_time = #{tradeTime} </if>
             <if test="tradeType != null and tradeType != ''"> or trade_type = #{tradeType} </if>
             <if test="warehouseId != null and warehouseId != ''"> or warehouse_id = #{warehouseId} </if>
             <if test="warehouseMappingCode != null and warehouseMappingCode != ''"> or warehouse_mapping_code = #{warehouseMappingCode} </if>
             <if test="warehouseName != null and warehouseName != ''"> or warehouse_name = #{warehouseName} </if>
             <if test="warehouseNo != null and warehouseNo != ''"> or warehouse_no = #{warehouseNo} </if>
             <if test="weight != null and weight != ''"> or weight = #{weight} </if>
             <if test="id != null"> or id = #{id} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString()  "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>

<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesEntity" keyProperty="id" useGeneratedKeys="true">
    insert into busidata_tocsales(
  <trim suffix="" suffixOverrides=",">
       <if test="badReason != null and badReason != ''"> bad_reason , </if>
            <if test="blockReason != null and blockReason != ''"> block_reason , </if>
            <if test="buyerMessage != null and buyerMessage != ''"> buyer_message , </if>
            <if test="codAmount != null and codAmount != ''"> cod_amount , </if>
            <if test="consignTime != null and consignTime != ''"> consign_time , </if>
            <if test="created != null and created != ''"> created , </if>
            <if test="csRemark != null and csRemark != ''"> cs_remark , </if>
            <if test="currency != null and currency != ''"> currency , </if>
            <if test="customerNo != null and customerNo != ''"> customer_no , </if>
            <if test="deliveryTerm != null and deliveryTerm != ''"> delivery_term , </if>
            <if test="discount != null and discount != ''"> discount , </if>
            <if test="fenxiaoNick != null and fenxiaoNick != ''"> fenxiao_nick , </if>
            <if test="flagName != null and flagName != ''"> flag_name , </if>
            <if test="goodsCount != null and goodsCount != ''"> goods_count , </if>
            <if test="goodsTotalAmount != null and goodsTotalAmount != ''"> goods_total_amount , </if>
            <if test="goodsTotalCost != null and goodsTotalCost != ''"> goods_total_cost , </if>
            <if test="idCardType != null and idCardType != ''"> id_card_type , </if>
            <if test="invoiceContent != null and invoiceContent != ''"> invoice_content , </if>
            <if test="invoiceId != null and invoiceId != ''"> invoice_id , </if>
            <if test="invoiceTitle != null and invoiceTitle != ''"> invoice_title , </if>
            <if test="invoiceType != null and invoiceType != ''"> invoice_type , </if>
            <if test="logisticsCode != null and logisticsCode != ''"> logistics_code , </if>
            <if test="logisticsId != null and logisticsId != ''"> logistics_id , </if>
            <if test="logisticsName != null and logisticsName != ''"> logistics_name , </if>
            <if test="logisticsNo != null and logisticsNo != ''"> logistics_no , </if>
            <if test="logisticsPrintStatus != null and logisticsPrintStatus != ''"> logistics_print_status , </if>
            <if test="logisticsType != null and logisticsType != ''"> logistics_type , </if>
            <if test="modified != null and modified != ''"> modified , </if>
            <if test="orderNo != null and orderNo != ''"> order_no , </if>
            <if test="orderType != null and orderType != ''"> order_type , </if>
            <if test="packageFee != null and packageFee != ''"> package_fee , </if>
            <if test="paid != null and paid != ''"> paid , </if>
            <if test="payTime != null and payTime != ''"> pay_time , </if>
            <if test="picklistNo != null and picklistNo != ''"> picklist_no , </if>
            <if test="picklistSeq != null and picklistSeq != ''"> picklist_seq , </if>
            <if test="platformId != null and platformId != ''"> platform_id , </if>
            <if test="postAmount != null and postAmount != ''"> post_amount , </if>
            <if test="postFee != null and postFee != ''"> post_fee , </if>
            <if test="printRemark != null and printRemark != ''"> print_remark , </if>
            <if test="receivable != null and receivable != ''"> receivable , </if>
            <if test="receiverArea != null and receiverArea != ''"> receiver_area , </if>
            <if test="receiverCity != null and receiverCity != ''"> receiver_city , </if>
            <if test="receiverCountry != null and receiverCountry != ''"> receiver_country , </if>
            <if test="receiverDistrict != null and receiverDistrict != ''"> receiver_district , </if>
            <if test="receiverDtb != null and receiverDtb != ''"> receiver_dtb , </if>
            <if test="receiverProvince != null and receiverProvince != ''"> receiver_province , </if>
            <if test="receiverZip != null and receiverZip != ''"> receiver_zip , </if>
            <if test="refundStatus != null and refundStatus != ''"> refund_status , </if>
            <if test="remark != null and remark != ''"> remark , </if>
            <if test="seqNo != null and seqNo != ''"> seq_no , </if>
            <if test="shopId != null and shopId != ''"> shop_id , </if>
            <if test="shopName != null and shopName != ''"> shop_name , </if>
            <if test="shopNo != null and shopNo != ''"> shop_no , </if>
            <if test="shopPlatformId != null and shopPlatformId != ''"> shop_platform_id , </if>
            <if test="shopRemark != null and shopRemark != ''"> shop_remark , </if>
            <if test="srcOrderNo != null and srcOrderNo != ''"> src_order_no , </if>
            <if test="srcTradeNo != null and srcTradeNo != ''"> src_trade_no , </if>
            <if test="status != null and status != ''"> status , </if>
            <if test="stockCheckTime != null and stockCheckTime != ''"> stock_check_time , </if>
            <if test="stockoutId != null and stockoutId != ''"> stockout_id , </if>
            <if test="subPlatformId != null and subPlatformId != ''"> sub_platform_id , </if>
            <if test="tax != null and tax != ''"> tax , </if>
            <if test="taxRate != null and taxRate != ''"> tax_rate , </if>
            <if test="tradeFrom != null and tradeFrom != ''"> trade_from , </if>
            <if test="tradeId != null and tradeId != ''"> trade_id , </if>
            <if test="tradeLabel != null and tradeLabel != ''"> trade_label , </if>
            <if test="tradeNo != null and tradeNo != ''"> trade_no , </if>
            <if test="tradeStatus != null and tradeStatus != ''"> trade_status , </if>
            <if test="tradeTime != null and tradeTime != ''"> trade_time , </if>
            <if test="tradeType != null and tradeType != ''"> trade_type , </if>
            <if test="warehouseId != null and warehouseId != ''"> warehouse_id , </if>
            <if test="warehouseMappingCode != null and warehouseMappingCode != ''"> warehouse_mapping_code , </if>
            <if test="warehouseName != null and warehouseName != ''"> warehouse_name , </if>
            <if test="warehouseNo != null and warehouseNo != ''"> warehouse_no , </if>
            <if test="weight != null and weight != ''"> weight , </if>
            <if test="id != null"> id , </if>
            <if test="sorts == null ">sorts,</if>
    <if test="sts == null ">sts,</if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <if test="badReason != null and badReason != ''"> #{badReason} ,</if>
            <if test="blockReason != null and blockReason != ''"> #{blockReason} ,</if>
            <if test="buyerMessage != null and buyerMessage != ''"> #{buyerMessage} ,</if>
            <if test="codAmount != null and codAmount != ''"> #{codAmount} ,</if>
            <if test="consignTime != null and consignTime != ''"> #{consignTime} ,</if>
            <if test="created != null and created != ''"> #{created} ,</if>
            <if test="csRemark != null and csRemark != ''"> #{csRemark} ,</if>
            <if test="currency != null and currency != ''"> #{currency} ,</if>
            <if test="customerNo != null and customerNo != ''"> #{customerNo} ,</if>
            <if test="deliveryTerm != null and deliveryTerm != ''"> #{deliveryTerm} ,</if>
            <if test="discount != null and discount != ''"> #{discount} ,</if>
            <if test="fenxiaoNick != null and fenxiaoNick != ''"> #{fenxiaoNick} ,</if>
            <if test="flagName != null and flagName != ''"> #{flagName} ,</if>
            <if test="goodsCount != null and goodsCount != ''"> #{goodsCount} ,</if>
            <if test="goodsTotalAmount != null and goodsTotalAmount != ''"> #{goodsTotalAmount} ,</if>
            <if test="goodsTotalCost != null and goodsTotalCost != ''"> #{goodsTotalCost} ,</if>
            <if test="idCardType != null and idCardType != ''"> #{idCardType} ,</if>
            <if test="invoiceContent != null and invoiceContent != ''"> #{invoiceContent} ,</if>
            <if test="invoiceId != null and invoiceId != ''"> #{invoiceId} ,</if>
            <if test="invoiceTitle != null and invoiceTitle != ''"> #{invoiceTitle} ,</if>
            <if test="invoiceType != null and invoiceType != ''"> #{invoiceType} ,</if>
            <if test="logisticsCode != null and logisticsCode != ''"> #{logisticsCode} ,</if>
            <if test="logisticsId != null and logisticsId != ''"> #{logisticsId} ,</if>
            <if test="logisticsName != null and logisticsName != ''"> #{logisticsName} ,</if>
            <if test="logisticsNo != null and logisticsNo != ''"> #{logisticsNo} ,</if>
            <if test="logisticsPrintStatus != null and logisticsPrintStatus != ''"> #{logisticsPrintStatus} ,</if>
            <if test="logisticsType != null and logisticsType != ''"> #{logisticsType} ,</if>
            <if test="modified != null and modified != ''"> #{modified} ,</if>
            <if test="orderNo != null and orderNo != ''"> #{orderNo} ,</if>
            <if test="orderType != null and orderType != ''"> #{orderType} ,</if>
            <if test="packageFee != null and packageFee != ''"> #{packageFee} ,</if>
            <if test="paid != null and paid != ''"> #{paid} ,</if>
            <if test="payTime != null and payTime != ''"> #{payTime} ,</if>
            <if test="picklistNo != null and picklistNo != ''"> #{picklistNo} ,</if>
            <if test="picklistSeq != null and picklistSeq != ''"> #{picklistSeq} ,</if>
            <if test="platformId != null and platformId != ''"> #{platformId} ,</if>
            <if test="postAmount != null and postAmount != ''"> #{postAmount} ,</if>
            <if test="postFee != null and postFee != ''"> #{postFee} ,</if>
            <if test="printRemark != null and printRemark != ''"> #{printRemark} ,</if>
            <if test="receivable != null and receivable != ''"> #{receivable} ,</if>
            <if test="receiverArea != null and receiverArea != ''"> #{receiverArea} ,</if>
            <if test="receiverCity != null and receiverCity != ''"> #{receiverCity} ,</if>
            <if test="receiverCountry != null and receiverCountry != ''"> #{receiverCountry} ,</if>
            <if test="receiverDistrict != null and receiverDistrict != ''"> #{receiverDistrict} ,</if>
            <if test="receiverDtb != null and receiverDtb != ''"> #{receiverDtb} ,</if>
            <if test="receiverProvince != null and receiverProvince != ''"> #{receiverProvince} ,</if>
            <if test="receiverZip != null and receiverZip != ''"> #{receiverZip} ,</if>
            <if test="refundStatus != null and refundStatus != ''"> #{refundStatus} ,</if>
            <if test="remark != null and remark != ''"> #{remark} ,</if>
            <if test="seqNo != null and seqNo != ''"> #{seqNo} ,</if>
            <if test="shopId != null and shopId != ''"> #{shopId} ,</if>
            <if test="shopName != null and shopName != ''"> #{shopName} ,</if>
            <if test="shopNo != null and shopNo != ''"> #{shopNo} ,</if>
            <if test="shopPlatformId != null and shopPlatformId != ''"> #{shopPlatformId} ,</if>
            <if test="shopRemark != null and shopRemark != ''"> #{shopRemark} ,</if>
            <if test="srcOrderNo != null and srcOrderNo != ''"> #{srcOrderNo} ,</if>
            <if test="srcTradeNo != null and srcTradeNo != ''"> #{srcTradeNo} ,</if>
            <if test="status != null and status != ''"> #{status} ,</if>
            <if test="stockCheckTime != null and stockCheckTime != ''"> #{stockCheckTime} ,</if>
            <if test="stockoutId != null and stockoutId != ''"> #{stockoutId} ,</if>
            <if test="subPlatformId != null and subPlatformId != ''"> #{subPlatformId} ,</if>
            <if test="tax != null and tax != ''"> #{tax} ,</if>
            <if test="taxRate != null and taxRate != ''"> #{taxRate} ,</if>
            <if test="tradeFrom != null and tradeFrom != ''"> #{tradeFrom} ,</if>
            <if test="tradeId != null and tradeId != ''"> #{tradeId} ,</if>
            <if test="tradeLabel != null and tradeLabel != ''"> #{tradeLabel} ,</if>
            <if test="tradeNo != null and tradeNo != ''"> #{tradeNo} ,</if>
            <if test="tradeStatus != null and tradeStatus != ''"> #{tradeStatus} ,</if>
            <if test="tradeTime != null and tradeTime != ''"> #{tradeTime} ,</if>
            <if test="tradeType != null and tradeType != ''"> #{tradeType} ,</if>
            <if test="warehouseId != null and warehouseId != ''"> #{warehouseId} ,</if>
            <if test="warehouseMappingCode != null and warehouseMappingCode != ''"> #{warehouseMappingCode} ,</if>
            <if test="warehouseName != null and warehouseName != ''"> #{warehouseName} ,</if>
            <if test="warehouseNo != null and warehouseNo != ''"> #{warehouseNo} ,</if>
            <if test="weight != null and weight != ''"> #{weight} ,</if>
            <if test="id != null"> #{id} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from busidata_tocsales a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>

<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
  insert IGNORE into busidata_tocsales(bad_reason, block_reason, buyer_message, cod_amount, consign_time, created, cs_remark, currency, customer_no, delivery_term, discount, fenxiao_nick, flag_name, goods_count, goods_total_amount, goods_total_cost, id_card_type, invoice_content, invoice_id, invoice_title, invoice_type, logistics_code, logistics_id, logistics_name, logistics_no, logistics_print_status, logistics_type, modified, order_no, order_type, package_fee, paid, pay_time, picklist_no, picklist_seq, platform_id, post_amount, post_fee, print_remark, receivable, receiver_area, receiver_city, receiver_country, receiver_district, receiver_dtb, receiver_province, receiver_zip, refund_status, remark, seq_no, shop_id, shop_name, shop_no, shop_platform_id, shop_remark, src_order_no, src_trade_no, status, stock_check_time, stockout_id, sub_platform_id, tax, tax_rate, trade_from, trade_id, trade_label, trade_no, trade_status, trade_time, trade_type, warehouse_id, warehouse_mapping_code, warehouse_name, warehouse_no, weight,business_month,business_date)
    values
    <foreach collection="list" item="entity" separator=",">
    (#{entity.badReason},#{entity.blockReason},#{entity.buyerMessage},#{entity.codAmount},#{entity.consignTime},#{entity.created},#{entity.csRemark},#{entity.currency},#{entity.customerNo},#{entity.deliveryTerm},#{entity.discount},#{entity.fenxiaoNick},#{entity.flagName},#{entity.goodsCount},#{entity.goodsTotalAmount},#{entity.goodsTotalCost},#{entity.idCardType},#{entity.invoiceContent},#{entity.invoiceId},#{entity.invoiceTitle},#{entity.invoiceType},#{entity.logisticsCode},#{entity.logisticsId},#{entity.logisticsName},#{entity.logisticsNo},#{entity.logisticsPrintStatus},#{entity.logisticsType},#{entity.modified},#{entity.orderNo},#{entity.orderType},#{entity.packageFee},#{entity.paid},#{entity.payTime},#{entity.picklistNo},#{entity.picklistSeq},#{entity.platformId},#{entity.postAmount},#{entity.postFee},#{entity.printRemark},#{entity.receivable},#{entity.receiverArea},#{entity.receiverCity},#{entity.receiverCountry},#{entity.receiverDistrict},#{entity.receiverDtb},#{entity.receiverProvince},#{entity.receiverZip},#{entity.refundStatus},#{entity.remark},#{entity.seqNo},#{entity.shopId},#{entity.shopName},#{entity.shopNo},#{entity.shopPlatformId},#{entity.shopRemark},#{entity.srcOrderNo},#{entity.srcTradeNo},#{entity.status},#{entity.stockCheckTime},#{entity.stockoutId},#{entity.subPlatformId},#{entity.tax},#{entity.taxRate},#{entity.tradeFrom},#{entity.tradeId},#{entity.tradeLabel},#{entity.tradeNo},#{entity.tradeStatus},#{entity.tradeTime},#{entity.tradeType},#{entity.warehouseId},#{entity.warehouseMappingCode},#{entity.warehouseName},#{entity.warehouseNo},#{entity.weight},#{entity.business_month},#{entity.business_date})
    </foreach>
</insert>

<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
    insert into busidata_tocsales(bad_reason, block_reason, buyer_message, cod_amount, consign_time, created, cs_remark, currency, customer_no, delivery_term, discount, fenxiao_nick, flag_name, goods_count, goods_total_amount, goods_total_cost, id_card_type, invoice_content, invoice_id, invoice_title, invoice_type, logistics_code, logistics_id, logistics_name, logistics_no, logistics_print_status, logistics_type, modified, order_no, order_type, package_fee, paid, pay_time, picklist_no, picklist_seq, platform_id, post_amount, post_fee, print_remark, receivable, receiver_area, receiver_city, receiver_country, receiver_district, receiver_dtb, receiver_province, receiver_zip, refund_status, remark, seq_no, shop_id, shop_name, shop_no, shop_platform_id, shop_remark, src_order_no, src_trade_no, status, stock_check_time, stockout_id, sub_platform_id, tax, tax_rate, trade_from, trade_id, trade_label, trade_no, trade_status, trade_time, trade_type, warehouse_id, warehouse_mapping_code, warehouse_name, warehouse_no, weight,business_month,business_date)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.badReason},#{entity.blockReason},#{entity.buyerMessage},#{entity.codAmount},#{entity.consignTime},#{entity.created},#{entity.csRemark},#{entity.currency},#{entity.customerNo},#{entity.deliveryTerm},#{entity.discount},#{entity.fenxiaoNick},#{entity.flagName},#{entity.goodsCount},#{entity.goodsTotalAmount},#{entity.goodsTotalCost},#{entity.idCardType},#{entity.invoiceContent},#{entity.invoiceId},#{entity.invoiceTitle},#{entity.invoiceType},#{entity.logisticsCode},#{entity.logisticsId},#{entity.logisticsName},#{entity.logisticsNo},#{entity.logisticsPrintStatus},#{entity.logisticsType},#{entity.modified},#{entity.orderNo},#{entity.orderType},#{entity.packageFee},#{entity.paid},#{entity.payTime},#{entity.picklistNo},#{entity.picklistSeq},#{entity.platformId},#{entity.postAmount},#{entity.postFee},#{entity.printRemark},#{entity.receivable},#{entity.receiverArea},#{entity.receiverCity},#{entity.receiverCountry},#{entity.receiverDistrict},#{entity.receiverDtb},#{entity.receiverProvince},#{entity.receiverZip},#{entity.refundStatus},#{entity.remark},#{entity.seqNo},#{entity.shopId},#{entity.shopName},#{entity.shopNo},#{entity.shopPlatformId},#{entity.shopRemark},#{entity.srcOrderNo},#{entity.srcTradeNo},#{entity.status},#{entity.stockCheckTime},#{entity.stockoutId},#{entity.subPlatformId},#{entity.tax},#{entity.taxRate},#{entity.tradeFrom},#{entity.tradeId},#{entity.tradeLabel},#{entity.tradeNo},#{entity.tradeStatus},#{entity.tradeTime},#{entity.tradeType},#{entity.warehouseId},#{entity.warehouseMappingCode},#{entity.warehouseName},#{entity.warehouseNo},#{entity.weight},#{entity.business_month},#{entity.business_date})
    </foreach>
    on duplicate key update
    bad_reason = values(bad_reason),
    block_reason = values(block_reason),
    buyer_message = values(buyer_message),
    cod_amount = values(cod_amount),
    consign_time = values(consign_time),
    created = values(created),
    cs_remark = values(cs_remark),
    currency = values(currency),
    customer_no = values(customer_no),
    delivery_term = values(delivery_term),
    discount = values(discount),
    fenxiao_nick = values(fenxiao_nick),
    flag_name = values(flag_name),
    goods_count = values(goods_count),
    goods_total_amount = values(goods_total_amount),
    goods_total_cost = values(goods_total_cost),
    id_card_type = values(id_card_type),
    invoice_content = values(invoice_content),
    invoice_id = values(invoice_id),
    invoice_title = values(invoice_title),
    invoice_type = values(invoice_type),
    logistics_code = values(logistics_code),
    logistics_id = values(logistics_id),
    logistics_name = values(logistics_name),
    logistics_no = values(logistics_no),
    logistics_print_status = values(logistics_print_status),
    logistics_type = values(logistics_type),
    modified = values(modified),
    order_no = values(order_no),
    order_type = values(order_type),
    package_fee = values(package_fee),
    paid = values(paid),
    pay_time = values(pay_time),
    picklist_no = values(picklist_no),
    picklist_seq = values(picklist_seq),
    platform_id = values(platform_id),
    post_amount = values(post_amount),
    post_fee = values(post_fee),
    print_remark = values(print_remark),
    receivable = values(receivable),
    receiver_area = values(receiver_area),
    receiver_city = values(receiver_city),
    receiver_country = values(receiver_country),
    receiver_district = values(receiver_district),
    receiver_dtb = values(receiver_dtb),
    receiver_province = values(receiver_province),
    receiver_zip = values(receiver_zip),
    refund_status = values(refund_status),
    remark = values(remark),
    seq_no = values(seq_no),
    shop_id = values(shop_id),
    shop_name = values(shop_name),
    shop_no = values(shop_no),
    shop_platform_id = values(shop_platform_id),
    shop_remark = values(shop_remark),
    src_order_no = values(src_order_no),
    src_trade_no = values(src_trade_no),
    status = values(status),
    stock_check_time = values(stock_check_time),
    stockout_id = values(stockout_id),
    sub_platform_id = values(sub_platform_id),
    tax = values(tax),
    tax_rate = values(tax_rate),
    trade_from = values(trade_from),
    trade_id = values(trade_id),
    trade_label = values(trade_label),
    trade_no = values(trade_no),
    trade_status = values(trade_status),
    trade_time = values(trade_time),
    trade_type = values(trade_type),
    warehouse_id = values(warehouse_id),
    warehouse_mapping_code = values(warehouse_mapping_code),
    warehouse_name = values(warehouse_name),
    warehouse_no = values(warehouse_no),
    weight = values(weight)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesEntity" >
update busidata_tocsales  set
<trim suffix="" suffixOverrides=",">
  <if test="badReason != null and badReason != ''"> bad_reason = #{badReason},</if>
  <if test="blockReason != null and blockReason != ''"> block_reason = #{blockReason},</if>
  <if test="buyerMessage != null and buyerMessage != ''"> buyer_message = #{buyerMessage},</if>
  <if test="codAmount != null and codAmount != ''"> cod_amount = #{codAmount},</if>
  <if test="consignTime != null and consignTime != ''"> consign_time = #{consignTime},</if>
  <if test="created != null and created != ''"> created = #{created},</if>
  <if test="csRemark != null and csRemark != ''"> cs_remark = #{csRemark},</if>
  <if test="currency != null and currency != ''"> currency = #{currency},</if>
  <if test="customerNo != null and customerNo != ''"> customer_no = #{customerNo},</if>
  <if test="deliveryTerm != null and deliveryTerm != ''"> delivery_term = #{deliveryTerm},</if>
  <if test="discount != null and discount != ''"> discount = #{discount},</if>
  <if test="fenxiaoNick != null and fenxiaoNick != ''"> fenxiao_nick = #{fenxiaoNick},</if>
  <if test="flagName != null and flagName != ''"> flag_name = #{flagName},</if>
  <if test="goodsCount != null and goodsCount != ''"> goods_count = #{goodsCount},</if>
  <if test="goodsTotalAmount != null and goodsTotalAmount != ''"> goods_total_amount = #{goodsTotalAmount},</if>
  <if test="goodsTotalCost != null and goodsTotalCost != ''"> goods_total_cost = #{goodsTotalCost},</if>
  <if test="idCardType != null and idCardType != ''"> id_card_type = #{idCardType},</if>
  <if test="invoiceContent != null and invoiceContent != ''"> invoice_content = #{invoiceContent},</if>
  <if test="invoiceId != null and invoiceId != ''"> invoice_id = #{invoiceId},</if>
  <if test="invoiceTitle != null and invoiceTitle != ''"> invoice_title = #{invoiceTitle},</if>
  <if test="invoiceType != null and invoiceType != ''"> invoice_type = #{invoiceType},</if>
  <if test="logisticsCode != null and logisticsCode != ''"> logistics_code = #{logisticsCode},</if>
  <if test="logisticsId != null and logisticsId != ''"> logistics_id = #{logisticsId},</if>
  <if test="logisticsName != null and logisticsName != ''"> logistics_name = #{logisticsName},</if>
  <if test="logisticsNo != null and logisticsNo != ''"> logistics_no = #{logisticsNo},</if>
  <if test="logisticsPrintStatus != null and logisticsPrintStatus != ''"> logistics_print_status = #{logisticsPrintStatus},</if>
  <if test="logisticsType != null and logisticsType != ''"> logistics_type = #{logisticsType},</if>
  <if test="modified != null and modified != ''"> modified = #{modified},</if>
  <if test="orderNo != null and orderNo != ''"> order_no = #{orderNo},</if>
  <if test="orderType != null and orderType != ''"> order_type = #{orderType},</if>
  <if test="packageFee != null and packageFee != ''"> package_fee = #{packageFee},</if>
  <if test="paid != null and paid != ''"> paid = #{paid},</if>
  <if test="payTime != null and payTime != ''"> pay_time = #{payTime},</if>
  <if test="picklistNo != null and picklistNo != ''"> picklist_no = #{picklistNo},</if>
  <if test="picklistSeq != null and picklistSeq != ''"> picklist_seq = #{picklistSeq},</if>
  <if test="platformId != null and platformId != ''"> platform_id = #{platformId},</if>
  <if test="postAmount != null and postAmount != ''"> post_amount = #{postAmount},</if>
  <if test="postFee != null and postFee != ''"> post_fee = #{postFee},</if>
  <if test="printRemark != null and printRemark != ''"> print_remark = #{printRemark},</if>
  <if test="receivable != null and receivable != ''"> receivable = #{receivable},</if>
  <if test="receiverArea != null and receiverArea != ''"> receiver_area = #{receiverArea},</if>
  <if test="receiverCity != null and receiverCity != ''"> receiver_city = #{receiverCity},</if>
  <if test="receiverCountry != null and receiverCountry != ''"> receiver_country = #{receiverCountry},</if>
  <if test="receiverDistrict != null and receiverDistrict != ''"> receiver_district = #{receiverDistrict},</if>
  <if test="receiverDtb != null and receiverDtb != ''"> receiver_dtb = #{receiverDtb},</if>
  <if test="receiverProvince != null and receiverProvince != ''"> receiver_province = #{receiverProvince},</if>
  <if test="receiverZip != null and receiverZip != ''"> receiver_zip = #{receiverZip},</if>
  <if test="refundStatus != null and refundStatus != ''"> refund_status = #{refundStatus},</if>
  <if test="remark != null and remark != ''"> remark = #{remark},</if>
  <if test="seqNo != null and seqNo != ''"> seq_no = #{seqNo},</if>
  <if test="shopId != null and shopId != ''"> shop_id = #{shopId},</if>
  <if test="shopName != null and shopName != ''"> shop_name = #{shopName},</if>
  <if test="shopNo != null and shopNo != ''"> shop_no = #{shopNo},</if>
  <if test="shopPlatformId != null and shopPlatformId != ''"> shop_platform_id = #{shopPlatformId},</if>
  <if test="shopRemark != null and shopRemark != ''"> shop_remark = #{shopRemark},</if>
  <if test="srcOrderNo != null and srcOrderNo != ''"> src_order_no = #{srcOrderNo},</if>
  <if test="srcTradeNo != null and srcTradeNo != ''"> src_trade_no = #{srcTradeNo},</if>
  <if test="status != null and status != ''"> status = #{status},</if>
  <if test="stockCheckTime != null and stockCheckTime != ''"> stock_check_time = #{stockCheckTime},</if>
  <if test="stockoutId != null and stockoutId != ''"> stockout_id = #{stockoutId},</if>
  <if test="subPlatformId != null and subPlatformId != ''"> sub_platform_id = #{subPlatformId},</if>
  <if test="tax != null and tax != ''"> tax = #{tax},</if>
  <if test="taxRate != null and taxRate != ''"> tax_rate = #{taxRate},</if>
  <if test="tradeFrom != null and tradeFrom != ''"> trade_from = #{tradeFrom},</if>
  <if test="tradeId != null and tradeId != ''"> trade_id = #{tradeId},</if>
  <if test="tradeLabel != null and tradeLabel != ''"> trade_label = #{tradeLabel},</if>
  <if test="tradeNo != null and tradeNo != ''"> trade_no = #{tradeNo},</if>
  <if test="tradeStatus != null and tradeStatus != ''"> trade_status = #{tradeStatus},</if>
  <if test="tradeTime != null and tradeTime != ''"> trade_time = #{tradeTime},</if>
  <if test="tradeType != null and tradeType != ''"> trade_type = #{tradeType},</if>
  <if test="warehouseId != null and warehouseId != ''"> warehouse_id = #{warehouseId},</if>
  <if test="warehouseMappingCode != null and warehouseMappingCode != ''"> warehouse_mapping_code = #{warehouseMappingCode},</if>
  <if test="warehouseName != null and warehouseName != ''"> warehouse_name = #{warehouseName},</if>
  <if test="warehouseNo != null and warehouseNo != ''"> warehouse_no = #{warehouseNo},</if>
  <if test="weight != null and weight != ''"> weight = #{weight},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesEntity" >
update busidata_tocsales  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesEntity" >
update busidata_tocsales  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 <trim prefix="where" prefixOverrides="and"> 
        <if test="badReason != null and badReason != ''"> and bad_reason = #{badReason} </if>
            <if test="blockReason != null and blockReason != ''"> and block_reason = #{blockReason} </if>
            <if test="buyerMessage != null and buyerMessage != ''"> and buyer_message = #{buyerMessage} </if>
            <if test="codAmount != null and codAmount != ''"> and cod_amount = #{codAmount} </if>
            <if test="consignTime != null and consignTime != ''"> and consign_time = #{consignTime} </if>
            <if test="created != null and created != ''"> and created = #{created} </if>
            <if test="csRemark != null and csRemark != ''"> and cs_remark = #{csRemark} </if>
            <if test="currency != null and currency != ''"> and currency = #{currency} </if>
            <if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo} </if>
            <if test="deliveryTerm != null and deliveryTerm != ''"> and delivery_term = #{deliveryTerm} </if>
            <if test="discount != null and discount != ''"> and discount = #{discount} </if>
            <if test="fenxiaoNick != null and fenxiaoNick != ''"> and fenxiao_nick = #{fenxiaoNick} </if>
            <if test="flagName != null and flagName != ''"> and flag_name = #{flagName} </if>
            <if test="goodsCount != null and goodsCount != ''"> and goods_count = #{goodsCount} </if>
            <if test="goodsTotalAmount != null and goodsTotalAmount != ''"> and goods_total_amount = #{goodsTotalAmount} </if>
            <if test="goodsTotalCost != null and goodsTotalCost != ''"> and goods_total_cost = #{goodsTotalCost} </if>
            <if test="idCardType != null and idCardType != ''"> and id_card_type = #{idCardType} </if>
            <if test="invoiceContent != null and invoiceContent != ''"> and invoice_content = #{invoiceContent} </if>
            <if test="invoiceId != null and invoiceId != ''"> and invoice_id = #{invoiceId} </if>
            <if test="invoiceTitle != null and invoiceTitle != ''"> and invoice_title = #{invoiceTitle} </if>
            <if test="invoiceType != null and invoiceType != ''"> and invoice_type = #{invoiceType} </if>
            <if test="logisticsCode != null and logisticsCode != ''"> and logistics_code = #{logisticsCode} </if>
            <if test="logisticsId != null and logisticsId != ''"> and logistics_id = #{logisticsId} </if>
            <if test="logisticsName != null and logisticsName != ''"> and logistics_name = #{logisticsName} </if>
            <if test="logisticsNo != null and logisticsNo != ''"> and logistics_no = #{logisticsNo} </if>
            <if test="logisticsPrintStatus != null and logisticsPrintStatus != ''"> and logistics_print_status = #{logisticsPrintStatus} </if>
            <if test="logisticsType != null and logisticsType != ''"> and logistics_type = #{logisticsType} </if>
            <if test="modified != null and modified != ''"> and modified = #{modified} </if>
            <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo} </if>
            <if test="orderType != null and orderType != ''"> and order_type = #{orderType} </if>
            <if test="packageFee != null and packageFee != ''"> and package_fee = #{packageFee} </if>
            <if test="paid != null and paid != ''"> and paid = #{paid} </if>
            <if test="payTime != null and payTime != ''"> and pay_time = #{payTime} </if>
            <if test="picklistNo != null and picklistNo != ''"> and picklist_no = #{picklistNo} </if>
            <if test="picklistSeq != null and picklistSeq != ''"> and picklist_seq = #{picklistSeq} </if>
            <if test="platformId != null and platformId != ''"> and platform_id = #{platformId} </if>
            <if test="postAmount != null and postAmount != ''"> and post_amount = #{postAmount} </if>
            <if test="postFee != null and postFee != ''"> and post_fee = #{postFee} </if>
            <if test="printRemark != null and printRemark != ''"> and print_remark = #{printRemark} </if>
            <if test="receivable != null and receivable != ''"> and receivable = #{receivable} </if>
            <if test="receiverArea != null and receiverArea != ''"> and receiver_area = #{receiverArea} </if>
            <if test="receiverCity != null and receiverCity != ''"> and receiver_city = #{receiverCity} </if>
            <if test="receiverCountry != null and receiverCountry != ''"> and receiver_country = #{receiverCountry} </if>
            <if test="receiverDistrict != null and receiverDistrict != ''"> and receiver_district = #{receiverDistrict} </if>
            <if test="receiverDtb != null and receiverDtb != ''"> and receiver_dtb = #{receiverDtb} </if>
            <if test="receiverProvince != null and receiverProvince != ''"> and receiver_province = #{receiverProvince} </if>
            <if test="receiverZip != null and receiverZip != ''"> and receiver_zip = #{receiverZip} </if>
            <if test="refundStatus != null and refundStatus != ''"> and refund_status = #{refundStatus} </if>
            <if test="remark != null and remark != ''"> and remark = #{remark} </if>
            <if test="seqNo != null and seqNo != ''"> and seq_no = #{seqNo} </if>
            <if test="shopId != null and shopId != ''"> and shop_id = #{shopId} </if>
            <if test="shopName != null and shopName != ''"> and shop_name = #{shopName} </if>
            <if test="shopNo != null and shopNo != ''"> and shop_no = #{shopNo} </if>
            <if test="shopPlatformId != null and shopPlatformId != ''"> and shop_platform_id = #{shopPlatformId} </if>
            <if test="shopRemark != null and shopRemark != ''"> and shop_remark = #{shopRemark} </if>
            <if test="srcOrderNo != null and srcOrderNo != ''"> and src_order_no = #{srcOrderNo} </if>
            <if test="srcTradeNo != null and srcTradeNo != ''"> and src_trade_no = #{srcTradeNo} </if>
            <if test="status != null and status != ''"> and status = #{status} </if>
            <if test="stockCheckTime != null and stockCheckTime != ''"> and stock_check_time = #{stockCheckTime} </if>
            <if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId} </if>
            <if test="subPlatformId != null and subPlatformId != ''"> and sub_platform_id = #{subPlatformId} </if>
            <if test="tax != null and tax != ''"> and tax = #{tax} </if>
            <if test="taxRate != null and taxRate != ''"> and tax_rate = #{taxRate} </if>
            <if test="tradeFrom != null and tradeFrom != ''"> and trade_from = #{tradeFrom} </if>
            <if test="tradeId != null and tradeId != ''"> and trade_id = #{tradeId} </if>
            <if test="tradeLabel != null and tradeLabel != ''"> and trade_label = #{tradeLabel} </if>
            <if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo} </if>
            <if test="tradeStatus != null and tradeStatus != ''"> and trade_status = #{tradeStatus} </if>
            <if test="tradeTime != null and tradeTime != ''"> and trade_time = #{tradeTime} </if>
            <if test="tradeType != null and tradeType != ''"> and trade_type = #{tradeType} </if>
            <if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId} </if>
            <if test="warehouseMappingCode != null and warehouseMappingCode != ''"> and warehouse_mapping_code = #{warehouseMappingCode} </if>
            <if test="warehouseName != null and warehouseName != ''"> and warehouse_name = #{warehouseName} </if>
            <if test="warehouseNo != null and warehouseNo != ''"> and warehouse_no = #{warehouseNo} </if>
            <if test="weight != null and weight != ''"> and weight = #{weight} </if>
            <if test="id != null"> and id = #{id} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from busidata_tocsales where id = #{id}
</delete>

</mapper>

