<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.plugin.lets.dao.impl.SoSaleorderBDaoImpl">

    <resultMap id="get-SoSaleorderBEntity-result" type="com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity" >
       <result property="alrconfincomny" column="alrconfincomny" jdbcType="VARCHAR"/>
           <result property="alrconfinconum" column="alrconfinconum" jdbcType="VARCHAR"/>
           <result property="bbindflag" column="bbindflag" jdbcType="VARCHAR"/>
           <result property="bdericttrans" column="bdericttrans" jdbcType="VARCHAR"/>
           <result property="blargessflag" column="blargessflag" jdbcType="VARCHAR"/>
           <result property="boosflag" column="boosflag" jdbcType="VARCHAR"/>
           <result property="breturnprofit" column="breturnprofit" jdbcType="VARCHAR"/>
           <result property="bsafeprice" column="bsafeprice" jdbcType="VARCHAR"/>
           <result property="bsupplyflag" column="bsupplyflag" jdbcType="VARCHAR"/>
           <result property="cadvisecalbodyid" column="cadvisecalbodyid" jdbcType="VARCHAR"/>
           <result property="cbatchid" column="cbatchid" jdbcType="VARCHAR"/>
           <result property="cbodywarehouseid" column="cbodywarehouseid" jdbcType="VARCHAR"/>
           <result property="cbomorderid" column="cbomorderid" jdbcType="VARCHAR"/>
           <result property="cchantypeid" column="cchantypeid" jdbcType="VARCHAR"/>
           <result property="cconsigncorpid" column="cconsigncorpid" jdbcType="VARCHAR"/>
           <result property="ccurrencytypeid" column="ccurrencytypeid" jdbcType="VARCHAR"/>
           <result property="cfactoryid" column="cfactoryid" jdbcType="VARCHAR"/>
           <result property="cfreezeid" column="cfreezeid" jdbcType="VARCHAR"/>
           <result property="cinvbasdocid" column="cinvbasdocid" jdbcType="VARCHAR"/>
           <result property="cinventoryid" column="cinventoryid" jdbcType="VARCHAR"/>
           <result property="cinventoryid1" column="cinventoryid1" jdbcType="VARCHAR"/>
           <result property="clargessrowno" column="clargessrowno" jdbcType="VARCHAR"/>
           <result property="coperatorid" column="coperatorid" jdbcType="VARCHAR"/>
           <result property="corderBid" column="corder_bid" jdbcType="VARCHAR"/>
           <result property="cpackunitid" column="cpackunitid" jdbcType="VARCHAR"/>
           <result property="cpricecalproc" column="cpricecalproc" jdbcType="VARCHAR"/>
           <result property="cpriceitemid" column="cpriceitemid" jdbcType="VARCHAR"/>
           <result property="cpriceitemtable" column="cpriceitemtable" jdbcType="VARCHAR"/>
           <result property="cpricepolicyid" column="cpricepolicyid" jdbcType="VARCHAR"/>
           <result property="cprolineid" column="cprolineid" jdbcType="VARCHAR"/>
           <result property="cproviderid" column="cproviderid" jdbcType="VARCHAR"/>
           <result property="cquoteunitid" column="cquoteunitid" jdbcType="VARCHAR"/>
           <result property="crecaddrnode" column="crecaddrnode" jdbcType="VARCHAR"/>
           <result property="creccalbodyid" column="creccalbodyid" jdbcType="VARCHAR"/>
           <result property="creceiptareaid" column="creceiptareaid" jdbcType="VARCHAR"/>
           <result property="creceiptcorpid" column="creceiptcorpid" jdbcType="VARCHAR"/>
           <result property="creceipttype" column="creceipttype" jdbcType="VARCHAR"/>
           <result property="crecwareid" column="crecwareid" jdbcType="VARCHAR"/>
           <result property="crowno" column="crowno" jdbcType="VARCHAR"/>
           <result property="csaleid" column="csaleid" jdbcType="VARCHAR"/>
           <result property="csourcebillbodyid" column="csourcebillbodyid" jdbcType="VARCHAR"/>
           <result property="csourcebillid" column="csourcebillid" jdbcType="VARCHAR"/>
           <result property="ctManagebid" column="ct_managebid" jdbcType="VARCHAR"/>
           <result property="ctManageid" column="ct_manageid" jdbcType="VARCHAR"/>
           <result property="cunitid" column="cunitid" jdbcType="VARCHAR"/>
           <result property="dconsigndate" column="dconsigndate" jdbcType="VARCHAR"/>
           <result property="ddeliverdate" column="ddeliverdate" jdbcType="VARCHAR"/>
           <result property="dr" column="dr" jdbcType="INTEGER"/>
           <result property="fbatchstatus" column="fbatchstatus" jdbcType="INTEGER"/>
           <result property="frownote" column="frownote" jdbcType="VARCHAR"/>
           <result property="frowstatus" column="frowstatus" jdbcType="INTEGER"/>
           <result property="inccontimepoint" column="inccontimepoint" jdbcType="VARCHAR"/>
           <result property="inccontimepointname" column="inccontimepointname" jdbcType="VARCHAR"/>
           <result property="incoconfclose" column="incoconfclose" jdbcType="VARCHAR"/>
           <result property="nastretprofnum" column="nastretprofnum" jdbcType="VARCHAR"/>
           <result property="nasttaldcnum" column="nasttaldcnum" jdbcType="VARCHAR"/>
           <result property="ndiscountmny" column="ndiscountmny" jdbcType="VARCHAR"/>
           <result property="ndiscountrate" column="ndiscountrate" jdbcType="VARCHAR"/>
           <result property="nexchangeotobrate" column="nexchangeotobrate" jdbcType="VARCHAR"/>
           <result property="nitemdiscountrate" column="nitemdiscountrate" jdbcType="VARCHAR"/>
           <result property="nmaxprc" column="nmaxprc" jdbcType="VARCHAR"/>
           <result property="nmny" column="nmny" jdbcType="VARCHAR"/>
           <result property="nnetprice" column="nnetprice" jdbcType="VARCHAR"/>
           <result property="nnumber" column="nnumber" jdbcType="VARCHAR"/>
           <result property="norgqtnetprc" column="norgqtnetprc" jdbcType="VARCHAR"/>
           <result property="norgqtprc" column="norgqtprc" jdbcType="VARCHAR"/>
           <result property="norgqttaxnetprc" column="norgqttaxnetprc" jdbcType="VARCHAR"/>
           <result property="norgqttaxprc" column="norgqttaxprc" jdbcType="VARCHAR"/>
           <result property="noriginalcurdiscountmny" column="noriginalcurdiscountmny" jdbcType="VARCHAR"/>
           <result property="noriginalcurmny" column="noriginalcurmny" jdbcType="VARCHAR"/>
           <result property="noriginalcurnetprice" column="noriginalcurnetprice" jdbcType="VARCHAR"/>
           <result property="noriginalcurprice" column="noriginalcurprice" jdbcType="VARCHAR"/>
           <result property="noriginalcursummny" column="noriginalcursummny" jdbcType="VARCHAR"/>
           <result property="noriginalcurtaxmny" column="noriginalcurtaxmny" jdbcType="VARCHAR"/>
           <result property="noriginalcurtaxnetprice" column="noriginalcurtaxnetprice" jdbcType="VARCHAR"/>
           <result property="noriginalcurtaxprice" column="noriginalcurtaxprice" jdbcType="VARCHAR"/>
           <result property="npacknumber" column="npacknumber" jdbcType="VARCHAR"/>
           <result property="nprice" column="nprice" jdbcType="VARCHAR"/>
           <result property="nqtnetprc" column="nqtnetprc" jdbcType="VARCHAR"/>
           <result property="nqtorgnetprc" column="nqtorgnetprc" jdbcType="VARCHAR"/>
           <result property="nqtorgprc" column="nqtorgprc" jdbcType="VARCHAR"/>
           <result property="nqtorgtaxnetprc" column="nqtorgtaxnetprc" jdbcType="VARCHAR"/>
           <result property="nqtorgtaxprc" column="nqtorgtaxprc" jdbcType="VARCHAR"/>
           <result property="nqtprc" column="nqtprc" jdbcType="VARCHAR"/>
           <result property="nqttaxnetprc" column="nqttaxnetprc" jdbcType="VARCHAR"/>
           <result property="nqttaxprc" column="nqttaxprc" jdbcType="VARCHAR"/>
           <result property="nquoteunitnum" column="nquoteunitnum" jdbcType="VARCHAR"/>
           <result property="nquoteunitrate" column="nquoteunitrate" jdbcType="VARCHAR"/>
           <result property="nretprofmny" column="nretprofmny" jdbcType="VARCHAR"/>
           <result property="nretprofnum" column="nretprofnum" jdbcType="VARCHAR"/>
           <result property="nreturntaxrate" column="nreturntaxrate" jdbcType="VARCHAR"/>
           <result property="nsummny" column="nsummny" jdbcType="VARCHAR"/>
           <result property="ntaldcmny" column="ntaldcmny" jdbcType="VARCHAR"/>
           <result property="ntaldcnum" column="ntaldcnum" jdbcType="VARCHAR"/>
           <result property="ntaxmny" column="ntaxmny" jdbcType="VARCHAR"/>
           <result property="ntaxnetprice" column="ntaxnetprice" jdbcType="VARCHAR"/>
           <result property="ntaxprice" column="ntaxprice" jdbcType="VARCHAR"/>
           <result property="ntaxrate" column="ntaxrate" jdbcType="VARCHAR"/>
           <result property="pkCorp" column="pk_corp" jdbcType="VARCHAR"/>
           <result property="refundflag" column="refundflag" jdbcType="VARCHAR"/>
           <result property="tconsigntime" column="tconsigntime" jdbcType="VARCHAR"/>
           <result property="tdelivertime" column="tdelivertime" jdbcType="VARCHAR"/>
           <result property="ts" column="ts" jdbcType="VARCHAR"/>
           <result property="veditreason" column="veditreason" jdbcType="VARCHAR"/>
           <result property="vreceiveaddress" column="vreceiveaddress" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "SoSaleorderBEntity_Base_Column_List">
        alrconfincomny
       ,alrconfinconum 
        ,bbindflag 
        ,bdericttrans 
        ,blargessflag 
        ,boosflag 
        ,breturnprofit 
        ,bsafeprice 
        ,bsupplyflag 
        ,cadvisecalbodyid 
        ,cbatchid 
        ,cbodywarehouseid 
        ,cbomorderid 
        ,cchantypeid 
        ,cconsigncorpid 
        ,ccurrencytypeid 
        ,cfactoryid 
        ,cfreezeid 
        ,cinvbasdocid 
        ,cinventoryid 
        ,cinventoryid1 
        ,clargessrowno 
        ,coperatorid 
        ,corder_bid 
        ,cpackunitid 
        ,cpricecalproc 
        ,cpriceitemid 
        ,cpriceitemtable 
        ,cpricepolicyid 
        ,cprolineid 
        ,cproviderid 
        ,cquoteunitid 
        ,crecaddrnode 
        ,creccalbodyid 
        ,creceiptareaid 
        ,creceiptcorpid 
        ,creceipttype 
        ,crecwareid 
        ,crowno 
        ,csaleid 
        ,csourcebillbodyid 
        ,csourcebillid 
        ,ct_managebid 
        ,ct_manageid 
        ,cunitid 
        ,dconsigndate 
        ,ddeliverdate 
        ,dr 
        ,fbatchstatus 
        ,frownote 
        ,frowstatus 
        ,inccontimepoint 
        ,inccontimepointname 
        ,incoconfclose 
        ,nastretprofnum 
        ,nasttaldcnum 
        ,ndiscountmny 
        ,ndiscountrate 
        ,nexchangeotobrate 
        ,nitemdiscountrate 
        ,nmaxprc 
        ,nmny 
        ,nnetprice 
        ,nnumber 
        ,norgqtnetprc 
        ,norgqtprc 
        ,norgqttaxnetprc 
        ,norgqttaxprc 
        ,noriginalcurdiscountmny 
        ,noriginalcurmny 
        ,noriginalcurnetprice 
        ,noriginalcurprice 
        ,noriginalcursummny 
        ,noriginalcurtaxmny 
        ,noriginalcurtaxnetprice 
        ,noriginalcurtaxprice 
        ,npacknumber 
        ,nprice 
        ,nqtnetprc 
        ,nqtorgnetprc 
        ,nqtorgprc 
        ,nqtorgtaxnetprc 
        ,nqtorgtaxprc 
        ,nqtprc 
        ,nqttaxnetprc 
        ,nqttaxprc 
        ,nquoteunitnum 
        ,nquoteunitrate 
        ,nretprofmny 
        ,nretprofnum 
        ,nreturntaxrate 
        ,nsummny 
        ,ntaldcmny 
        ,ntaldcnum 
        ,ntaxmny 
        ,ntaxnetprice 
        ,ntaxprice 
        ,ntaxrate 
        ,pk_corp 
        ,refundflag 
        ,tconsigntime 
        ,tdelivertime 
        ,ts 
        ,veditreason 
        ,vreceiveaddress 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-SoSaleorderBEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity">
    select
    <include refid="SoSaleorderBEntity_Base_Column_List" />
    from so_saleorder_b
    <trim prefix="where" prefixOverrides="and"> 
        <if test="alrconfincomny != null and alrconfincomny != ''"> and alrconfincomny = #{alrconfincomny} </if>
            <if test="alrconfinconum != null and alrconfinconum != ''"> and alrconfinconum = #{alrconfinconum} </if>
            <if test="bbindflag != null and bbindflag != ''"> and bbindflag = #{bbindflag} </if>
            <if test="bdericttrans != null and bdericttrans != ''"> and bdericttrans = #{bdericttrans} </if>
            <if test="blargessflag != null and blargessflag != ''"> and blargessflag = #{blargessflag} </if>
            <if test="boosflag != null and boosflag != ''"> and boosflag = #{boosflag} </if>
            <if test="breturnprofit != null and breturnprofit != ''"> and breturnprofit = #{breturnprofit} </if>
            <if test="bsafeprice != null and bsafeprice != ''"> and bsafeprice = #{bsafeprice} </if>
            <if test="bsupplyflag != null and bsupplyflag != ''"> and bsupplyflag = #{bsupplyflag} </if>
            <if test="cadvisecalbodyid != null and cadvisecalbodyid != ''"> and cadvisecalbodyid = #{cadvisecalbodyid} </if>
            <if test="cbatchid != null and cbatchid != ''"> and cbatchid = #{cbatchid} </if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> and cbodywarehouseid = #{cbodywarehouseid} </if>
            <if test="cbomorderid != null and cbomorderid != ''"> and cbomorderid = #{cbomorderid} </if>
            <if test="cchantypeid != null and cchantypeid != ''"> and cchantypeid = #{cchantypeid} </if>
            <if test="cconsigncorpid != null and cconsigncorpid != ''"> and cconsigncorpid = #{cconsigncorpid} </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and ccurrencytypeid = #{ccurrencytypeid} </if>
            <if test="cfactoryid != null and cfactoryid != ''"> and cfactoryid = #{cfactoryid} </if>
            <if test="cfreezeid != null and cfreezeid != ''"> and cfreezeid = #{cfreezeid} </if>
            <if test="cinvbasdocid != null and cinvbasdocid != ''"> and cinvbasdocid = #{cinvbasdocid} </if>
            <if test="cinventoryid != null and cinventoryid != ''"> and cinventoryid = #{cinventoryid} </if>
            <if test="cinventoryid1 != null and cinventoryid1 != ''"> and cinventoryid1 = #{cinventoryid1} </if>
            <if test="clargessrowno != null and clargessrowno != ''"> and clargessrowno = #{clargessrowno} </if>
            <if test="coperatorid != null and coperatorid != ''"> and coperatorid = #{coperatorid} </if>
            <if test="corderBid != null and corderBid != ''"> and corder_bid = #{corderBid} </if>
            <if test="cpackunitid != null and cpackunitid != ''"> and cpackunitid = #{cpackunitid} </if>
            <if test="cpricecalproc != null and cpricecalproc != ''"> and cpricecalproc = #{cpricecalproc} </if>
            <if test="cpriceitemid != null and cpriceitemid != ''"> and cpriceitemid = #{cpriceitemid} </if>
            <if test="cpriceitemtable != null and cpriceitemtable != ''"> and cpriceitemtable = #{cpriceitemtable} </if>
            <if test="cpricepolicyid != null and cpricepolicyid != ''"> and cpricepolicyid = #{cpricepolicyid} </if>
            <if test="cprolineid != null and cprolineid != ''"> and cprolineid = #{cprolineid} </if>
            <if test="cproviderid != null and cproviderid != ''"> and cproviderid = #{cproviderid} </if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> and cquoteunitid = #{cquoteunitid} </if>
            <if test="crecaddrnode != null and crecaddrnode != ''"> and crecaddrnode = #{crecaddrnode} </if>
            <if test="creccalbodyid != null and creccalbodyid != ''"> and creccalbodyid = #{creccalbodyid} </if>
            <if test="creceiptareaid != null and creceiptareaid != ''"> and creceiptareaid = #{creceiptareaid} </if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> and creceiptcorpid = #{creceiptcorpid} </if>
            <if test="creceipttype != null and creceipttype != ''"> and creceipttype = #{creceipttype} </if>
            <if test="crecwareid != null and crecwareid != ''"> and crecwareid = #{crecwareid} </if>
            <if test="crowno != null and crowno != ''"> and crowno = #{crowno} </if>
            <if test="csaleid != null and csaleid != ''"> and csaleid = #{csaleid} </if>
            <if test="csourcebillbodyid != null and csourcebillbodyid != ''"> and csourcebillbodyid = #{csourcebillbodyid} </if>
            <if test="csourcebillid != null and csourcebillid != ''"> and csourcebillid = #{csourcebillid} </if>
            <if test="ctManagebid != null and ctManagebid != ''"> and ct_managebid = #{ctManagebid} </if>
            <if test="ctManageid != null and ctManageid != ''"> and ct_manageid = #{ctManageid} </if>
            <if test="cunitid != null and cunitid != ''"> and cunitid = #{cunitid} </if>
            <if test="dconsigndate != null and dconsigndate != ''"> and dconsigndate = #{dconsigndate} </if>
            <if test="ddeliverdate != null and ddeliverdate != ''"> and ddeliverdate = #{ddeliverdate} </if>
            <if test="dr != null"> and dr = #{dr} </if>
            <if test="fbatchstatus != null"> and fbatchstatus = #{fbatchstatus} </if>
            <if test="frownote != null and frownote != ''"> and frownote = #{frownote} </if>
            <if test="frowstatus != null"> and frowstatus = #{frowstatus} </if>
            <if test="inccontimepoint != null and inccontimepoint != ''"> and inccontimepoint = #{inccontimepoint} </if>
            <if test="inccontimepointname != null and inccontimepointname != ''"> and inccontimepointname = #{inccontimepointname} </if>
            <if test="incoconfclose != null and incoconfclose != ''"> and incoconfclose = #{incoconfclose} </if>
            <if test="nastretprofnum != null and nastretprofnum != ''"> and nastretprofnum = #{nastretprofnum} </if>
            <if test="nasttaldcnum != null and nasttaldcnum != ''"> and nasttaldcnum = #{nasttaldcnum} </if>
            <if test="ndiscountmny != null and ndiscountmny != ''"> and ndiscountmny = #{ndiscountmny} </if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> and ndiscountrate = #{ndiscountrate} </if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> and nexchangeotobrate = #{nexchangeotobrate} </if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> and nitemdiscountrate = #{nitemdiscountrate} </if>
            <if test="nmaxprc != null and nmaxprc != ''"> and nmaxprc = #{nmaxprc} </if>
            <if test="nmny != null and nmny != ''"> and nmny = #{nmny} </if>
            <if test="nnetprice != null and nnetprice != ''"> and nnetprice = #{nnetprice} </if>
            <if test="nnumber != null and nnumber != ''"> and nnumber = #{nnumber} </if>
            <if test="norgqtnetprc != null and norgqtnetprc != ''"> and norgqtnetprc = #{norgqtnetprc} </if>
            <if test="norgqtprc != null and norgqtprc != ''"> and norgqtprc = #{norgqtprc} </if>
            <if test="norgqttaxnetprc != null and norgqttaxnetprc != ''"> and norgqttaxnetprc = #{norgqttaxnetprc} </if>
            <if test="norgqttaxprc != null and norgqttaxprc != ''"> and norgqttaxprc = #{norgqttaxprc} </if>
            <if test="noriginalcurdiscountmny != null and noriginalcurdiscountmny != ''"> and noriginalcurdiscountmny = #{noriginalcurdiscountmny} </if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> and noriginalcurmny = #{noriginalcurmny} </if>
            <if test="noriginalcurnetprice != null and noriginalcurnetprice != ''"> and noriginalcurnetprice = #{noriginalcurnetprice} </if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> and noriginalcurprice = #{noriginalcurprice} </if>
            <if test="noriginalcursummny != null and noriginalcursummny != ''"> and noriginalcursummny = #{noriginalcursummny} </if>
            <if test="noriginalcurtaxmny != null and noriginalcurtaxmny != ''"> and noriginalcurtaxmny = #{noriginalcurtaxmny} </if>
            <if test="noriginalcurtaxnetprice != null and noriginalcurtaxnetprice != ''"> and noriginalcurtaxnetprice = #{noriginalcurtaxnetprice} </if>
            <if test="noriginalcurtaxprice != null and noriginalcurtaxprice != ''"> and noriginalcurtaxprice = #{noriginalcurtaxprice} </if>
            <if test="npacknumber != null and npacknumber != ''"> and npacknumber = #{npacknumber} </if>
            <if test="nprice != null and nprice != ''"> and nprice = #{nprice} </if>
            <if test="nqtnetprc != null and nqtnetprc != ''"> and nqtnetprc = #{nqtnetprc} </if>
            <if test="nqtorgnetprc != null and nqtorgnetprc != ''"> and nqtorgnetprc = #{nqtorgnetprc} </if>
            <if test="nqtorgprc != null and nqtorgprc != ''"> and nqtorgprc = #{nqtorgprc} </if>
            <if test="nqtorgtaxnetprc != null and nqtorgtaxnetprc != ''"> and nqtorgtaxnetprc = #{nqtorgtaxnetprc} </if>
            <if test="nqtorgtaxprc != null and nqtorgtaxprc != ''"> and nqtorgtaxprc = #{nqtorgtaxprc} </if>
            <if test="nqtprc != null and nqtprc != ''"> and nqtprc = #{nqtprc} </if>
            <if test="nqttaxnetprc != null and nqttaxnetprc != ''"> and nqttaxnetprc = #{nqttaxnetprc} </if>
            <if test="nqttaxprc != null and nqttaxprc != ''"> and nqttaxprc = #{nqttaxprc} </if>
            <if test="nquoteunitnum != null and nquoteunitnum != ''"> and nquoteunitnum = #{nquoteunitnum} </if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> and nquoteunitrate = #{nquoteunitrate} </if>
            <if test="nretprofmny != null and nretprofmny != ''"> and nretprofmny = #{nretprofmny} </if>
            <if test="nretprofnum != null and nretprofnum != ''"> and nretprofnum = #{nretprofnum} </if>
            <if test="nreturntaxrate != null and nreturntaxrate != ''"> and nreturntaxrate = #{nreturntaxrate} </if>
            <if test="nsummny != null and nsummny != ''"> and nsummny = #{nsummny} </if>
            <if test="ntaldcmny != null and ntaldcmny != ''"> and ntaldcmny = #{ntaldcmny} </if>
            <if test="ntaldcnum != null and ntaldcnum != ''"> and ntaldcnum = #{ntaldcnum} </if>
            <if test="ntaxmny != null and ntaxmny != ''"> and ntaxmny = #{ntaxmny} </if>
            <if test="ntaxnetprice != null and ntaxnetprice != ''"> and ntaxnetprice = #{ntaxnetprice} </if>
            <if test="ntaxprice != null and ntaxprice != ''"> and ntaxprice = #{ntaxprice} </if>
            <if test="ntaxrate != null and ntaxrate != ''"> and ntaxrate = #{ntaxrate} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="refundflag != null and refundflag != ''"> and refundflag = #{refundflag} </if>
            <if test="tconsigntime != null and tconsigntime != ''"> and tconsigntime = #{tconsigntime} </if>
            <if test="tdelivertime != null and tdelivertime != ''"> and tdelivertime = #{tdelivertime} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
            <if test="veditreason != null and veditreason != ''"> and veditreason = #{veditreason} </if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''"> and vreceiveaddress = #{vreceiveaddress} </if>
    </trim>
    <if test=" sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
    
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity">
        select  count(1)   from so_saleorder_b
    <trim prefix="where" prefixOverrides="and"> 
        <if test="alrconfincomny != null and alrconfincomny != ''"> and alrconfincomny = #{alrconfincomny} </if>
            <if test="alrconfinconum != null and alrconfinconum != ''"> and alrconfinconum = #{alrconfinconum} </if>
            <if test="bbindflag != null and bbindflag != ''"> and bbindflag = #{bbindflag} </if>
            <if test="bdericttrans != null and bdericttrans != ''"> and bdericttrans = #{bdericttrans} </if>
            <if test="blargessflag != null and blargessflag != ''"> and blargessflag = #{blargessflag} </if>
            <if test="boosflag != null and boosflag != ''"> and boosflag = #{boosflag} </if>
            <if test="breturnprofit != null and breturnprofit != ''"> and breturnprofit = #{breturnprofit} </if>
            <if test="bsafeprice != null and bsafeprice != ''"> and bsafeprice = #{bsafeprice} </if>
            <if test="bsupplyflag != null and bsupplyflag != ''"> and bsupplyflag = #{bsupplyflag} </if>
            <if test="cadvisecalbodyid != null and cadvisecalbodyid != ''"> and cadvisecalbodyid = #{cadvisecalbodyid} </if>
            <if test="cbatchid != null and cbatchid != ''"> and cbatchid = #{cbatchid} </if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> and cbodywarehouseid = #{cbodywarehouseid} </if>
            <if test="cbomorderid != null and cbomorderid != ''"> and cbomorderid = #{cbomorderid} </if>
            <if test="cchantypeid != null and cchantypeid != ''"> and cchantypeid = #{cchantypeid} </if>
            <if test="cconsigncorpid != null and cconsigncorpid != ''"> and cconsigncorpid = #{cconsigncorpid} </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and ccurrencytypeid = #{ccurrencytypeid} </if>
            <if test="cfactoryid != null and cfactoryid != ''"> and cfactoryid = #{cfactoryid} </if>
            <if test="cfreezeid != null and cfreezeid != ''"> and cfreezeid = #{cfreezeid} </if>
            <if test="cinvbasdocid != null and cinvbasdocid != ''"> and cinvbasdocid = #{cinvbasdocid} </if>
            <if test="cinventoryid != null and cinventoryid != ''"> and cinventoryid = #{cinventoryid} </if>
            <if test="cinventoryid1 != null and cinventoryid1 != ''"> and cinventoryid1 = #{cinventoryid1} </if>
            <if test="clargessrowno != null and clargessrowno != ''"> and clargessrowno = #{clargessrowno} </if>
            <if test="coperatorid != null and coperatorid != ''"> and coperatorid = #{coperatorid} </if>
            <if test="corderBid != null and corderBid != ''"> and corder_bid = #{corderBid} </if>
            <if test="cpackunitid != null and cpackunitid != ''"> and cpackunitid = #{cpackunitid} </if>
            <if test="cpricecalproc != null and cpricecalproc != ''"> and cpricecalproc = #{cpricecalproc} </if>
            <if test="cpriceitemid != null and cpriceitemid != ''"> and cpriceitemid = #{cpriceitemid} </if>
            <if test="cpriceitemtable != null and cpriceitemtable != ''"> and cpriceitemtable = #{cpriceitemtable} </if>
            <if test="cpricepolicyid != null and cpricepolicyid != ''"> and cpricepolicyid = #{cpricepolicyid} </if>
            <if test="cprolineid != null and cprolineid != ''"> and cprolineid = #{cprolineid} </if>
            <if test="cproviderid != null and cproviderid != ''"> and cproviderid = #{cproviderid} </if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> and cquoteunitid = #{cquoteunitid} </if>
            <if test="crecaddrnode != null and crecaddrnode != ''"> and crecaddrnode = #{crecaddrnode} </if>
            <if test="creccalbodyid != null and creccalbodyid != ''"> and creccalbodyid = #{creccalbodyid} </if>
            <if test="creceiptareaid != null and creceiptareaid != ''"> and creceiptareaid = #{creceiptareaid} </if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> and creceiptcorpid = #{creceiptcorpid} </if>
            <if test="creceipttype != null and creceipttype != ''"> and creceipttype = #{creceipttype} </if>
            <if test="crecwareid != null and crecwareid != ''"> and crecwareid = #{crecwareid} </if>
            <if test="crowno != null and crowno != ''"> and crowno = #{crowno} </if>
            <if test="csaleid != null and csaleid != ''"> and csaleid = #{csaleid} </if>
            <if test="csourcebillbodyid != null and csourcebillbodyid != ''"> and csourcebillbodyid = #{csourcebillbodyid} </if>
            <if test="csourcebillid != null and csourcebillid != ''"> and csourcebillid = #{csourcebillid} </if>
            <if test="ctManagebid != null and ctManagebid != ''"> and ct_managebid = #{ctManagebid} </if>
            <if test="ctManageid != null and ctManageid != ''"> and ct_manageid = #{ctManageid} </if>
            <if test="cunitid != null and cunitid != ''"> and cunitid = #{cunitid} </if>
            <if test="dconsigndate != null and dconsigndate != ''"> and dconsigndate = #{dconsigndate} </if>
            <if test="ddeliverdate != null and ddeliverdate != ''"> and ddeliverdate = #{ddeliverdate} </if>
            <if test="dr != null"> and dr = #{dr} </if>
            <if test="fbatchstatus != null"> and fbatchstatus = #{fbatchstatus} </if>
            <if test="frownote != null and frownote != ''"> and frownote = #{frownote} </if>
            <if test="frowstatus != null"> and frowstatus = #{frowstatus} </if>
            <if test="inccontimepoint != null and inccontimepoint != ''"> and inccontimepoint = #{inccontimepoint} </if>
            <if test="inccontimepointname != null and inccontimepointname != ''"> and inccontimepointname = #{inccontimepointname} </if>
            <if test="incoconfclose != null and incoconfclose != ''"> and incoconfclose = #{incoconfclose} </if>
            <if test="nastretprofnum != null and nastretprofnum != ''"> and nastretprofnum = #{nastretprofnum} </if>
            <if test="nasttaldcnum != null and nasttaldcnum != ''"> and nasttaldcnum = #{nasttaldcnum} </if>
            <if test="ndiscountmny != null and ndiscountmny != ''"> and ndiscountmny = #{ndiscountmny} </if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> and ndiscountrate = #{ndiscountrate} </if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> and nexchangeotobrate = #{nexchangeotobrate} </if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> and nitemdiscountrate = #{nitemdiscountrate} </if>
            <if test="nmaxprc != null and nmaxprc != ''"> and nmaxprc = #{nmaxprc} </if>
            <if test="nmny != null and nmny != ''"> and nmny = #{nmny} </if>
            <if test="nnetprice != null and nnetprice != ''"> and nnetprice = #{nnetprice} </if>
            <if test="nnumber != null and nnumber != ''"> and nnumber = #{nnumber} </if>
            <if test="norgqtnetprc != null and norgqtnetprc != ''"> and norgqtnetprc = #{norgqtnetprc} </if>
            <if test="norgqtprc != null and norgqtprc != ''"> and norgqtprc = #{norgqtprc} </if>
            <if test="norgqttaxnetprc != null and norgqttaxnetprc != ''"> and norgqttaxnetprc = #{norgqttaxnetprc} </if>
            <if test="norgqttaxprc != null and norgqttaxprc != ''"> and norgqttaxprc = #{norgqttaxprc} </if>
            <if test="noriginalcurdiscountmny != null and noriginalcurdiscountmny != ''"> and noriginalcurdiscountmny = #{noriginalcurdiscountmny} </if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> and noriginalcurmny = #{noriginalcurmny} </if>
            <if test="noriginalcurnetprice != null and noriginalcurnetprice != ''"> and noriginalcurnetprice = #{noriginalcurnetprice} </if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> and noriginalcurprice = #{noriginalcurprice} </if>
            <if test="noriginalcursummny != null and noriginalcursummny != ''"> and noriginalcursummny = #{noriginalcursummny} </if>
            <if test="noriginalcurtaxmny != null and noriginalcurtaxmny != ''"> and noriginalcurtaxmny = #{noriginalcurtaxmny} </if>
            <if test="noriginalcurtaxnetprice != null and noriginalcurtaxnetprice != ''"> and noriginalcurtaxnetprice = #{noriginalcurtaxnetprice} </if>
            <if test="noriginalcurtaxprice != null and noriginalcurtaxprice != ''"> and noriginalcurtaxprice = #{noriginalcurtaxprice} </if>
            <if test="npacknumber != null and npacknumber != ''"> and npacknumber = #{npacknumber} </if>
            <if test="nprice != null and nprice != ''"> and nprice = #{nprice} </if>
            <if test="nqtnetprc != null and nqtnetprc != ''"> and nqtnetprc = #{nqtnetprc} </if>
            <if test="nqtorgnetprc != null and nqtorgnetprc != ''"> and nqtorgnetprc = #{nqtorgnetprc} </if>
            <if test="nqtorgprc != null and nqtorgprc != ''"> and nqtorgprc = #{nqtorgprc} </if>
            <if test="nqtorgtaxnetprc != null and nqtorgtaxnetprc != ''"> and nqtorgtaxnetprc = #{nqtorgtaxnetprc} </if>
            <if test="nqtorgtaxprc != null and nqtorgtaxprc != ''"> and nqtorgtaxprc = #{nqtorgtaxprc} </if>
            <if test="nqtprc != null and nqtprc != ''"> and nqtprc = #{nqtprc} </if>
            <if test="nqttaxnetprc != null and nqttaxnetprc != ''"> and nqttaxnetprc = #{nqttaxnetprc} </if>
            <if test="nqttaxprc != null and nqttaxprc != ''"> and nqttaxprc = #{nqttaxprc} </if>
            <if test="nquoteunitnum != null and nquoteunitnum != ''"> and nquoteunitnum = #{nquoteunitnum} </if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> and nquoteunitrate = #{nquoteunitrate} </if>
            <if test="nretprofmny != null and nretprofmny != ''"> and nretprofmny = #{nretprofmny} </if>
            <if test="nretprofnum != null and nretprofnum != ''"> and nretprofnum = #{nretprofnum} </if>
            <if test="nreturntaxrate != null and nreturntaxrate != ''"> and nreturntaxrate = #{nreturntaxrate} </if>
            <if test="nsummny != null and nsummny != ''"> and nsummny = #{nsummny} </if>
            <if test="ntaldcmny != null and ntaldcmny != ''"> and ntaldcmny = #{ntaldcmny} </if>
            <if test="ntaldcnum != null and ntaldcnum != ''"> and ntaldcnum = #{ntaldcnum} </if>
            <if test="ntaxmny != null and ntaxmny != ''"> and ntaxmny = #{ntaxmny} </if>
            <if test="ntaxnetprice != null and ntaxnetprice != ''"> and ntaxnetprice = #{ntaxnetprice} </if>
            <if test="ntaxprice != null and ntaxprice != ''"> and ntaxprice = #{ntaxprice} </if>
            <if test="ntaxrate != null and ntaxrate != ''"> and ntaxrate = #{ntaxrate} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="refundflag != null and refundflag != ''"> and refundflag = #{refundflag} </if>
            <if test="tconsigntime != null and tconsigntime != ''"> and tconsigntime = #{tconsigntime} </if>
            <if test="tdelivertime != null and tdelivertime != ''"> and tdelivertime = #{tdelivertime} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
            <if test="veditreason != null and veditreason != ''"> and veditreason = #{veditreason} </if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''"> and vreceiveaddress = #{vreceiveaddress} </if>
    </trim>
    <if test=" 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-SoSaleorderBEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity">
    select
    <include refid="SoSaleorderBEntity_Base_Column_List" />
    from so_saleorder_b
    <trim prefix="where" prefixOverrides="and"> 
        <if test="alrconfincomny != null and alrconfincomny != ''"> and alrconfincomny like concat('%',#{alrconfincomny},'%') </if>
            <if test="alrconfinconum != null and alrconfinconum != ''"> and alrconfinconum like concat('%',#{alrconfinconum},'%') </if>
            <if test="bbindflag != null and bbindflag != ''"> and bbindflag like concat('%',#{bbindflag},'%') </if>
            <if test="bdericttrans != null and bdericttrans != ''"> and bdericttrans like concat('%',#{bdericttrans},'%') </if>
            <if test="blargessflag != null and blargessflag != ''"> and blargessflag like concat('%',#{blargessflag},'%') </if>
            <if test="boosflag != null and boosflag != ''"> and boosflag like concat('%',#{boosflag},'%') </if>
            <if test="breturnprofit != null and breturnprofit != ''"> and breturnprofit like concat('%',#{breturnprofit},'%') </if>
            <if test="bsafeprice != null and bsafeprice != ''"> and bsafeprice like concat('%',#{bsafeprice},'%') </if>
            <if test="bsupplyflag != null and bsupplyflag != ''"> and bsupplyflag like concat('%',#{bsupplyflag},'%') </if>
            <if test="cadvisecalbodyid != null and cadvisecalbodyid != ''"> and cadvisecalbodyid like concat('%',#{cadvisecalbodyid},'%') </if>
            <if test="cbatchid != null and cbatchid != ''"> and cbatchid like concat('%',#{cbatchid},'%') </if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> and cbodywarehouseid like concat('%',#{cbodywarehouseid},'%') </if>
            <if test="cbomorderid != null and cbomorderid != ''"> and cbomorderid like concat('%',#{cbomorderid},'%') </if>
            <if test="cchantypeid != null and cchantypeid != ''"> and cchantypeid like concat('%',#{cchantypeid},'%') </if>
            <if test="cconsigncorpid != null and cconsigncorpid != ''"> and cconsigncorpid like concat('%',#{cconsigncorpid},'%') </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and ccurrencytypeid like concat('%',#{ccurrencytypeid},'%') </if>
            <if test="cfactoryid != null and cfactoryid != ''"> and cfactoryid like concat('%',#{cfactoryid},'%') </if>
            <if test="cfreezeid != null and cfreezeid != ''"> and cfreezeid like concat('%',#{cfreezeid},'%') </if>
            <if test="cinvbasdocid != null and cinvbasdocid != ''"> and cinvbasdocid like concat('%',#{cinvbasdocid},'%') </if>
            <if test="cinventoryid != null and cinventoryid != ''"> and cinventoryid like concat('%',#{cinventoryid},'%') </if>
            <if test="cinventoryid1 != null and cinventoryid1 != ''"> and cinventoryid1 like concat('%',#{cinventoryid1},'%') </if>
            <if test="clargessrowno != null and clargessrowno != ''"> and clargessrowno like concat('%',#{clargessrowno},'%') </if>
            <if test="coperatorid != null and coperatorid != ''"> and coperatorid like concat('%',#{coperatorid},'%') </if>
            <if test="corderBid != null and corderBid != ''"> and corder_bid like concat('%',#{corderBid},'%') </if>
            <if test="cpackunitid != null and cpackunitid != ''"> and cpackunitid like concat('%',#{cpackunitid},'%') </if>
            <if test="cpricecalproc != null and cpricecalproc != ''"> and cpricecalproc like concat('%',#{cpricecalproc},'%') </if>
            <if test="cpriceitemid != null and cpriceitemid != ''"> and cpriceitemid like concat('%',#{cpriceitemid},'%') </if>
            <if test="cpriceitemtable != null and cpriceitemtable != ''"> and cpriceitemtable like concat('%',#{cpriceitemtable},'%') </if>
            <if test="cpricepolicyid != null and cpricepolicyid != ''"> and cpricepolicyid like concat('%',#{cpricepolicyid},'%') </if>
            <if test="cprolineid != null and cprolineid != ''"> and cprolineid like concat('%',#{cprolineid},'%') </if>
            <if test="cproviderid != null and cproviderid != ''"> and cproviderid like concat('%',#{cproviderid},'%') </if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> and cquoteunitid like concat('%',#{cquoteunitid},'%') </if>
            <if test="crecaddrnode != null and crecaddrnode != ''"> and crecaddrnode like concat('%',#{crecaddrnode},'%') </if>
            <if test="creccalbodyid != null and creccalbodyid != ''"> and creccalbodyid like concat('%',#{creccalbodyid},'%') </if>
            <if test="creceiptareaid != null and creceiptareaid != ''"> and creceiptareaid like concat('%',#{creceiptareaid},'%') </if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> and creceiptcorpid like concat('%',#{creceiptcorpid},'%') </if>
            <if test="creceipttype != null and creceipttype != ''"> and creceipttype like concat('%',#{creceipttype},'%') </if>
            <if test="crecwareid != null and crecwareid != ''"> and crecwareid like concat('%',#{crecwareid},'%') </if>
            <if test="crowno != null and crowno != ''"> and crowno like concat('%',#{crowno},'%') </if>
            <if test="csaleid != null and csaleid != ''"> and csaleid like concat('%',#{csaleid},'%') </if>
            <if test="csourcebillbodyid != null and csourcebillbodyid != ''"> and csourcebillbodyid like concat('%',#{csourcebillbodyid},'%') </if>
            <if test="csourcebillid != null and csourcebillid != ''"> and csourcebillid like concat('%',#{csourcebillid},'%') </if>
            <if test="ctManagebid != null and ctManagebid != ''"> and ct_managebid like concat('%',#{ctManagebid},'%') </if>
            <if test="ctManageid != null and ctManageid != ''"> and ct_manageid like concat('%',#{ctManageid},'%') </if>
            <if test="cunitid != null and cunitid != ''"> and cunitid like concat('%',#{cunitid},'%') </if>
            <if test="dconsigndate != null and dconsigndate != ''"> and dconsigndate like concat('%',#{dconsigndate},'%') </if>
            <if test="ddeliverdate != null and ddeliverdate != ''"> and ddeliverdate like concat('%',#{ddeliverdate},'%') </if>
            <if test="dr != null"> and dr like concat('%',#{dr},'%') </if>
            <if test="fbatchstatus != null"> and fbatchstatus like concat('%',#{fbatchstatus},'%') </if>
            <if test="frownote != null and frownote != ''"> and frownote like concat('%',#{frownote},'%') </if>
            <if test="frowstatus != null"> and frowstatus like concat('%',#{frowstatus},'%') </if>
            <if test="inccontimepoint != null and inccontimepoint != ''"> and inccontimepoint like concat('%',#{inccontimepoint},'%') </if>
            <if test="inccontimepointname != null and inccontimepointname != ''"> and inccontimepointname like concat('%',#{inccontimepointname},'%') </if>
            <if test="incoconfclose != null and incoconfclose != ''"> and incoconfclose like concat('%',#{incoconfclose},'%') </if>
            <if test="nastretprofnum != null and nastretprofnum != ''"> and nastretprofnum like concat('%',#{nastretprofnum},'%') </if>
            <if test="nasttaldcnum != null and nasttaldcnum != ''"> and nasttaldcnum like concat('%',#{nasttaldcnum},'%') </if>
            <if test="ndiscountmny != null and ndiscountmny != ''"> and ndiscountmny like concat('%',#{ndiscountmny},'%') </if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> and ndiscountrate like concat('%',#{ndiscountrate},'%') </if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> and nexchangeotobrate like concat('%',#{nexchangeotobrate},'%') </if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> and nitemdiscountrate like concat('%',#{nitemdiscountrate},'%') </if>
            <if test="nmaxprc != null and nmaxprc != ''"> and nmaxprc like concat('%',#{nmaxprc},'%') </if>
            <if test="nmny != null and nmny != ''"> and nmny like concat('%',#{nmny},'%') </if>
            <if test="nnetprice != null and nnetprice != ''"> and nnetprice like concat('%',#{nnetprice},'%') </if>
            <if test="nnumber != null and nnumber != ''"> and nnumber like concat('%',#{nnumber},'%') </if>
            <if test="norgqtnetprc != null and norgqtnetprc != ''"> and norgqtnetprc like concat('%',#{norgqtnetprc},'%') </if>
            <if test="norgqtprc != null and norgqtprc != ''"> and norgqtprc like concat('%',#{norgqtprc},'%') </if>
            <if test="norgqttaxnetprc != null and norgqttaxnetprc != ''"> and norgqttaxnetprc like concat('%',#{norgqttaxnetprc},'%') </if>
            <if test="norgqttaxprc != null and norgqttaxprc != ''"> and norgqttaxprc like concat('%',#{norgqttaxprc},'%') </if>
            <if test="noriginalcurdiscountmny != null and noriginalcurdiscountmny != ''"> and noriginalcurdiscountmny like concat('%',#{noriginalcurdiscountmny},'%') </if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> and noriginalcurmny like concat('%',#{noriginalcurmny},'%') </if>
            <if test="noriginalcurnetprice != null and noriginalcurnetprice != ''"> and noriginalcurnetprice like concat('%',#{noriginalcurnetprice},'%') </if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> and noriginalcurprice like concat('%',#{noriginalcurprice},'%') </if>
            <if test="noriginalcursummny != null and noriginalcursummny != ''"> and noriginalcursummny like concat('%',#{noriginalcursummny},'%') </if>
            <if test="noriginalcurtaxmny != null and noriginalcurtaxmny != ''"> and noriginalcurtaxmny like concat('%',#{noriginalcurtaxmny},'%') </if>
            <if test="noriginalcurtaxnetprice != null and noriginalcurtaxnetprice != ''"> and noriginalcurtaxnetprice like concat('%',#{noriginalcurtaxnetprice},'%') </if>
            <if test="noriginalcurtaxprice != null and noriginalcurtaxprice != ''"> and noriginalcurtaxprice like concat('%',#{noriginalcurtaxprice},'%') </if>
            <if test="npacknumber != null and npacknumber != ''"> and npacknumber like concat('%',#{npacknumber},'%') </if>
            <if test="nprice != null and nprice != ''"> and nprice like concat('%',#{nprice},'%') </if>
            <if test="nqtnetprc != null and nqtnetprc != ''"> and nqtnetprc like concat('%',#{nqtnetprc},'%') </if>
            <if test="nqtorgnetprc != null and nqtorgnetprc != ''"> and nqtorgnetprc like concat('%',#{nqtorgnetprc},'%') </if>
            <if test="nqtorgprc != null and nqtorgprc != ''"> and nqtorgprc like concat('%',#{nqtorgprc},'%') </if>
            <if test="nqtorgtaxnetprc != null and nqtorgtaxnetprc != ''"> and nqtorgtaxnetprc like concat('%',#{nqtorgtaxnetprc},'%') </if>
            <if test="nqtorgtaxprc != null and nqtorgtaxprc != ''"> and nqtorgtaxprc like concat('%',#{nqtorgtaxprc},'%') </if>
            <if test="nqtprc != null and nqtprc != ''"> and nqtprc like concat('%',#{nqtprc},'%') </if>
            <if test="nqttaxnetprc != null and nqttaxnetprc != ''"> and nqttaxnetprc like concat('%',#{nqttaxnetprc},'%') </if>
            <if test="nqttaxprc != null and nqttaxprc != ''"> and nqttaxprc like concat('%',#{nqttaxprc},'%') </if>
            <if test="nquoteunitnum != null and nquoteunitnum != ''"> and nquoteunitnum like concat('%',#{nquoteunitnum},'%') </if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> and nquoteunitrate like concat('%',#{nquoteunitrate},'%') </if>
            <if test="nretprofmny != null and nretprofmny != ''"> and nretprofmny like concat('%',#{nretprofmny},'%') </if>
            <if test="nretprofnum != null and nretprofnum != ''"> and nretprofnum like concat('%',#{nretprofnum},'%') </if>
            <if test="nreturntaxrate != null and nreturntaxrate != ''"> and nreturntaxrate like concat('%',#{nreturntaxrate},'%') </if>
            <if test="nsummny != null and nsummny != ''"> and nsummny like concat('%',#{nsummny},'%') </if>
            <if test="ntaldcmny != null and ntaldcmny != ''"> and ntaldcmny like concat('%',#{ntaldcmny},'%') </if>
            <if test="ntaldcnum != null and ntaldcnum != ''"> and ntaldcnum like concat('%',#{ntaldcnum},'%') </if>
            <if test="ntaxmny != null and ntaxmny != ''"> and ntaxmny like concat('%',#{ntaxmny},'%') </if>
            <if test="ntaxnetprice != null and ntaxnetprice != ''"> and ntaxnetprice like concat('%',#{ntaxnetprice},'%') </if>
            <if test="ntaxprice != null and ntaxprice != ''"> and ntaxprice like concat('%',#{ntaxprice},'%') </if>
            <if test="ntaxrate != null and ntaxrate != ''"> and ntaxrate like concat('%',#{ntaxrate},'%') </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp like concat('%',#{pkCorp},'%') </if>
            <if test="refundflag != null and refundflag != ''"> and refundflag like concat('%',#{refundflag},'%') </if>
            <if test="tconsigntime != null and tconsigntime != ''"> and tconsigntime like concat('%',#{tconsigntime},'%') </if>
            <if test="tdelivertime != null and tdelivertime != ''"> and tdelivertime like concat('%',#{tdelivertime},'%') </if>
            <if test="ts != null and ts != ''"> and ts like concat('%',#{ts},'%') </if>
            <if test="veditreason != null and veditreason != ''"> and veditreason like concat('%',#{veditreason},'%') </if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''"> and vreceiveaddress like concat('%',#{vreceiveaddress},'%') </if>
    </trim>
    <if test=" 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="SoSaleorderBentity_list_or" resultMap="get-SoSaleorderBEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity">
    select
    <include refid="SoSaleorderBEntity_Base_Column_List" />
    from so_saleorder_b
    <trim prefix="where" prefixOverrides="and"> 
         <if test="alrconfincomny != null and alrconfincomny != ''"> or alrconfincomny = #{alrconfincomny} </if>
             <if test="alrconfinconum != null and alrconfinconum != ''"> or alrconfinconum = #{alrconfinconum} </if>
             <if test="bbindflag != null and bbindflag != ''"> or bbindflag = #{bbindflag} </if>
             <if test="bdericttrans != null and bdericttrans != ''"> or bdericttrans = #{bdericttrans} </if>
             <if test="blargessflag != null and blargessflag != ''"> or blargessflag = #{blargessflag} </if>
             <if test="boosflag != null and boosflag != ''"> or boosflag = #{boosflag} </if>
             <if test="breturnprofit != null and breturnprofit != ''"> or breturnprofit = #{breturnprofit} </if>
             <if test="bsafeprice != null and bsafeprice != ''"> or bsafeprice = #{bsafeprice} </if>
             <if test="bsupplyflag != null and bsupplyflag != ''"> or bsupplyflag = #{bsupplyflag} </if>
             <if test="cadvisecalbodyid != null and cadvisecalbodyid != ''"> or cadvisecalbodyid = #{cadvisecalbodyid} </if>
             <if test="cbatchid != null and cbatchid != ''"> or cbatchid = #{cbatchid} </if>
             <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> or cbodywarehouseid = #{cbodywarehouseid} </if>
             <if test="cbomorderid != null and cbomorderid != ''"> or cbomorderid = #{cbomorderid} </if>
             <if test="cchantypeid != null and cchantypeid != ''"> or cchantypeid = #{cchantypeid} </if>
             <if test="cconsigncorpid != null and cconsigncorpid != ''"> or cconsigncorpid = #{cconsigncorpid} </if>
             <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> or ccurrencytypeid = #{ccurrencytypeid} </if>
             <if test="cfactoryid != null and cfactoryid != ''"> or cfactoryid = #{cfactoryid} </if>
             <if test="cfreezeid != null and cfreezeid != ''"> or cfreezeid = #{cfreezeid} </if>
             <if test="cinvbasdocid != null and cinvbasdocid != ''"> or cinvbasdocid = #{cinvbasdocid} </if>
             <if test="cinventoryid != null and cinventoryid != ''"> or cinventoryid = #{cinventoryid} </if>
             <if test="cinventoryid1 != null and cinventoryid1 != ''"> or cinventoryid1 = #{cinventoryid1} </if>
             <if test="clargessrowno != null and clargessrowno != ''"> or clargessrowno = #{clargessrowno} </if>
             <if test="coperatorid != null and coperatorid != ''"> or coperatorid = #{coperatorid} </if>
             <if test="corderBid != null and corderBid != ''"> or corder_bid = #{corderBid} </if>
             <if test="cpackunitid != null and cpackunitid != ''"> or cpackunitid = #{cpackunitid} </if>
             <if test="cpricecalproc != null and cpricecalproc != ''"> or cpricecalproc = #{cpricecalproc} </if>
             <if test="cpriceitemid != null and cpriceitemid != ''"> or cpriceitemid = #{cpriceitemid} </if>
             <if test="cpriceitemtable != null and cpriceitemtable != ''"> or cpriceitemtable = #{cpriceitemtable} </if>
             <if test="cpricepolicyid != null and cpricepolicyid != ''"> or cpricepolicyid = #{cpricepolicyid} </if>
             <if test="cprolineid != null and cprolineid != ''"> or cprolineid = #{cprolineid} </if>
             <if test="cproviderid != null and cproviderid != ''"> or cproviderid = #{cproviderid} </if>
             <if test="cquoteunitid != null and cquoteunitid != ''"> or cquoteunitid = #{cquoteunitid} </if>
             <if test="crecaddrnode != null and crecaddrnode != ''"> or crecaddrnode = #{crecaddrnode} </if>
             <if test="creccalbodyid != null and creccalbodyid != ''"> or creccalbodyid = #{creccalbodyid} </if>
             <if test="creceiptareaid != null and creceiptareaid != ''"> or creceiptareaid = #{creceiptareaid} </if>
             <if test="creceiptcorpid != null and creceiptcorpid != ''"> or creceiptcorpid = #{creceiptcorpid} </if>
             <if test="creceipttype != null and creceipttype != ''"> or creceipttype = #{creceipttype} </if>
             <if test="crecwareid != null and crecwareid != ''"> or crecwareid = #{crecwareid} </if>
             <if test="crowno != null and crowno != ''"> or crowno = #{crowno} </if>
             <if test="csaleid != null and csaleid != ''"> or csaleid = #{csaleid} </if>
             <if test="csourcebillbodyid != null and csourcebillbodyid != ''"> or csourcebillbodyid = #{csourcebillbodyid} </if>
             <if test="csourcebillid != null and csourcebillid != ''"> or csourcebillid = #{csourcebillid} </if>
             <if test="ctManagebid != null and ctManagebid != ''"> or ct_managebid = #{ctManagebid} </if>
             <if test="ctManageid != null and ctManageid != ''"> or ct_manageid = #{ctManageid} </if>
             <if test="cunitid != null and cunitid != ''"> or cunitid = #{cunitid} </if>
             <if test="dconsigndate != null and dconsigndate != ''"> or dconsigndate = #{dconsigndate} </if>
             <if test="ddeliverdate != null and ddeliverdate != ''"> or ddeliverdate = #{ddeliverdate} </if>
             <if test="dr != null"> or dr = #{dr} </if>
             <if test="fbatchstatus != null"> or fbatchstatus = #{fbatchstatus} </if>
             <if test="frownote != null and frownote != ''"> or frownote = #{frownote} </if>
             <if test="frowstatus != null"> or frowstatus = #{frowstatus} </if>
             <if test="inccontimepoint != null and inccontimepoint != ''"> or inccontimepoint = #{inccontimepoint} </if>
             <if test="inccontimepointname != null and inccontimepointname != ''"> or inccontimepointname = #{inccontimepointname} </if>
             <if test="incoconfclose != null and incoconfclose != ''"> or incoconfclose = #{incoconfclose} </if>
             <if test="nastretprofnum != null and nastretprofnum != ''"> or nastretprofnum = #{nastretprofnum} </if>
             <if test="nasttaldcnum != null and nasttaldcnum != ''"> or nasttaldcnum = #{nasttaldcnum} </if>
             <if test="ndiscountmny != null and ndiscountmny != ''"> or ndiscountmny = #{ndiscountmny} </if>
             <if test="ndiscountrate != null and ndiscountrate != ''"> or ndiscountrate = #{ndiscountrate} </if>
             <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> or nexchangeotobrate = #{nexchangeotobrate} </if>
             <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> or nitemdiscountrate = #{nitemdiscountrate} </if>
             <if test="nmaxprc != null and nmaxprc != ''"> or nmaxprc = #{nmaxprc} </if>
             <if test="nmny != null and nmny != ''"> or nmny = #{nmny} </if>
             <if test="nnetprice != null and nnetprice != ''"> or nnetprice = #{nnetprice} </if>
             <if test="nnumber != null and nnumber != ''"> or nnumber = #{nnumber} </if>
             <if test="norgqtnetprc != null and norgqtnetprc != ''"> or norgqtnetprc = #{norgqtnetprc} </if>
             <if test="norgqtprc != null and norgqtprc != ''"> or norgqtprc = #{norgqtprc} </if>
             <if test="norgqttaxnetprc != null and norgqttaxnetprc != ''"> or norgqttaxnetprc = #{norgqttaxnetprc} </if>
             <if test="norgqttaxprc != null and norgqttaxprc != ''"> or norgqttaxprc = #{norgqttaxprc} </if>
             <if test="noriginalcurdiscountmny != null and noriginalcurdiscountmny != ''"> or noriginalcurdiscountmny = #{noriginalcurdiscountmny} </if>
             <if test="noriginalcurmny != null and noriginalcurmny != ''"> or noriginalcurmny = #{noriginalcurmny} </if>
             <if test="noriginalcurnetprice != null and noriginalcurnetprice != ''"> or noriginalcurnetprice = #{noriginalcurnetprice} </if>
             <if test="noriginalcurprice != null and noriginalcurprice != ''"> or noriginalcurprice = #{noriginalcurprice} </if>
             <if test="noriginalcursummny != null and noriginalcursummny != ''"> or noriginalcursummny = #{noriginalcursummny} </if>
             <if test="noriginalcurtaxmny != null and noriginalcurtaxmny != ''"> or noriginalcurtaxmny = #{noriginalcurtaxmny} </if>
             <if test="noriginalcurtaxnetprice != null and noriginalcurtaxnetprice != ''"> or noriginalcurtaxnetprice = #{noriginalcurtaxnetprice} </if>
             <if test="noriginalcurtaxprice != null and noriginalcurtaxprice != ''"> or noriginalcurtaxprice = #{noriginalcurtaxprice} </if>
             <if test="npacknumber != null and npacknumber != ''"> or npacknumber = #{npacknumber} </if>
             <if test="nprice != null and nprice != ''"> or nprice = #{nprice} </if>
             <if test="nqtnetprc != null and nqtnetprc != ''"> or nqtnetprc = #{nqtnetprc} </if>
             <if test="nqtorgnetprc != null and nqtorgnetprc != ''"> or nqtorgnetprc = #{nqtorgnetprc} </if>
             <if test="nqtorgprc != null and nqtorgprc != ''"> or nqtorgprc = #{nqtorgprc} </if>
             <if test="nqtorgtaxnetprc != null and nqtorgtaxnetprc != ''"> or nqtorgtaxnetprc = #{nqtorgtaxnetprc} </if>
             <if test="nqtorgtaxprc != null and nqtorgtaxprc != ''"> or nqtorgtaxprc = #{nqtorgtaxprc} </if>
             <if test="nqtprc != null and nqtprc != ''"> or nqtprc = #{nqtprc} </if>
             <if test="nqttaxnetprc != null and nqttaxnetprc != ''"> or nqttaxnetprc = #{nqttaxnetprc} </if>
             <if test="nqttaxprc != null and nqttaxprc != ''"> or nqttaxprc = #{nqttaxprc} </if>
             <if test="nquoteunitnum != null and nquoteunitnum != ''"> or nquoteunitnum = #{nquoteunitnum} </if>
             <if test="nquoteunitrate != null and nquoteunitrate != ''"> or nquoteunitrate = #{nquoteunitrate} </if>
             <if test="nretprofmny != null and nretprofmny != ''"> or nretprofmny = #{nretprofmny} </if>
             <if test="nretprofnum != null and nretprofnum != ''"> or nretprofnum = #{nretprofnum} </if>
             <if test="nreturntaxrate != null and nreturntaxrate != ''"> or nreturntaxrate = #{nreturntaxrate} </if>
             <if test="nsummny != null and nsummny != ''"> or nsummny = #{nsummny} </if>
             <if test="ntaldcmny != null and ntaldcmny != ''"> or ntaldcmny = #{ntaldcmny} </if>
             <if test="ntaldcnum != null and ntaldcnum != ''"> or ntaldcnum = #{ntaldcnum} </if>
             <if test="ntaxmny != null and ntaxmny != ''"> or ntaxmny = #{ntaxmny} </if>
             <if test="ntaxnetprice != null and ntaxnetprice != ''"> or ntaxnetprice = #{ntaxnetprice} </if>
             <if test="ntaxprice != null and ntaxprice != ''"> or ntaxprice = #{ntaxprice} </if>
             <if test="ntaxrate != null and ntaxrate != ''"> or ntaxrate = #{ntaxrate} </if>
             <if test="pkCorp != null and pkCorp != ''"> or pk_corp = #{pkCorp} </if>
             <if test="refundflag != null and refundflag != ''"> or refundflag = #{refundflag} </if>
             <if test="tconsigntime != null and tconsigntime != ''"> or tconsigntime = #{tconsigntime} </if>
             <if test="tdelivertime != null and tdelivertime != ''"> or tdelivertime = #{tdelivertime} </if>
             <if test="ts != null and ts != ''"> or ts = #{ts} </if>
             <if test="veditreason != null and veditreason != ''"> or veditreason = #{veditreason} </if>
             <if test="vreceiveaddress != null and vreceiveaddress != ''"> or vreceiveaddress = #{vreceiveaddress} </if>
    </trim>
    <if test=" sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>

<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity" keyProperty="corderBid" useGeneratedKeys="true">
    insert into so_saleorder_b(
  <trim suffix="" suffixOverrides=",">
       <if test="alrconfincomny != null and alrconfincomny != ''"> alrconfincomny , </if>
            <if test="alrconfinconum != null and alrconfinconum != ''"> alrconfinconum , </if>
            <if test="bbindflag != null and bbindflag != ''"> bbindflag , </if>
            <if test="bdericttrans != null and bdericttrans != ''"> bdericttrans , </if>
            <if test="blargessflag != null and blargessflag != ''"> blargessflag , </if>
            <if test="boosflag != null and boosflag != ''"> boosflag , </if>
            <if test="breturnprofit != null and breturnprofit != ''"> breturnprofit , </if>
            <if test="bsafeprice != null and bsafeprice != ''"> bsafeprice , </if>
            <if test="bsupplyflag != null and bsupplyflag != ''"> bsupplyflag , </if>
            <if test="cadvisecalbodyid != null and cadvisecalbodyid != ''"> cadvisecalbodyid , </if>
            <if test="cbatchid != null and cbatchid != ''"> cbatchid , </if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> cbodywarehouseid , </if>
            <if test="cbomorderid != null and cbomorderid != ''"> cbomorderid , </if>
            <if test="cchantypeid != null and cchantypeid != ''"> cchantypeid , </if>
            <if test="cconsigncorpid != null and cconsigncorpid != ''"> cconsigncorpid , </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> ccurrencytypeid , </if>
            <if test="cfactoryid != null and cfactoryid != ''"> cfactoryid , </if>
            <if test="cfreezeid != null and cfreezeid != ''"> cfreezeid , </if>
            <if test="cinvbasdocid != null and cinvbasdocid != ''"> cinvbasdocid , </if>
            <if test="cinventoryid != null and cinventoryid != ''"> cinventoryid , </if>
            <if test="cinventoryid1 != null and cinventoryid1 != ''"> cinventoryid1 , </if>
            <if test="clargessrowno != null and clargessrowno != ''"> clargessrowno , </if>
            <if test="coperatorid != null and coperatorid != ''"> coperatorid , </if>
            <if test="corderBid != null and corderBid != ''"> corder_bid , </if>
            <if test="cpackunitid != null and cpackunitid != ''"> cpackunitid , </if>
            <if test="cpricecalproc != null and cpricecalproc != ''"> cpricecalproc , </if>
            <if test="cpriceitemid != null and cpriceitemid != ''"> cpriceitemid , </if>
            <if test="cpriceitemtable != null and cpriceitemtable != ''"> cpriceitemtable , </if>
            <if test="cpricepolicyid != null and cpricepolicyid != ''"> cpricepolicyid , </if>
            <if test="cprolineid != null and cprolineid != ''"> cprolineid , </if>
            <if test="cproviderid != null and cproviderid != ''"> cproviderid , </if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> cquoteunitid , </if>
            <if test="crecaddrnode != null and crecaddrnode != ''"> crecaddrnode , </if>
            <if test="creccalbodyid != null and creccalbodyid != ''"> creccalbodyid , </if>
            <if test="creceiptareaid != null and creceiptareaid != ''"> creceiptareaid , </if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> creceiptcorpid , </if>
            <if test="creceipttype != null and creceipttype != ''"> creceipttype , </if>
            <if test="crecwareid != null and crecwareid != ''"> crecwareid , </if>
            <if test="crowno != null and crowno != ''"> crowno , </if>
            <if test="csaleid != null and csaleid != ''"> csaleid , </if>
            <if test="csourcebillbodyid != null and csourcebillbodyid != ''"> csourcebillbodyid , </if>
            <if test="csourcebillid != null and csourcebillid != ''"> csourcebillid , </if>
            <if test="ctManagebid != null and ctManagebid != ''"> ct_managebid , </if>
            <if test="ctManageid != null and ctManageid != ''"> ct_manageid , </if>
            <if test="cunitid != null and cunitid != ''"> cunitid , </if>
            <if test="dconsigndate != null and dconsigndate != ''"> dconsigndate , </if>
            <if test="ddeliverdate != null and ddeliverdate != ''"> ddeliverdate , </if>
            <if test="dr != null"> dr , </if>
            <if test="fbatchstatus != null"> fbatchstatus , </if>
            <if test="frownote != null and frownote != ''"> frownote , </if>
            <if test="frowstatus != null"> frowstatus , </if>
            <if test="inccontimepoint != null and inccontimepoint != ''"> inccontimepoint , </if>
            <if test="inccontimepointname != null and inccontimepointname != ''"> inccontimepointname , </if>
            <if test="incoconfclose != null and incoconfclose != ''"> incoconfclose , </if>
            <if test="nastretprofnum != null and nastretprofnum != ''"> nastretprofnum , </if>
            <if test="nasttaldcnum != null and nasttaldcnum != ''"> nasttaldcnum , </if>
            <if test="ndiscountmny != null and ndiscountmny != ''"> ndiscountmny , </if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> ndiscountrate , </if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> nexchangeotobrate , </if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> nitemdiscountrate , </if>
            <if test="nmaxprc != null and nmaxprc != ''"> nmaxprc , </if>
            <if test="nmny != null and nmny != ''"> nmny , </if>
            <if test="nnetprice != null and nnetprice != ''"> nnetprice , </if>
            <if test="nnumber != null and nnumber != ''"> nnumber , </if>
            <if test="norgqtnetprc != null and norgqtnetprc != ''"> norgqtnetprc , </if>
            <if test="norgqtprc != null and norgqtprc != ''"> norgqtprc , </if>
            <if test="norgqttaxnetprc != null and norgqttaxnetprc != ''"> norgqttaxnetprc , </if>
            <if test="norgqttaxprc != null and norgqttaxprc != ''"> norgqttaxprc , </if>
            <if test="noriginalcurdiscountmny != null and noriginalcurdiscountmny != ''"> noriginalcurdiscountmny , </if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> noriginalcurmny , </if>
            <if test="noriginalcurnetprice != null and noriginalcurnetprice != ''"> noriginalcurnetprice , </if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> noriginalcurprice , </if>
            <if test="noriginalcursummny != null and noriginalcursummny != ''"> noriginalcursummny , </if>
            <if test="noriginalcurtaxmny != null and noriginalcurtaxmny != ''"> noriginalcurtaxmny , </if>
            <if test="noriginalcurtaxnetprice != null and noriginalcurtaxnetprice != ''"> noriginalcurtaxnetprice , </if>
            <if test="noriginalcurtaxprice != null and noriginalcurtaxprice != ''"> noriginalcurtaxprice , </if>
            <if test="npacknumber != null and npacknumber != ''"> npacknumber , </if>
            <if test="nprice != null and nprice != ''"> nprice , </if>
            <if test="nqtnetprc != null and nqtnetprc != ''"> nqtnetprc , </if>
            <if test="nqtorgnetprc != null and nqtorgnetprc != ''"> nqtorgnetprc , </if>
            <if test="nqtorgprc != null and nqtorgprc != ''"> nqtorgprc , </if>
            <if test="nqtorgtaxnetprc != null and nqtorgtaxnetprc != ''"> nqtorgtaxnetprc , </if>
            <if test="nqtorgtaxprc != null and nqtorgtaxprc != ''"> nqtorgtaxprc , </if>
            <if test="nqtprc != null and nqtprc != ''"> nqtprc , </if>
            <if test="nqttaxnetprc != null and nqttaxnetprc != ''"> nqttaxnetprc , </if>
            <if test="nqttaxprc != null and nqttaxprc != ''"> nqttaxprc , </if>
            <if test="nquoteunitnum != null and nquoteunitnum != ''"> nquoteunitnum , </if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> nquoteunitrate , </if>
            <if test="nretprofmny != null and nretprofmny != ''"> nretprofmny , </if>
            <if test="nretprofnum != null and nretprofnum != ''"> nretprofnum , </if>
            <if test="nreturntaxrate != null and nreturntaxrate != ''"> nreturntaxrate , </if>
            <if test="nsummny != null and nsummny != ''"> nsummny , </if>
            <if test="ntaldcmny != null and ntaldcmny != ''"> ntaldcmny , </if>
            <if test="ntaldcnum != null and ntaldcnum != ''"> ntaldcnum , </if>
            <if test="ntaxmny != null and ntaxmny != ''"> ntaxmny , </if>
            <if test="ntaxnetprice != null and ntaxnetprice != ''"> ntaxnetprice , </if>
            <if test="ntaxprice != null and ntaxprice != ''"> ntaxprice , </if>
            <if test="ntaxrate != null and ntaxrate != ''"> ntaxrate , </if>
            <if test="pkCorp != null and pkCorp != ''"> pk_corp , </if>
            <if test="refundflag != null and refundflag != ''"> refundflag , </if>
            <if test="tconsigntime != null and tconsigntime != ''"> tconsigntime , </if>
            <if test="tdelivertime != null and tdelivertime != ''"> tdelivertime , </if>
            <if test="ts != null and ts != ''"> ts , </if>
            <if test="veditreason != null and veditreason != ''"> veditreason , </if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''"> vreceiveaddress , </if>
            <if test="sorts == null ">sorts,</if>
    <if test="sts == null ">sts,</if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <if test="alrconfincomny != null and alrconfincomny != ''"> #{alrconfincomny} ,</if>
            <if test="alrconfinconum != null and alrconfinconum != ''"> #{alrconfinconum} ,</if>
            <if test="bbindflag != null and bbindflag != ''"> #{bbindflag} ,</if>
            <if test="bdericttrans != null and bdericttrans != ''"> #{bdericttrans} ,</if>
            <if test="blargessflag != null and blargessflag != ''"> #{blargessflag} ,</if>
            <if test="boosflag != null and boosflag != ''"> #{boosflag} ,</if>
            <if test="breturnprofit != null and breturnprofit != ''"> #{breturnprofit} ,</if>
            <if test="bsafeprice != null and bsafeprice != ''"> #{bsafeprice} ,</if>
            <if test="bsupplyflag != null and bsupplyflag != ''"> #{bsupplyflag} ,</if>
            <if test="cadvisecalbodyid != null and cadvisecalbodyid != ''"> #{cadvisecalbodyid} ,</if>
            <if test="cbatchid != null and cbatchid != ''"> #{cbatchid} ,</if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> #{cbodywarehouseid} ,</if>
            <if test="cbomorderid != null and cbomorderid != ''"> #{cbomorderid} ,</if>
            <if test="cchantypeid != null and cchantypeid != ''"> #{cchantypeid} ,</if>
            <if test="cconsigncorpid != null and cconsigncorpid != ''"> #{cconsigncorpid} ,</if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> #{ccurrencytypeid} ,</if>
            <if test="cfactoryid != null and cfactoryid != ''"> #{cfactoryid} ,</if>
            <if test="cfreezeid != null and cfreezeid != ''"> #{cfreezeid} ,</if>
            <if test="cinvbasdocid != null and cinvbasdocid != ''"> #{cinvbasdocid} ,</if>
            <if test="cinventoryid != null and cinventoryid != ''"> #{cinventoryid} ,</if>
            <if test="cinventoryid1 != null and cinventoryid1 != ''"> #{cinventoryid1} ,</if>
            <if test="clargessrowno != null and clargessrowno != ''"> #{clargessrowno} ,</if>
            <if test="coperatorid != null and coperatorid != ''"> #{coperatorid} ,</if>
            <if test="corderBid != null and corderBid != ''"> #{corderBid} ,</if>
            <if test="cpackunitid != null and cpackunitid != ''"> #{cpackunitid} ,</if>
            <if test="cpricecalproc != null and cpricecalproc != ''"> #{cpricecalproc} ,</if>
            <if test="cpriceitemid != null and cpriceitemid != ''"> #{cpriceitemid} ,</if>
            <if test="cpriceitemtable != null and cpriceitemtable != ''"> #{cpriceitemtable} ,</if>
            <if test="cpricepolicyid != null and cpricepolicyid != ''"> #{cpricepolicyid} ,</if>
            <if test="cprolineid != null and cprolineid != ''"> #{cprolineid} ,</if>
            <if test="cproviderid != null and cproviderid != ''"> #{cproviderid} ,</if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> #{cquoteunitid} ,</if>
            <if test="crecaddrnode != null and crecaddrnode != ''"> #{crecaddrnode} ,</if>
            <if test="creccalbodyid != null and creccalbodyid != ''"> #{creccalbodyid} ,</if>
            <if test="creceiptareaid != null and creceiptareaid != ''"> #{creceiptareaid} ,</if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> #{creceiptcorpid} ,</if>
            <if test="creceipttype != null and creceipttype != ''"> #{creceipttype} ,</if>
            <if test="crecwareid != null and crecwareid != ''"> #{crecwareid} ,</if>
            <if test="crowno != null and crowno != ''"> #{crowno} ,</if>
            <if test="csaleid != null and csaleid != ''"> #{csaleid} ,</if>
            <if test="csourcebillbodyid != null and csourcebillbodyid != ''"> #{csourcebillbodyid} ,</if>
            <if test="csourcebillid != null and csourcebillid != ''"> #{csourcebillid} ,</if>
            <if test="ctManagebid != null and ctManagebid != ''"> #{ctManagebid} ,</if>
            <if test="ctManageid != null and ctManageid != ''"> #{ctManageid} ,</if>
            <if test="cunitid != null and cunitid != ''"> #{cunitid} ,</if>
            <if test="dconsigndate != null and dconsigndate != ''"> #{dconsigndate} ,</if>
            <if test="ddeliverdate != null and ddeliverdate != ''"> #{ddeliverdate} ,</if>
            <if test="dr != null"> #{dr} ,</if>
            <if test="fbatchstatus != null"> #{fbatchstatus} ,</if>
            <if test="frownote != null and frownote != ''"> #{frownote} ,</if>
            <if test="frowstatus != null"> #{frowstatus} ,</if>
            <if test="inccontimepoint != null and inccontimepoint != ''"> #{inccontimepoint} ,</if>
            <if test="inccontimepointname != null and inccontimepointname != ''"> #{inccontimepointname} ,</if>
            <if test="incoconfclose != null and incoconfclose != ''"> #{incoconfclose} ,</if>
            <if test="nastretprofnum != null and nastretprofnum != ''"> #{nastretprofnum} ,</if>
            <if test="nasttaldcnum != null and nasttaldcnum != ''"> #{nasttaldcnum} ,</if>
            <if test="ndiscountmny != null and ndiscountmny != ''"> #{ndiscountmny} ,</if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> #{ndiscountrate} ,</if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> #{nexchangeotobrate} ,</if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> #{nitemdiscountrate} ,</if>
            <if test="nmaxprc != null and nmaxprc != ''"> #{nmaxprc} ,</if>
            <if test="nmny != null and nmny != ''"> #{nmny} ,</if>
            <if test="nnetprice != null and nnetprice != ''"> #{nnetprice} ,</if>
            <if test="nnumber != null and nnumber != ''"> #{nnumber} ,</if>
            <if test="norgqtnetprc != null and norgqtnetprc != ''"> #{norgqtnetprc} ,</if>
            <if test="norgqtprc != null and norgqtprc != ''"> #{norgqtprc} ,</if>
            <if test="norgqttaxnetprc != null and norgqttaxnetprc != ''"> #{norgqttaxnetprc} ,</if>
            <if test="norgqttaxprc != null and norgqttaxprc != ''"> #{norgqttaxprc} ,</if>
            <if test="noriginalcurdiscountmny != null and noriginalcurdiscountmny != ''"> #{noriginalcurdiscountmny} ,</if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> #{noriginalcurmny} ,</if>
            <if test="noriginalcurnetprice != null and noriginalcurnetprice != ''"> #{noriginalcurnetprice} ,</if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> #{noriginalcurprice} ,</if>
            <if test="noriginalcursummny != null and noriginalcursummny != ''"> #{noriginalcursummny} ,</if>
            <if test="noriginalcurtaxmny != null and noriginalcurtaxmny != ''"> #{noriginalcurtaxmny} ,</if>
            <if test="noriginalcurtaxnetprice != null and noriginalcurtaxnetprice != ''"> #{noriginalcurtaxnetprice} ,</if>
            <if test="noriginalcurtaxprice != null and noriginalcurtaxprice != ''"> #{noriginalcurtaxprice} ,</if>
            <if test="npacknumber != null and npacknumber != ''"> #{npacknumber} ,</if>
            <if test="nprice != null and nprice != ''"> #{nprice} ,</if>
            <if test="nqtnetprc != null and nqtnetprc != ''"> #{nqtnetprc} ,</if>
            <if test="nqtorgnetprc != null and nqtorgnetprc != ''"> #{nqtorgnetprc} ,</if>
            <if test="nqtorgprc != null and nqtorgprc != ''"> #{nqtorgprc} ,</if>
            <if test="nqtorgtaxnetprc != null and nqtorgtaxnetprc != ''"> #{nqtorgtaxnetprc} ,</if>
            <if test="nqtorgtaxprc != null and nqtorgtaxprc != ''"> #{nqtorgtaxprc} ,</if>
            <if test="nqtprc != null and nqtprc != ''"> #{nqtprc} ,</if>
            <if test="nqttaxnetprc != null and nqttaxnetprc != ''"> #{nqttaxnetprc} ,</if>
            <if test="nqttaxprc != null and nqttaxprc != ''"> #{nqttaxprc} ,</if>
            <if test="nquoteunitnum != null and nquoteunitnum != ''"> #{nquoteunitnum} ,</if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> #{nquoteunitrate} ,</if>
            <if test="nretprofmny != null and nretprofmny != ''"> #{nretprofmny} ,</if>
            <if test="nretprofnum != null and nretprofnum != ''"> #{nretprofnum} ,</if>
            <if test="nreturntaxrate != null and nreturntaxrate != ''"> #{nreturntaxrate} ,</if>
            <if test="nsummny != null and nsummny != ''"> #{nsummny} ,</if>
            <if test="ntaldcmny != null and ntaldcmny != ''"> #{ntaldcmny} ,</if>
            <if test="ntaldcnum != null and ntaldcnum != ''"> #{ntaldcnum} ,</if>
            <if test="ntaxmny != null and ntaxmny != ''"> #{ntaxmny} ,</if>
            <if test="ntaxnetprice != null and ntaxnetprice != ''"> #{ntaxnetprice} ,</if>
            <if test="ntaxprice != null and ntaxprice != ''"> #{ntaxprice} ,</if>
            <if test="ntaxrate != null and ntaxrate != ''"> #{ntaxrate} ,</if>
            <if test="pkCorp != null and pkCorp != ''"> #{pkCorp} ,</if>
            <if test="refundflag != null and refundflag != ''"> #{refundflag} ,</if>
            <if test="tconsigntime != null and tconsigntime != ''"> #{tconsigntime} ,</if>
            <if test="tdelivertime != null and tdelivertime != ''"> #{tdelivertime} ,</if>
            <if test="ts != null and ts != ''"> #{ts} ,</if>
            <if test="veditreason != null and veditreason != ''"> #{veditreason} ,</if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''"> #{vreceiveaddress} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from so_saleorder_b a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="corderBid" useGeneratedKeys="true">
  insert into so_saleorder_b(alrconfincomny, alrconfinconum, bbindflag, bdericttrans, blargessflag, boosflag, breturnprofit, bsafeprice, bsupplyflag, cadvisecalbodyid, cbatchid, cbodywarehouseid, cbomorderid, cchantypeid, cconsigncorpid, ccurrencytypeid, cfactoryid, cfreezeid, cinvbasdocid, cinventoryid, cinventoryid1, clargessrowno, coperatorid, cpackunitid, cpricecalproc, cpriceitemid, cpriceitemtable, cpricepolicyid, cprolineid, cproviderid, cquoteunitid, crecaddrnode, creccalbodyid, creceiptareaid, creceiptcorpid, creceipttype, crecwareid, crowno, csaleid, csourcebillbodyid, csourcebillid, ct_managebid, ct_manageid, cunitid, dconsigndate, ddeliverdate, dr, fbatchstatus, frownote, frowstatus, inccontimepoint, inccontimepointname, incoconfclose, nastretprofnum, nasttaldcnum, ndiscountmny, ndiscountrate, nexchangeotobrate, nitemdiscountrate, nmaxprc, nmny, nnetprice, nnumber, norgqtnetprc, norgqtprc, norgqttaxnetprc, norgqttaxprc, noriginalcurdiscountmny, noriginalcurmny, noriginalcurnetprice, noriginalcurprice, noriginalcursummny, noriginalcurtaxmny, noriginalcurtaxnetprice, noriginalcurtaxprice, npacknumber, nprice, nqtnetprc, nqtorgnetprc, nqtorgprc, nqtorgtaxnetprc, nqtorgtaxprc, nqtprc, nqttaxnetprc, nqttaxprc, nquoteunitnum, nquoteunitrate, nretprofmny, nretprofnum, nreturntaxrate, nsummny, ntaldcmny, ntaldcnum, ntaxmny, ntaxnetprice, ntaxprice, ntaxrate, pk_corp, refundflag, tconsigntime, tdelivertime, ts, veditreason, vreceiveaddress,  sts) 
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.alrconfincomny},#{entity.alrconfinconum},#{entity.bbindflag},#{entity.bdericttrans},#{entity.blargessflag},#{entity.boosflag},#{entity.breturnprofit},#{entity.bsafeprice},#{entity.bsupplyflag},#{entity.cadvisecalbodyid},#{entity.cbatchid},#{entity.cbodywarehouseid},#{entity.cbomorderid},#{entity.cchantypeid},#{entity.cconsigncorpid},#{entity.ccurrencytypeid},#{entity.cfactoryid},#{entity.cfreezeid},#{entity.cinvbasdocid},#{entity.cinventoryid},#{entity.cinventoryid1},#{entity.clargessrowno},#{entity.coperatorid},#{entity.cpackunitid},#{entity.cpricecalproc},#{entity.cpriceitemid},#{entity.cpriceitemtable},#{entity.cpricepolicyid},#{entity.cprolineid},#{entity.cproviderid},#{entity.cquoteunitid},#{entity.crecaddrnode},#{entity.creccalbodyid},#{entity.creceiptareaid},#{entity.creceiptcorpid},#{entity.creceipttype},#{entity.crecwareid},#{entity.crowno},#{entity.csaleid},#{entity.csourcebillbodyid},#{entity.csourcebillid},#{entity.ctManagebid},#{entity.ctManageid},#{entity.cunitid},#{entity.dconsigndate},#{entity.ddeliverdate},#{entity.dr},#{entity.fbatchstatus},#{entity.frownote},#{entity.frowstatus},#{entity.inccontimepoint},#{entity.inccontimepointname},#{entity.incoconfclose},#{entity.nastretprofnum},#{entity.nasttaldcnum},#{entity.ndiscountmny},#{entity.ndiscountrate},#{entity.nexchangeotobrate},#{entity.nitemdiscountrate},#{entity.nmaxprc},#{entity.nmny},#{entity.nnetprice},#{entity.nnumber},#{entity.norgqtnetprc},#{entity.norgqtprc},#{entity.norgqttaxnetprc},#{entity.norgqttaxprc},#{entity.noriginalcurdiscountmny},#{entity.noriginalcurmny},#{entity.noriginalcurnetprice},#{entity.noriginalcurprice},#{entity.noriginalcursummny},#{entity.noriginalcurtaxmny},#{entity.noriginalcurtaxnetprice},#{entity.noriginalcurtaxprice},#{entity.npacknumber},#{entity.nprice},#{entity.nqtnetprc},#{entity.nqtorgnetprc},#{entity.nqtorgprc},#{entity.nqtorgtaxnetprc},#{entity.nqtorgtaxprc},#{entity.nqtprc},#{entity.nqttaxnetprc},#{entity.nqttaxprc},#{entity.nquoteunitnum},#{entity.nquoteunitrate},#{entity.nretprofmny},#{entity.nretprofnum},#{entity.nreturntaxrate},#{entity.nsummny},#{entity.ntaldcmny},#{entity.ntaldcnum},#{entity.ntaxmny},#{entity.ntaxnetprice},#{entity.ntaxprice},#{entity.ntaxrate},#{entity.pkCorp},#{entity.refundflag},#{entity.tconsigntime},#{entity.tdelivertime},#{entity.ts},#{entity.veditreason},#{entity.vreceiveaddress}, 'Y')
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="corderBid" useGeneratedKeys="true">
    insert into so_saleorder_b(alrconfincomny, alrconfinconum, bbindflag, bdericttrans, blargessflag, boosflag, breturnprofit, bsafeprice, bsupplyflag, cadvisecalbodyid, cbatchid, cbodywarehouseid, cbomorderid, cchantypeid, cconsigncorpid, ccurrencytypeid, cfactoryid, cfreezeid, cinvbasdocid, cinventoryid, cinventoryid1, clargessrowno, coperatorid, cpackunitid, cpricecalproc, cpriceitemid, cpriceitemtable, cpricepolicyid, cprolineid, cproviderid, cquoteunitid, crecaddrnode, creccalbodyid, creceiptareaid, creceiptcorpid, creceipttype, crecwareid, crowno, csaleid, csourcebillbodyid, csourcebillid, ct_managebid, ct_manageid, cunitid, dconsigndate, ddeliverdate, dr, fbatchstatus, frownote, frowstatus, inccontimepoint, inccontimepointname, incoconfclose, nastretprofnum, nasttaldcnum, ndiscountmny, ndiscountrate, nexchangeotobrate, nitemdiscountrate, nmaxprc, nmny, nnetprice, nnumber, norgqtnetprc, norgqtprc, norgqttaxnetprc, norgqttaxprc, noriginalcurdiscountmny, noriginalcurmny, noriginalcurnetprice, noriginalcurprice, noriginalcursummny, noriginalcurtaxmny, noriginalcurtaxnetprice, noriginalcurtaxprice, npacknumber, nprice, nqtnetprc, nqtorgnetprc, nqtorgprc, nqtorgtaxnetprc, nqtorgtaxprc, nqtprc, nqttaxnetprc, nqttaxprc, nquoteunitnum, nquoteunitrate, nretprofmny, nretprofnum, nreturntaxrate, nsummny, ntaldcmny, ntaldcnum, ntaxmny, ntaxnetprice, ntaxprice, ntaxrate, pk_corp, refundflag, tconsigntime, tdelivertime, ts, veditreason, vreceiveaddress)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.alrconfincomny},#{entity.alrconfinconum},#{entity.bbindflag},#{entity.bdericttrans},#{entity.blargessflag},#{entity.boosflag},#{entity.breturnprofit},#{entity.bsafeprice},#{entity.bsupplyflag},#{entity.cadvisecalbodyid},#{entity.cbatchid},#{entity.cbodywarehouseid},#{entity.cbomorderid},#{entity.cchantypeid},#{entity.cconsigncorpid},#{entity.ccurrencytypeid},#{entity.cfactoryid},#{entity.cfreezeid},#{entity.cinvbasdocid},#{entity.cinventoryid},#{entity.cinventoryid1},#{entity.clargessrowno},#{entity.coperatorid},#{entity.cpackunitid},#{entity.cpricecalproc},#{entity.cpriceitemid},#{entity.cpriceitemtable},#{entity.cpricepolicyid},#{entity.cprolineid},#{entity.cproviderid},#{entity.cquoteunitid},#{entity.crecaddrnode},#{entity.creccalbodyid},#{entity.creceiptareaid},#{entity.creceiptcorpid},#{entity.creceipttype},#{entity.crecwareid},#{entity.crowno},#{entity.csaleid},#{entity.csourcebillbodyid},#{entity.csourcebillid},#{entity.ctManagebid},#{entity.ctManageid},#{entity.cunitid},#{entity.dconsigndate},#{entity.ddeliverdate},#{entity.dr},#{entity.fbatchstatus},#{entity.frownote},#{entity.frowstatus},#{entity.inccontimepoint},#{entity.inccontimepointname},#{entity.incoconfclose},#{entity.nastretprofnum},#{entity.nasttaldcnum},#{entity.ndiscountmny},#{entity.ndiscountrate},#{entity.nexchangeotobrate},#{entity.nitemdiscountrate},#{entity.nmaxprc},#{entity.nmny},#{entity.nnetprice},#{entity.nnumber},#{entity.norgqtnetprc},#{entity.norgqtprc},#{entity.norgqttaxnetprc},#{entity.norgqttaxprc},#{entity.noriginalcurdiscountmny},#{entity.noriginalcurmny},#{entity.noriginalcurnetprice},#{entity.noriginalcurprice},#{entity.noriginalcursummny},#{entity.noriginalcurtaxmny},#{entity.noriginalcurtaxnetprice},#{entity.noriginalcurtaxprice},#{entity.npacknumber},#{entity.nprice},#{entity.nqtnetprc},#{entity.nqtorgnetprc},#{entity.nqtorgprc},#{entity.nqtorgtaxnetprc},#{entity.nqtorgtaxprc},#{entity.nqtprc},#{entity.nqttaxnetprc},#{entity.nqttaxprc},#{entity.nquoteunitnum},#{entity.nquoteunitrate},#{entity.nretprofmny},#{entity.nretprofnum},#{entity.nreturntaxrate},#{entity.nsummny},#{entity.ntaldcmny},#{entity.ntaldcnum},#{entity.ntaxmny},#{entity.ntaxnetprice},#{entity.ntaxprice},#{entity.ntaxrate},#{entity.pkCorp},#{entity.refundflag},#{entity.tconsigntime},#{entity.tdelivertime},#{entity.ts},#{entity.veditreason},#{entity.vreceiveaddress})
    </foreach>
    on duplicate key update
    alrconfincomny = values(alrconfincomny),
    alrconfinconum = values(alrconfinconum),
    bbindflag = values(bbindflag),
    bdericttrans = values(bdericttrans),
    blargessflag = values(blargessflag),
    boosflag = values(boosflag),
    breturnprofit = values(breturnprofit),
    bsafeprice = values(bsafeprice),
    bsupplyflag = values(bsupplyflag),
    cadvisecalbodyid = values(cadvisecalbodyid),
    cbatchid = values(cbatchid),
    cbodywarehouseid = values(cbodywarehouseid),
    cbomorderid = values(cbomorderid),
    cchantypeid = values(cchantypeid),
    cconsigncorpid = values(cconsigncorpid),
    ccurrencytypeid = values(ccurrencytypeid),
    cfactoryid = values(cfactoryid),
    cfreezeid = values(cfreezeid),
    cinvbasdocid = values(cinvbasdocid),
    cinventoryid = values(cinventoryid),
    cinventoryid1 = values(cinventoryid1),
    clargessrowno = values(clargessrowno),
    coperatorid = values(coperatorid),
    cpackunitid = values(cpackunitid),
    cpricecalproc = values(cpricecalproc),
    cpriceitemid = values(cpriceitemid),
    cpriceitemtable = values(cpriceitemtable),
    cpricepolicyid = values(cpricepolicyid),
    cprolineid = values(cprolineid),
    cproviderid = values(cproviderid),
    cquoteunitid = values(cquoteunitid),
    crecaddrnode = values(crecaddrnode),
    creccalbodyid = values(creccalbodyid),
    creceiptareaid = values(creceiptareaid),
    creceiptcorpid = values(creceiptcorpid),
    creceipttype = values(creceipttype),
    crecwareid = values(crecwareid),
    crowno = values(crowno),
    csaleid = values(csaleid),
    csourcebillbodyid = values(csourcebillbodyid),
    csourcebillid = values(csourcebillid),
    ct_managebid = values(ct_managebid),
    ct_manageid = values(ct_manageid),
    cunitid = values(cunitid),
    dconsigndate = values(dconsigndate),
    ddeliverdate = values(ddeliverdate),
    dr = values(dr),
    fbatchstatus = values(fbatchstatus),
    frownote = values(frownote),
    frowstatus = values(frowstatus),
    inccontimepoint = values(inccontimepoint),
    inccontimepointname = values(inccontimepointname),
    incoconfclose = values(incoconfclose),
    nastretprofnum = values(nastretprofnum),
    nasttaldcnum = values(nasttaldcnum),
    ndiscountmny = values(ndiscountmny),
    ndiscountrate = values(ndiscountrate),
    nexchangeotobrate = values(nexchangeotobrate),
    nitemdiscountrate = values(nitemdiscountrate),
    nmaxprc = values(nmaxprc),
    nmny = values(nmny),
    nnetprice = values(nnetprice),
    nnumber = values(nnumber),
    norgqtnetprc = values(norgqtnetprc),
    norgqtprc = values(norgqtprc),
    norgqttaxnetprc = values(norgqttaxnetprc),
    norgqttaxprc = values(norgqttaxprc),
    noriginalcurdiscountmny = values(noriginalcurdiscountmny),
    noriginalcurmny = values(noriginalcurmny),
    noriginalcurnetprice = values(noriginalcurnetprice),
    noriginalcurprice = values(noriginalcurprice),
    noriginalcursummny = values(noriginalcursummny),
    noriginalcurtaxmny = values(noriginalcurtaxmny),
    noriginalcurtaxnetprice = values(noriginalcurtaxnetprice),
    noriginalcurtaxprice = values(noriginalcurtaxprice),
    npacknumber = values(npacknumber),
    nprice = values(nprice),
    nqtnetprc = values(nqtnetprc),
    nqtorgnetprc = values(nqtorgnetprc),
    nqtorgprc = values(nqtorgprc),
    nqtorgtaxnetprc = values(nqtorgtaxnetprc),
    nqtorgtaxprc = values(nqtorgtaxprc),
    nqtprc = values(nqtprc),
    nqttaxnetprc = values(nqttaxnetprc),
    nqttaxprc = values(nqttaxprc),
    nquoteunitnum = values(nquoteunitnum),
    nquoteunitrate = values(nquoteunitrate),
    nretprofmny = values(nretprofmny),
    nretprofnum = values(nretprofnum),
    nreturntaxrate = values(nreturntaxrate),
    nsummny = values(nsummny),
    ntaldcmny = values(ntaldcmny),
    ntaldcnum = values(ntaldcnum),
    ntaxmny = values(ntaxmny),
    ntaxnetprice = values(ntaxnetprice),
    ntaxprice = values(ntaxprice),
    ntaxrate = values(ntaxrate),
    pk_corp = values(pk_corp),
    refundflag = values(refundflag),
    tconsigntime = values(tconsigntime),
    tdelivertime = values(tdelivertime),
    ts = values(ts),
    veditreason = values(veditreason),
    vreceiveaddress = values(vreceiveaddress)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity" >
update so_saleorder_b  set
<trim suffix="" suffixOverrides=",">
  <if test="alrconfincomny != null and alrconfincomny != ''"> alrconfincomny = #{alrconfincomny},</if>
  <if test="alrconfinconum != null and alrconfinconum != ''"> alrconfinconum = #{alrconfinconum},</if>
  <if test="bbindflag != null and bbindflag != ''"> bbindflag = #{bbindflag},</if>
  <if test="bdericttrans != null and bdericttrans != ''"> bdericttrans = #{bdericttrans},</if>
  <if test="blargessflag != null and blargessflag != ''"> blargessflag = #{blargessflag},</if>
  <if test="boosflag != null and boosflag != ''"> boosflag = #{boosflag},</if>
  <if test="breturnprofit != null and breturnprofit != ''"> breturnprofit = #{breturnprofit},</if>
  <if test="bsafeprice != null and bsafeprice != ''"> bsafeprice = #{bsafeprice},</if>
  <if test="bsupplyflag != null and bsupplyflag != ''"> bsupplyflag = #{bsupplyflag},</if>
  <if test="cadvisecalbodyid != null and cadvisecalbodyid != ''"> cadvisecalbodyid = #{cadvisecalbodyid},</if>
  <if test="cbatchid != null and cbatchid != ''"> cbatchid = #{cbatchid},</if>
  <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> cbodywarehouseid = #{cbodywarehouseid},</if>
  <if test="cbomorderid != null and cbomorderid != ''"> cbomorderid = #{cbomorderid},</if>
  <if test="cchantypeid != null and cchantypeid != ''"> cchantypeid = #{cchantypeid},</if>
  <if test="cconsigncorpid != null and cconsigncorpid != ''"> cconsigncorpid = #{cconsigncorpid},</if>
  <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> ccurrencytypeid = #{ccurrencytypeid},</if>
  <if test="cfactoryid != null and cfactoryid != ''"> cfactoryid = #{cfactoryid},</if>
  <if test="cfreezeid != null and cfreezeid != ''"> cfreezeid = #{cfreezeid},</if>
  <if test="cinvbasdocid != null and cinvbasdocid != ''"> cinvbasdocid = #{cinvbasdocid},</if>
  <if test="cinventoryid != null and cinventoryid != ''"> cinventoryid = #{cinventoryid},</if>
  <if test="cinventoryid1 != null and cinventoryid1 != ''"> cinventoryid1 = #{cinventoryid1},</if>
  <if test="clargessrowno != null and clargessrowno != ''"> clargessrowno = #{clargessrowno},</if>
  <if test="coperatorid != null and coperatorid != ''"> coperatorid = #{coperatorid},</if>
  <if test="cpackunitid != null and cpackunitid != ''"> cpackunitid = #{cpackunitid},</if>
  <if test="cpricecalproc != null and cpricecalproc != ''"> cpricecalproc = #{cpricecalproc},</if>
  <if test="cpriceitemid != null and cpriceitemid != ''"> cpriceitemid = #{cpriceitemid},</if>
  <if test="cpriceitemtable != null and cpriceitemtable != ''"> cpriceitemtable = #{cpriceitemtable},</if>
  <if test="cpricepolicyid != null and cpricepolicyid != ''"> cpricepolicyid = #{cpricepolicyid},</if>
  <if test="cprolineid != null and cprolineid != ''"> cprolineid = #{cprolineid},</if>
  <if test="cproviderid != null and cproviderid != ''"> cproviderid = #{cproviderid},</if>
  <if test="cquoteunitid != null and cquoteunitid != ''"> cquoteunitid = #{cquoteunitid},</if>
  <if test="crecaddrnode != null and crecaddrnode != ''"> crecaddrnode = #{crecaddrnode},</if>
  <if test="creccalbodyid != null and creccalbodyid != ''"> creccalbodyid = #{creccalbodyid},</if>
  <if test="creceiptareaid != null and creceiptareaid != ''"> creceiptareaid = #{creceiptareaid},</if>
  <if test="creceiptcorpid != null and creceiptcorpid != ''"> creceiptcorpid = #{creceiptcorpid},</if>
  <if test="creceipttype != null and creceipttype != ''"> creceipttype = #{creceipttype},</if>
  <if test="crecwareid != null and crecwareid != ''"> crecwareid = #{crecwareid},</if>
  <if test="crowno != null and crowno != ''"> crowno = #{crowno},</if>
  <if test="csaleid != null and csaleid != ''"> csaleid = #{csaleid},</if>
  <if test="csourcebillbodyid != null and csourcebillbodyid != ''"> csourcebillbodyid = #{csourcebillbodyid},</if>
  <if test="csourcebillid != null and csourcebillid != ''"> csourcebillid = #{csourcebillid},</if>
  <if test="ctManagebid != null and ctManagebid != ''"> ct_managebid = #{ctManagebid},</if>
  <if test="ctManageid != null and ctManageid != ''"> ct_manageid = #{ctManageid},</if>
  <if test="cunitid != null and cunitid != ''"> cunitid = #{cunitid},</if>
  <if test="dconsigndate != null and dconsigndate != ''"> dconsigndate = #{dconsigndate},</if>
  <if test="ddeliverdate != null and ddeliverdate != ''"> ddeliverdate = #{ddeliverdate},</if>
  <if test="dr != null"> dr = #{dr},</if>
  <if test="fbatchstatus != null"> fbatchstatus = #{fbatchstatus},</if>
  <if test="frownote != null and frownote != ''"> frownote = #{frownote},</if>
  <if test="frowstatus != null"> frowstatus = #{frowstatus},</if>
  <if test="inccontimepoint != null and inccontimepoint != ''"> inccontimepoint = #{inccontimepoint},</if>
  <if test="inccontimepointname != null and inccontimepointname != ''"> inccontimepointname = #{inccontimepointname},</if>
  <if test="incoconfclose != null and incoconfclose != ''"> incoconfclose = #{incoconfclose},</if>
  <if test="nastretprofnum != null and nastretprofnum != ''"> nastretprofnum = #{nastretprofnum},</if>
  <if test="nasttaldcnum != null and nasttaldcnum != ''"> nasttaldcnum = #{nasttaldcnum},</if>
  <if test="ndiscountmny != null and ndiscountmny != ''"> ndiscountmny = #{ndiscountmny},</if>
  <if test="ndiscountrate != null and ndiscountrate != ''"> ndiscountrate = #{ndiscountrate},</if>
  <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> nexchangeotobrate = #{nexchangeotobrate},</if>
  <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> nitemdiscountrate = #{nitemdiscountrate},</if>
  <if test="nmaxprc != null and nmaxprc != ''"> nmaxprc = #{nmaxprc},</if>
  <if test="nmny != null and nmny != ''"> nmny = #{nmny},</if>
  <if test="nnetprice != null and nnetprice != ''"> nnetprice = #{nnetprice},</if>
  <if test="nnumber != null and nnumber != ''"> nnumber = #{nnumber},</if>
  <if test="norgqtnetprc != null and norgqtnetprc != ''"> norgqtnetprc = #{norgqtnetprc},</if>
  <if test="norgqtprc != null and norgqtprc != ''"> norgqtprc = #{norgqtprc},</if>
  <if test="norgqttaxnetprc != null and norgqttaxnetprc != ''"> norgqttaxnetprc = #{norgqttaxnetprc},</if>
  <if test="norgqttaxprc != null and norgqttaxprc != ''"> norgqttaxprc = #{norgqttaxprc},</if>
  <if test="noriginalcurdiscountmny != null and noriginalcurdiscountmny != ''"> noriginalcurdiscountmny = #{noriginalcurdiscountmny},</if>
  <if test="noriginalcurmny != null and noriginalcurmny != ''"> noriginalcurmny = #{noriginalcurmny},</if>
  <if test="noriginalcurnetprice != null and noriginalcurnetprice != ''"> noriginalcurnetprice = #{noriginalcurnetprice},</if>
  <if test="noriginalcurprice != null and noriginalcurprice != ''"> noriginalcurprice = #{noriginalcurprice},</if>
  <if test="noriginalcursummny != null and noriginalcursummny != ''"> noriginalcursummny = #{noriginalcursummny},</if>
  <if test="noriginalcurtaxmny != null and noriginalcurtaxmny != ''"> noriginalcurtaxmny = #{noriginalcurtaxmny},</if>
  <if test="noriginalcurtaxnetprice != null and noriginalcurtaxnetprice != ''"> noriginalcurtaxnetprice = #{noriginalcurtaxnetprice},</if>
  <if test="noriginalcurtaxprice != null and noriginalcurtaxprice != ''"> noriginalcurtaxprice = #{noriginalcurtaxprice},</if>
  <if test="npacknumber != null and npacknumber != ''"> npacknumber = #{npacknumber},</if>
  <if test="nprice != null and nprice != ''"> nprice = #{nprice},</if>
  <if test="nqtnetprc != null and nqtnetprc != ''"> nqtnetprc = #{nqtnetprc},</if>
  <if test="nqtorgnetprc != null and nqtorgnetprc != ''"> nqtorgnetprc = #{nqtorgnetprc},</if>
  <if test="nqtorgprc != null and nqtorgprc != ''"> nqtorgprc = #{nqtorgprc},</if>
  <if test="nqtorgtaxnetprc != null and nqtorgtaxnetprc != ''"> nqtorgtaxnetprc = #{nqtorgtaxnetprc},</if>
  <if test="nqtorgtaxprc != null and nqtorgtaxprc != ''"> nqtorgtaxprc = #{nqtorgtaxprc},</if>
  <if test="nqtprc != null and nqtprc != ''"> nqtprc = #{nqtprc},</if>
  <if test="nqttaxnetprc != null and nqttaxnetprc != ''"> nqttaxnetprc = #{nqttaxnetprc},</if>
  <if test="nqttaxprc != null and nqttaxprc != ''"> nqttaxprc = #{nqttaxprc},</if>
  <if test="nquoteunitnum != null and nquoteunitnum != ''"> nquoteunitnum = #{nquoteunitnum},</if>
  <if test="nquoteunitrate != null and nquoteunitrate != ''"> nquoteunitrate = #{nquoteunitrate},</if>
  <if test="nretprofmny != null and nretprofmny != ''"> nretprofmny = #{nretprofmny},</if>
  <if test="nretprofnum != null and nretprofnum != ''"> nretprofnum = #{nretprofnum},</if>
  <if test="nreturntaxrate != null and nreturntaxrate != ''"> nreturntaxrate = #{nreturntaxrate},</if>
  <if test="nsummny != null and nsummny != ''"> nsummny = #{nsummny},</if>
  <if test="ntaldcmny != null and ntaldcmny != ''"> ntaldcmny = #{ntaldcmny},</if>
  <if test="ntaldcnum != null and ntaldcnum != ''"> ntaldcnum = #{ntaldcnum},</if>
  <if test="ntaxmny != null and ntaxmny != ''"> ntaxmny = #{ntaxmny},</if>
  <if test="ntaxnetprice != null and ntaxnetprice != ''"> ntaxnetprice = #{ntaxnetprice},</if>
  <if test="ntaxprice != null and ntaxprice != ''"> ntaxprice = #{ntaxprice},</if>
  <if test="ntaxrate != null and ntaxrate != ''"> ntaxrate = #{ntaxrate},</if>
  <if test="pkCorp != null and pkCorp != ''"> pk_corp = #{pkCorp},</if>
  <if test="refundflag != null and refundflag != ''"> refundflag = #{refundflag},</if>
  <if test="tconsigntime != null and tconsigntime != ''"> tconsigntime = #{tconsigntime},</if>
  <if test="tdelivertime != null and tdelivertime != ''"> tdelivertime = #{tdelivertime},</if>
  <if test="ts != null and ts != ''"> ts = #{ts},</if>
  <if test="veditreason != null and veditreason != ''"> veditreason = #{veditreason},</if>
  <if test="vreceiveaddress != null and vreceiveaddress != ''"> vreceiveaddress = #{vreceiveaddress},</if>
</trim>
where corder_bid = #{corderBid}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity" >
update so_saleorder_b  set sts= 'N'
where corder_bid = #{corderBid}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity" >
update so_saleorder_b  set sts= 'N' 
 <trim prefix="where" prefixOverrides="and"> 
        <if test="alrconfincomny != null and alrconfincomny != ''"> and alrconfincomny = #{alrconfincomny} </if>
            <if test="alrconfinconum != null and alrconfinconum != ''"> and alrconfinconum = #{alrconfinconum} </if>
            <if test="bbindflag != null and bbindflag != ''"> and bbindflag = #{bbindflag} </if>
            <if test="bdericttrans != null and bdericttrans != ''"> and bdericttrans = #{bdericttrans} </if>
            <if test="blargessflag != null and blargessflag != ''"> and blargessflag = #{blargessflag} </if>
            <if test="boosflag != null and boosflag != ''"> and boosflag = #{boosflag} </if>
            <if test="breturnprofit != null and breturnprofit != ''"> and breturnprofit = #{breturnprofit} </if>
            <if test="bsafeprice != null and bsafeprice != ''"> and bsafeprice = #{bsafeprice} </if>
            <if test="bsupplyflag != null and bsupplyflag != ''"> and bsupplyflag = #{bsupplyflag} </if>
            <if test="cadvisecalbodyid != null and cadvisecalbodyid != ''"> and cadvisecalbodyid = #{cadvisecalbodyid} </if>
            <if test="cbatchid != null and cbatchid != ''"> and cbatchid = #{cbatchid} </if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> and cbodywarehouseid = #{cbodywarehouseid} </if>
            <if test="cbomorderid != null and cbomorderid != ''"> and cbomorderid = #{cbomorderid} </if>
            <if test="cchantypeid != null and cchantypeid != ''"> and cchantypeid = #{cchantypeid} </if>
            <if test="cconsigncorpid != null and cconsigncorpid != ''"> and cconsigncorpid = #{cconsigncorpid} </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and ccurrencytypeid = #{ccurrencytypeid} </if>
            <if test="cfactoryid != null and cfactoryid != ''"> and cfactoryid = #{cfactoryid} </if>
            <if test="cfreezeid != null and cfreezeid != ''"> and cfreezeid = #{cfreezeid} </if>
            <if test="cinvbasdocid != null and cinvbasdocid != ''"> and cinvbasdocid = #{cinvbasdocid} </if>
            <if test="cinventoryid != null and cinventoryid != ''"> and cinventoryid = #{cinventoryid} </if>
            <if test="cinventoryid1 != null and cinventoryid1 != ''"> and cinventoryid1 = #{cinventoryid1} </if>
            <if test="clargessrowno != null and clargessrowno != ''"> and clargessrowno = #{clargessrowno} </if>
            <if test="coperatorid != null and coperatorid != ''"> and coperatorid = #{coperatorid} </if>
            <if test="corderBid != null and corderBid != ''"> and corder_bid = #{corderBid} </if>
            <if test="cpackunitid != null and cpackunitid != ''"> and cpackunitid = #{cpackunitid} </if>
            <if test="cpricecalproc != null and cpricecalproc != ''"> and cpricecalproc = #{cpricecalproc} </if>
            <if test="cpriceitemid != null and cpriceitemid != ''"> and cpriceitemid = #{cpriceitemid} </if>
            <if test="cpriceitemtable != null and cpriceitemtable != ''"> and cpriceitemtable = #{cpriceitemtable} </if>
            <if test="cpricepolicyid != null and cpricepolicyid != ''"> and cpricepolicyid = #{cpricepolicyid} </if>
            <if test="cprolineid != null and cprolineid != ''"> and cprolineid = #{cprolineid} </if>
            <if test="cproviderid != null and cproviderid != ''"> and cproviderid = #{cproviderid} </if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> and cquoteunitid = #{cquoteunitid} </if>
            <if test="crecaddrnode != null and crecaddrnode != ''"> and crecaddrnode = #{crecaddrnode} </if>
            <if test="creccalbodyid != null and creccalbodyid != ''"> and creccalbodyid = #{creccalbodyid} </if>
            <if test="creceiptareaid != null and creceiptareaid != ''"> and creceiptareaid = #{creceiptareaid} </if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> and creceiptcorpid = #{creceiptcorpid} </if>
            <if test="creceipttype != null and creceipttype != ''"> and creceipttype = #{creceipttype} </if>
            <if test="crecwareid != null and crecwareid != ''"> and crecwareid = #{crecwareid} </if>
            <if test="crowno != null and crowno != ''"> and crowno = #{crowno} </if>
            <if test="csaleid != null and csaleid != ''"> and csaleid = #{csaleid} </if>
            <if test="csourcebillbodyid != null and csourcebillbodyid != ''"> and csourcebillbodyid = #{csourcebillbodyid} </if>
            <if test="csourcebillid != null and csourcebillid != ''"> and csourcebillid = #{csourcebillid} </if>
            <if test="ctManagebid != null and ctManagebid != ''"> and ct_managebid = #{ctManagebid} </if>
            <if test="ctManageid != null and ctManageid != ''"> and ct_manageid = #{ctManageid} </if>
            <if test="cunitid != null and cunitid != ''"> and cunitid = #{cunitid} </if>
            <if test="dconsigndate != null and dconsigndate != ''"> and dconsigndate = #{dconsigndate} </if>
            <if test="ddeliverdate != null and ddeliverdate != ''"> and ddeliverdate = #{ddeliverdate} </if>
            <if test="dr != null"> and dr = #{dr} </if>
            <if test="fbatchstatus != null"> and fbatchstatus = #{fbatchstatus} </if>
            <if test="frownote != null and frownote != ''"> and frownote = #{frownote} </if>
            <if test="frowstatus != null"> and frowstatus = #{frowstatus} </if>
            <if test="inccontimepoint != null and inccontimepoint != ''"> and inccontimepoint = #{inccontimepoint} </if>
            <if test="inccontimepointname != null and inccontimepointname != ''"> and inccontimepointname = #{inccontimepointname} </if>
            <if test="incoconfclose != null and incoconfclose != ''"> and incoconfclose = #{incoconfclose} </if>
            <if test="nastretprofnum != null and nastretprofnum != ''"> and nastretprofnum = #{nastretprofnum} </if>
            <if test="nasttaldcnum != null and nasttaldcnum != ''"> and nasttaldcnum = #{nasttaldcnum} </if>
            <if test="ndiscountmny != null and ndiscountmny != ''"> and ndiscountmny = #{ndiscountmny} </if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> and ndiscountrate = #{ndiscountrate} </if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> and nexchangeotobrate = #{nexchangeotobrate} </if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> and nitemdiscountrate = #{nitemdiscountrate} </if>
            <if test="nmaxprc != null and nmaxprc != ''"> and nmaxprc = #{nmaxprc} </if>
            <if test="nmny != null and nmny != ''"> and nmny = #{nmny} </if>
            <if test="nnetprice != null and nnetprice != ''"> and nnetprice = #{nnetprice} </if>
            <if test="nnumber != null and nnumber != ''"> and nnumber = #{nnumber} </if>
            <if test="norgqtnetprc != null and norgqtnetprc != ''"> and norgqtnetprc = #{norgqtnetprc} </if>
            <if test="norgqtprc != null and norgqtprc != ''"> and norgqtprc = #{norgqtprc} </if>
            <if test="norgqttaxnetprc != null and norgqttaxnetprc != ''"> and norgqttaxnetprc = #{norgqttaxnetprc} </if>
            <if test="norgqttaxprc != null and norgqttaxprc != ''"> and norgqttaxprc = #{norgqttaxprc} </if>
            <if test="noriginalcurdiscountmny != null and noriginalcurdiscountmny != ''"> and noriginalcurdiscountmny = #{noriginalcurdiscountmny} </if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> and noriginalcurmny = #{noriginalcurmny} </if>
            <if test="noriginalcurnetprice != null and noriginalcurnetprice != ''"> and noriginalcurnetprice = #{noriginalcurnetprice} </if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> and noriginalcurprice = #{noriginalcurprice} </if>
            <if test="noriginalcursummny != null and noriginalcursummny != ''"> and noriginalcursummny = #{noriginalcursummny} </if>
            <if test="noriginalcurtaxmny != null and noriginalcurtaxmny != ''"> and noriginalcurtaxmny = #{noriginalcurtaxmny} </if>
            <if test="noriginalcurtaxnetprice != null and noriginalcurtaxnetprice != ''"> and noriginalcurtaxnetprice = #{noriginalcurtaxnetprice} </if>
            <if test="noriginalcurtaxprice != null and noriginalcurtaxprice != ''"> and noriginalcurtaxprice = #{noriginalcurtaxprice} </if>
            <if test="npacknumber != null and npacknumber != ''"> and npacknumber = #{npacknumber} </if>
            <if test="nprice != null and nprice != ''"> and nprice = #{nprice} </if>
            <if test="nqtnetprc != null and nqtnetprc != ''"> and nqtnetprc = #{nqtnetprc} </if>
            <if test="nqtorgnetprc != null and nqtorgnetprc != ''"> and nqtorgnetprc = #{nqtorgnetprc} </if>
            <if test="nqtorgprc != null and nqtorgprc != ''"> and nqtorgprc = #{nqtorgprc} </if>
            <if test="nqtorgtaxnetprc != null and nqtorgtaxnetprc != ''"> and nqtorgtaxnetprc = #{nqtorgtaxnetprc} </if>
            <if test="nqtorgtaxprc != null and nqtorgtaxprc != ''"> and nqtorgtaxprc = #{nqtorgtaxprc} </if>
            <if test="nqtprc != null and nqtprc != ''"> and nqtprc = #{nqtprc} </if>
            <if test="nqttaxnetprc != null and nqttaxnetprc != ''"> and nqttaxnetprc = #{nqttaxnetprc} </if>
            <if test="nqttaxprc != null and nqttaxprc != ''"> and nqttaxprc = #{nqttaxprc} </if>
            <if test="nquoteunitnum != null and nquoteunitnum != ''"> and nquoteunitnum = #{nquoteunitnum} </if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> and nquoteunitrate = #{nquoteunitrate} </if>
            <if test="nretprofmny != null and nretprofmny != ''"> and nretprofmny = #{nretprofmny} </if>
            <if test="nretprofnum != null and nretprofnum != ''"> and nretprofnum = #{nretprofnum} </if>
            <if test="nreturntaxrate != null and nreturntaxrate != ''"> and nreturntaxrate = #{nreturntaxrate} </if>
            <if test="nsummny != null and nsummny != ''"> and nsummny = #{nsummny} </if>
            <if test="ntaldcmny != null and ntaldcmny != ''"> and ntaldcmny = #{ntaldcmny} </if>
            <if test="ntaldcnum != null and ntaldcnum != ''"> and ntaldcnum = #{ntaldcnum} </if>
            <if test="ntaxmny != null and ntaxmny != ''"> and ntaxmny = #{ntaxmny} </if>
            <if test="ntaxnetprice != null and ntaxnetprice != ''"> and ntaxnetprice = #{ntaxnetprice} </if>
            <if test="ntaxprice != null and ntaxprice != ''"> and ntaxprice = #{ntaxprice} </if>
            <if test="ntaxrate != null and ntaxrate != ''"> and ntaxrate = #{ntaxrate} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="refundflag != null and refundflag != ''"> and refundflag = #{refundflag} </if>
            <if test="tconsigntime != null and tconsigntime != ''"> and tconsigntime = #{tconsigntime} </if>
            <if test="tdelivertime != null and tdelivertime != ''"> and tdelivertime = #{tdelivertime} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
            <if test="veditreason != null and veditreason != ''"> and veditreason = #{veditreason} </if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''"> and vreceiveaddress = #{vreceiveaddress} </if>
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from so_saleorder_b where corder_bid = #{corderBid}
</delete>

    <select id="querySoSaleBEntity" parameterType="com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity" resultMap="get-SoSaleorderBEntity-result">
        select <include refid="SoSaleorderBEntity_Base_Column_List" /> from so_saleorder_b
        where
        <if test="csaleid!=null and csaleid!=''">
          csaleid = #{csaleid}
        </if>
        <if test="csaleids!=null and csaleids!=''">
            csaleid in (${csaleids})
        </if>
          and dr = 0 and 1=1;
    </select>

    <resultMap id="queryErrorDetailsIdResultMap" type="com.hzya.frame.plugin.lets.queryvo.ExtIntegrationTaskLivingDetailsQueryVo">
        <result property="vdef19" column="vdef19" />
        <result property="vdef20" column="vdef20" />
        <result property="csale_bid" column="csale_bid" />
    </resultMap>

    <select id="queryErrorDetailsId" parameterType="com.hzya.frame.plugin.lets.entity.SoSaleorderBEntity" resultMap="queryErrorDetailsIdResultMap">
        select
            d.vdef19,
            d.vdef20,
            d.csale_bid
        from so_saleorder_b a
        left join bd_invmandoc b on a.cinventoryid = b.pk_invmandoc and b.dr = 0
        left join bd_invbasdoc c on c.pk_invbasdoc = b.pk_invbasdoc
        left join so_saleexecute d on a.corder_bid =  d.csale_bid and d.creceipttype=30
        left join so_sale e on e.csaleid = a.csaleid
        where a.dr = 0
        and a.csaleid in (
            select csaleid from so_sale where
            dr = 0
            <if test="dbilldate!=null and dbilldate!=''">
                and dbilldate = #{dbilldate}
            </if>
            <if test="cbiztype!=null and cbiztype!=''">
                and cbiztype = #{cbiztype}
            </if>
            <if test="csaleid!=null and csaleid!=''">
                and csaleid = #{csaleid}
            </if>
        )
        <if test="vdef19!=null and vdef19!=''">
            and d.vdef19 = #{vdef19}
        </if>
        <if test="vdef19ByIn!=null and vdef19ByIn!=''">
            and d.vdef19 in (${vdef19ByIn})
        </if>
    </select>
</mapper>

