<?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.TocofsSaleoutDetailedDaoImpl">
    <resultMap id="get-TocofsSaleoutDetailedEntity-result" type="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity" >
        <result property="id" column="id" jdbcType="INTEGER"/>
        <result property="clientcode" column="clientCode" jdbcType="VARCHAR"/>
        <result property="companycode" column="companyCode" jdbcType="VARCHAR"/>
        <result property="facilitycode" column="facilityCode" jdbcType="VARCHAR"/>
        <result property="shipmentcode" column="shipmentCode" jdbcType="VARCHAR"/>
        <result property="reforderid" column="refOrderId" jdbcType="INTEGER"/>
        <result property="reforderdetailid" column="refOrderDetailId" jdbcType="INTEGER"/>
        <result property="refordercode" column="refOrderCode" jdbcType="VARCHAR"/>
        <result property="allocinvid" column="allocInvId" jdbcType="INTEGER"/>
        <result property="skucode" column="skuCode" jdbcType="VARCHAR"/>
        <result property="skuname" column="skuName" jdbcType="VARCHAR"/>
        <result property="sourceordercode" column="sourceOrderCode" jdbcType="VARCHAR"/>
        <result property="sourcelinenum" column="sourceLineNum" jdbcType="VARCHAR"/>
        <result property="inventorysts" column="inventorySts" jdbcType="VARCHAR"/>
        <result property="isgift" column="isGift" jdbcType="INTEGER"/>
        <result property="requestqty" column="requestQty" jdbcType="INTEGER"/>
        <result property="shipqty" column="shipQty" jdbcType="INTEGER"/>
        <result property="shipat" column="shipAt" jdbcType="VARCHAR"/>
        <result property="quantityum" column="quantityUM" jdbcType="VARCHAR"/>
        <result property="listprice" column="listPrice" jdbcType="INTEGER"/>
        <result property="itemtotalamount" column="itemTotalAmount" jdbcType="INTEGER"/>
        <result property="totalpayamount" column="totalPayAmount" 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="created" column="created" jdbcType="VARCHAR"/>
        <result property="createdby" column="createdBy" jdbcType="VARCHAR"/>
        <result property="lastupdated" column="lastUpdated" jdbcType="VARCHAR"/>
        <result property="lastupdatedby" column="lastUpdatedBy" jdbcType="VARCHAR"/>
        <result property="maintableid" column="mainTableId" jdbcType="VARCHAR"/>
        <result property="newpushdate" column="newPushDate" jdbcType="VARCHAR"/>
        <result property="newtransmitinfo" column="newTransmitInfo" jdbcType="VARCHAR"/>
        <result property="newstate" column="newState" jdbcType="VARCHAR"/>
        <result property="newstate2" column="newState2" jdbcType="VARCHAR"/>
        <result property="newstate3" column="newState3" jdbcType="VARCHAR"/>
        <result property="newstate4" column="newState4" jdbcType="VARCHAR"/>
        <result property="newsystemnumber" column="newSystemNumber" jdbcType="VARCHAR"/>
        <result property="newsystemprimary" column="newSystemPrimary" jdbcType="VARCHAR"/>
        <result property="newsystemnumber2" column="newSystemNumber2" jdbcType="VARCHAR"/>
        <result property="newsystemprimary2" column="newSystemPrimary2" jdbcType="VARCHAR"/>
        <result property="newsystemnumber3" column="newSystemNumber3" jdbcType="VARCHAR"/>
        <result property="newsystemprimary3" column="newSystemPrimary3" jdbcType="VARCHAR"/>
        <result property="newsystemnumber4" column="newSystemNumber4" jdbcType="VARCHAR"/>
        <result property="newsystemprimary4" column="newSystemPrimary4" jdbcType="VARCHAR"/>
        <result property="businessdate" column="businessDate" jdbcType="VARCHAR"/>
        <result property="successfultradedate" column="successfulTradeDate" jdbcType="VARCHAR"/>
        <result property="businesstype" column="businessType" 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 = "TocofsSaleoutDetailedEntity_Base_Column_List">
        id
        ,clientCode
        ,companyCode
        ,facilityCode
        ,shipmentCode
        ,refOrderId
        ,refOrderDetailId
        ,refOrderCode
        ,allocInvId
        ,skuCode
        ,skuName
        ,sourceOrderCode
        ,sourceLineNum
        ,inventorySts
        ,isGift
        ,requestQty
        ,shipQty
        ,shipAt
        ,quantityUM
        ,listPrice
        ,itemTotalAmount
        ,totalPayAmount
        ,totalWeight
        ,totalVolume
        ,totalVolumeWeight
        ,weightUM
        ,volumeUM
        ,created
        ,createdBy
        ,lastUpdated
        ,lastUpdatedBy
        ,mainTableId
        ,newPushDate
        ,newTransmitInfo
        ,newState
        ,newState2
        ,newState3
        ,newState4
        ,newSystemNumber
        ,newSystemPrimary
        ,newSystemNumber2
        ,newSystemPrimary2
        ,newSystemNumber3
        ,newSystemPrimary3
        ,newSystemNumber4
        ,newSystemPrimary4
        ,businessDate
        ,successfulTradeDate
        ,businessType
        ,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-TocofsSaleoutDetailedEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
        select
        <include refid="TocofsSaleoutDetailedEntity_Base_Column_List" />
        from tocofs_saleout_detailed
        <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="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
            <if test="shipmentcode != null and shipmentcode != ''"> and shipmentCode = #{shipmentcode} </if>
            <if test="reforderid != null"> and refOrderId = #{reforderid} </if>
            <if test="reforderdetailid != null"> and refOrderDetailId = #{reforderdetailid} </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
            <if test="allocinvid != null"> and allocInvId = #{allocinvid} </if>
            <if test="skucode != null and skucode != ''"> and skuCode = #{skucode} </if>
            <if test="skuname != null and skuname != ''"> and skuName = #{skuname} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
            <if test="sourcelinenum != null and sourcelinenum != ''"> and sourceLineNum = #{sourcelinenum} </if>
            <if test="inventorysts != null and inventorysts != ''"> and inventorySts = #{inventorysts} </if>
            <if test="isgift != null"> and isGift = #{isgift} </if>
            <if test="requestqty != null"> and requestQty = #{requestqty} </if>
            <if test="shipqty != null"> and shipQty = #{shipqty} </if>
            <if test="shipat != null and shipat != ''"> and shipAt = #{shipat} </if>
            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
            <if test="listprice != null"> and listPrice = #{listprice} </if>
            <if test="itemtotalamount != null"> and itemTotalAmount = #{itemtotalamount} </if>
            <if test="totalpayamount != null"> and totalPayAmount = #{totalpayamount} </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="created != null and created != ''"> and created = #{created} </if>
            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
            <if test="maintableid != null and maintableid != ''"> and mainTableId = #{maintableid} </if>
            <if test="newpushdate != null and newpushdate != ''"> and newPushDate = #{newpushdate} </if>
            <if test="newtransmitinfo != null and newtransmitinfo != ''"> and newTransmitInfo = #{newtransmitinfo} </if>
            <if test="newstate != null and newstate != ''"> and newState = #{newstate} </if>
            <if test="newstate2 != null and newstate2 != ''"> and newState2 = #{newstate2} </if>
            <if test="newstate3 != null and newstate3 != ''"> and newState3 = #{newstate3} </if>
            <if test="newstate4 != null and newstate4 != ''"> and newState4 = #{newstate4} </if>
            <if test="newsystemnumber != null and newsystemnumber != ''"> and newSystemNumber = #{newsystemnumber} </if>
            <if test="newsystemprimary != null and newsystemprimary != ''"> and newSystemPrimary = #{newsystemprimary} </if>
            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> and newSystemNumber2 = #{newsystemnumber2} </if>
            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> and newSystemPrimary2 = #{newsystemprimary2} </if>
            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> and newSystemNumber3 = #{newsystemnumber3} </if>
            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> and newSystemPrimary3 = #{newsystemprimary3} </if>
            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> and newSystemNumber4 = #{newsystemnumber4} </if>
            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> and newSystemPrimary4 = #{newsystemprimary4} </if>
            <if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if>
            <if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate = #{successfultradedate} </if>
            <if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </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>
            <if test="ids!=null and ids!=''">and id in (${ids})</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.TocofsSaleoutDetailedEntity">
        select  count(1)   from tocofs_saleout_detailed
        <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="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
            <if test="shipmentcode != null and shipmentcode != ''"> and shipmentCode = #{shipmentcode} </if>
            <if test="reforderid != null"> and refOrderId = #{reforderid} </if>
            <if test="reforderdetailid != null"> and refOrderDetailId = #{reforderdetailid} </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
            <if test="allocinvid != null"> and allocInvId = #{allocinvid} </if>
            <if test="skucode != null and skucode != ''"> and skuCode = #{skucode} </if>
            <if test="skuname != null and skuname != ''"> and skuName = #{skuname} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
            <if test="sourcelinenum != null and sourcelinenum != ''"> and sourceLineNum = #{sourcelinenum} </if>
            <if test="inventorysts != null and inventorysts != ''"> and inventorySts = #{inventorysts} </if>
            <if test="isgift != null"> and isGift = #{isgift} </if>
            <if test="requestqty != null"> and requestQty = #{requestqty} </if>
            <if test="shipqty != null"> and shipQty = #{shipqty} </if>
            <if test="shipat != null and shipat != ''"> and shipAt = #{shipat} </if>
            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
            <if test="listprice != null"> and listPrice = #{listprice} </if>
            <if test="itemtotalamount != null"> and itemTotalAmount = #{itemtotalamount} </if>
            <if test="totalpayamount != null"> and totalPayAmount = #{totalpayamount} </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="created != null and created != ''"> and created = #{created} </if>
            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
            <if test="maintableid != null and maintableid != ''"> and mainTableId = #{maintableid} </if>
            <if test="newpushdate != null and newpushdate != ''"> and newPushDate = #{newpushdate} </if>
            <if test="newtransmitinfo != null and newtransmitinfo != ''"> and newTransmitInfo = #{newtransmitinfo} </if>
            <if test="newstate != null and newstate != ''"> and newState = #{newstate} </if>
            <if test="newstate2 != null and newstate2 != ''"> and newState2 = #{newstate2} </if>
            <if test="newstate3 != null and newstate3 != ''"> and newState3 = #{newstate3} </if>
            <if test="newstate4 != null and newstate4 != ''"> and newState4 = #{newstate4} </if>
            <if test="newsystemnumber != null and newsystemnumber != ''"> and newSystemNumber = #{newsystemnumber} </if>
            <if test="newsystemprimary != null and newsystemprimary != ''"> and newSystemPrimary = #{newsystemprimary} </if>
            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> and newSystemNumber2 = #{newsystemnumber2} </if>
            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> and newSystemPrimary2 = #{newsystemprimary2} </if>
            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> and newSystemNumber3 = #{newsystemnumber3} </if>
            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> and newSystemPrimary3 = #{newsystemprimary3} </if>
            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> and newSystemNumber4 = #{newsystemnumber4} </if>
            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> and newSystemPrimary4 = #{newsystemprimary4} </if>
            <if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if>
            <if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate = #{successfultradedate} </if>
            <if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </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-TocofsSaleoutDetailedEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
        select
        <include refid="TocofsSaleoutDetailedEntity_Base_Column_List" />
        from tocofs_saleout_detailed
        <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="facilitycode != null and facilitycode != ''"> and facilityCode like concat('%',#{facilitycode},'%') </if>
            <if test="shipmentcode != null and shipmentcode != ''"> and shipmentCode like concat('%',#{shipmentcode},'%') </if>
            <if test="reforderid != null"> and refOrderId like concat('%',#{reforderid},'%') </if>
            <if test="reforderdetailid != null"> and refOrderDetailId like concat('%',#{reforderdetailid},'%') </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode like concat('%',#{refordercode},'%') </if>
            <if test="allocinvid != null"> and allocInvId like concat('%',#{allocinvid},'%') </if>
            <if test="skucode != null and skucode != ''"> and skuCode like concat('%',#{skucode},'%') </if>
            <if test="skuname != null and skuname != ''"> and skuName like concat('%',#{skuname},'%') </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode like concat('%',#{sourceordercode},'%') </if>
            <if test="sourcelinenum != null and sourcelinenum != ''"> and sourceLineNum like concat('%',#{sourcelinenum},'%') </if>
            <if test="inventorysts != null and inventorysts != ''"> and inventorySts like concat('%',#{inventorysts},'%') </if>
            <if test="isgift != null"> and isGift like concat('%',#{isgift},'%') </if>
            <if test="requestqty != null"> and requestQty like concat('%',#{requestqty},'%') </if>
            <if test="shipqty != null"> and shipQty like concat('%',#{shipqty},'%') </if>
            <if test="shipat != null and shipat != ''"> and shipAt like concat('%',#{shipat},'%') </if>
            <if test="quantityum != null and quantityum != ''"> and quantityUM like concat('%',#{quantityum},'%') </if>
            <if test="listprice != null"> and listPrice like concat('%',#{listprice},'%') </if>
            <if test="itemtotalamount != null"> and itemTotalAmount like concat('%',#{itemtotalamount},'%') </if>
            <if test="totalpayamount != null"> and totalPayAmount like concat('%',#{totalpayamount},'%') </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="created != null and created != ''"> and created like concat('%',#{created},'%') </if>
            <if test="createdby != null and createdby != ''"> and createdBy like concat('%',#{createdby},'%') </if>
            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated like concat('%',#{lastupdated},'%') </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy like concat('%',#{lastupdatedby},'%') </if>
            <if test="maintableid != null and maintableid != ''"> and mainTableId like concat('%',#{maintableid},'%') </if>
            <if test="newpushdate != null and newpushdate != ''"> and newPushDate like concat('%',#{newpushdate},'%') </if>
            <if test="newtransmitinfo != null and newtransmitinfo != ''"> and newTransmitInfo like concat('%',#{newtransmitinfo},'%') </if>
            <if test="newstate != null and newstate != ''"> and newState like concat('%',#{newstate},'%') </if>
            <if test="newstate2 != null and newstate2 != ''"> and newState2 like concat('%',#{newstate2},'%') </if>
            <if test="newstate3 != null and newstate3 != ''"> and newState3 like concat('%',#{newstate3},'%') </if>
            <if test="newstate4 != null and newstate4 != ''"> and newState4 like concat('%',#{newstate4},'%') </if>
            <if test="newsystemnumber != null and newsystemnumber != ''"> and newSystemNumber like concat('%',#{newsystemnumber},'%') </if>
            <if test="newsystemprimary != null and newsystemprimary != ''"> and newSystemPrimary like concat('%',#{newsystemprimary},'%') </if>
            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> and newSystemNumber2 like concat('%',#{newsystemnumber2},'%') </if>
            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> and newSystemPrimary2 like concat('%',#{newsystemprimary2},'%') </if>
            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> and newSystemNumber3 like concat('%',#{newsystemnumber3},'%') </if>
            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> and newSystemPrimary3 like concat('%',#{newsystemprimary3},'%') </if>
            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> and newSystemNumber4 like concat('%',#{newsystemnumber4},'%') </if>
            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> and newSystemPrimary4 like concat('%',#{newsystemprimary4},'%') </if>
            <if test="businessdate != null and businessdate != ''"> and businessDate like concat('%',#{businessdate},'%') </if>
            <if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate like concat('%',#{successfultradedate},'%') </if>
            <if test="businesstype != null and businesstype != ''"> and businessType like concat('%',#{businesstype},'%') </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="TocofsSaleoutDetailedentity_list_or" resultMap="get-TocofsSaleoutDetailedEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
        select
        <include refid="TocofsSaleoutDetailedEntity_Base_Column_List" />
        from tocofs_saleout_detailed
        <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="facilitycode != null and facilitycode != ''"> or facilityCode = #{facilitycode} </if>
            <if test="shipmentcode != null and shipmentcode != ''"> or shipmentCode = #{shipmentcode} </if>
            <if test="reforderid != null"> or refOrderId = #{reforderid} </if>
            <if test="reforderdetailid != null"> or refOrderDetailId = #{reforderdetailid} </if>
            <if test="refordercode != null and refordercode != ''"> or refOrderCode = #{refordercode} </if>
            <if test="allocinvid != null"> or allocInvId = #{allocinvid} </if>
            <if test="skucode != null and skucode != ''"> or skuCode = #{skucode} </if>
            <if test="skuname != null and skuname != ''"> or skuName = #{skuname} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> or sourceOrderCode = #{sourceordercode} </if>
            <if test="sourcelinenum != null and sourcelinenum != ''"> or sourceLineNum = #{sourcelinenum} </if>
            <if test="inventorysts != null and inventorysts != ''"> or inventorySts = #{inventorysts} </if>
            <if test="isgift != null"> or isGift = #{isgift} </if>
            <if test="requestqty != null"> or requestQty = #{requestqty} </if>
            <if test="shipqty != null"> or shipQty = #{shipqty} </if>
            <if test="shipat != null and shipat != ''"> or shipAt = #{shipat} </if>
            <if test="quantityum != null and quantityum != ''"> or quantityUM = #{quantityum} </if>
            <if test="listprice != null"> or listPrice = #{listprice} </if>
            <if test="itemtotalamount != null"> or itemTotalAmount = #{itemtotalamount} </if>
            <if test="totalpayamount != null"> or totalPayAmount = #{totalpayamount} </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="created != null and created != ''"> or created = #{created} </if>
            <if test="createdby != null and createdby != ''"> or createdBy = #{createdby} </if>
            <if test="lastupdated != null and lastupdated != ''"> or lastUpdated = #{lastupdated} </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> or lastUpdatedBy = #{lastupdatedby} </if>
            <if test="maintableid != null and maintableid != ''"> or mainTableId = #{maintableid} </if>
            <if test="newpushdate != null and newpushdate != ''"> or newPushDate = #{newpushdate} </if>
            <if test="newtransmitinfo != null and newtransmitinfo != ''"> or newTransmitInfo = #{newtransmitinfo} </if>
            <if test="newstate != null and newstate != ''"> or newState = #{newstate} </if>
            <if test="newstate2 != null and newstate2 != ''"> or newState2 = #{newstate2} </if>
            <if test="newstate3 != null and newstate3 != ''"> or newState3 = #{newstate3} </if>
            <if test="newstate4 != null and newstate4 != ''"> or newState4 = #{newstate4} </if>
            <if test="newsystemnumber != null and newsystemnumber != ''"> or newSystemNumber = #{newsystemnumber} </if>
            <if test="newsystemprimary != null and newsystemprimary != ''"> or newSystemPrimary = #{newsystemprimary} </if>
            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> or newSystemNumber2 = #{newsystemnumber2} </if>
            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> or newSystemPrimary2 = #{newsystemprimary2} </if>
            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> or newSystemNumber3 = #{newsystemnumber3} </if>
            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> or newSystemPrimary3 = #{newsystemprimary3} </if>
            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> or newSystemNumber4 = #{newsystemnumber4} </if>
            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> or newSystemPrimary4 = #{newsystemprimary4} </if>
            <if test="businessdate != null and businessdate != ''"> or businessDate = #{businessdate} </if>
            <if test="successfultradedate != null and successfultradedate != ''"> or successfulTradeDate = #{successfultradedate} </if>
            <if test="businesstype != null and businesstype != ''"> or businessType = #{businesstype} </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.TocofsSaleoutDetailedEntity" keyProperty="id" useGeneratedKeys="true">
        insert into tocofs_saleout_detailed(
        <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="facilitycode != null and facilitycode != ''"> facilityCode , </if>
            <if test="shipmentcode != null and shipmentcode != ''"> shipmentCode , </if>
            <if test="reforderid != null"> refOrderId , </if>
            <if test="reforderdetailid != null"> refOrderDetailId , </if>
            <if test="refordercode != null and refordercode != ''"> refOrderCode , </if>
            <if test="allocinvid != null"> allocInvId , </if>
            <if test="skucode != null and skucode != ''"> skuCode , </if>
            <if test="skuname != null and skuname != ''"> skuName , </if>
            <if test="sourceordercode != null and sourceordercode != ''"> sourceOrderCode , </if>
            <if test="sourcelinenum != null and sourcelinenum != ''"> sourceLineNum , </if>
            <if test="inventorysts != null and inventorysts != ''"> inventorySts , </if>
            <if test="isgift != null"> isGift , </if>
            <if test="requestqty != null"> requestQty , </if>
            <if test="shipqty != null"> shipQty , </if>
            <if test="shipat != null and shipat != ''"> shipAt , </if>
            <if test="quantityum != null and quantityum != ''"> quantityUM , </if>
            <if test="listprice != null"> listPrice , </if>
            <if test="itemtotalamount != null"> itemTotalAmount , </if>
            <if test="totalpayamount != null"> totalPayAmount , </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="created != null and created != ''"> created , </if>
            <if test="createdby != null and createdby != ''"> createdBy , </if>
            <if test="lastupdated != null and lastupdated != ''"> lastUpdated , </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> lastUpdatedBy , </if>
            <if test="maintableid != null and maintableid != ''"> mainTableId , </if>
            <if test="newpushdate != null and newpushdate != ''"> newPushDate , </if>
            <if test="newtransmitinfo != null and newtransmitinfo != ''"> newTransmitInfo , </if>
            <if test="newstate != null and newstate != ''"> newState , </if>
            <if test="newstate2 != null and newstate2 != ''"> newState2 , </if>
            <if test="newstate3 != null and newstate3 != ''"> newState3 , </if>
            <if test="newstate4 != null and newstate4 != ''"> newState4 , </if>
            <if test="newsystemnumber != null and newsystemnumber != ''"> newSystemNumber , </if>
            <if test="newsystemprimary != null and newsystemprimary != ''"> newSystemPrimary , </if>
            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> newSystemNumber2 , </if>
            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> newSystemPrimary2 , </if>
            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> newSystemNumber3 , </if>
            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> newSystemPrimary3 , </if>
            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> newSystemNumber4 , </if>
            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> newSystemPrimary4 , </if>
            <if test="businessdate != null and businessdate != ''"> businessDate , </if>
            <if test="successfultradedate != null and successfultradedate != ''"> successfulTradeDate , </if>
            <if test="businesstype != null and businesstype != ''"> businessType , </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="facilitycode != null and facilitycode != ''"> #{facilitycode} ,</if>
            <if test="shipmentcode != null and shipmentcode != ''"> #{shipmentcode} ,</if>
            <if test="reforderid != null"> #{reforderid} ,</if>
            <if test="reforderdetailid != null"> #{reforderdetailid} ,</if>
            <if test="refordercode != null and refordercode != ''"> #{refordercode} ,</if>
            <if test="allocinvid != null"> #{allocinvid} ,</if>
            <if test="skucode != null and skucode != ''"> #{skucode} ,</if>
            <if test="skuname != null and skuname != ''"> #{skuname} ,</if>
            <if test="sourceordercode != null and sourceordercode != ''"> #{sourceordercode} ,</if>
            <if test="sourcelinenum != null and sourcelinenum != ''"> #{sourcelinenum} ,</if>
            <if test="inventorysts != null and inventorysts != ''"> #{inventorysts} ,</if>
            <if test="isgift != null"> #{isgift} ,</if>
            <if test="requestqty != null"> #{requestqty} ,</if>
            <if test="shipqty != null"> #{shipqty} ,</if>
            <if test="shipat != null and shipat != ''"> #{shipat} ,</if>
            <if test="quantityum != null and quantityum != ''"> #{quantityum} ,</if>
            <if test="listprice != null"> #{listprice} ,</if>
            <if test="itemtotalamount != null"> #{itemtotalamount} ,</if>
            <if test="totalpayamount != null"> #{totalpayamount} ,</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="created != null and created != ''"> #{created} ,</if>
            <if test="createdby != null and createdby != ''"> #{createdby} ,</if>
            <if test="lastupdated != null and lastupdated != ''"> #{lastupdated} ,</if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> #{lastupdatedby} ,</if>
            <if test="maintableid != null and maintableid != ''"> #{maintableid} ,</if>
            <if test="newpushdate != null and newpushdate != ''"> #{newpushdate} ,</if>
            <if test="newtransmitinfo != null and newtransmitinfo != ''"> #{newtransmitinfo} ,</if>
            <if test="newstate != null and newstate != ''"> #{newstate} ,</if>
            <if test="newstate2 != null and newstate2 != ''"> #{newstate2} ,</if>
            <if test="newstate3 != null and newstate3 != ''"> #{newstate3} ,</if>
            <if test="newstate4 != null and newstate4 != ''"> #{newstate4} ,</if>
            <if test="newsystemnumber != null and newsystemnumber != ''"> #{newsystemnumber} ,</if>
            <if test="newsystemprimary != null and newsystemprimary != ''"> #{newsystemprimary} ,</if>
            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> #{newsystemnumber2} ,</if>
            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> #{newsystemprimary2} ,</if>
            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> #{newsystemnumber3} ,</if>
            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> #{newsystemprimary3} ,</if>
            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> #{newsystemnumber4} ,</if>
            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> #{newsystemprimary4} ,</if>
            <if test="businessdate != null and businessdate != ''"> #{businessdate} ,</if>
            <if test="successfultradedate != null and successfultradedate != ''"> #{successfultradedate} ,</if>
            <if test="businesstype != null and businesstype != ''"> #{businesstype} ,</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_detailed 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_detailed(clientCode, companyCode, facilityCode, shipmentCode, refOrderId, refOrderDetailId, refOrderCode, allocInvId, skuCode, skuName, sourceOrderCode, sourceLineNum, inventorySts, isGift, requestQty, shipQty, shipAt, quantityUM, listPrice, itemTotalAmount, totalPayAmount, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, created, createdBy, lastUpdated, lastUpdatedBy, mainTableId, newPushDate, newTransmitInfo, newState, newState2, newState3, newState4, newSystemNumber, newSystemPrimary, newSystemNumber2, newSystemPrimary2, newSystemNumber3, newSystemPrimary3, newSystemNumber4, newSystemPrimary4, businessDate, successfulTradeDate, businessType, 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.facilitycode},#{entity.shipmentcode},#{entity.reforderid},#{entity.reforderdetailid},#{entity.refordercode},#{entity.allocinvid},#{entity.skucode},#{entity.skuname},#{entity.sourceordercode},#{entity.sourcelinenum},#{entity.inventorysts},#{entity.isgift},#{entity.requestqty},#{entity.shipqty},#{entity.shipat},#{entity.quantityum},#{entity.listprice},#{entity.itemtotalamount},#{entity.totalpayamount},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.maintableid},#{entity.newpushdate},#{entity.newtransmitinfo},#{entity.newstate},#{entity.newstate2},#{entity.newstate3},#{entity.newstate4},#{entity.newsystemnumber},#{entity.newsystemprimary},#{entity.newsystemnumber2},#{entity.newsystemprimary2},#{entity.newsystemnumber3},#{entity.newsystemprimary3},#{entity.newsystemnumber4},#{entity.newsystemprimary4},#{entity.businessdate},#{entity.successfultradedate},#{entity.businesstype},#{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_detailed(id,clientCode, companyCode, facilityCode, shipmentCode, refOrderId, refOrderDetailId, refOrderCode, allocInvId, skuCode, skuName, sourceOrderCode, sourceLineNum, inventorySts, isGift, requestQty, shipQty, shipAt, quantityUM, listPrice, itemTotalAmount, totalPayAmount, totalWeight, totalVolume, totalVolumeWeight, weightUM, volumeUM, created, createdBy, lastUpdated, lastUpdatedBy, mainTableId, businessDate, successfulTradeDate, businessType)
        values
        <foreach collection="list" item="entity" separator=",">
            (#{entity.id},#{entity.clientcode},#{entity.companycode},#{entity.facilitycode},#{entity.shipmentcode},#{entity.reforderid},#{entity.reforderdetailid},#{entity.refordercode},#{entity.allocinvid},#{entity.skucode},#{entity.skuname},#{entity.sourceordercode},#{entity.sourcelinenum},#{entity.inventorysts},#{entity.isgift},#{entity.requestqty},#{entity.shipqty},#{entity.shipat},#{entity.quantityum},#{entity.listprice},#{entity.itemtotalamount},#{entity.totalpayamount},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.weightum},#{entity.volumeum},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.maintableid},#{entity.businessdate},#{entity.successfultradedate},#{entity.businesstype})
        </foreach>
        on duplicate key update
        id = values(id),
        clientCode = values(clientCode),
        companyCode = values(companyCode),
        facilityCode = values(facilityCode),
        shipmentCode = values(shipmentCode),
        refOrderId = values(refOrderId),
        refOrderDetailId = values(refOrderDetailId),
        refOrderCode = values(refOrderCode),
        allocInvId = values(allocInvId),
        skuCode = values(skuCode),
        skuName = values(skuName),
        sourceOrderCode = values(sourceOrderCode),
        sourceLineNum = values(sourceLineNum),
        inventorySts = values(inventorySts),
        isGift = values(isGift),
        requestQty = values(requestQty),
        shipQty = values(shipQty),
        shipAt = values(shipAt),
        quantityUM = values(quantityUM),
        listPrice = values(listPrice),
        itemTotalAmount = values(itemTotalAmount),
        totalPayAmount = values(totalPayAmount),
        totalWeight = values(totalWeight),
        totalVolume = values(totalVolume),
        totalVolumeWeight = values(totalVolumeWeight),
        weightUM = values(weightUM),
        volumeUM = values(volumeUM),
        created = values(created),
        createdBy = values(createdBy),
        lastUpdated = values(lastUpdated),
        lastUpdatedBy = values(lastUpdatedBy),
        mainTableId = values(mainTableId),
        businessDate = values(businessDate),
        successfulTradeDate = values(successfulTradeDate),
        businessType = values(businessType)
        </insert>


    <!-- 出库成功，更新推送状态（适合档案转啊）-->
    <insert id="entityInsertOrUpdateBatchStock" keyProperty="id" useGeneratedKeys="true" parameterType="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
        insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState)
        values
        <foreach collection="list" item="entity" separator=",">
            (
                #{entity.id},
                #{entity.newpushdate},
                #{entity.newtransmitinfo},
                #{entity.newstate}
             )
        </foreach>
        on duplicate key update
        id = values(id),
        newPushDate = values(newPushDate),
        newTransmitInfo = values(newTransmitInfo),
        newState = values(newState)
    </insert>


    <!-- TOC更新推送状态（适合库存同步）-->
    <insert id="entityInsertOrUpdateBatchStock2" keyProperty="id" useGeneratedKeys="true" parameterType="com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity">
        insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState,newSystemNumber,newSystemPrimary)
        values
        <foreach collection="list" item="entity" separator=",">
            (
                #{entity.id},
                #{entity.newpushdate},
                #{entity.newtransmitinfo},
                #{entity.newstate},
                #{entity.newsystemnumber},
                #{entity.newsystemprimary}
            )
        </foreach>
        on duplicate key update
        id = values(id),
        newPushDate = values(newPushDate),
        newTransmitInfo = values(newTransmitInfo),
        newState = values(newState),
        newSystemNumber = values(newSystemNumber),
        newSystemPrimary = values(newSystemPrimary)
    </insert>


    <!-- TOC更新推送状态（适合确认收入红字）-->
    <insert id="entityInsertOrUpdateBatchStock3" keyProperty="id" useGeneratedKeys="true">
        insert into tocofs_saleout_detailed(id,def1,def2,newState2,newSystemNumber2,newSystemPrimary2)
        values
        <foreach collection="list" item="entity" separator=",">
            (
            #{entity.id},
            #{entity.def1},
            #{entity.def2},
            #{entity.newstate2},
            #{entity.newsystemnumber2},
            #{entity.newsystemprimary2}
            )
        </foreach>
        on duplicate key update
        id = values(id),
        def1 = values(def1),
        def2 = values(def2),
        newState2 = values(newState2),
        newSystemNumber2 = values(newSystemNumber2),
        newSystemPrimary2 = values(newSystemPrimary2)
    </insert>


    <!-- TOC更新推送状态（适合确认收入蓝字）-->
    <insert id="entityInsertOrUpdateBatchStock4" keyProperty="id" useGeneratedKeys="true">
        insert into tocofs_saleout_detailed(id,def3,def4,newState3,newSystemNumber3,newSystemPrimary3)
        values
        <foreach collection="list" item="entity" separator=",">
            (
            #{entity.id},
            #{entity.def3},
            #{entity.def4},
            #{entity.newstate3},
            #{entity.newsystemnumber3},
            #{entity.newsystemprimary3}
            )
        </foreach>
        on duplicate key update
        id = values(id),
        def3 = values(def3),
        def4 = values(def4),
        newState3 = values(newState3),
        newSystemNumber3 = values(newSystemNumber3),
        newSystemPrimary3 = values(newSystemPrimary3)
    </insert>



    <!-- TOB更新推送状态（适合确认收入蓝字）-->
    <insert id="entityInsertOrUpdateBatchStock5" keyProperty="id" useGeneratedKeys="true">
        insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState4,newSystemNumber,newSystemPrimary)
        values
        <foreach collection="list" item="entity" separator=",">
            (
            #{entity.id},
            #{entity.newPushDate},
            #{entity.newTransmitInfo},
            #{entity.newState4},
            #{entity.newSystemNumber},
            #{entity.newSystemPrimary}
            )
        </foreach>
        on duplicate key update
        id = values(id),
        newPushDate = values(newPushDate),
        newTransmitInfo = values(newTransmitInfo),
        newState4 = values(newState4),
        newSystemNumber = values(newSystemNumber),
        newSystemPrimary = values(newSystemPrimary)
    </insert>




    <!-- TOB更新推送状态（适合确认收入蓝字）-->
    <insert id="entityInsertOrUpdateBatchStock6" keyProperty="id" useGeneratedKeys="true">
        insert into tocofs_saleout_detailed(id,newPushDate,newTransmitInfo,newState,newSystemNumber,newSystemPrimary)
        values
        <foreach collection="list" item="entity" separator=",">
            (
            #{entity.id},
            #{entity.newpushdate},
            #{entity.newtransmitinfo},
            #{entity.newstate},
            #{entity.newsystemnumber},
            #{entity.newsystemprimary}
            )
        </foreach>
        on duplicate key update
        id = values(id),
        newPushDate = values(newPushDate),
        newTransmitInfo = values(newTransmitInfo),
        newState = values(newState),
        newSystemNumber = values(newSystemNumber),
        newSystemPrimary = values(newSystemPrimary)
    </insert>

    <!-- TOB更新推送状态（适合确认收入蓝字）-->
    <insert id="entityInsertOrUpdateBatchStock7" keyProperty="id" useGeneratedKeys="true">
        insert into tocofs_saleout_detailed(id,def5,def6,newstate4)
        values
        <foreach collection="list" item="entity" separator=",">
            (
            #{entity.id},
            #{entity.def5},
            #{entity.def6},
            #{entity.newstate4}
            )
        </foreach>
        on duplicate key update
        id = values(id),
        def5 = values(def5),
        def6 = values(def6),
        newstate4 = values(newstate4)
    </insert>

    <!-- TOB更新推送状态（适合确认收入蓝字）-->
    <insert id="entityInsertOrUpdateBatchStock8" keyProperty="id" useGeneratedKeys="true">
        insert into tocofs_saleout_detailed(id,def5,def6,newState4,newSystemNumber4,newSystemPrimary4)
        values
        <foreach collection="list" item="entity" separator=",">
            (
            #{entity.id},
            #{entity.def5},
            #{entity.def6},
            #{entity.newstate4},
            #{entity.newsystemnumber4},
            #{entity.newsystemprimary4}
            )
        </foreach>
        on duplicate key update
        id = values(id),
        def5 = values(def5),
        def6 = values(def6),
        newState4 = values(newState4),
        newSystemNumber4 = values(newSystemNumber4),
        newSystemPrimary4 = values(newSystemPrimary4)
    </insert>

    <!--通过主键修改方法-->
    <update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity" >
        update tocofs_saleout_detailed  set
        <trim suffix="" suffixOverrides=",">
            <if test="clientcode != null and clientcode != ''"> clientCode = #{clientcode},</if>
            <if test="companycode != null and companycode != ''"> companyCode = #{companycode},</if>
            <if test="facilitycode != null and facilitycode != ''"> facilityCode = #{facilitycode},</if>
            <if test="shipmentcode != null and shipmentcode != ''"> shipmentCode = #{shipmentcode},</if>
            <if test="reforderid != null"> refOrderId = #{reforderid},</if>
            <if test="reforderdetailid != null"> refOrderDetailId = #{reforderdetailid},</if>
            <if test="refordercode != null and refordercode != ''"> refOrderCode = #{refordercode},</if>
            <if test="allocinvid != null"> allocInvId = #{allocinvid},</if>
            <if test="skucode != null and skucode != ''"> skuCode = #{skucode},</if>
            <if test="skuname != null and skuname != ''"> skuName = #{skuname},</if>
            <if test="sourceordercode != null and sourceordercode != ''"> sourceOrderCode = #{sourceordercode},</if>
            <if test="sourcelinenum != null and sourcelinenum != ''"> sourceLineNum = #{sourcelinenum},</if>
            <if test="inventorysts != null and inventorysts != ''"> inventorySts = #{inventorysts},</if>
            <if test="isgift != null"> isGift = #{isgift},</if>
            <if test="requestqty != null"> requestQty = #{requestqty},</if>
            <if test="shipqty != null"> shipQty = #{shipqty},</if>
            <if test="shipat != null and shipat != ''"> shipAt = #{shipat},</if>
            <if test="quantityum != null and quantityum != ''"> quantityUM = #{quantityum},</if>
            <if test="listprice != null"> listPrice = #{listprice},</if>
            <if test="itemtotalamount != null"> itemTotalAmount = #{itemtotalamount},</if>
            <if test="totalpayamount != null"> totalPayAmount = #{totalpayamount},</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="created != null and created != ''"> created = #{created},</if>
            <if test="createdby != null and createdby != ''"> createdBy = #{createdby},</if>
            <if test="lastupdated != null and lastupdated != ''"> lastUpdated = #{lastupdated},</if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> lastUpdatedBy = #{lastupdatedby},</if>
            <if test="maintableid != null and maintableid != ''"> mainTableId = #{maintableid},</if>
            <if test="newpushdate != null and newpushdate != ''"> newPushDate = #{newpushdate},</if>
            <if test="newtransmitinfo != null and newtransmitinfo != ''"> newTransmitInfo = #{newtransmitinfo},</if>
            <if test="newstate != null and newstate != ''"> newState = #{newstate},</if>
            <if test="newstate2 != null and newstate2 != ''"> newState2 = #{newstate2},</if>
            <if test="newstate3 != null and newstate3 != ''"> newState3 = #{newstate3},</if>
            <if test="newstate4 != null and newstate4 != ''"> newState4 = #{newstate4},</if>
            <if test="newsystemnumber != null and newsystemnumber != ''"> newSystemNumber = #{newsystemnumber},</if>
            <if test="newsystemprimary != null and newsystemprimary != ''"> newSystemPrimary = #{newsystemprimary},</if>
            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> newSystemNumber2 = #{newsystemnumber2},</if>
            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> newSystemPrimary2 = #{newsystemprimary2},</if>
            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> newSystemNumber3 = #{newsystemnumber3},</if>
            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> newSystemPrimary3 = #{newsystemprimary3},</if>
            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> newSystemNumber4 = #{newsystemnumber4},</if>
            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> newSystemPrimary4 = #{newsystemprimary4},</if>
            <if test="businessdate != null and businessdate != ''"> businessDate = #{businessdate},</if>
            <if test="successfultradedate != null and successfultradedate != ''"> successfulTradeDate = #{successfultradedate},</if>
            <if test="businesstype != null and businesstype != ''"> businessType = #{businesstype},</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.TocofsSaleoutDetailedEntity" >
        update tocofs_saleout_detailed  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.TocofsSaleoutDetailedEntity" >
        update tocofs_saleout_detailed  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="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
            <if test="shipmentcode != null and shipmentcode != ''"> and shipmentCode = #{shipmentcode} </if>
            <if test="reforderid != null"> and refOrderId = #{reforderid} </if>
            <if test="reforderdetailid != null"> and refOrderDetailId = #{reforderdetailid} </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
            <if test="allocinvid != null"> and allocInvId = #{allocinvid} </if>
            <if test="skucode != null and skucode != ''"> and skuCode = #{skucode} </if>
            <if test="skuname != null and skuname != ''"> and skuName = #{skuname} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
            <if test="sourcelinenum != null and sourcelinenum != ''"> and sourceLineNum = #{sourcelinenum} </if>
            <if test="inventorysts != null and inventorysts != ''"> and inventorySts = #{inventorysts} </if>
            <if test="isgift != null"> and isGift = #{isgift} </if>
            <if test="requestqty != null"> and requestQty = #{requestqty} </if>
            <if test="shipqty != null"> and shipQty = #{shipqty} </if>
            <if test="shipat != null and shipat != ''"> and shipAt = #{shipat} </if>
            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
            <if test="listprice != null"> and listPrice = #{listprice} </if>
            <if test="itemtotalamount != null"> and itemTotalAmount = #{itemtotalamount} </if>
            <if test="totalpayamount != null"> and totalPayAmount = #{totalpayamount} </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="created != null and created != ''"> and created = #{created} </if>
            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
            <if test="maintableid != null and maintableid != ''"> and mainTableId = #{maintableid} </if>
            <if test="newpushdate != null and newpushdate != ''"> and newPushDate = #{newpushdate} </if>
            <if test="newtransmitinfo != null and newtransmitinfo != ''"> and newTransmitInfo = #{newtransmitinfo} </if>
            <if test="newstate != null and newstate != ''"> and newState = #{newstate} </if>
            <if test="newstate2 != null and newstate2 != ''"> and newState2 = #{newstate2} </if>
            <if test="newstate3 != null and newstate3 != ''"> and newState3 = #{newstate3} </if>
            <if test="newstate4 != null and newstate4 != ''"> and newState4 = #{newstate4} </if>
            <if test="newsystemnumber != null and newsystemnumber != ''"> and newSystemNumber = #{newsystemnumber} </if>
            <if test="newsystemprimary != null and newsystemprimary != ''"> and newSystemPrimary = #{newsystemprimary} </if>
            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> and newSystemNumber2 = #{newsystemnumber2} </if>
            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> and newSystemPrimary2 = #{newsystemprimary2} </if>
            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> and newSystemNumber3 = #{newsystemnumber3} </if>
            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> and newSystemPrimary3 = #{newsystemprimary3} </if>
            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> and newSystemNumber4 = #{newsystemnumber4} </if>
            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> and newSystemPrimary4 = #{newsystemprimary4} </if>
            <if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if>
            <if test="successfultradedate != null and successfultradedate != ''"> and successfulTradeDate = #{successfultradedate} </if>
            <if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </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_detailed where id = #{id}
    </delete>
</mapper>