<?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.ofs.dao.impl.TocofsSaleoutDaoImpl">
    <resultMap id="get-TocofsSaleoutEntity-result" type="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity" >
        <result property="id" column="id" jdbcType="INTEGER"/>
        <result property="clientcode" column="clientCode" jdbcType="VARCHAR"/>
        <result property="companycode" column="companyCode" jdbcType="VARCHAR"/>
        <result property="storecode" column="storeCode" jdbcType="VARCHAR"/>
        <result property="facilitycode" column="facilityCode" jdbcType="VARCHAR"/>
        <result property="code" column="code" jdbcType="VARCHAR"/>
        <result property="reforderid" column="refOrderId" jdbcType="INTEGER"/>
        <result property="refordercode" column="refOrderCode" jdbcType="VARCHAR"/>
        <result property="refordertype" column="refOrderType" jdbcType="VARCHAR"/>
        <result property="status" column="status" jdbcType="INTEGER"/>
        <result property="consolidated" column="consolidated" jdbcType="INTEGER"/>
        <result property="internalinstructiontype" column="internalInstructionType" jdbcType="VARCHAR"/>
        <result property="bizchannel" column="bizChannel" jdbcType="VARCHAR"/>
        <result property="sourceplatformcode" column="sourcePlatformCode" jdbcType="VARCHAR"/>
        <result property="processtype" column="processType" jdbcType="VARCHAR"/>
        <result property="sourceorderid" column="sourceOrderId" jdbcType="INTEGER"/>
        <result property="sourceordercode" column="sourceOrderCode" jdbcType="VARCHAR"/>
        <result property="shiptoattentionto" column="shipToAttentionTo" jdbcType="VARCHAR"/>
        <result property="sourceuseraccount" column="sourceUserAccount" jdbcType="VARCHAR"/>
        <result property="shiptoaddress" column="shipToAddress" jdbcType="VARCHAR"/>
        <result property="shiptocountry" column="shipToCountry" jdbcType="VARCHAR"/>
        <result property="shiptostate" column="shipToState" jdbcType="VARCHAR"/>
        <result property="shiptocity" column="shipToCity" jdbcType="VARCHAR"/>
        <result property="shiptodistrict" column="shipToDistrict" jdbcType="VARCHAR"/>
        <result property="shiptomobile" column="shipToMobile" jdbcType="VARCHAR"/>
        <result property="totallines" column="totalLines" jdbcType="INTEGER"/>
        <result property="totalqty" column="totalQty" jdbcType="INTEGER"/>
        <result property="totalcontainers" column="totalContainers" jdbcType="INTEGER"/>
        <result property="totalcases" column="totalCases" jdbcType="INTEGER"/>
        <result property="totalweight" column="totalWeight" jdbcType="INTEGER"/>
        <result property="totalvolume" column="totalVolume" jdbcType="INTEGER"/>
        <result property="totalvolumeweight" column="totalVolumeWeight" jdbcType="INTEGER"/>
        <result property="weightum" column="weightUM" jdbcType="VARCHAR"/>
        <result property="volumeum" column="volumeUM" jdbcType="VARCHAR"/>
        <result property="totalamount" column="totalAmount" jdbcType="INTEGER"/>
        <result property="totalpayamount" column="totalPayAmount" jdbcType="INTEGER"/>
        <result property="postageamount" column="postageAmount" jdbcType="INTEGER"/>
        <result property="itemtotalamount" column="itemTotalAmount" jdbcType="INTEGER"/>
        <result property="totalfulfillqty" column="totalFulfillQty" jdbcType="VARCHAR"/>
        <result property="totalfulfillweight" column="totalFulfillWeight" jdbcType="VARCHAR"/>
        <result property="totalfulfillvolume" column="totalFulfillVolume" jdbcType="VARCHAR"/>
        <result property="totalfulfillvolumeweight" column="totalFulfillVolumeWeight" jdbcType="VARCHAR"/>
        <result property="shipat" column="shipAt" jdbcType="VARCHAR"/>
        <result property="carriercode" column="carrierCode" jdbcType="VARCHAR"/>
        <result property="primarywaybillcode" column="primaryWaybillCode" jdbcType="VARCHAR"/>
        <result property="paymentstatus" column="paymentStatus" jdbcType="INTEGER"/>
        <result property="codrequired" column="codRequired" jdbcType="VARCHAR"/>
        <result property="invoicerequired" column="invoiceRequired" jdbcType="VARCHAR"/>
        <result property="paidat" column="paidAt" jdbcType="VARCHAR"/>
        <result property="shipfromattentionto" column="shipFromAttentionTo" jdbcType="VARCHAR"/>
        <result property="shipfromaddress" column="shipFromAddress" jdbcType="VARCHAR"/>
        <result property="shipfromdistrict" column="shipFromDistrict" jdbcType="VARCHAR"/>
        <result property="shipfromcity" column="shipFromCity" jdbcType="VARCHAR"/>
        <result property="shipfromstate" column="shipFromState" jdbcType="VARCHAR"/>
        <result property="shipfromcountry" column="shipFromCountry" jdbcType="VARCHAR"/>
        <result property="shipfrompostalcode" column="shipFromPostalCode" jdbcType="VARCHAR"/>
        <result property="shipfromphone" column="shipFromPhone" jdbcType="VARCHAR"/>
        <result property="shipfrommobile" column="shipFromMobile" jdbcType="VARCHAR"/>
        <result property="shipfromfax" column="shipFromFax" jdbcType="VARCHAR"/>
        <result property="shipfromemail" column="shipFromEmail" jdbcType="VARCHAR"/>
        <result property="codamount" column="codAmount" jdbcType="INTEGER"/>
        <result property="tax" column="tax" jdbcType="INTEGER"/>
        <result property="taxpaid" column="taxPaid" jdbcType="INTEGER"/>
        <result property="tradesuccessat" column="tradeSuccessAt" jdbcType="VARCHAR"/>
        <result property="sourceorderstatus" column="sourceOrderStatus" jdbcType="VARCHAR"/>
        <result property="shiptostatename" column="shipToStateName" jdbcType="VARCHAR"/>
        <result property="shiptocityname" column="shipToCityName" jdbcType="VARCHAR"/>
        <result property="shiptodistrictname" column="shipToDistrictName" jdbcType="VARCHAR"/>
        <result property="shipmenttype" column="shipmentType" jdbcType="VARCHAR"/>
        <result property="def1" column="def1" jdbcType="VARCHAR"/>
        <result property="def2" column="def2" jdbcType="VARCHAR"/>
        <result property="def3" column="def3" jdbcType="VARCHAR"/>
        <result property="def4" column="def4" jdbcType="VARCHAR"/>
        <result property="def5" column="def5" jdbcType="VARCHAR"/>
        <result property="def6" column="def6" jdbcType="VARCHAR"/>
        <result property="def7" column="def7" jdbcType="VARCHAR"/>
        <result property="def8" column="def8" jdbcType="VARCHAR"/>
        <result property="def9" column="def9" jdbcType="VARCHAR"/>
        <result property="def10" column="def10" jdbcType="VARCHAR"/>
        <result property="def11" column="def11" jdbcType="VARCHAR"/>
        <result property="def12" column="def12" jdbcType="VARCHAR"/>
        <result property="def13" column="def13" jdbcType="VARCHAR"/>
        <result property="def14" column="def14" jdbcType="VARCHAR"/>
        <result property="def15" column="def15" jdbcType="VARCHAR"/>
        <result property="def16" column="def16" jdbcType="VARCHAR"/>
        <result property="def17" column="def17" jdbcType="VARCHAR"/>
        <result property="def18" column="def18" jdbcType="VARCHAR"/>
        <result property="def19" column="def19" jdbcType="VARCHAR"/>
        <result property="def20" column="def20" jdbcType="VARCHAR"/>
        <result property="def21" column="def21" jdbcType="VARCHAR"/>
        <result property="def22" column="def22" jdbcType="VARCHAR"/>
        <result property="def23" column="def23" jdbcType="VARCHAR"/>
        <result property="def24" column="def24" jdbcType="VARCHAR"/>
        <result property="def25" column="def25" jdbcType="VARCHAR"/>
        <result property="def26" column="def26" jdbcType="VARCHAR"/>
        <result property="def27" column="def27" jdbcType="VARCHAR"/>
        <result property="def28" column="def28" jdbcType="VARCHAR"/>
        <result property="def29" column="def29" jdbcType="VARCHAR"/>
        <result property="def30" column="def30" jdbcType="VARCHAR"/>
        <result property="def31" column="def31" jdbcType="VARCHAR"/>
        <result property="def32" column="def32" jdbcType="VARCHAR"/>
        <result property="def33" column="def33" jdbcType="VARCHAR"/>
        <result property="def34" column="def34" jdbcType="VARCHAR"/>
        <result property="def35" column="def35" jdbcType="VARCHAR"/>
        <result property="def36" column="def36" jdbcType="VARCHAR"/>
        <result property="def37" column="def37" jdbcType="VARCHAR"/>
        <result property="def38" column="def38" jdbcType="VARCHAR"/>
        <result property="def39" column="def39" jdbcType="VARCHAR"/>
        <result property="def40" column="def40" jdbcType="VARCHAR"/>
    </resultMap>
    <!-- 查询的字段-->
    <sql id = "TocofsSaleoutEntity_Base_Column_List">
        id
        ,clientCode
        ,companyCode
        ,storeCode
        ,facilityCode
        ,code
        ,refOrderId
        ,refOrderCode
        ,refOrderType
        ,status
        ,consolidated
        ,internalInstructionType
        ,bizChannel
        ,sourcePlatformCode
        ,processType
        ,sourceOrderId
        ,sourceOrderCode
        ,shipToAttentionTo
        ,sourceUserAccount
        ,shipToAddress
        ,shipToCountry
        ,shipToState
        ,shipToCity
        ,shipToDistrict
        ,shipToMobile
        ,totalLines
        ,totalQty
        ,totalContainers
        ,totalCases
        ,totalWeight
        ,totalVolume
        ,totalVolumeWeight
        ,weightUM
        ,volumeUM
        ,totalAmount
        ,totalPayAmount
        ,postageAmount
        ,itemTotalAmount
        ,totalFulfillQty
        ,totalFulfillWeight
        ,totalFulfillVolume
        ,totalFulfillVolumeWeight
        ,shipAt
        ,carrierCode
        ,primaryWaybillCode
        ,paymentStatus
        ,codRequired
        ,invoiceRequired
        ,paidAt
        ,shipFromAttentionTo
        ,shipFromAddress
        ,shipFromDistrict
        ,shipFromCity
        ,shipFromState
        ,shipFromCountry
        ,shipFromPostalCode
        ,shipFromPhone
        ,shipFromMobile
        ,shipFromFax
        ,shipFromEmail
        ,codAmount
        ,tax
        ,taxPaid
        ,tradeSuccessAt
        ,sourceOrderStatus
        ,shipToStateName
        ,shipToCityName
        ,shipToDistrictName
        ,shipmentType
        ,def1
        ,def2
        ,def3
        ,def4
        ,def5
        ,def6
        ,def7
        ,def8
        ,def9
        ,def10
        ,def11
        ,def12
        ,def13
        ,def14
        ,def15
        ,def16
        ,def17
        ,def18
        ,def19
        ,def20
        ,def21
        ,def22
        ,def23
        ,def24
        ,def25
        ,def26
        ,def27
        ,def28
        ,def29
        ,def30
        ,def31
        ,def32
        ,def33
        ,def34
        ,def35
        ,def36
        ,def37
        ,def38
        ,def39
        ,def40
    </sql>
    <!-- 查询 采用==查询 -->
    <select id="entity_list_base" resultMap="get-TocofsSaleoutEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity">
        select
        <include refid="TocofsSaleoutEntity_Base_Column_List" />
        from tocofs_saleout
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null"> and id = #{id} </if>
            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
            <if test="storecode != null and storecode != ''"> and storeCode = #{storecode} </if>
            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
            <if test="code != null and code != ''"> and code = #{code} </if>
            <if test="reforderid != null"> and refOrderId = #{reforderid} </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
            <if test="refordertype != null and refordertype != ''"> and refOrderType = #{refordertype} </if>
            <if test="status != null"> and status = #{status} </if>
            <if test="consolidated != null"> and consolidated = #{consolidated} </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType = #{internalinstructiontype} </if>
            <if test="bizchannel != null and bizchannel != ''"> and bizChannel = #{bizchannel} </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode = #{sourceplatformcode} </if>
            <if test="processtype != null and processtype != ''"> and processType = #{processtype} </if>
            <if test="sourceorderid != null"> and sourceOrderId = #{sourceorderid} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
            <if test="shiptoattentionto != null and shiptoattentionto != ''"> and shipToAttentionTo = #{shiptoattentionto} </if>
            <if test="sourceuseraccount != null and sourceuseraccount != ''"> and sourceUserAccount = #{sourceuseraccount} </if>
            <if test="shiptoaddress != null and shiptoaddress != ''"> and shipToAddress = #{shiptoaddress} </if>
            <if test="shiptocountry != null and shiptocountry != ''"> and shipToCountry = #{shiptocountry} </if>
            <if test="shiptostate != null and shiptostate != ''"> and shipToState = #{shiptostate} </if>
            <if test="shiptocity != null and shiptocity != ''"> and shipToCity = #{shiptocity} </if>
            <if test="shiptodistrict != null and shiptodistrict != ''"> and shipToDistrict = #{shiptodistrict} </if>
            <if test="shiptomobile != null and shiptomobile != ''"> and shipToMobile = #{shiptomobile} </if>
            <if test="totallines != null"> and totalLines = #{totallines} </if>
            <if test="totalqty != null"> and totalQty = #{totalqty} </if>
            <if test="totalcontainers != null"> and totalContainers = #{totalcontainers} </if>
            <if test="totalcases != null"> and totalCases = #{totalcases} </if>
            <if test="totalweight != null"> and totalWeight = #{totalweight} </if>
            <if test="totalvolume != null"> and totalVolume = #{totalvolume} </if>
            <if test="totalvolumeweight != null"> and totalVolumeWeight = #{totalvolumeweight} </if>
            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
            <if test="totalamount != null"> and totalAmount = #{totalamount} </if>
            <if test="totalpayamount != null"> and totalPayAmount = #{totalpayamount} </if>
            <if test="postageamount != null"> and postageAmount = #{postageamount} </if>
            <if test="itemtotalamount != null"> and itemTotalAmount = #{itemtotalamount} </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty = #{totalfulfillqty} </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight = #{totalfulfillweight} </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume = #{totalfulfillvolume} </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
            <if test="shipat != null and shipat != ''"> and shipAt = #{shipat} </if>
            <if test="carriercode != null and carriercode != ''"> and carrierCode = #{carriercode} </if>
            <if test="primarywaybillcode != null and primarywaybillcode != ''"> and primaryWaybillCode = #{primarywaybillcode} </if>
            <if test="paymentstatus != null"> and paymentStatus = #{paymentstatus} </if>
            <if test="codrequired != null and codrequired != ''"> and codRequired = #{codrequired} </if>
            <if test="invoicerequired != null and invoicerequired != ''"> and invoiceRequired = #{invoicerequired} </if>
            <if test="paidat != null and paidat != ''"> and paidAt = #{paidat} </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo = #{shipfromattentionto} </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress = #{shipfromaddress} </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict = #{shipfromdistrict} </if>
            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity = #{shipfromcity} </if>
            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState = #{shipfromstate} </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry = #{shipfromcountry} </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode = #{shipfrompostalcode} </if>
            <if test="shipfromphone != null and shipfromphone != ''"> and shipFromPhone = #{shipfromphone} </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile = #{shipfrommobile} </if>
            <if test="shipfromfax != null and shipfromfax != ''"> and shipFromFax = #{shipfromfax} </if>
            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail = #{shipfromemail} </if>
            <if test="codamount != null"> and codAmount = #{codamount} </if>
            <if test="tax != null"> and tax = #{tax} </if>
            <if test="taxpaid != null"> and taxPaid = #{taxpaid} </if>
            <if test="tradesuccessat != null and tradesuccessat != ''"> and tradeSuccessAt = #{tradesuccessat} </if>
            <if test="sourceorderstatus != null and sourceorderstatus != ''"> and sourceOrderStatus = #{sourceorderstatus} </if>
            <if test="shiptostatename != null and shiptostatename != ''"> and shipToStateName = #{shiptostatename} </if>
            <if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName = #{shiptocityname} </if>
            <if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName = #{shiptodistrictname} </if>
            <if test="shipmenttype != null and shipmenttype != ''"> and shipmentType = #{shipmenttype} </if>
            <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
            <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
            <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
            <if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
            <if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
            <if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
            <if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
            <if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
            <if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
            <if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
            <if test="def11 != null and def11 != ''"> and def11 = #{def11} </if>
            <if test="def12 != null and def12 != ''"> and def12 = #{def12} </if>
            <if test="def13 != null and def13 != ''"> and def13 = #{def13} </if>
            <if test="def14 != null and def14 != ''"> and def14 = #{def14} </if>
            <if test="def15 != null and def15 != ''"> and def15 = #{def15} </if>
            <if test="def16 != null and def16 != ''"> and def16 = #{def16} </if>
            <if test="def17 != null and def17 != ''"> and def17 = #{def17} </if>
            <if test="def18 != null and def18 != ''"> and def18 = #{def18} </if>
            <if test="def19 != null and def19 != ''"> and def19 = #{def19} </if>
            <if test="def20 != null and def20 != ''"> and def20 = #{def20} </if>
            <if test="def21 != null and def21 != ''"> and def21 = #{def21} </if>
            <if test="def22 != null and def22 != ''"> and def22 = #{def22} </if>
            <if test="def23 != null and def23 != ''"> and def23 = #{def23} </if>
            <if test="def24 != null and def24 != ''"> and def24 = #{def24} </if>
            <if test="def25 != null and def25 != ''"> and def25 = #{def25} </if>
            <if test="def26 != null and def26 != ''"> and def26 = #{def26} </if>
            <if test="def27 != null and def27 != ''"> and def27 = #{def27} </if>
            <if test="def28 != null and def28 != ''"> and def28 = #{def28} </if>
            <if test="def29 != null and def29 != ''"> and def29 = #{def29} </if>
            <if test="def30 != null and def30 != ''"> and def30 = #{def30} </if>
            <if test="def31 != null and def31 != ''"> and def31 = #{def31} </if>
            <if test="def32 != null and def32 != ''"> and def32 = #{def32} </if>
            <if test="def33 != null and def33 != ''"> and def33 = #{def33} </if>
            <if test="def34 != null and def34 != ''"> and def34 = #{def34} </if>
            <if test="def35 != null and def35 != ''"> and def35 = #{def35} </if>
            <if test="def36 != null and def36 != ''"> and def36 = #{def36} </if>
            <if test="def37 != null and def37 != ''"> and def37 = #{def37} </if>
            <if test="def38 != null and def38 != ''"> and def38 = #{def38} </if>
            <if test="def39 != null and def39 != ''"> and def39 = #{def39} </if>
            <if test="def40 != null and def40 != ''"> and def40 = #{def40} </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.ofs.entity.TocofsSaleoutEntity">
        select  count(1)   from tocofs_saleout
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null"> and id = #{id} </if>
            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
            <if test="storecode != null and storecode != ''"> and storeCode = #{storecode} </if>
            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
            <if test="code != null and code != ''"> and code = #{code} </if>
            <if test="reforderid != null"> and refOrderId = #{reforderid} </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
            <if test="refordertype != null and refordertype != ''"> and refOrderType = #{refordertype} </if>
            <if test="status != null"> and status = #{status} </if>
            <if test="consolidated != null"> and consolidated = #{consolidated} </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType = #{internalinstructiontype} </if>
            <if test="bizchannel != null and bizchannel != ''"> and bizChannel = #{bizchannel} </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode = #{sourceplatformcode} </if>
            <if test="processtype != null and processtype != ''"> and processType = #{processtype} </if>
            <if test="sourceorderid != null"> and sourceOrderId = #{sourceorderid} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
            <if test="shiptoattentionto != null and shiptoattentionto != ''"> and shipToAttentionTo = #{shiptoattentionto} </if>
            <if test="sourceuseraccount != null and sourceuseraccount != ''"> and sourceUserAccount = #{sourceuseraccount} </if>
            <if test="shiptoaddress != null and shiptoaddress != ''"> and shipToAddress = #{shiptoaddress} </if>
            <if test="shiptocountry != null and shiptocountry != ''"> and shipToCountry = #{shiptocountry} </if>
            <if test="shiptostate != null and shiptostate != ''"> and shipToState = #{shiptostate} </if>
            <if test="shiptocity != null and shiptocity != ''"> and shipToCity = #{shiptocity} </if>
            <if test="shiptodistrict != null and shiptodistrict != ''"> and shipToDistrict = #{shiptodistrict} </if>
            <if test="shiptomobile != null and shiptomobile != ''"> and shipToMobile = #{shiptomobile} </if>
            <if test="totallines != null"> and totalLines = #{totallines} </if>
            <if test="totalqty != null"> and totalQty = #{totalqty} </if>
            <if test="totalcontainers != null"> and totalContainers = #{totalcontainers} </if>
            <if test="totalcases != null"> and totalCases = #{totalcases} </if>
            <if test="totalweight != null"> and totalWeight = #{totalweight} </if>
            <if test="totalvolume != null"> and totalVolume = #{totalvolume} </if>
            <if test="totalvolumeweight != null"> and totalVolumeWeight = #{totalvolumeweight} </if>
            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
            <if test="totalamount != null"> and totalAmount = #{totalamount} </if>
            <if test="totalpayamount != null"> and totalPayAmount = #{totalpayamount} </if>
            <if test="postageamount != null"> and postageAmount = #{postageamount} </if>
            <if test="itemtotalamount != null"> and itemTotalAmount = #{itemtotalamount} </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty = #{totalfulfillqty} </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight = #{totalfulfillweight} </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume = #{totalfulfillvolume} </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
            <if test="shipat != null and shipat != ''"> and shipAt = #{shipat} </if>
            <if test="carriercode != null and carriercode != ''"> and carrierCode = #{carriercode} </if>
            <if test="primarywaybillcode != null and primarywaybillcode != ''"> and primaryWaybillCode = #{primarywaybillcode} </if>
            <if test="paymentstatus != null"> and paymentStatus = #{paymentstatus} </if>
            <if test="codrequired != null and codrequired != ''"> and codRequired = #{codrequired} </if>
            <if test="invoicerequired != null and invoicerequired != ''"> and invoiceRequired = #{invoicerequired} </if>
            <if test="paidat != null and paidat != ''"> and paidAt = #{paidat} </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo = #{shipfromattentionto} </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress = #{shipfromaddress} </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict = #{shipfromdistrict} </if>
            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity = #{shipfromcity} </if>
            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState = #{shipfromstate} </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry = #{shipfromcountry} </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode = #{shipfrompostalcode} </if>
            <if test="shipfromphone != null and shipfromphone != ''"> and shipFromPhone = #{shipfromphone} </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile = #{shipfrommobile} </if>
            <if test="shipfromfax != null and shipfromfax != ''"> and shipFromFax = #{shipfromfax} </if>
            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail = #{shipfromemail} </if>
            <if test="codamount != null"> and codAmount = #{codamount} </if>
            <if test="tax != null"> and tax = #{tax} </if>
            <if test="taxpaid != null"> and taxPaid = #{taxpaid} </if>
            <if test="tradesuccessat != null and tradesuccessat != ''"> and tradeSuccessAt = #{tradesuccessat} </if>
            <if test="sourceorderstatus != null and sourceorderstatus != ''"> and sourceOrderStatus = #{sourceorderstatus} </if>
            <if test="shiptostatename != null and shiptostatename != ''"> and shipToStateName = #{shiptostatename} </if>
            <if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName = #{shiptocityname} </if>
            <if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName = #{shiptodistrictname} </if>
            <if test="shipmenttype != null and shipmenttype != ''"> and shipmentType = #{shipmenttype} </if>
            <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
            <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
            <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
            <if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
            <if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
            <if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
            <if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
            <if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
            <if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
            <if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
            <if test="def11 != null and def11 != ''"> and def11 = #{def11} </if>
            <if test="def12 != null and def12 != ''"> and def12 = #{def12} </if>
            <if test="def13 != null and def13 != ''"> and def13 = #{def13} </if>
            <if test="def14 != null and def14 != ''"> and def14 = #{def14} </if>
            <if test="def15 != null and def15 != ''"> and def15 = #{def15} </if>
            <if test="def16 != null and def16 != ''"> and def16 = #{def16} </if>
            <if test="def17 != null and def17 != ''"> and def17 = #{def17} </if>
            <if test="def18 != null and def18 != ''"> and def18 = #{def18} </if>
            <if test="def19 != null and def19 != ''"> and def19 = #{def19} </if>
            <if test="def20 != null and def20 != ''"> and def20 = #{def20} </if>
            <if test="def21 != null and def21 != ''"> and def21 = #{def21} </if>
            <if test="def22 != null and def22 != ''"> and def22 = #{def22} </if>
            <if test="def23 != null and def23 != ''"> and def23 = #{def23} </if>
            <if test="def24 != null and def24 != ''"> and def24 = #{def24} </if>
            <if test="def25 != null and def25 != ''"> and def25 = #{def25} </if>
            <if test="def26 != null and def26 != ''"> and def26 = #{def26} </if>
            <if test="def27 != null and def27 != ''"> and def27 = #{def27} </if>
            <if test="def28 != null and def28 != ''"> and def28 = #{def28} </if>
            <if test="def29 != null and def29 != ''"> and def29 = #{def29} </if>
            <if test="def30 != null and def30 != ''"> and def30 = #{def30} </if>
            <if test="def31 != null and def31 != ''"> and def31 = #{def31} </if>
            <if test="def32 != null and def32 != ''"> and def32 = #{def32} </if>
            <if test="def33 != null and def33 != ''"> and def33 = #{def33} </if>
            <if test="def34 != null and def34 != ''"> and def34 = #{def34} </if>
            <if test="def35 != null and def35 != ''"> and def35 = #{def35} </if>
            <if test="def36 != null and def36 != ''"> and def36 = #{def36} </if>
            <if test="def37 != null and def37 != ''"> and def37 = #{def37} </if>
            <if test="def38 != null and def38 != ''"> and def38 = #{def38} </if>
            <if test="def39 != null and def39 != ''"> and def39 = #{def39} </if>
            <if test="def40 != null and def40 != ''"> and def40 = #{def40} </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-TocofsSaleoutEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity">
        select
        <include refid="TocofsSaleoutEntity_Base_Column_List" />
        from tocofs_saleout
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null"> and id like concat('%',#{id},'%') </if>
            <if test="clientcode != null and clientcode != ''"> and clientCode like concat('%',#{clientcode},'%') </if>
            <if test="companycode != null and companycode != ''"> and companyCode like concat('%',#{companycode},'%') </if>
            <if test="storecode != null and storecode != ''"> and storeCode like concat('%',#{storecode},'%') </if>
            <if test="facilitycode != null and facilitycode != ''"> and facilityCode like concat('%',#{facilitycode},'%') </if>
            <if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
            <if test="reforderid != null"> and refOrderId like concat('%',#{reforderid},'%') </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode like concat('%',#{refordercode},'%') </if>
            <if test="refordertype != null and refordertype != ''"> and refOrderType like concat('%',#{refordertype},'%') </if>
            <if test="status != null"> and status like concat('%',#{status},'%') </if>
            <if test="consolidated != null"> and consolidated like concat('%',#{consolidated},'%') </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType like concat('%',#{internalinstructiontype},'%') </if>
            <if test="bizchannel != null and bizchannel != ''"> and bizChannel like concat('%',#{bizchannel},'%') </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode like concat('%',#{sourceplatformcode},'%') </if>
            <if test="processtype != null and processtype != ''"> and processType like concat('%',#{processtype},'%') </if>
            <if test="sourceorderid != null"> and sourceOrderId like concat('%',#{sourceorderid},'%') </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode like concat('%',#{sourceordercode},'%') </if>
            <if test="shiptoattentionto != null and shiptoattentionto != ''"> and shipToAttentionTo like concat('%',#{shiptoattentionto},'%') </if>
            <if test="sourceuseraccount != null and sourceuseraccount != ''"> and sourceUserAccount like concat('%',#{sourceuseraccount},'%') </if>
            <if test="shiptoaddress != null and shiptoaddress != ''"> and shipToAddress like concat('%',#{shiptoaddress},'%') </if>
            <if test="shiptocountry != null and shiptocountry != ''"> and shipToCountry like concat('%',#{shiptocountry},'%') </if>
            <if test="shiptostate != null and shiptostate != ''"> and shipToState like concat('%',#{shiptostate},'%') </if>
            <if test="shiptocity != null and shiptocity != ''"> and shipToCity like concat('%',#{shiptocity},'%') </if>
            <if test="shiptodistrict != null and shiptodistrict != ''"> and shipToDistrict like concat('%',#{shiptodistrict},'%') </if>
            <if test="shiptomobile != null and shiptomobile != ''"> and shipToMobile like concat('%',#{shiptomobile},'%') </if>
            <if test="totallines != null"> and totalLines like concat('%',#{totallines},'%') </if>
            <if test="totalqty != null"> and totalQty like concat('%',#{totalqty},'%') </if>
            <if test="totalcontainers != null"> and totalContainers like concat('%',#{totalcontainers},'%') </if>
            <if test="totalcases != null"> and totalCases like concat('%',#{totalcases},'%') </if>
            <if test="totalweight != null"> and totalWeight like concat('%',#{totalweight},'%') </if>
            <if test="totalvolume != null"> and totalVolume like concat('%',#{totalvolume},'%') </if>
            <if test="totalvolumeweight != null"> and totalVolumeWeight like concat('%',#{totalvolumeweight},'%') </if>
            <if test="weightum != null and weightum != ''"> and weightUM like concat('%',#{weightum},'%') </if>
            <if test="volumeum != null and volumeum != ''"> and volumeUM like concat('%',#{volumeum},'%') </if>
            <if test="totalamount != null"> and totalAmount like concat('%',#{totalamount},'%') </if>
            <if test="totalpayamount != null"> and totalPayAmount like concat('%',#{totalpayamount},'%') </if>
            <if test="postageamount != null"> and postageAmount like concat('%',#{postageamount},'%') </if>
            <if test="itemtotalamount != null"> and itemTotalAmount like concat('%',#{itemtotalamount},'%') </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty like concat('%',#{totalfulfillqty},'%') </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight like concat('%',#{totalfulfillweight},'%') </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume like concat('%',#{totalfulfillvolume},'%') </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight like concat('%',#{totalfulfillvolumeweight},'%') </if>
            <if test="shipat != null and shipat != ''"> and shipAt like concat('%',#{shipat},'%') </if>
            <if test="carriercode != null and carriercode != ''"> and carrierCode like concat('%',#{carriercode},'%') </if>
            <if test="primarywaybillcode != null and primarywaybillcode != ''"> and primaryWaybillCode like concat('%',#{primarywaybillcode},'%') </if>
            <if test="paymentstatus != null"> and paymentStatus like concat('%',#{paymentstatus},'%') </if>
            <if test="codrequired != null and codrequired != ''"> and codRequired like concat('%',#{codrequired},'%') </if>
            <if test="invoicerequired != null and invoicerequired != ''"> and invoiceRequired like concat('%',#{invoicerequired},'%') </if>
            <if test="paidat != null and paidat != ''"> and paidAt like concat('%',#{paidat},'%') </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo like concat('%',#{shipfromattentionto},'%') </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress like concat('%',#{shipfromaddress},'%') </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict like concat('%',#{shipfromdistrict},'%') </if>
            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity like concat('%',#{shipfromcity},'%') </if>
            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState like concat('%',#{shipfromstate},'%') </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry like concat('%',#{shipfromcountry},'%') </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode like concat('%',#{shipfrompostalcode},'%') </if>
            <if test="shipfromphone != null and shipfromphone != ''"> and shipFromPhone like concat('%',#{shipfromphone},'%') </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile like concat('%',#{shipfrommobile},'%') </if>
            <if test="shipfromfax != null and shipfromfax != ''"> and shipFromFax like concat('%',#{shipfromfax},'%') </if>
            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail like concat('%',#{shipfromemail},'%') </if>
            <if test="codamount != null"> and codAmount like concat('%',#{codamount},'%') </if>
            <if test="tax != null"> and tax like concat('%',#{tax},'%') </if>
            <if test="taxpaid != null"> and taxPaid like concat('%',#{taxpaid},'%') </if>
            <if test="tradesuccessat != null and tradesuccessat != ''"> and tradeSuccessAt like concat('%',#{tradesuccessat},'%') </if>
            <if test="sourceorderstatus != null and sourceorderstatus != ''"> and sourceOrderStatus like concat('%',#{sourceorderstatus},'%') </if>
            <if test="shiptostatename != null and shiptostatename != ''"> and shipToStateName like concat('%',#{shiptostatename},'%') </if>
            <if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName like concat('%',#{shiptocityname},'%') </if>
            <if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName like concat('%',#{shiptodistrictname},'%') </if>
            <if test="shipmenttype != null and shipmenttype != ''"> and shipmentType like concat('%',#{shipmenttype},'%') </if>
            <if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if>
            <if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if>
            <if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if>
            <if test="def4 != null and def4 != ''"> and def4 like concat('%',#{def4},'%') </if>
            <if test="def5 != null and def5 != ''"> and def5 like concat('%',#{def5},'%') </if>
            <if test="def6 != null and def6 != ''"> and def6 like concat('%',#{def6},'%') </if>
            <if test="def7 != null and def7 != ''"> and def7 like concat('%',#{def7},'%') </if>
            <if test="def8 != null and def8 != ''"> and def8 like concat('%',#{def8},'%') </if>
            <if test="def9 != null and def9 != ''"> and def9 like concat('%',#{def9},'%') </if>
            <if test="def10 != null and def10 != ''"> and def10 like concat('%',#{def10},'%') </if>
            <if test="def11 != null and def11 != ''"> and def11 like concat('%',#{def11},'%') </if>
            <if test="def12 != null and def12 != ''"> and def12 like concat('%',#{def12},'%') </if>
            <if test="def13 != null and def13 != ''"> and def13 like concat('%',#{def13},'%') </if>
            <if test="def14 != null and def14 != ''"> and def14 like concat('%',#{def14},'%') </if>
            <if test="def15 != null and def15 != ''"> and def15 like concat('%',#{def15},'%') </if>
            <if test="def16 != null and def16 != ''"> and def16 like concat('%',#{def16},'%') </if>
            <if test="def17 != null and def17 != ''"> and def17 like concat('%',#{def17},'%') </if>
            <if test="def18 != null and def18 != ''"> and def18 like concat('%',#{def18},'%') </if>
            <if test="def19 != null and def19 != ''"> and def19 like concat('%',#{def19},'%') </if>
            <if test="def20 != null and def20 != ''"> and def20 like concat('%',#{def20},'%') </if>
            <if test="def21 != null and def21 != ''"> and def21 like concat('%',#{def21},'%') </if>
            <if test="def22 != null and def22 != ''"> and def22 like concat('%',#{def22},'%') </if>
            <if test="def23 != null and def23 != ''"> and def23 like concat('%',#{def23},'%') </if>
            <if test="def24 != null and def24 != ''"> and def24 like concat('%',#{def24},'%') </if>
            <if test="def25 != null and def25 != ''"> and def25 like concat('%',#{def25},'%') </if>
            <if test="def26 != null and def26 != ''"> and def26 like concat('%',#{def26},'%') </if>
            <if test="def27 != null and def27 != ''"> and def27 like concat('%',#{def27},'%') </if>
            <if test="def28 != null and def28 != ''"> and def28 like concat('%',#{def28},'%') </if>
            <if test="def29 != null and def29 != ''"> and def29 like concat('%',#{def29},'%') </if>
            <if test="def30 != null and def30 != ''"> and def30 like concat('%',#{def30},'%') </if>
            <if test="def31 != null and def31 != ''"> and def31 like concat('%',#{def31},'%') </if>
            <if test="def32 != null and def32 != ''"> and def32 like concat('%',#{def32},'%') </if>
            <if test="def33 != null and def33 != ''"> and def33 like concat('%',#{def33},'%') </if>
            <if test="def34 != null and def34 != ''"> and def34 like concat('%',#{def34},'%') </if>
            <if test="def35 != null and def35 != ''"> and def35 like concat('%',#{def35},'%') </if>
            <if test="def36 != null and def36 != ''"> and def36 like concat('%',#{def36},'%') </if>
            <if test="def37 != null and def37 != ''"> and def37 like concat('%',#{def37},'%') </if>
            <if test="def38 != null and def38 != ''"> and def38 like concat('%',#{def38},'%') </if>
            <if test="def39 != null and def39 != ''"> and def39 like concat('%',#{def39},'%') </if>
            <if test="def40 != null and def40 != ''"> and def40 like concat('%',#{def40},'%') </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="TocofsSaleoutentity_list_or" resultMap="get-TocofsSaleoutEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity">
        select
        <include refid="TocofsSaleoutEntity_Base_Column_List" />
        from tocofs_saleout
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null"> or id = #{id} </if>
            <if test="clientcode != null and clientcode != ''"> or clientCode = #{clientcode} </if>
            <if test="companycode != null and companycode != ''"> or companyCode = #{companycode} </if>
            <if test="storecode != null and storecode != ''"> or storeCode = #{storecode} </if>
            <if test="facilitycode != null and facilitycode != ''"> or facilityCode = #{facilitycode} </if>
            <if test="code != null and code != ''"> or code = #{code} </if>
            <if test="reforderid != null"> or refOrderId = #{reforderid} </if>
            <if test="refordercode != null and refordercode != ''"> or refOrderCode = #{refordercode} </if>
            <if test="refordertype != null and refordertype != ''"> or refOrderType = #{refordertype} </if>
            <if test="status != null"> or status = #{status} </if>
            <if test="consolidated != null"> or consolidated = #{consolidated} </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> or internalInstructionType = #{internalinstructiontype} </if>
            <if test="bizchannel != null and bizchannel != ''"> or bizChannel = #{bizchannel} </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> or sourcePlatformCode = #{sourceplatformcode} </if>
            <if test="processtype != null and processtype != ''"> or processType = #{processtype} </if>
            <if test="sourceorderid != null"> or sourceOrderId = #{sourceorderid} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> or sourceOrderCode = #{sourceordercode} </if>
            <if test="shiptoattentionto != null and shiptoattentionto != ''"> or shipToAttentionTo = #{shiptoattentionto} </if>
            <if test="sourceuseraccount != null and sourceuseraccount != ''"> or sourceUserAccount = #{sourceuseraccount} </if>
            <if test="shiptoaddress != null and shiptoaddress != ''"> or shipToAddress = #{shiptoaddress} </if>
            <if test="shiptocountry != null and shiptocountry != ''"> or shipToCountry = #{shiptocountry} </if>
            <if test="shiptostate != null and shiptostate != ''"> or shipToState = #{shiptostate} </if>
            <if test="shiptocity != null and shiptocity != ''"> or shipToCity = #{shiptocity} </if>
            <if test="shiptodistrict != null and shiptodistrict != ''"> or shipToDistrict = #{shiptodistrict} </if>
            <if test="shiptomobile != null and shiptomobile != ''"> or shipToMobile = #{shiptomobile} </if>
            <if test="totallines != null"> or totalLines = #{totallines} </if>
            <if test="totalqty != null"> or totalQty = #{totalqty} </if>
            <if test="totalcontainers != null"> or totalContainers = #{totalcontainers} </if>
            <if test="totalcases != null"> or totalCases = #{totalcases} </if>
            <if test="totalweight != null"> or totalWeight = #{totalweight} </if>
            <if test="totalvolume != null"> or totalVolume = #{totalvolume} </if>
            <if test="totalvolumeweight != null"> or totalVolumeWeight = #{totalvolumeweight} </if>
            <if test="weightum != null and weightum != ''"> or weightUM = #{weightum} </if>
            <if test="volumeum != null and volumeum != ''"> or volumeUM = #{volumeum} </if>
            <if test="totalamount != null"> or totalAmount = #{totalamount} </if>
            <if test="totalpayamount != null"> or totalPayAmount = #{totalpayamount} </if>
            <if test="postageamount != null"> or postageAmount = #{postageamount} </if>
            <if test="itemtotalamount != null"> or itemTotalAmount = #{itemtotalamount} </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> or totalFulfillQty = #{totalfulfillqty} </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> or totalFulfillWeight = #{totalfulfillweight} </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> or totalFulfillVolume = #{totalfulfillvolume} </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> or totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
            <if test="shipat != null and shipat != ''"> or shipAt = #{shipat} </if>
            <if test="carriercode != null and carriercode != ''"> or carrierCode = #{carriercode} </if>
            <if test="primarywaybillcode != null and primarywaybillcode != ''"> or primaryWaybillCode = #{primarywaybillcode} </if>
            <if test="paymentstatus != null"> or paymentStatus = #{paymentstatus} </if>
            <if test="codrequired != null and codrequired != ''"> or codRequired = #{codrequired} </if>
            <if test="invoicerequired != null and invoicerequired != ''"> or invoiceRequired = #{invoicerequired} </if>
            <if test="paidat != null and paidat != ''"> or paidAt = #{paidat} </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> or shipFromAttentionTo = #{shipfromattentionto} </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> or shipFromAddress = #{shipfromaddress} </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> or shipFromDistrict = #{shipfromdistrict} </if>
            <if test="shipfromcity != null and shipfromcity != ''"> or shipFromCity = #{shipfromcity} </if>
            <if test="shipfromstate != null and shipfromstate != ''"> or shipFromState = #{shipfromstate} </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> or shipFromCountry = #{shipfromcountry} </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> or shipFromPostalCode = #{shipfrompostalcode} </if>
            <if test="shipfromphone != null and shipfromphone != ''"> or shipFromPhone = #{shipfromphone} </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> or shipFromMobile = #{shipfrommobile} </if>
            <if test="shipfromfax != null and shipfromfax != ''"> or shipFromFax = #{shipfromfax} </if>
            <if test="shipfromemail != null and shipfromemail != ''"> or shipFromEmail = #{shipfromemail} </if>
            <if test="codamount != null"> or codAmount = #{codamount} </if>
            <if test="tax != null"> or tax = #{tax} </if>
            <if test="taxpaid != null"> or taxPaid = #{taxpaid} </if>
            <if test="tradesuccessat != null and tradesuccessat != ''"> or tradeSuccessAt = #{tradesuccessat} </if>
            <if test="sourceorderstatus != null and sourceorderstatus != ''"> or sourceOrderStatus = #{sourceorderstatus} </if>
            <if test="shiptostatename != null and shiptostatename != ''"> or shipToStateName = #{shiptostatename} </if>
            <if test="shiptocityname != null and shiptocityname != ''"> or shipToCityName = #{shiptocityname} </if>
            <if test="shiptodistrictname != null and shiptodistrictname != ''"> or shipToDistrictName = #{shiptodistrictname} </if>
            <if test="shipmenttype != null and shipmenttype != ''"> or shipmentType = #{shipmenttype} </if>
            <if test="def1 != null and def1 != ''"> or def1 = #{def1} </if>
            <if test="def2 != null and def2 != ''"> or def2 = #{def2} </if>
            <if test="def3 != null and def3 != ''"> or def3 = #{def3} </if>
            <if test="def4 != null and def4 != ''"> or def4 = #{def4} </if>
            <if test="def5 != null and def5 != ''"> or def5 = #{def5} </if>
            <if test="def6 != null and def6 != ''"> or def6 = #{def6} </if>
            <if test="def7 != null and def7 != ''"> or def7 = #{def7} </if>
            <if test="def8 != null and def8 != ''"> or def8 = #{def8} </if>
            <if test="def9 != null and def9 != ''"> or def9 = #{def9} </if>
            <if test="def10 != null and def10 != ''"> or def10 = #{def10} </if>
            <if test="def11 != null and def11 != ''"> or def11 = #{def11} </if>
            <if test="def12 != null and def12 != ''"> or def12 = #{def12} </if>
            <if test="def13 != null and def13 != ''"> or def13 = #{def13} </if>
            <if test="def14 != null and def14 != ''"> or def14 = #{def14} </if>
            <if test="def15 != null and def15 != ''"> or def15 = #{def15} </if>
            <if test="def16 != null and def16 != ''"> or def16 = #{def16} </if>
            <if test="def17 != null and def17 != ''"> or def17 = #{def17} </if>
            <if test="def18 != null and def18 != ''"> or def18 = #{def18} </if>
            <if test="def19 != null and def19 != ''"> or def19 = #{def19} </if>
            <if test="def20 != null and def20 != ''"> or def20 = #{def20} </if>
            <if test="def21 != null and def21 != ''"> or def21 = #{def21} </if>
            <if test="def22 != null and def22 != ''"> or def22 = #{def22} </if>
            <if test="def23 != null and def23 != ''"> or def23 = #{def23} </if>
            <if test="def24 != null and def24 != ''"> or def24 = #{def24} </if>
            <if test="def25 != null and def25 != ''"> or def25 = #{def25} </if>
            <if test="def26 != null and def26 != ''"> or def26 = #{def26} </if>
            <if test="def27 != null and def27 != ''"> or def27 = #{def27} </if>
            <if test="def28 != null and def28 != ''"> or def28 = #{def28} </if>
            <if test="def29 != null and def29 != ''"> or def29 = #{def29} </if>
            <if test="def30 != null and def30 != ''"> or def30 = #{def30} </if>
            <if test="def31 != null and def31 != ''"> or def31 = #{def31} </if>
            <if test="def32 != null and def32 != ''"> or def32 = #{def32} </if>
            <if test="def33 != null and def33 != ''"> or def33 = #{def33} </if>
            <if test="def34 != null and def34 != ''"> or def34 = #{def34} </if>
            <if test="def35 != null and def35 != ''"> or def35 = #{def35} </if>
            <if test="def36 != null and def36 != ''"> or def36 = #{def36} </if>
            <if test="def37 != null and def37 != ''"> or def37 = #{def37} </if>
            <if test="def38 != null and def38 != ''"> or def38 = #{def38} </if>
            <if test="def39 != null and def39 != ''"> or def39 = #{def39} </if>
            <if test="def40 != null and def40 != ''"> or def40 = #{def40} </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.ofs.entity.TocofsSaleoutEntity" keyProperty="id" useGeneratedKeys="true">
        insert into tocofs_saleout(
        <trim suffix="" suffixOverrides=",">
            <if test="id != null"> id , </if>
            <if test="clientcode != null and clientcode != ''"> clientCode , </if>
            <if test="companycode != null and companycode != ''"> companyCode , </if>
            <if test="storecode != null and storecode != ''"> storeCode , </if>
            <if test="facilitycode != null and facilitycode != ''"> facilityCode , </if>
            <if test="code != null and code != ''"> code , </if>
            <if test="reforderid != null"> refOrderId , </if>
            <if test="refordercode != null and refordercode != ''"> refOrderCode , </if>
            <if test="refordertype != null and refordertype != ''"> refOrderType , </if>
            <if test="status != null"> status , </if>
            <if test="consolidated != null"> consolidated , </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> internalInstructionType , </if>
            <if test="bizchannel != null and bizchannel != ''"> bizChannel , </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> sourcePlatformCode , </if>
            <if test="processtype != null and processtype != ''"> processType , </if>
            <if test="sourceorderid != null"> sourceOrderId , </if>
            <if test="sourceordercode != null and sourceordercode != ''"> sourceOrderCode , </if>
            <if test="shiptoattentionto != null and shiptoattentionto != ''"> shipToAttentionTo , </if>
            <if test="sourceuseraccount != null and sourceuseraccount != ''"> sourceUserAccount , </if>
            <if test="shiptoaddress != null and shiptoaddress != ''"> shipToAddress , </if>
            <if test="shiptocountry != null and shiptocountry != ''"> shipToCountry , </if>
            <if test="shiptostate != null and shiptostate != ''"> shipToState , </if>
            <if test="shiptocity != null and shiptocity != ''"> shipToCity , </if>
            <if test="shiptodistrict != null and shiptodistrict != ''"> shipToDistrict , </if>
            <if test="shiptomobile != null and shiptomobile != ''"> shipToMobile , </if>
            <if test="totallines != null"> totalLines , </if>
            <if test="totalqty != null"> totalQty , </if>
            <if test="totalcontainers != null"> totalContainers , </if>
            <if test="totalcases != null"> totalCases , </if>
            <if test="totalweight != null"> totalWeight , </if>
            <if test="totalvolume != null"> totalVolume , </if>
            <if test="totalvolumeweight != null"> totalVolumeWeight , </if>
            <if test="weightum != null and weightum != ''"> weightUM , </if>
            <if test="volumeum != null and volumeum != ''"> volumeUM , </if>
            <if test="totalamount != null"> totalAmount , </if>
            <if test="totalpayamount != null"> totalPayAmount , </if>
            <if test="postageamount != null"> postageAmount , </if>
            <if test="itemtotalamount != null"> itemTotalAmount , </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> totalFulfillQty , </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> totalFulfillWeight , </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> totalFulfillVolume , </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> totalFulfillVolumeWeight , </if>
            <if test="shipat != null and shipat != ''"> shipAt , </if>
            <if test="carriercode != null and carriercode != ''"> carrierCode , </if>
            <if test="primarywaybillcode != null and primarywaybillcode != ''"> primaryWaybillCode , </if>
            <if test="paymentstatus != null"> paymentStatus , </if>
            <if test="codrequired != null and codrequired != ''"> codRequired , </if>
            <if test="invoicerequired != null and invoicerequired != ''"> invoiceRequired , </if>
            <if test="paidat != null and paidat != ''"> paidAt , </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> shipFromAttentionTo , </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> shipFromAddress , </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> shipFromDistrict , </if>
            <if test="shipfromcity != null and shipfromcity != ''"> shipFromCity , </if>
            <if test="shipfromstate != null and shipfromstate != ''"> shipFromState , </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> shipFromCountry , </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> shipFromPostalCode , </if>
            <if test="shipfromphone != null and shipfromphone != ''"> shipFromPhone , </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> shipFromMobile , </if>
            <if test="shipfromfax != null and shipfromfax != ''"> shipFromFax , </if>
            <if test="shipfromemail != null and shipfromemail != ''"> shipFromEmail , </if>
            <if test="codamount != null"> codAmount , </if>
            <if test="tax != null"> tax , </if>
            <if test="taxpaid != null"> taxPaid , </if>
            <if test="tradesuccessat != null and tradesuccessat != ''"> tradeSuccessAt , </if>
            <if test="sourceorderstatus != null and sourceorderstatus != ''"> sourceOrderStatus , </if>
            <if test="shiptostatename != null and shiptostatename != ''"> shipToStateName , </if>
            <if test="shiptocityname != null and shiptocityname != ''"> shipToCityName , </if>
            <if test="shiptodistrictname != null and shiptodistrictname != ''"> shipToDistrictName , </if>
            <if test="shipmenttype != null and shipmenttype != ''"> shipmentType , </if>
            <if test="def1 != null and def1 != ''"> def1 , </if>
            <if test="def2 != null and def2 != ''"> def2 , </if>
            <if test="def3 != null and def3 != ''"> def3 , </if>
            <if test="def4 != null and def4 != ''"> def4 , </if>
            <if test="def5 != null and def5 != ''"> def5 , </if>
            <if test="def6 != null and def6 != ''"> def6 , </if>
            <if test="def7 != null and def7 != ''"> def7 , </if>
            <if test="def8 != null and def8 != ''"> def8 , </if>
            <if test="def9 != null and def9 != ''"> def9 , </if>
            <if test="def10 != null and def10 != ''"> def10 , </if>
            <if test="def11 != null and def11 != ''"> def11 , </if>
            <if test="def12 != null and def12 != ''"> def12 , </if>
            <if test="def13 != null and def13 != ''"> def13 , </if>
            <if test="def14 != null and def14 != ''"> def14 , </if>
            <if test="def15 != null and def15 != ''"> def15 , </if>
            <if test="def16 != null and def16 != ''"> def16 , </if>
            <if test="def17 != null and def17 != ''"> def17 , </if>
            <if test="def18 != null and def18 != ''"> def18 , </if>
            <if test="def19 != null and def19 != ''"> def19 , </if>
            <if test="def20 != null and def20 != ''"> def20 , </if>
            <if test="def21 != null and def21 != ''"> def21 , </if>
            <if test="def22 != null and def22 != ''"> def22 , </if>
            <if test="def23 != null and def23 != ''"> def23 , </if>
            <if test="def24 != null and def24 != ''"> def24 , </if>
            <if test="def25 != null and def25 != ''"> def25 , </if>
            <if test="def26 != null and def26 != ''"> def26 , </if>
            <if test="def27 != null and def27 != ''"> def27 , </if>
            <if test="def28 != null and def28 != ''"> def28 , </if>
            <if test="def29 != null and def29 != ''"> def29 , </if>
            <if test="def30 != null and def30 != ''"> def30 , </if>
            <if test="def31 != null and def31 != ''"> def31 , </if>
            <if test="def32 != null and def32 != ''"> def32 , </if>
            <if test="def33 != null and def33 != ''"> def33 , </if>
            <if test="def34 != null and def34 != ''"> def34 , </if>
            <if test="def35 != null and def35 != ''"> def35 , </if>
            <if test="def36 != null and def36 != ''"> def36 , </if>
            <if test="def37 != null and def37 != ''"> def37 , </if>
            <if test="def38 != null and def38 != ''"> def38 , </if>
            <if test="def39 != null and def39 != ''"> def39 , </if>
            <if test="def40 != null and def40 != ''"> def40 , </if>
            <if test="sorts == null ">sorts,</if>
            <if test="sts == null ">sts,</if>
        </trim>
        )values(
        <trim suffix="" suffixOverrides=",">
            <if test="id != null"> #{id} ,</if>
            <if test="clientcode != null and clientcode != ''"> #{clientcode} ,</if>
            <if test="companycode != null and companycode != ''"> #{companycode} ,</if>
            <if test="storecode != null and storecode != ''"> #{storecode} ,</if>
            <if test="facilitycode != null and facilitycode != ''"> #{facilitycode} ,</if>
            <if test="code != null and code != ''"> #{code} ,</if>
            <if test="reforderid != null"> #{reforderid} ,</if>
            <if test="refordercode != null and refordercode != ''"> #{refordercode} ,</if>
            <if test="refordertype != null and refordertype != ''"> #{refordertype} ,</if>
            <if test="status != null"> #{status} ,</if>
            <if test="consolidated != null"> #{consolidated} ,</if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> #{internalinstructiontype} ,</if>
            <if test="bizchannel != null and bizchannel != ''"> #{bizchannel} ,</if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> #{sourceplatformcode} ,</if>
            <if test="processtype != null and processtype != ''"> #{processtype} ,</if>
            <if test="sourceorderid != null"> #{sourceorderid} ,</if>
            <if test="sourceordercode != null and sourceordercode != ''"> #{sourceordercode} ,</if>
            <if test="shiptoattentionto != null and shiptoattentionto != ''"> #{shiptoattentionto} ,</if>
            <if test="sourceuseraccount != null and sourceuseraccount != ''"> #{sourceuseraccount} ,</if>
            <if test="shiptoaddress != null and shiptoaddress != ''"> #{shiptoaddress} ,</if>
            <if test="shiptocountry != null and shiptocountry != ''"> #{shiptocountry} ,</if>
            <if test="shiptostate != null and shiptostate != ''"> #{shiptostate} ,</if>
            <if test="shiptocity != null and shiptocity != ''"> #{shiptocity} ,</if>
            <if test="shiptodistrict != null and shiptodistrict != ''"> #{shiptodistrict} ,</if>
            <if test="shiptomobile != null and shiptomobile != ''"> #{shiptomobile} ,</if>
            <if test="totallines != null"> #{totallines} ,</if>
            <if test="totalqty != null"> #{totalqty} ,</if>
            <if test="totalcontainers != null"> #{totalcontainers} ,</if>
            <if test="totalcases != null"> #{totalcases} ,</if>
            <if test="totalweight != null"> #{totalweight} ,</if>
            <if test="totalvolume != null"> #{totalvolume} ,</if>
            <if test="totalvolumeweight != null"> #{totalvolumeweight} ,</if>
            <if test="weightum != null and weightum != ''"> #{weightum} ,</if>
            <if test="volumeum != null and volumeum != ''"> #{volumeum} ,</if>
            <if test="totalamount != null"> #{totalamount} ,</if>
            <if test="totalpayamount != null"> #{totalpayamount} ,</if>
            <if test="postageamount != null"> #{postageamount} ,</if>
            <if test="itemtotalamount != null"> #{itemtotalamount} ,</if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> #{totalfulfillqty} ,</if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> #{totalfulfillweight} ,</if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> #{totalfulfillvolume} ,</if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> #{totalfulfillvolumeweight} ,</if>
            <if test="shipat != null and shipat != ''"> #{shipat} ,</if>
            <if test="carriercode != null and carriercode != ''"> #{carriercode} ,</if>
            <if test="primarywaybillcode != null and primarywaybillcode != ''"> #{primarywaybillcode} ,</if>
            <if test="paymentstatus != null"> #{paymentstatus} ,</if>
            <if test="codrequired != null and codrequired != ''"> #{codrequired} ,</if>
            <if test="invoicerequired != null and invoicerequired != ''"> #{invoicerequired} ,</if>
            <if test="paidat != null and paidat != ''"> #{paidat} ,</if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> #{shipfromattentionto} ,</if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> #{shipfromaddress} ,</if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> #{shipfromdistrict} ,</if>
            <if test="shipfromcity != null and shipfromcity != ''"> #{shipfromcity} ,</if>
            <if test="shipfromstate != null and shipfromstate != ''"> #{shipfromstate} ,</if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> #{shipfromcountry} ,</if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> #{shipfrompostalcode} ,</if>
            <if test="shipfromphone != null and shipfromphone != ''"> #{shipfromphone} ,</if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> #{shipfrommobile} ,</if>
            <if test="shipfromfax != null and shipfromfax != ''"> #{shipfromfax} ,</if>
            <if test="shipfromemail != null and shipfromemail != ''"> #{shipfromemail} ,</if>
            <if test="codamount != null"> #{codamount} ,</if>
            <if test="tax != null"> #{tax} ,</if>
            <if test="taxpaid != null"> #{taxpaid} ,</if>
            <if test="tradesuccessat != null and tradesuccessat != ''"> #{tradesuccessat} ,</if>
            <if test="sourceorderstatus != null and sourceorderstatus != ''"> #{sourceorderstatus} ,</if>
            <if test="shiptostatename != null and shiptostatename != ''"> #{shiptostatename} ,</if>
            <if test="shiptocityname != null and shiptocityname != ''"> #{shiptocityname} ,</if>
            <if test="shiptodistrictname != null and shiptodistrictname != ''"> #{shiptodistrictname} ,</if>
            <if test="shipmenttype != null and shipmenttype != ''"> #{shipmenttype} ,</if>
            <if test="def1 != null and def1 != ''"> #{def1} ,</if>
            <if test="def2 != null and def2 != ''"> #{def2} ,</if>
            <if test="def3 != null and def3 != ''"> #{def3} ,</if>
            <if test="def4 != null and def4 != ''"> #{def4} ,</if>
            <if test="def5 != null and def5 != ''"> #{def5} ,</if>
            <if test="def6 != null and def6 != ''"> #{def6} ,</if>
            <if test="def7 != null and def7 != ''"> #{def7} ,</if>
            <if test="def8 != null and def8 != ''"> #{def8} ,</if>
            <if test="def9 != null and def9 != ''"> #{def9} ,</if>
            <if test="def10 != null and def10 != ''"> #{def10} ,</if>
            <if test="def11 != null and def11 != ''"> #{def11} ,</if>
            <if test="def12 != null and def12 != ''"> #{def12} ,</if>
            <if test="def13 != null and def13 != ''"> #{def13} ,</if>
            <if test="def14 != null and def14 != ''"> #{def14} ,</if>
            <if test="def15 != null and def15 != ''"> #{def15} ,</if>
            <if test="def16 != null and def16 != ''"> #{def16} ,</if>
            <if test="def17 != null and def17 != ''"> #{def17} ,</if>
            <if test="def18 != null and def18 != ''"> #{def18} ,</if>
            <if test="def19 != null and def19 != ''"> #{def19} ,</if>
            <if test="def20 != null and def20 != ''"> #{def20} ,</if>
            <if test="def21 != null and def21 != ''"> #{def21} ,</if>
            <if test="def22 != null and def22 != ''"> #{def22} ,</if>
            <if test="def23 != null and def23 != ''"> #{def23} ,</if>
            <if test="def24 != null and def24 != ''"> #{def24} ,</if>
            <if test="def25 != null and def25 != ''"> #{def25} ,</if>
            <if test="def26 != null and def26 != ''"> #{def26} ,</if>
            <if test="def27 != null and def27 != ''"> #{def27} ,</if>
            <if test="def28 != null and def28 != ''"> #{def28} ,</if>
            <if test="def29 != null and def29 != ''"> #{def29} ,</if>
            <if test="def30 != null and def30 != ''"> #{def30} ,</if>
            <if test="def31 != null and def31 != ''"> #{def31} ,</if>
            <if test="def32 != null and def32 != ''"> #{def32} ,</if>
            <if test="def33 != null and def33 != ''"> #{def33} ,</if>
            <if test="def34 != null and def34 != ''"> #{def34} ,</if>
            <if test="def35 != null and def35 != ''"> #{def35} ,</if>
            <if test="def36 != null and def36 != ''"> #{def36} ,</if>
            <if test="def37 != null and def37 != ''"> #{def37} ,</if>
            <if test="def38 != null and def38 != ''"> #{def38} ,</if>
            <if test="def39 != null and def39 != ''"> #{def39} ,</if>
            <if test="def40 != null and def40 != ''"> #{def40} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from tocofs_saleout a WHERE a.sts = 'Y' ),</if>
            <if test="sts == null ">'Y',</if>
        </trim>
        )
    </insert>
    <!-- 批量新增 -->
    <insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
        insert into tocofs_saleout(clientCode, companyCode, storeCode, facilityCode, code, refOrderId, refOrderCode, refOrderType, status, consolidated, internalInstructionType, bizChannel, sourcePlatformCode, processType, sourceOrderId, sourceOrderCode, shipToAttentionTo, sourceUserAccount, shipToAddress, shipToCountry, shipToState, shipToCity, shipToDistrict, shipToMobile, totalLines, totalQty, totalContainers, totalCases, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, totalAmount, totalPayAmount, postageAmount, itemTotalAmount, totalFulfillQty, totalFulfillWeight, totalFulfillVolume, totalFulfillVolumeWeight, shipAt, carrierCode, primaryWaybillCode, paymentStatus, codRequired, invoiceRequired, paidAt, shipFromAttentionTo, shipFromAddress, shipFromDistrict, shipFromCity, shipFromState, shipFromCountry, shipFromPostalCode, shipFromPhone, shipFromMobile, shipFromFax, shipFromEmail, codAmount, tax, taxPaid, tradeSuccessAt, sourceOrderStatus, shipToStateName, shipToCityName, shipToDistrictName, shipmentType, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def20, def21, def22, def23, def24, def25, def26, def27, def28, def29, def30, def31, def32, def33, def34, def35, def36, def37, def38, def39, def40,  sts)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.clientcode},#{entity.companycode},#{entity.storecode},#{entity.facilitycode},#{entity.code},#{entity.reforderid},#{entity.refordercode},#{entity.refordertype},#{entity.status},#{entity.consolidated},#{entity.internalinstructiontype},#{entity.bizchannel},#{entity.sourceplatformcode},#{entity.processtype},#{entity.sourceorderid},#{entity.sourceordercode},#{entity.shiptoattentionto},#{entity.sourceuseraccount},#{entity.shiptoaddress},#{entity.shiptocountry},#{entity.shiptostate},#{entity.shiptocity},#{entity.shiptodistrict},#{entity.shiptomobile},#{entity.totallines},#{entity.totalqty},#{entity.totalcontainers},#{entity.totalcases},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.totalamount},#{entity.totalpayamount},#{entity.postageamount},#{entity.itemtotalamount},#{entity.totalfulfillqty},#{entity.totalfulfillweight},#{entity.totalfulfillvolume},#{entity.totalfulfillvolumeweight},#{entity.shipat},#{entity.carriercode},#{entity.primarywaybillcode},#{entity.paymentstatus},#{entity.codrequired},#{entity.invoicerequired},#{entity.paidat},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromdistrict},#{entity.shipfromcity},#{entity.shipfromstate},#{entity.shipfromcountry},#{entity.shipfrompostalcode},#{entity.shipfromphone},#{entity.shipfrommobile},#{entity.shipfromfax},#{entity.shipfromemail},#{entity.codamount},#{entity.tax},#{entity.taxpaid},#{entity.tradesuccessat},#{entity.sourceorderstatus},#{entity.shiptostatename},#{entity.shiptocityname},#{entity.shiptodistrictname},#{entity.shipmenttype},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def14},#{entity.def15},#{entity.def16},#{entity.def17},#{entity.def18},#{entity.def19},#{entity.def20},#{entity.def21},#{entity.def22},#{entity.def23},#{entity.def24},#{entity.def25},#{entity.def26},#{entity.def27},#{entity.def28},#{entity.def29},#{entity.def30},#{entity.def31},#{entity.def32},#{entity.def33},#{entity.def34},#{entity.def35},#{entity.def36},#{entity.def37},#{entity.def38},#{entity.def39},#{entity.def40}, 'Y')
        </foreach>
    </insert>
    <!-- 批量新增或者修改-->
    <insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into tocofs_saleout(id,clientCode, companyCode, storeCode, facilityCode, code, refOrderId, refOrderCode, refOrderType, status, consolidated, internalInstructionType, bizChannel, sourcePlatformCode, processType, sourceOrderId, sourceOrderCode, shipToAttentionTo, sourceUserAccount, shipToAddress, shipToCountry, shipToState, shipToCity, shipToDistrict, shipToMobile, totalLines, totalQty, totalContainers, totalCases, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, totalAmount, totalPayAmount, postageAmount, itemTotalAmount, totalFulfillQty, totalFulfillWeight, totalFulfillVolume, totalFulfillVolumeWeight, shipAt, carrierCode, primaryWaybillCode, paymentStatus, codRequired, invoiceRequired, paidAt, shipFromAttentionTo, shipFromAddress, shipFromDistrict, shipFromCity, shipFromState, shipFromCountry, shipFromPostalCode, shipFromPhone, shipFromMobile, shipFromFax, shipFromEmail, codAmount, tax, taxPaid, tradeSuccessAt, sourceOrderStatus, shipToStateName, shipToCityName, shipToDistrictName, shipmentType, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def20, def21, def22, def23, def24, def25, def26, def27, def28, def29, def30, def31, def32, def33, def34, def35, def36, def37, def38, def39, def40)
        values
        <foreach collection="list" item="entity" separator=",">
            (#{entity.id},#{entity.clientcode},#{entity.companycode},#{entity.storecode},#{entity.facilitycode},#{entity.code},#{entity.reforderid},#{entity.refordercode},#{entity.refordertype},#{entity.status},#{entity.consolidated},#{entity.internalinstructiontype},#{entity.bizchannel},#{entity.sourceplatformcode},#{entity.processtype},#{entity.sourceorderid},#{entity.sourceordercode},#{entity.shiptoattentionto},#{entity.sourceuseraccount},#{entity.shiptoaddress},#{entity.shiptocountry},#{entity.shiptostate},#{entity.shiptocity},#{entity.shiptodistrict},#{entity.shiptomobile},#{entity.totallines},#{entity.totalqty},#{entity.totalcontainers},#{entity.totalcases},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.totalamount},#{entity.totalpayamount},#{entity.postageamount},#{entity.itemtotalamount},#{entity.totalfulfillqty},#{entity.totalfulfillweight},#{entity.totalfulfillvolume},#{entity.totalfulfillvolumeweight},#{entity.shipat},#{entity.carriercode},#{entity.primarywaybillcode},#{entity.paymentstatus},#{entity.codrequired},#{entity.invoicerequired},#{entity.paidat},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromdistrict},#{entity.shipfromcity},#{entity.shipfromstate},#{entity.shipfromcountry},#{entity.shipfrompostalcode},#{entity.shipfromphone},#{entity.shipfrommobile},#{entity.shipfromfax},#{entity.shipfromemail},#{entity.codamount},#{entity.tax},#{entity.taxpaid},#{entity.tradesuccessat},#{entity.sourceorderstatus},#{entity.shiptostatename},#{entity.shiptocityname},#{entity.shiptodistrictname},#{entity.shipmenttype},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def14},#{entity.def15},#{entity.def16},#{entity.def17},#{entity.def18},#{entity.def19},#{entity.def20},#{entity.def21},#{entity.def22},#{entity.def23},#{entity.def24},#{entity.def25},#{entity.def26},#{entity.def27},#{entity.def28},#{entity.def29},#{entity.def30},#{entity.def31},#{entity.def32},#{entity.def33},#{entity.def34},#{entity.def35},#{entity.def36},#{entity.def37},#{entity.def38},#{entity.def39},#{entity.def40})
        </foreach>
        on duplicate key update
        id = values(id),
        clientCode = values(clientCode),
        companyCode = values(companyCode),
        storeCode = values(storeCode),
        facilityCode = values(facilityCode),
        code = values(code),
        refOrderId = values(refOrderId),
        refOrderCode = values(refOrderCode),
        refOrderType = values(refOrderType),
        status = values(status),
        consolidated = values(consolidated),
        internalInstructionType = values(internalInstructionType),
        bizChannel = values(bizChannel),
        sourcePlatformCode = values(sourcePlatformCode),
        processType = values(processType),
        sourceOrderId = values(sourceOrderId),
        sourceOrderCode = values(sourceOrderCode),
        shipToAttentionTo = values(shipToAttentionTo),
        sourceUserAccount = values(sourceUserAccount),
        shipToAddress = values(shipToAddress),
        shipToCountry = values(shipToCountry),
        shipToState = values(shipToState),
        shipToCity = values(shipToCity),
        shipToDistrict = values(shipToDistrict),
        shipToMobile = values(shipToMobile),
        totalLines = values(totalLines),
        totalQty = values(totalQty),
        totalContainers = values(totalContainers),
        totalCases = values(totalCases),
        totalWeight = values(totalWeight),
        totalVolume = values(totalVolume),
        totalVolumeWeight = values(totalVolumeWeight),
        weightUM = values(weightUM),
        volumeUM = values(volumeUM),
        totalAmount = values(totalAmount),
        totalPayAmount = values(totalPayAmount),
        postageAmount = values(postageAmount),
        itemTotalAmount = values(itemTotalAmount),
        totalFulfillQty = values(totalFulfillQty),
        totalFulfillWeight = values(totalFulfillWeight),
        totalFulfillVolume = values(totalFulfillVolume),
        totalFulfillVolumeWeight = values(totalFulfillVolumeWeight),
        shipAt = values(shipAt),
        carrierCode = values(carrierCode),
        primaryWaybillCode = values(primaryWaybillCode),
        paymentStatus = values(paymentStatus),
        codRequired = values(codRequired),
        invoiceRequired = values(invoiceRequired),
        paidAt = values(paidAt),
        shipFromAttentionTo = values(shipFromAttentionTo),
        shipFromAddress = values(shipFromAddress),
        shipFromDistrict = values(shipFromDistrict),
        shipFromCity = values(shipFromCity),
        shipFromState = values(shipFromState),
        shipFromCountry = values(shipFromCountry),
        shipFromPostalCode = values(shipFromPostalCode),
        shipFromPhone = values(shipFromPhone),
        shipFromMobile = values(shipFromMobile),
        shipFromFax = values(shipFromFax),
        shipFromEmail = values(shipFromEmail),
        codAmount = values(codAmount),
        tax = values(tax),
        taxPaid = values(taxPaid),
        tradeSuccessAt = values(tradeSuccessAt),
        sourceOrderStatus = values(sourceOrderStatus),
        shipToStateName = values(shipToStateName),
        shipToCityName = values(shipToCityName),
        shipToDistrictName = values(shipToDistrictName),
        shipmentType = values(shipmentType),
        def1 = values(def1),
        def2 = values(def2),
        def3 = values(def3),
        def4 = values(def4),
        def5 = values(def5),
        def6 = values(def6),
        def7 = values(def7),
        def8 = values(def8),
        def9 = values(def9),
        def10 = values(def10),
        def11 = values(def11),
        def12 = values(def12),
        def13 = values(def13),
        def14 = values(def14),
        def15 = values(def15),
        def16 = values(def16),
        def17 = values(def17),
        def18 = values(def18),
        def19 = values(def19),
        def20 = values(def20),
        def21 = values(def21),
        def22 = values(def22),
        def23 = values(def23),
        def24 = values(def24),
        def25 = values(def25),
        def26 = values(def26),
        def27 = values(def27),
        def28 = values(def28),
        def29 = values(def29),
        def30 = values(def30),
        def31 = values(def31),
        def32 = values(def32),
        def33 = values(def33),
        def34 = values(def34),
        def35 = values(def35),
        def36 = values(def36),
        def37 = values(def37),
        def38 = values(def38),
        def39 = values(def39),
        def40 = values(def40)</insert>
    <!--通过主键修改方法-->
    <update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity" >
        update tocofs_saleout  set
        <trim suffix="" suffixOverrides=",">
            <if test="clientcode != null and clientcode != ''"> clientCode = #{clientcode},</if>
            <if test="companycode != null and companycode != ''"> companyCode = #{companycode},</if>
            <if test="storecode != null and storecode != ''"> storeCode = #{storecode},</if>
            <if test="facilitycode != null and facilitycode != ''"> facilityCode = #{facilitycode},</if>
            <if test="code != null and code != ''"> code = #{code},</if>
            <if test="reforderid != null"> refOrderId = #{reforderid},</if>
            <if test="refordercode != null and refordercode != ''"> refOrderCode = #{refordercode},</if>
            <if test="refordertype != null and refordertype != ''"> refOrderType = #{refordertype},</if>
            <if test="status != null"> status = #{status},</if>
            <if test="consolidated != null"> consolidated = #{consolidated},</if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> internalInstructionType = #{internalinstructiontype},</if>
            <if test="bizchannel != null and bizchannel != ''"> bizChannel = #{bizchannel},</if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> sourcePlatformCode = #{sourceplatformcode},</if>
            <if test="processtype != null and processtype != ''"> processType = #{processtype},</if>
            <if test="sourceorderid != null"> sourceOrderId = #{sourceorderid},</if>
            <if test="sourceordercode != null and sourceordercode != ''"> sourceOrderCode = #{sourceordercode},</if>
            <if test="shiptoattentionto != null and shiptoattentionto != ''"> shipToAttentionTo = #{shiptoattentionto},</if>
            <if test="sourceuseraccount != null and sourceuseraccount != ''"> sourceUserAccount = #{sourceuseraccount},</if>
            <if test="shiptoaddress != null and shiptoaddress != ''"> shipToAddress = #{shiptoaddress},</if>
            <if test="shiptocountry != null and shiptocountry != ''"> shipToCountry = #{shiptocountry},</if>
            <if test="shiptostate != null and shiptostate != ''"> shipToState = #{shiptostate},</if>
            <if test="shiptocity != null and shiptocity != ''"> shipToCity = #{shiptocity},</if>
            <if test="shiptodistrict != null and shiptodistrict != ''"> shipToDistrict = #{shiptodistrict},</if>
            <if test="shiptomobile != null and shiptomobile != ''"> shipToMobile = #{shiptomobile},</if>
            <if test="totallines != null"> totalLines = #{totallines},</if>
            <if test="totalqty != null"> totalQty = #{totalqty},</if>
            <if test="totalcontainers != null"> totalContainers = #{totalcontainers},</if>
            <if test="totalcases != null"> totalCases = #{totalcases},</if>
            <if test="totalweight != null"> totalWeight = #{totalweight},</if>
            <if test="totalvolume != null"> totalVolume = #{totalvolume},</if>
            <if test="totalvolumeweight != null"> totalVolumeWeight = #{totalvolumeweight},</if>
            <if test="weightum != null and weightum != ''"> weightUM = #{weightum},</if>
            <if test="volumeum != null and volumeum != ''"> volumeUM = #{volumeum},</if>
            <if test="totalamount != null"> totalAmount = #{totalamount},</if>
            <if test="totalpayamount != null"> totalPayAmount = #{totalpayamount},</if>
            <if test="postageamount != null"> postageAmount = #{postageamount},</if>
            <if test="itemtotalamount != null"> itemTotalAmount = #{itemtotalamount},</if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> totalFulfillQty = #{totalfulfillqty},</if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> totalFulfillWeight = #{totalfulfillweight},</if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> totalFulfillVolume = #{totalfulfillvolume},</if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> totalFulfillVolumeWeight = #{totalfulfillvolumeweight},</if>
            <if test="shipat != null and shipat != ''"> shipAt = #{shipat},</if>
            <if test="carriercode != null and carriercode != ''"> carrierCode = #{carriercode},</if>
            <if test="primarywaybillcode != null and primarywaybillcode != ''"> primaryWaybillCode = #{primarywaybillcode},</if>
            <if test="paymentstatus != null"> paymentStatus = #{paymentstatus},</if>
            <if test="codrequired != null and codrequired != ''"> codRequired = #{codrequired},</if>
            <if test="invoicerequired != null and invoicerequired != ''"> invoiceRequired = #{invoicerequired},</if>
            <if test="paidat != null and paidat != ''"> paidAt = #{paidat},</if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> shipFromAttentionTo = #{shipfromattentionto},</if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> shipFromAddress = #{shipfromaddress},</if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> shipFromDistrict = #{shipfromdistrict},</if>
            <if test="shipfromcity != null and shipfromcity != ''"> shipFromCity = #{shipfromcity},</if>
            <if test="shipfromstate != null and shipfromstate != ''"> shipFromState = #{shipfromstate},</if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> shipFromCountry = #{shipfromcountry},</if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> shipFromPostalCode = #{shipfrompostalcode},</if>
            <if test="shipfromphone != null and shipfromphone != ''"> shipFromPhone = #{shipfromphone},</if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> shipFromMobile = #{shipfrommobile},</if>
            <if test="shipfromfax != null and shipfromfax != ''"> shipFromFax = #{shipfromfax},</if>
            <if test="shipfromemail != null and shipfromemail != ''"> shipFromEmail = #{shipfromemail},</if>
            <if test="codamount != null"> codAmount = #{codamount},</if>
            <if test="tax != null"> tax = #{tax},</if>
            <if test="taxpaid != null"> taxPaid = #{taxpaid},</if>
            <if test="tradesuccessat != null and tradesuccessat != ''"> tradeSuccessAt = #{tradesuccessat},</if>
            <if test="sourceorderstatus != null and sourceorderstatus != ''"> sourceOrderStatus = #{sourceorderstatus},</if>
            <if test="shiptostatename != null and shiptostatename != ''"> shipToStateName = #{shiptostatename},</if>
            <if test="shiptocityname != null and shiptocityname != ''"> shipToCityName = #{shiptocityname},</if>
            <if test="shiptodistrictname != null and shiptodistrictname != ''"> shipToDistrictName = #{shiptodistrictname},</if>
            <if test="shipmenttype != null and shipmenttype != ''"> shipmentType = #{shipmenttype},</if>
            <if test="def1 != null and def1 != ''"> def1 = #{def1},</if>
            <if test="def2 != null and def2 != ''"> def2 = #{def2},</if>
            <if test="def3 != null and def3 != ''"> def3 = #{def3},</if>
            <if test="def4 != null and def4 != ''"> def4 = #{def4},</if>
            <if test="def5 != null and def5 != ''"> def5 = #{def5},</if>
            <if test="def6 != null and def6 != ''"> def6 = #{def6},</if>
            <if test="def7 != null and def7 != ''"> def7 = #{def7},</if>
            <if test="def8 != null and def8 != ''"> def8 = #{def8},</if>
            <if test="def9 != null and def9 != ''"> def9 = #{def9},</if>
            <if test="def10 != null and def10 != ''"> def10 = #{def10},</if>
            <if test="def11 != null and def11 != ''"> def11 = #{def11},</if>
            <if test="def12 != null and def12 != ''"> def12 = #{def12},</if>
            <if test="def13 != null and def13 != ''"> def13 = #{def13},</if>
            <if test="def14 != null and def14 != ''"> def14 = #{def14},</if>
            <if test="def15 != null and def15 != ''"> def15 = #{def15},</if>
            <if test="def16 != null and def16 != ''"> def16 = #{def16},</if>
            <if test="def17 != null and def17 != ''"> def17 = #{def17},</if>
            <if test="def18 != null and def18 != ''"> def18 = #{def18},</if>
            <if test="def19 != null and def19 != ''"> def19 = #{def19},</if>
            <if test="def20 != null and def20 != ''"> def20 = #{def20},</if>
            <if test="def21 != null and def21 != ''"> def21 = #{def21},</if>
            <if test="def22 != null and def22 != ''"> def22 = #{def22},</if>
            <if test="def23 != null and def23 != ''"> def23 = #{def23},</if>
            <if test="def24 != null and def24 != ''"> def24 = #{def24},</if>
            <if test="def25 != null and def25 != ''"> def25 = #{def25},</if>
            <if test="def26 != null and def26 != ''"> def26 = #{def26},</if>
            <if test="def27 != null and def27 != ''"> def27 = #{def27},</if>
            <if test="def28 != null and def28 != ''"> def28 = #{def28},</if>
            <if test="def29 != null and def29 != ''"> def29 = #{def29},</if>
            <if test="def30 != null and def30 != ''"> def30 = #{def30},</if>
            <if test="def31 != null and def31 != ''"> def31 = #{def31},</if>
            <if test="def32 != null and def32 != ''"> def32 = #{def32},</if>
            <if test="def33 != null and def33 != ''"> def33 = #{def33},</if>
            <if test="def34 != null and def34 != ''"> def34 = #{def34},</if>
            <if test="def35 != null and def35 != ''"> def35 = #{def35},</if>
            <if test="def36 != null and def36 != ''"> def36 = #{def36},</if>
            <if test="def37 != null and def37 != ''"> def37 = #{def37},</if>
            <if test="def38 != null and def38 != ''"> def38 = #{def38},</if>
            <if test="def39 != null and def39 != ''"> def39 = #{def39},</if>
            <if test="def40 != null and def40 != ''"> def40 = #{def40},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 逻辑删除 -->
    <update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity" >
        update tocofs_saleout  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.ofs.entity.TocofsSaleoutEntity" >
        update tocofs_saleout  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null"> and id = #{id} </if>
            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
            <if test="storecode != null and storecode != ''"> and storeCode = #{storecode} </if>
            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
            <if test="code != null and code != ''"> and code = #{code} </if>
            <if test="reforderid != null"> and refOrderId = #{reforderid} </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
            <if test="refordertype != null and refordertype != ''"> and refOrderType = #{refordertype} </if>
            <if test="status != null"> and status = #{status} </if>
            <if test="consolidated != null"> and consolidated = #{consolidated} </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType = #{internalinstructiontype} </if>
            <if test="bizchannel != null and bizchannel != ''"> and bizChannel = #{bizchannel} </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode = #{sourceplatformcode} </if>
            <if test="processtype != null and processtype != ''"> and processType = #{processtype} </if>
            <if test="sourceorderid != null"> and sourceOrderId = #{sourceorderid} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
            <if test="shiptoattentionto != null and shiptoattentionto != ''"> and shipToAttentionTo = #{shiptoattentionto} </if>
            <if test="sourceuseraccount != null and sourceuseraccount != ''"> and sourceUserAccount = #{sourceuseraccount} </if>
            <if test="shiptoaddress != null and shiptoaddress != ''"> and shipToAddress = #{shiptoaddress} </if>
            <if test="shiptocountry != null and shiptocountry != ''"> and shipToCountry = #{shiptocountry} </if>
            <if test="shiptostate != null and shiptostate != ''"> and shipToState = #{shiptostate} </if>
            <if test="shiptocity != null and shiptocity != ''"> and shipToCity = #{shiptocity} </if>
            <if test="shiptodistrict != null and shiptodistrict != ''"> and shipToDistrict = #{shiptodistrict} </if>
            <if test="shiptomobile != null and shiptomobile != ''"> and shipToMobile = #{shiptomobile} </if>
            <if test="totallines != null"> and totalLines = #{totallines} </if>
            <if test="totalqty != null"> and totalQty = #{totalqty} </if>
            <if test="totalcontainers != null"> and totalContainers = #{totalcontainers} </if>
            <if test="totalcases != null"> and totalCases = #{totalcases} </if>
            <if test="totalweight != null"> and totalWeight = #{totalweight} </if>
            <if test="totalvolume != null"> and totalVolume = #{totalvolume} </if>
            <if test="totalvolumeweight != null"> and totalVolumeWeight = #{totalvolumeweight} </if>
            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
            <if test="totalamount != null"> and totalAmount = #{totalamount} </if>
            <if test="totalpayamount != null"> and totalPayAmount = #{totalpayamount} </if>
            <if test="postageamount != null"> and postageAmount = #{postageamount} </if>
            <if test="itemtotalamount != null"> and itemTotalAmount = #{itemtotalamount} </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty = #{totalfulfillqty} </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight = #{totalfulfillweight} </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume = #{totalfulfillvolume} </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
            <if test="shipat != null and shipat != ''"> and shipAt = #{shipat} </if>
            <if test="carriercode != null and carriercode != ''"> and carrierCode = #{carriercode} </if>
            <if test="primarywaybillcode != null and primarywaybillcode != ''"> and primaryWaybillCode = #{primarywaybillcode} </if>
            <if test="paymentstatus != null"> and paymentStatus = #{paymentstatus} </if>
            <if test="codrequired != null and codrequired != ''"> and codRequired = #{codrequired} </if>
            <if test="invoicerequired != null and invoicerequired != ''"> and invoiceRequired = #{invoicerequired} </if>
            <if test="paidat != null and paidat != ''"> and paidAt = #{paidat} </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo = #{shipfromattentionto} </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress = #{shipfromaddress} </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict = #{shipfromdistrict} </if>
            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity = #{shipfromcity} </if>
            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState = #{shipfromstate} </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry = #{shipfromcountry} </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode = #{shipfrompostalcode} </if>
            <if test="shipfromphone != null and shipfromphone != ''"> and shipFromPhone = #{shipfromphone} </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile = #{shipfrommobile} </if>
            <if test="shipfromfax != null and shipfromfax != ''"> and shipFromFax = #{shipfromfax} </if>
            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail = #{shipfromemail} </if>
            <if test="codamount != null"> and codAmount = #{codamount} </if>
            <if test="tax != null"> and tax = #{tax} </if>
            <if test="taxpaid != null"> and taxPaid = #{taxpaid} </if>
            <if test="tradesuccessat != null and tradesuccessat != ''"> and tradeSuccessAt = #{tradesuccessat} </if>
            <if test="sourceorderstatus != null and sourceorderstatus != ''"> and sourceOrderStatus = #{sourceorderstatus} </if>
            <if test="shiptostatename != null and shiptostatename != ''"> and shipToStateName = #{shiptostatename} </if>
            <if test="shiptocityname != null and shiptocityname != ''"> and shipToCityName = #{shiptocityname} </if>
            <if test="shiptodistrictname != null and shiptodistrictname != ''"> and shipToDistrictName = #{shiptodistrictname} </if>
            <if test="shipmenttype != null and shipmenttype != ''"> and shipmentType = #{shipmenttype} </if>
            <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
            <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
            <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
            <if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
            <if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
            <if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
            <if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
            <if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
            <if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
            <if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
            <if test="def11 != null and def11 != ''"> and def11 = #{def11} </if>
            <if test="def12 != null and def12 != ''"> and def12 = #{def12} </if>
            <if test="def13 != null and def13 != ''"> and def13 = #{def13} </if>
            <if test="def14 != null and def14 != ''"> and def14 = #{def14} </if>
            <if test="def15 != null and def15 != ''"> and def15 = #{def15} </if>
            <if test="def16 != null and def16 != ''"> and def16 = #{def16} </if>
            <if test="def17 != null and def17 != ''"> and def17 = #{def17} </if>
            <if test="def18 != null and def18 != ''"> and def18 = #{def18} </if>
            <if test="def19 != null and def19 != ''"> and def19 = #{def19} </if>
            <if test="def20 != null and def20 != ''"> and def20 = #{def20} </if>
            <if test="def21 != null and def21 != ''"> and def21 = #{def21} </if>
            <if test="def22 != null and def22 != ''"> and def22 = #{def22} </if>
            <if test="def23 != null and def23 != ''"> and def23 = #{def23} </if>
            <if test="def24 != null and def24 != ''"> and def24 = #{def24} </if>
            <if test="def25 != null and def25 != ''"> and def25 = #{def25} </if>
            <if test="def26 != null and def26 != ''"> and def26 = #{def26} </if>
            <if test="def27 != null and def27 != ''"> and def27 = #{def27} </if>
            <if test="def28 != null and def28 != ''"> and def28 = #{def28} </if>
            <if test="def29 != null and def29 != ''"> and def29 = #{def29} </if>
            <if test="def30 != null and def30 != ''"> and def30 = #{def30} </if>
            <if test="def31 != null and def31 != ''"> and def31 = #{def31} </if>
            <if test="def32 != null and def32 != ''"> and def32 = #{def32} </if>
            <if test="def33 != null and def33 != ''"> and def33 = #{def33} </if>
            <if test="def34 != null and def34 != ''"> and def34 = #{def34} </if>
            <if test="def35 != null and def35 != ''"> and def35 = #{def35} </if>
            <if test="def36 != null and def36 != ''"> and def36 = #{def36} </if>
            <if test="def37 != null and def37 != ''"> and def37 = #{def37} </if>
            <if test="def38 != null and def38 != ''"> and def38 = #{def38} </if>
            <if test="def39 != null and def39 != ''"> and def39 = #{def39} </if>
            <if test="def40 != null and def40 != ''"> and def40 = #{def40} </if>
            and sts='Y'
        </trim>
    </update>
    <!--通过主键删除-->
    <delete id="entity_delete">
        delete from tocofs_saleout where id = #{id}
    </delete>
</mapper>