<?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.SoSaleinvoiceBDaoImpl">

    <resultMap id="get-SoSaleinvoiceBEntity-result" type="com.hzya.frame.plugin.lets.entity.SoSaleinvoiceBEntity" >
       <result property="alrconfincomny" column="ALRCONFINCOMNY" jdbcType="VARCHAR"/>
           <result property="alrconfinconum" column="ALRCONFINCONUM" jdbcType="VARCHAR"/>
           <result property="blargessflag" column="BLARGESSFLAG" jdbcType="VARCHAR"/>
           <result property="cbatchid" column="CBATCHID" jdbcType="VARCHAR"/>
           <result property="cbodywarehouseid" column="CBODYWAREHOUSEID" jdbcType="VARCHAR"/>
           <result property="ccalbodyid" column="CCALBODYID" jdbcType="VARCHAR"/>
           <result property="ccurrencytypeid" column="CCURRENCYTYPEID" jdbcType="VARCHAR"/>
           <result property="ccustomerid" column="CCUSTOMERID" 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="cinvoiceBid" column="CINVOICE_BID" jdbcType="VARCHAR"/>
           <result property="coriginalbillcode" column="CORIGINALBILLCODE" jdbcType="VARCHAR"/>
           <result property="costsubjid" column="COSTSUBJID" jdbcType="VARCHAR"/>
           <result property="cpackunitid" column="CPACKUNITID" jdbcType="VARCHAR"/>
           <result property="cprolineid" column="CPROLINEID" jdbcType="VARCHAR"/>
           <result property="cquoteunitid" column="CQUOTEUNITID" jdbcType="VARCHAR"/>
           <result property="creceiptcorpid" column="CRECEIPTCORPID" jdbcType="VARCHAR"/>
           <result property="creceipttype" column="CRECEIPTTYPE" 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="ctManageid" column="CT_MANAGEID" jdbcType="VARCHAR"/>
           <result property="cunitid" column="CUNITID" jdbcType="VARCHAR"/>
           <result property="cupinvoicebillbodyid" column="CUPINVOICEBILLBODYID" jdbcType="VARCHAR"/>
           <result property="cupinvoicebillcode" column="CUPINVOICEBILLCODE" jdbcType="VARCHAR"/>
           <result property="cupinvoicebillid" column="CUPINVOICEBILLID" jdbcType="VARCHAR"/>
           <result property="cupreceipttype" column="CUPRECEIPTTYPE" jdbcType="VARCHAR"/>
           <result property="cupsourcebillbodyid" column="CUPSOURCEBILLBODYID" jdbcType="VARCHAR"/>
           <result property="cupsourcebillcode" column="CUPSOURCEBILLCODE" jdbcType="VARCHAR"/>
           <result property="cupsourcebillid" column="CUPSOURCEBILLID" jdbcType="VARCHAR"/>
           <result property="ddeliverdate" column="DDELIVERDATE" jdbcType="VARCHAR"/>
           <result property="dr" column="DR" jdbcType="VARCHAR"/>
           <result property="fbatchstatus" column="FBATCHSTATUS" jdbcType="VARCHAR"/>
           <result property="frownote" column="FROWNOTE" jdbcType="VARCHAR"/>
           <result property="frowstatus" column="FROWSTATUS" jdbcType="VARCHAR"/>
           <result property="inccontimepoint" column="INCCONTIMEPOINT" jdbcType="VARCHAR"/>
           <result property="inccontimepointname" column="INCCONTIMEPOINTNAME" jdbcType="VARCHAR"/>
           <result property="ncostmny" column="NCOSTMNY" 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="ninvoicediscountrate" column="NINVOICEDISCOUNTRATE" jdbcType="VARCHAR"/>
           <result property="nitemdiscountrate" column="NITEMDISCOUNTRATE" 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="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="nqocurtaxnetpri" column="NQOCURTAXNETPRI" jdbcType="VARCHAR"/>
           <result property="nqunetprice" column="NQUNETPRICE" jdbcType="VARCHAR"/>
           <result property="nquoricurnetpri" column="NQUORICURNETPRI" jdbcType="VARCHAR"/>
           <result property="nquoricurpri" column="NQUORICURPRI" jdbcType="VARCHAR"/>
           <result property="nquoricurtaxpri" column="NQUORICURTAXPRI" jdbcType="VARCHAR"/>
           <result property="nquotenumber" column="NQUOTENUMBER" jdbcType="VARCHAR"/>
           <result property="nquoteunitrate" column="NQUOTEUNITRATE" jdbcType="VARCHAR"/>
           <result property="nquprice" column="NQUPRICE" jdbcType="VARCHAR"/>
           <result property="nqutaxnetprice" column="NQUTAXNETPRICE" jdbcType="VARCHAR"/>
           <result property="nqutaxprice" column="NQUTAXPRICE" jdbcType="VARCHAR"/>
           <result property="nsimulatecostmny" column="NSIMULATECOSTMNY" jdbcType="VARCHAR"/>
           <result property="nsubcursummny" column="NSUBCURSUMMNY" jdbcType="VARCHAR"/>
           <result property="nsubqunetpri" column="NSUBQUNETPRI" jdbcType="VARCHAR"/>
           <result property="nsubqupri" column="NSUBQUPRI" jdbcType="VARCHAR"/>
           <result property="nsubqutaxnetpri" column="NSUBQUTAXNETPRI" jdbcType="VARCHAR"/>
           <result property="nsubqutaxpri" column="NSUBQUTAXPRI" jdbcType="VARCHAR"/>
           <result property="nsubsummny" column="NSUBSUMMNY" jdbcType="VARCHAR"/>
           <result property="nsubtaxnetprice" column="NSUBTAXNETPRICE" jdbcType="VARCHAR"/>
           <result property="nsummny" column="NSUMMNY" 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="ntotalapplydismny" column="NTOTALAPPLYDISMNY" jdbcType="VARCHAR"/>
           <result property="ntotalapplymny" column="NTOTALAPPLYMNY" jdbcType="VARCHAR"/>
           <result property="ntotalapplynumber" column="NTOTALAPPLYNUMBER" jdbcType="VARCHAR"/>
           <result property="ntotalapplysummny" column="NTOTALAPPLYSUMMNY" jdbcType="VARCHAR"/>
           <result property="ntotalapplytaxmny" column="NTOTALAPPLYTAXMNY" jdbcType="VARCHAR"/>
           <result property="ntotalhedgapplydismny" column="NTOTALHEDGAPPLYDISMNY" jdbcType="VARCHAR"/>
           <result property="ntotalhedgapplymny" column="NTOTALHEDGAPPLYMNY" jdbcType="VARCHAR"/>
           <result property="ntotalhedgapplynumber" column="NTOTALHEDGAPPLYNUMBER" jdbcType="VARCHAR"/>
           <result property="ntotalhedgapplysummny" column="NTOTALHEDGAPPLYSUMMNY" jdbcType="VARCHAR"/>
           <result property="ntotalhedgapplytaxmny" column="NTOTALHEDGAPPLYTAXMNY" jdbcType="VARCHAR"/>
           <result property="ntotaltoswymny" column="NTOTALTOSWYMNY" jdbcType="VARCHAR"/>
           <result property="ntotaltoswynumber" column="NTOTALTOSWYNUMBER" jdbcType="VARCHAR"/>
           <result property="pkCorp" column="PK_CORP" jdbcType="VARCHAR"/>
           <result property="pkTaxclass" column="PK_TAXCLASS" jdbcType="VARCHAR"/>
           <result property="ts" column="TS" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "SoSaleinvoiceBEntity_Base_Column_List">
        ALRCONFINCOMNY
       ,ALRCONFINCONUM 
        ,BLARGESSFLAG 
        ,CBATCHID 
        ,CBODYWAREHOUSEID 
        ,CCALBODYID 
        ,CCURRENCYTYPEID 
        ,CCUSTOMERID 
        ,CFREEZEID 
        ,CINVBASDOCID 
        ,CINVENTORYID 
        ,CINVOICE_BID 
        ,CORIGINALBILLCODE 
        ,COSTSUBJID 
        ,CPACKUNITID 
        ,CPROLINEID 
        ,CQUOTEUNITID 
        ,CRECEIPTCORPID 
        ,CRECEIPTTYPE 
        ,CROWNO 
        ,CSALEID 
        ,CSOURCEBILLBODYID 
        ,CSOURCEBILLID 
        ,CT_MANAGEID 
        ,CUNITID 
        ,CUPINVOICEBILLBODYID 
        ,CUPINVOICEBILLCODE 
        ,CUPINVOICEBILLID 
        ,CUPRECEIPTTYPE 
        ,CUPSOURCEBILLBODYID 
        ,CUPSOURCEBILLCODE 
        ,CUPSOURCEBILLID 
        ,DDELIVERDATE 
        ,DR 
        ,FBATCHSTATUS 
        ,FROWNOTE 
        ,FROWSTATUS 
        ,INCCONTIMEPOINT 
        ,INCCONTIMEPOINTNAME 
        ,NCOSTMNY 
        ,NDISCOUNTMNY 
        ,NDISCOUNTRATE 
        ,NEXCHANGEOTOBRATE 
        ,NINVOICEDISCOUNTRATE 
        ,NITEMDISCOUNTRATE 
        ,NMNY 
        ,NNETPRICE 
        ,NNUMBER 
        ,NORIGINALCURDISCOUNTMNY 
        ,NORIGINALCURMNY 
        ,NORIGINALCURNETPRICE 
        ,NORIGINALCURPRICE 
        ,NORIGINALCURSUMMNY 
        ,NORIGINALCURTAXMNY 
        ,NORIGINALCURTAXNETPRICE 
        ,NORIGINALCURTAXPRICE 
        ,NPACKNUMBER 
        ,NPRICE 
        ,NQOCURTAXNETPRI 
        ,NQUNETPRICE 
        ,NQUORICURNETPRI 
        ,NQUORICURPRI 
        ,NQUORICURTAXPRI 
        ,NQUOTENUMBER 
        ,NQUOTEUNITRATE 
        ,NQUPRICE 
        ,NQUTAXNETPRICE 
        ,NQUTAXPRICE 
        ,NSIMULATECOSTMNY 
        ,NSUBCURSUMMNY 
        ,NSUBQUNETPRI 
        ,NSUBQUPRI 
        ,NSUBQUTAXNETPRI 
        ,NSUBQUTAXPRI 
        ,NSUBSUMMNY 
        ,NSUBTAXNETPRICE 
        ,NSUMMNY 
        ,NTAXMNY 
        ,NTAXNETPRICE 
        ,NTAXPRICE 
        ,NTAXRATE 
        ,NTOTALAPPLYDISMNY 
        ,NTOTALAPPLYMNY 
        ,NTOTALAPPLYNUMBER 
        ,NTOTALAPPLYSUMMNY 
        ,NTOTALAPPLYTAXMNY 
        ,NTOTALHEDGAPPLYDISMNY 
        ,NTOTALHEDGAPPLYMNY 
        ,NTOTALHEDGAPPLYNUMBER 
        ,NTOTALHEDGAPPLYSUMMNY 
        ,NTOTALHEDGAPPLYTAXMNY 
        ,NTOTALTOSWYMNY 
        ,NTOTALTOSWYNUMBER 
        ,PK_CORP 
        ,PK_TAXCLASS 
        ,TS 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-SoSaleinvoiceBEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleinvoiceBEntity">
    select
    <include refid="SoSaleinvoiceBEntity_Base_Column_List" />
    from SO_SALEINVOICE_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="blargessflag != null and blargessflag != ''"> and BLARGESSFLAG = #{blargessflag} </if>
            <if test="cbatchid != null and cbatchid != ''"> and CBATCHID = #{cbatchid} </if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> and CBODYWAREHOUSEID = #{cbodywarehouseid} </if>
            <if test="ccalbodyid != null and ccalbodyid != ''"> and CCALBODYID = #{ccalbodyid} </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and CCURRENCYTYPEID = #{ccurrencytypeid} </if>
            <if test="ccustomerid != null and ccustomerid != ''"> and CCUSTOMERID = #{ccustomerid} </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="cinvoiceBid != null and cinvoiceBid != ''"> and CINVOICE_BID = #{cinvoiceBid} </if>
            <if test="coriginalbillcode != null and coriginalbillcode != ''"> and CORIGINALBILLCODE = #{coriginalbillcode} </if>
            <if test="costsubjid != null and costsubjid != ''"> and COSTSUBJID = #{costsubjid} </if>
            <if test="cpackunitid != null and cpackunitid != ''"> and CPACKUNITID = #{cpackunitid} </if>
            <if test="cprolineid != null and cprolineid != ''"> and CPROLINEID = #{cprolineid} </if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> and CQUOTEUNITID = #{cquoteunitid} </if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> and CRECEIPTCORPID = #{creceiptcorpid} </if>
            <if test="creceipttype != null and creceipttype != ''"> and CRECEIPTTYPE = #{creceipttype} </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="ctManageid != null and ctManageid != ''"> and CT_MANAGEID = #{ctManageid} </if>
            <if test="cunitid != null and cunitid != ''"> and CUNITID = #{cunitid} </if>
            <if test="cupinvoicebillbodyid != null and cupinvoicebillbodyid != ''"> and CUPINVOICEBILLBODYID = #{cupinvoicebillbodyid} </if>
            <if test="cupinvoicebillcode != null and cupinvoicebillcode != ''"> and CUPINVOICEBILLCODE = #{cupinvoicebillcode} </if>
            <if test="cupinvoicebillid != null and cupinvoicebillid != ''"> and CUPINVOICEBILLID = #{cupinvoicebillid} </if>
            <if test="cupreceipttype != null and cupreceipttype != ''"> and CUPRECEIPTTYPE = #{cupreceipttype} </if>
            <if test="cupsourcebillbodyid != null and cupsourcebillbodyid != ''"> and CUPSOURCEBILLBODYID = #{cupsourcebillbodyid} </if>
            <if test="cupsourcebillcode != null and cupsourcebillcode != ''"> and CUPSOURCEBILLCODE = #{cupsourcebillcode} </if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> and CUPSOURCEBILLID = #{cupsourcebillid} </if>
            <if test="ddeliverdate != null and ddeliverdate != ''"> and DDELIVERDATE = #{ddeliverdate} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="fbatchstatus != null and fbatchstatus != ''"> and FBATCHSTATUS = #{fbatchstatus} </if>
            <if test="frownote != null and frownote != ''"> and FROWNOTE = #{frownote} </if>
            <if test="frowstatus != null and frowstatus != ''"> 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="ncostmny != null and ncostmny != ''"> and NCOSTMNY = #{ncostmny} </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="ninvoicediscountrate != null and ninvoicediscountrate != ''"> and NINVOICEDISCOUNTRATE = #{ninvoicediscountrate} </if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> and NITEMDISCOUNTRATE = #{nitemdiscountrate} </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="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="nqocurtaxnetpri != null and nqocurtaxnetpri != ''"> and NQOCURTAXNETPRI = #{nqocurtaxnetpri} </if>
            <if test="nqunetprice != null and nqunetprice != ''"> and NQUNETPRICE = #{nqunetprice} </if>
            <if test="nquoricurnetpri != null and nquoricurnetpri != ''"> and NQUORICURNETPRI = #{nquoricurnetpri} </if>
            <if test="nquoricurpri != null and nquoricurpri != ''"> and NQUORICURPRI = #{nquoricurpri} </if>
            <if test="nquoricurtaxpri != null and nquoricurtaxpri != ''"> and NQUORICURTAXPRI = #{nquoricurtaxpri} </if>
            <if test="nquotenumber != null and nquotenumber != ''"> and NQUOTENUMBER = #{nquotenumber} </if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> and NQUOTEUNITRATE = #{nquoteunitrate} </if>
            <if test="nquprice != null and nquprice != ''"> and NQUPRICE = #{nquprice} </if>
            <if test="nqutaxnetprice != null and nqutaxnetprice != ''"> and NQUTAXNETPRICE = #{nqutaxnetprice} </if>
            <if test="nqutaxprice != null and nqutaxprice != ''"> and NQUTAXPRICE = #{nqutaxprice} </if>
            <if test="nsimulatecostmny != null and nsimulatecostmny != ''"> and NSIMULATECOSTMNY = #{nsimulatecostmny} </if>
            <if test="nsubcursummny != null and nsubcursummny != ''"> and NSUBCURSUMMNY = #{nsubcursummny} </if>
            <if test="nsubqunetpri != null and nsubqunetpri != ''"> and NSUBQUNETPRI = #{nsubqunetpri} </if>
            <if test="nsubqupri != null and nsubqupri != ''"> and NSUBQUPRI = #{nsubqupri} </if>
            <if test="nsubqutaxnetpri != null and nsubqutaxnetpri != ''"> and NSUBQUTAXNETPRI = #{nsubqutaxnetpri} </if>
            <if test="nsubqutaxpri != null and nsubqutaxpri != ''"> and NSUBQUTAXPRI = #{nsubqutaxpri} </if>
            <if test="nsubsummny != null and nsubsummny != ''"> and NSUBSUMMNY = #{nsubsummny} </if>
            <if test="nsubtaxnetprice != null and nsubtaxnetprice != ''"> and NSUBTAXNETPRICE = #{nsubtaxnetprice} </if>
            <if test="nsummny != null and nsummny != ''"> and NSUMMNY = #{nsummny} </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="ntotalapplydismny != null and ntotalapplydismny != ''"> and NTOTALAPPLYDISMNY = #{ntotalapplydismny} </if>
            <if test="ntotalapplymny != null and ntotalapplymny != ''"> and NTOTALAPPLYMNY = #{ntotalapplymny} </if>
            <if test="ntotalapplynumber != null and ntotalapplynumber != ''"> and NTOTALAPPLYNUMBER = #{ntotalapplynumber} </if>
            <if test="ntotalapplysummny != null and ntotalapplysummny != ''"> and NTOTALAPPLYSUMMNY = #{ntotalapplysummny} </if>
            <if test="ntotalapplytaxmny != null and ntotalapplytaxmny != ''"> and NTOTALAPPLYTAXMNY = #{ntotalapplytaxmny} </if>
            <if test="ntotalhedgapplydismny != null and ntotalhedgapplydismny != ''"> and NTOTALHEDGAPPLYDISMNY = #{ntotalhedgapplydismny} </if>
            <if test="ntotalhedgapplymny != null and ntotalhedgapplymny != ''"> and NTOTALHEDGAPPLYMNY = #{ntotalhedgapplymny} </if>
            <if test="ntotalhedgapplynumber != null and ntotalhedgapplynumber != ''"> and NTOTALHEDGAPPLYNUMBER = #{ntotalhedgapplynumber} </if>
            <if test="ntotalhedgapplysummny != null and ntotalhedgapplysummny != ''"> and NTOTALHEDGAPPLYSUMMNY = #{ntotalhedgapplysummny} </if>
            <if test="ntotalhedgapplytaxmny != null and ntotalhedgapplytaxmny != ''"> and NTOTALHEDGAPPLYTAXMNY = #{ntotalhedgapplytaxmny} </if>
            <if test="ntotaltoswymny != null and ntotaltoswymny != ''"> and NTOTALTOSWYMNY = #{ntotaltoswymny} </if>
            <if test="ntotaltoswynumber != null and ntotaltoswynumber != ''"> and NTOTALTOSWYNUMBER = #{ntotaltoswynumber} </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
            <if test="pkTaxclass != null and pkTaxclass != ''"> and PK_TAXCLASS = #{pkTaxclass} </if>
            <if test="ts != null and ts != ''"> and TS = #{ts} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
    
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleinvoiceBEntity">
        select  count(1)   from SO_SALEINVOICE_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="blargessflag != null and blargessflag != ''"> and BLARGESSFLAG = #{blargessflag} </if>
            <if test="cbatchid != null and cbatchid != ''"> and CBATCHID = #{cbatchid} </if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> and CBODYWAREHOUSEID = #{cbodywarehouseid} </if>
            <if test="ccalbodyid != null and ccalbodyid != ''"> and CCALBODYID = #{ccalbodyid} </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and CCURRENCYTYPEID = #{ccurrencytypeid} </if>
            <if test="ccustomerid != null and ccustomerid != ''"> and CCUSTOMERID = #{ccustomerid} </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="cinvoiceBid != null and cinvoiceBid != ''"> and CINVOICE_BID = #{cinvoiceBid} </if>
            <if test="coriginalbillcode != null and coriginalbillcode != ''"> and CORIGINALBILLCODE = #{coriginalbillcode} </if>
            <if test="costsubjid != null and costsubjid != ''"> and COSTSUBJID = #{costsubjid} </if>
            <if test="cpackunitid != null and cpackunitid != ''"> and CPACKUNITID = #{cpackunitid} </if>
            <if test="cprolineid != null and cprolineid != ''"> and CPROLINEID = #{cprolineid} </if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> and CQUOTEUNITID = #{cquoteunitid} </if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> and CRECEIPTCORPID = #{creceiptcorpid} </if>
            <if test="creceipttype != null and creceipttype != ''"> and CRECEIPTTYPE = #{creceipttype} </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="ctManageid != null and ctManageid != ''"> and CT_MANAGEID = #{ctManageid} </if>
            <if test="cunitid != null and cunitid != ''"> and CUNITID = #{cunitid} </if>
            <if test="cupinvoicebillbodyid != null and cupinvoicebillbodyid != ''"> and CUPINVOICEBILLBODYID = #{cupinvoicebillbodyid} </if>
            <if test="cupinvoicebillcode != null and cupinvoicebillcode != ''"> and CUPINVOICEBILLCODE = #{cupinvoicebillcode} </if>
            <if test="cupinvoicebillid != null and cupinvoicebillid != ''"> and CUPINVOICEBILLID = #{cupinvoicebillid} </if>
            <if test="cupreceipttype != null and cupreceipttype != ''"> and CUPRECEIPTTYPE = #{cupreceipttype} </if>
            <if test="cupsourcebillbodyid != null and cupsourcebillbodyid != ''"> and CUPSOURCEBILLBODYID = #{cupsourcebillbodyid} </if>
            <if test="cupsourcebillcode != null and cupsourcebillcode != ''"> and CUPSOURCEBILLCODE = #{cupsourcebillcode} </if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> and CUPSOURCEBILLID = #{cupsourcebillid} </if>
            <if test="ddeliverdate != null and ddeliverdate != ''"> and DDELIVERDATE = #{ddeliverdate} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="fbatchstatus != null and fbatchstatus != ''"> and FBATCHSTATUS = #{fbatchstatus} </if>
            <if test="frownote != null and frownote != ''"> and FROWNOTE = #{frownote} </if>
            <if test="frowstatus != null and frowstatus != ''"> 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="ncostmny != null and ncostmny != ''"> and NCOSTMNY = #{ncostmny} </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="ninvoicediscountrate != null and ninvoicediscountrate != ''"> and NINVOICEDISCOUNTRATE = #{ninvoicediscountrate} </if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> and NITEMDISCOUNTRATE = #{nitemdiscountrate} </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="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="nqocurtaxnetpri != null and nqocurtaxnetpri != ''"> and NQOCURTAXNETPRI = #{nqocurtaxnetpri} </if>
            <if test="nqunetprice != null and nqunetprice != ''"> and NQUNETPRICE = #{nqunetprice} </if>
            <if test="nquoricurnetpri != null and nquoricurnetpri != ''"> and NQUORICURNETPRI = #{nquoricurnetpri} </if>
            <if test="nquoricurpri != null and nquoricurpri != ''"> and NQUORICURPRI = #{nquoricurpri} </if>
            <if test="nquoricurtaxpri != null and nquoricurtaxpri != ''"> and NQUORICURTAXPRI = #{nquoricurtaxpri} </if>
            <if test="nquotenumber != null and nquotenumber != ''"> and NQUOTENUMBER = #{nquotenumber} </if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> and NQUOTEUNITRATE = #{nquoteunitrate} </if>
            <if test="nquprice != null and nquprice != ''"> and NQUPRICE = #{nquprice} </if>
            <if test="nqutaxnetprice != null and nqutaxnetprice != ''"> and NQUTAXNETPRICE = #{nqutaxnetprice} </if>
            <if test="nqutaxprice != null and nqutaxprice != ''"> and NQUTAXPRICE = #{nqutaxprice} </if>
            <if test="nsimulatecostmny != null and nsimulatecostmny != ''"> and NSIMULATECOSTMNY = #{nsimulatecostmny} </if>
            <if test="nsubcursummny != null and nsubcursummny != ''"> and NSUBCURSUMMNY = #{nsubcursummny} </if>
            <if test="nsubqunetpri != null and nsubqunetpri != ''"> and NSUBQUNETPRI = #{nsubqunetpri} </if>
            <if test="nsubqupri != null and nsubqupri != ''"> and NSUBQUPRI = #{nsubqupri} </if>
            <if test="nsubqutaxnetpri != null and nsubqutaxnetpri != ''"> and NSUBQUTAXNETPRI = #{nsubqutaxnetpri} </if>
            <if test="nsubqutaxpri != null and nsubqutaxpri != ''"> and NSUBQUTAXPRI = #{nsubqutaxpri} </if>
            <if test="nsubsummny != null and nsubsummny != ''"> and NSUBSUMMNY = #{nsubsummny} </if>
            <if test="nsubtaxnetprice != null and nsubtaxnetprice != ''"> and NSUBTAXNETPRICE = #{nsubtaxnetprice} </if>
            <if test="nsummny != null and nsummny != ''"> and NSUMMNY = #{nsummny} </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="ntotalapplydismny != null and ntotalapplydismny != ''"> and NTOTALAPPLYDISMNY = #{ntotalapplydismny} </if>
            <if test="ntotalapplymny != null and ntotalapplymny != ''"> and NTOTALAPPLYMNY = #{ntotalapplymny} </if>
            <if test="ntotalapplynumber != null and ntotalapplynumber != ''"> and NTOTALAPPLYNUMBER = #{ntotalapplynumber} </if>
            <if test="ntotalapplysummny != null and ntotalapplysummny != ''"> and NTOTALAPPLYSUMMNY = #{ntotalapplysummny} </if>
            <if test="ntotalapplytaxmny != null and ntotalapplytaxmny != ''"> and NTOTALAPPLYTAXMNY = #{ntotalapplytaxmny} </if>
            <if test="ntotalhedgapplydismny != null and ntotalhedgapplydismny != ''"> and NTOTALHEDGAPPLYDISMNY = #{ntotalhedgapplydismny} </if>
            <if test="ntotalhedgapplymny != null and ntotalhedgapplymny != ''"> and NTOTALHEDGAPPLYMNY = #{ntotalhedgapplymny} </if>
            <if test="ntotalhedgapplynumber != null and ntotalhedgapplynumber != ''"> and NTOTALHEDGAPPLYNUMBER = #{ntotalhedgapplynumber} </if>
            <if test="ntotalhedgapplysummny != null and ntotalhedgapplysummny != ''"> and NTOTALHEDGAPPLYSUMMNY = #{ntotalhedgapplysummny} </if>
            <if test="ntotalhedgapplytaxmny != null and ntotalhedgapplytaxmny != ''"> and NTOTALHEDGAPPLYTAXMNY = #{ntotalhedgapplytaxmny} </if>
            <if test="ntotaltoswymny != null and ntotaltoswymny != ''"> and NTOTALTOSWYMNY = #{ntotaltoswymny} </if>
            <if test="ntotaltoswynumber != null and ntotaltoswynumber != ''"> and NTOTALTOSWYNUMBER = #{ntotaltoswynumber} </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
            <if test="pkTaxclass != null and pkTaxclass != ''"> and PK_TAXCLASS = #{pkTaxclass} </if>
            <if test="ts != null and ts != ''"> and TS = #{ts} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
    </select>

    <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SoSaleinvoiceBEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleinvoiceBEntity">
    select
    <include refid="SoSaleinvoiceBEntity_Base_Column_List" />
    from SO_SALEINVOICE_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="blargessflag != null and blargessflag != ''"> and BLARGESSFLAG like concat('%',#{blargessflag},'%') </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="ccalbodyid != null and ccalbodyid != ''"> and CCALBODYID like concat('%',#{ccalbodyid},'%') </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and CCURRENCYTYPEID like concat('%',#{ccurrencytypeid},'%') </if>
            <if test="ccustomerid != null and ccustomerid != ''"> and CCUSTOMERID like concat('%',#{ccustomerid},'%') </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="cinvoiceBid != null and cinvoiceBid != ''"> and CINVOICE_BID like concat('%',#{cinvoiceBid},'%') </if>
            <if test="coriginalbillcode != null and coriginalbillcode != ''"> and CORIGINALBILLCODE like concat('%',#{coriginalbillcode},'%') </if>
            <if test="costsubjid != null and costsubjid != ''"> and COSTSUBJID like concat('%',#{costsubjid},'%') </if>
            <if test="cpackunitid != null and cpackunitid != ''"> and CPACKUNITID like concat('%',#{cpackunitid},'%') </if>
            <if test="cprolineid != null and cprolineid != ''"> and CPROLINEID like concat('%',#{cprolineid},'%') </if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> and CQUOTEUNITID like concat('%',#{cquoteunitid},'%') </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="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="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="cupinvoicebillbodyid != null and cupinvoicebillbodyid != ''"> and CUPINVOICEBILLBODYID like concat('%',#{cupinvoicebillbodyid},'%') </if>
            <if test="cupinvoicebillcode != null and cupinvoicebillcode != ''"> and CUPINVOICEBILLCODE like concat('%',#{cupinvoicebillcode},'%') </if>
            <if test="cupinvoicebillid != null and cupinvoicebillid != ''"> and CUPINVOICEBILLID like concat('%',#{cupinvoicebillid},'%') </if>
            <if test="cupreceipttype != null and cupreceipttype != ''"> and CUPRECEIPTTYPE like concat('%',#{cupreceipttype},'%') </if>
            <if test="cupsourcebillbodyid != null and cupsourcebillbodyid != ''"> and CUPSOURCEBILLBODYID like concat('%',#{cupsourcebillbodyid},'%') </if>
            <if test="cupsourcebillcode != null and cupsourcebillcode != ''"> and CUPSOURCEBILLCODE like concat('%',#{cupsourcebillcode},'%') </if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> and CUPSOURCEBILLID like concat('%',#{cupsourcebillid},'%') </if>
            <if test="ddeliverdate != null and ddeliverdate != ''"> and DDELIVERDATE like concat('%',#{ddeliverdate},'%') </if>
            <if test="dr != null and dr != ''"> and DR like concat('%',#{dr},'%') </if>
            <if test="fbatchstatus != null and fbatchstatus != ''"> and FBATCHSTATUS like concat('%',#{fbatchstatus},'%') </if>
            <if test="frownote != null and frownote != ''"> and FROWNOTE like concat('%',#{frownote},'%') </if>
            <if test="frowstatus != null and frowstatus != ''"> 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="ncostmny != null and ncostmny != ''"> and NCOSTMNY like concat('%',#{ncostmny},'%') </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="ninvoicediscountrate != null and ninvoicediscountrate != ''"> and NINVOICEDISCOUNTRATE like concat('%',#{ninvoicediscountrate},'%') </if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> and NITEMDISCOUNTRATE like concat('%',#{nitemdiscountrate},'%') </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="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="nqocurtaxnetpri != null and nqocurtaxnetpri != ''"> and NQOCURTAXNETPRI like concat('%',#{nqocurtaxnetpri},'%') </if>
            <if test="nqunetprice != null and nqunetprice != ''"> and NQUNETPRICE like concat('%',#{nqunetprice},'%') </if>
            <if test="nquoricurnetpri != null and nquoricurnetpri != ''"> and NQUORICURNETPRI like concat('%',#{nquoricurnetpri},'%') </if>
            <if test="nquoricurpri != null and nquoricurpri != ''"> and NQUORICURPRI like concat('%',#{nquoricurpri},'%') </if>
            <if test="nquoricurtaxpri != null and nquoricurtaxpri != ''"> and NQUORICURTAXPRI like concat('%',#{nquoricurtaxpri},'%') </if>
            <if test="nquotenumber != null and nquotenumber != ''"> and NQUOTENUMBER like concat('%',#{nquotenumber},'%') </if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> and NQUOTEUNITRATE like concat('%',#{nquoteunitrate},'%') </if>
            <if test="nquprice != null and nquprice != ''"> and NQUPRICE like concat('%',#{nquprice},'%') </if>
            <if test="nqutaxnetprice != null and nqutaxnetprice != ''"> and NQUTAXNETPRICE like concat('%',#{nqutaxnetprice},'%') </if>
            <if test="nqutaxprice != null and nqutaxprice != ''"> and NQUTAXPRICE like concat('%',#{nqutaxprice},'%') </if>
            <if test="nsimulatecostmny != null and nsimulatecostmny != ''"> and NSIMULATECOSTMNY like concat('%',#{nsimulatecostmny},'%') </if>
            <if test="nsubcursummny != null and nsubcursummny != ''"> and NSUBCURSUMMNY like concat('%',#{nsubcursummny},'%') </if>
            <if test="nsubqunetpri != null and nsubqunetpri != ''"> and NSUBQUNETPRI like concat('%',#{nsubqunetpri},'%') </if>
            <if test="nsubqupri != null and nsubqupri != ''"> and NSUBQUPRI like concat('%',#{nsubqupri},'%') </if>
            <if test="nsubqutaxnetpri != null and nsubqutaxnetpri != ''"> and NSUBQUTAXNETPRI like concat('%',#{nsubqutaxnetpri},'%') </if>
            <if test="nsubqutaxpri != null and nsubqutaxpri != ''"> and NSUBQUTAXPRI like concat('%',#{nsubqutaxpri},'%') </if>
            <if test="nsubsummny != null and nsubsummny != ''"> and NSUBSUMMNY like concat('%',#{nsubsummny},'%') </if>
            <if test="nsubtaxnetprice != null and nsubtaxnetprice != ''"> and NSUBTAXNETPRICE like concat('%',#{nsubtaxnetprice},'%') </if>
            <if test="nsummny != null and nsummny != ''"> and NSUMMNY like concat('%',#{nsummny},'%') </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="ntotalapplydismny != null and ntotalapplydismny != ''"> and NTOTALAPPLYDISMNY like concat('%',#{ntotalapplydismny},'%') </if>
            <if test="ntotalapplymny != null and ntotalapplymny != ''"> and NTOTALAPPLYMNY like concat('%',#{ntotalapplymny},'%') </if>
            <if test="ntotalapplynumber != null and ntotalapplynumber != ''"> and NTOTALAPPLYNUMBER like concat('%',#{ntotalapplynumber},'%') </if>
            <if test="ntotalapplysummny != null and ntotalapplysummny != ''"> and NTOTALAPPLYSUMMNY like concat('%',#{ntotalapplysummny},'%') </if>
            <if test="ntotalapplytaxmny != null and ntotalapplytaxmny != ''"> and NTOTALAPPLYTAXMNY like concat('%',#{ntotalapplytaxmny},'%') </if>
            <if test="ntotalhedgapplydismny != null and ntotalhedgapplydismny != ''"> and NTOTALHEDGAPPLYDISMNY like concat('%',#{ntotalhedgapplydismny},'%') </if>
            <if test="ntotalhedgapplymny != null and ntotalhedgapplymny != ''"> and NTOTALHEDGAPPLYMNY like concat('%',#{ntotalhedgapplymny},'%') </if>
            <if test="ntotalhedgapplynumber != null and ntotalhedgapplynumber != ''"> and NTOTALHEDGAPPLYNUMBER like concat('%',#{ntotalhedgapplynumber},'%') </if>
            <if test="ntotalhedgapplysummny != null and ntotalhedgapplysummny != ''"> and NTOTALHEDGAPPLYSUMMNY like concat('%',#{ntotalhedgapplysummny},'%') </if>
            <if test="ntotalhedgapplytaxmny != null and ntotalhedgapplytaxmny != ''"> and NTOTALHEDGAPPLYTAXMNY like concat('%',#{ntotalhedgapplytaxmny},'%') </if>
            <if test="ntotaltoswymny != null and ntotaltoswymny != ''"> and NTOTALTOSWYMNY like concat('%',#{ntotaltoswymny},'%') </if>
            <if test="ntotaltoswynumber != null and ntotaltoswynumber != ''"> and NTOTALTOSWYNUMBER like concat('%',#{ntotaltoswynumber},'%') </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP like concat('%',#{pkCorp},'%') </if>
            <if test="pkTaxclass != null and pkTaxclass != ''"> and PK_TAXCLASS like concat('%',#{pkTaxclass},'%') </if>
            <if test="ts != null and ts != ''"> and TS like concat('%',#{ts},'%') </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>

<!-- 查询列表 字段采用or格式 -->
<select id="SoSaleinvoiceBentity_list_or" resultMap="get-SoSaleinvoiceBEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleinvoiceBEntity">
    select
    <include refid="SoSaleinvoiceBEntity_Base_Column_List" />
    from SO_SALEINVOICE_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="blargessflag != null and blargessflag != ''"> or BLARGESSFLAG = #{blargessflag} </if>
             <if test="cbatchid != null and cbatchid != ''"> or CBATCHID = #{cbatchid} </if>
             <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> or CBODYWAREHOUSEID = #{cbodywarehouseid} </if>
             <if test="ccalbodyid != null and ccalbodyid != ''"> or CCALBODYID = #{ccalbodyid} </if>
             <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> or CCURRENCYTYPEID = #{ccurrencytypeid} </if>
             <if test="ccustomerid != null and ccustomerid != ''"> or CCUSTOMERID = #{ccustomerid} </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="cinvoiceBid != null and cinvoiceBid != ''"> or CINVOICE_BID = #{cinvoiceBid} </if>
             <if test="coriginalbillcode != null and coriginalbillcode != ''"> or CORIGINALBILLCODE = #{coriginalbillcode} </if>
             <if test="costsubjid != null and costsubjid != ''"> or COSTSUBJID = #{costsubjid} </if>
             <if test="cpackunitid != null and cpackunitid != ''"> or CPACKUNITID = #{cpackunitid} </if>
             <if test="cprolineid != null and cprolineid != ''"> or CPROLINEID = #{cprolineid} </if>
             <if test="cquoteunitid != null and cquoteunitid != ''"> or CQUOTEUNITID = #{cquoteunitid} </if>
             <if test="creceiptcorpid != null and creceiptcorpid != ''"> or CRECEIPTCORPID = #{creceiptcorpid} </if>
             <if test="creceipttype != null and creceipttype != ''"> or CRECEIPTTYPE = #{creceipttype} </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="ctManageid != null and ctManageid != ''"> or CT_MANAGEID = #{ctManageid} </if>
             <if test="cunitid != null and cunitid != ''"> or CUNITID = #{cunitid} </if>
             <if test="cupinvoicebillbodyid != null and cupinvoicebillbodyid != ''"> or CUPINVOICEBILLBODYID = #{cupinvoicebillbodyid} </if>
             <if test="cupinvoicebillcode != null and cupinvoicebillcode != ''"> or CUPINVOICEBILLCODE = #{cupinvoicebillcode} </if>
             <if test="cupinvoicebillid != null and cupinvoicebillid != ''"> or CUPINVOICEBILLID = #{cupinvoicebillid} </if>
             <if test="cupreceipttype != null and cupreceipttype != ''"> or CUPRECEIPTTYPE = #{cupreceipttype} </if>
             <if test="cupsourcebillbodyid != null and cupsourcebillbodyid != ''"> or CUPSOURCEBILLBODYID = #{cupsourcebillbodyid} </if>
             <if test="cupsourcebillcode != null and cupsourcebillcode != ''"> or CUPSOURCEBILLCODE = #{cupsourcebillcode} </if>
             <if test="cupsourcebillid != null and cupsourcebillid != ''"> or CUPSOURCEBILLID = #{cupsourcebillid} </if>
             <if test="ddeliverdate != null and ddeliverdate != ''"> or DDELIVERDATE = #{ddeliverdate} </if>
             <if test="dr != null and dr != ''"> or DR = #{dr} </if>
             <if test="fbatchstatus != null and fbatchstatus != ''"> or FBATCHSTATUS = #{fbatchstatus} </if>
             <if test="frownote != null and frownote != ''"> or FROWNOTE = #{frownote} </if>
             <if test="frowstatus != null and frowstatus != ''"> 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="ncostmny != null and ncostmny != ''"> or NCOSTMNY = #{ncostmny} </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="ninvoicediscountrate != null and ninvoicediscountrate != ''"> or NINVOICEDISCOUNTRATE = #{ninvoicediscountrate} </if>
             <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> or NITEMDISCOUNTRATE = #{nitemdiscountrate} </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="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="nqocurtaxnetpri != null and nqocurtaxnetpri != ''"> or NQOCURTAXNETPRI = #{nqocurtaxnetpri} </if>
             <if test="nqunetprice != null and nqunetprice != ''"> or NQUNETPRICE = #{nqunetprice} </if>
             <if test="nquoricurnetpri != null and nquoricurnetpri != ''"> or NQUORICURNETPRI = #{nquoricurnetpri} </if>
             <if test="nquoricurpri != null and nquoricurpri != ''"> or NQUORICURPRI = #{nquoricurpri} </if>
             <if test="nquoricurtaxpri != null and nquoricurtaxpri != ''"> or NQUORICURTAXPRI = #{nquoricurtaxpri} </if>
             <if test="nquotenumber != null and nquotenumber != ''"> or NQUOTENUMBER = #{nquotenumber} </if>
             <if test="nquoteunitrate != null and nquoteunitrate != ''"> or NQUOTEUNITRATE = #{nquoteunitrate} </if>
             <if test="nquprice != null and nquprice != ''"> or NQUPRICE = #{nquprice} </if>
             <if test="nqutaxnetprice != null and nqutaxnetprice != ''"> or NQUTAXNETPRICE = #{nqutaxnetprice} </if>
             <if test="nqutaxprice != null and nqutaxprice != ''"> or NQUTAXPRICE = #{nqutaxprice} </if>
             <if test="nsimulatecostmny != null and nsimulatecostmny != ''"> or NSIMULATECOSTMNY = #{nsimulatecostmny} </if>
             <if test="nsubcursummny != null and nsubcursummny != ''"> or NSUBCURSUMMNY = #{nsubcursummny} </if>
             <if test="nsubqunetpri != null and nsubqunetpri != ''"> or NSUBQUNETPRI = #{nsubqunetpri} </if>
             <if test="nsubqupri != null and nsubqupri != ''"> or NSUBQUPRI = #{nsubqupri} </if>
             <if test="nsubqutaxnetpri != null and nsubqutaxnetpri != ''"> or NSUBQUTAXNETPRI = #{nsubqutaxnetpri} </if>
             <if test="nsubqutaxpri != null and nsubqutaxpri != ''"> or NSUBQUTAXPRI = #{nsubqutaxpri} </if>
             <if test="nsubsummny != null and nsubsummny != ''"> or NSUBSUMMNY = #{nsubsummny} </if>
             <if test="nsubtaxnetprice != null and nsubtaxnetprice != ''"> or NSUBTAXNETPRICE = #{nsubtaxnetprice} </if>
             <if test="nsummny != null and nsummny != ''"> or NSUMMNY = #{nsummny} </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="ntotalapplydismny != null and ntotalapplydismny != ''"> or NTOTALAPPLYDISMNY = #{ntotalapplydismny} </if>
             <if test="ntotalapplymny != null and ntotalapplymny != ''"> or NTOTALAPPLYMNY = #{ntotalapplymny} </if>
             <if test="ntotalapplynumber != null and ntotalapplynumber != ''"> or NTOTALAPPLYNUMBER = #{ntotalapplynumber} </if>
             <if test="ntotalapplysummny != null and ntotalapplysummny != ''"> or NTOTALAPPLYSUMMNY = #{ntotalapplysummny} </if>
             <if test="ntotalapplytaxmny != null and ntotalapplytaxmny != ''"> or NTOTALAPPLYTAXMNY = #{ntotalapplytaxmny} </if>
             <if test="ntotalhedgapplydismny != null and ntotalhedgapplydismny != ''"> or NTOTALHEDGAPPLYDISMNY = #{ntotalhedgapplydismny} </if>
             <if test="ntotalhedgapplymny != null and ntotalhedgapplymny != ''"> or NTOTALHEDGAPPLYMNY = #{ntotalhedgapplymny} </if>
             <if test="ntotalhedgapplynumber != null and ntotalhedgapplynumber != ''"> or NTOTALHEDGAPPLYNUMBER = #{ntotalhedgapplynumber} </if>
             <if test="ntotalhedgapplysummny != null and ntotalhedgapplysummny != ''"> or NTOTALHEDGAPPLYSUMMNY = #{ntotalhedgapplysummny} </if>
             <if test="ntotalhedgapplytaxmny != null and ntotalhedgapplytaxmny != ''"> or NTOTALHEDGAPPLYTAXMNY = #{ntotalhedgapplytaxmny} </if>
             <if test="ntotaltoswymny != null and ntotaltoswymny != ''"> or NTOTALTOSWYMNY = #{ntotaltoswymny} </if>
             <if test="ntotaltoswynumber != null and ntotaltoswynumber != ''"> or NTOTALTOSWYNUMBER = #{ntotaltoswynumber} </if>
             <if test="pkCorp != null and pkCorp != ''"> or PK_CORP = #{pkCorp} </if>
             <if test="pkTaxclass != null and pkTaxclass != ''"> or PK_TAXCLASS = #{pkTaxclass} </if>
             <if test="ts != null and ts != ''"> or TS = #{ts} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString()  "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>

<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleinvoiceBEntity" keyProperty="cinvoiceBid" useGeneratedKeys="true">
    insert into SO_SALEINVOICE_B(
  <trim suffix="" suffixOverrides=",">
       <if test="alrconfincomny != null and alrconfincomny != ''"> ALRCONFINCOMNY , </if>
            <if test="alrconfinconum != null and alrconfinconum != ''"> ALRCONFINCONUM , </if>
            <if test="blargessflag != null and blargessflag != ''"> BLARGESSFLAG , </if>
            <if test="cbatchid != null and cbatchid != ''"> CBATCHID , </if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> CBODYWAREHOUSEID , </if>
            <if test="ccalbodyid != null and ccalbodyid != ''"> CCALBODYID , </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> CCURRENCYTYPEID , </if>
            <if test="ccustomerid != null and ccustomerid != ''"> CCUSTOMERID , </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="cinvoiceBid != null and cinvoiceBid != ''"> CINVOICE_BID , </if>
            <if test="coriginalbillcode != null and coriginalbillcode != ''"> CORIGINALBILLCODE , </if>
            <if test="costsubjid != null and costsubjid != ''"> COSTSUBJID , </if>
            <if test="cpackunitid != null and cpackunitid != ''"> CPACKUNITID , </if>
            <if test="cprolineid != null and cprolineid != ''"> CPROLINEID , </if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> CQUOTEUNITID , </if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> CRECEIPTCORPID , </if>
            <if test="creceipttype != null and creceipttype != ''"> CRECEIPTTYPE , </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="ctManageid != null and ctManageid != ''"> CT_MANAGEID , </if>
            <if test="cunitid != null and cunitid != ''"> CUNITID , </if>
            <if test="cupinvoicebillbodyid != null and cupinvoicebillbodyid != ''"> CUPINVOICEBILLBODYID , </if>
            <if test="cupinvoicebillcode != null and cupinvoicebillcode != ''"> CUPINVOICEBILLCODE , </if>
            <if test="cupinvoicebillid != null and cupinvoicebillid != ''"> CUPINVOICEBILLID , </if>
            <if test="cupreceipttype != null and cupreceipttype != ''"> CUPRECEIPTTYPE , </if>
            <if test="cupsourcebillbodyid != null and cupsourcebillbodyid != ''"> CUPSOURCEBILLBODYID , </if>
            <if test="cupsourcebillcode != null and cupsourcebillcode != ''"> CUPSOURCEBILLCODE , </if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> CUPSOURCEBILLID , </if>
            <if test="ddeliverdate != null 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 != ''"> FROWNOTE , </if>
            <if test="frowstatus != null and frowstatus != ''"> FROWSTATUS , </if>
            <if test="inccontimepoint != null and inccontimepoint != ''"> INCCONTIMEPOINT , </if>
            <if test="inccontimepointname != null and inccontimepointname != ''"> INCCONTIMEPOINTNAME , </if>
            <if test="ncostmny != null and ncostmny != ''"> NCOSTMNY , </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="ninvoicediscountrate != null and ninvoicediscountrate != ''"> NINVOICEDISCOUNTRATE , </if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> NITEMDISCOUNTRATE , </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="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="nqocurtaxnetpri != null and nqocurtaxnetpri != ''"> NQOCURTAXNETPRI , </if>
            <if test="nqunetprice != null and nqunetprice != ''"> NQUNETPRICE , </if>
            <if test="nquoricurnetpri != null and nquoricurnetpri != ''"> NQUORICURNETPRI , </if>
            <if test="nquoricurpri != null and nquoricurpri != ''"> NQUORICURPRI , </if>
            <if test="nquoricurtaxpri != null and nquoricurtaxpri != ''"> NQUORICURTAXPRI , </if>
            <if test="nquotenumber != null and nquotenumber != ''"> NQUOTENUMBER , </if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> NQUOTEUNITRATE , </if>
            <if test="nquprice != null and nquprice != ''"> NQUPRICE , </if>
            <if test="nqutaxnetprice != null and nqutaxnetprice != ''"> NQUTAXNETPRICE , </if>
            <if test="nqutaxprice != null and nqutaxprice != ''"> NQUTAXPRICE , </if>
            <if test="nsimulatecostmny != null and nsimulatecostmny != ''"> NSIMULATECOSTMNY , </if>
            <if test="nsubcursummny != null and nsubcursummny != ''"> NSUBCURSUMMNY , </if>
            <if test="nsubqunetpri != null and nsubqunetpri != ''"> NSUBQUNETPRI , </if>
            <if test="nsubqupri != null and nsubqupri != ''"> NSUBQUPRI , </if>
            <if test="nsubqutaxnetpri != null and nsubqutaxnetpri != ''"> NSUBQUTAXNETPRI , </if>
            <if test="nsubqutaxpri != null and nsubqutaxpri != ''"> NSUBQUTAXPRI , </if>
            <if test="nsubsummny != null and nsubsummny != ''"> NSUBSUMMNY , </if>
            <if test="nsubtaxnetprice != null and nsubtaxnetprice != ''"> NSUBTAXNETPRICE , </if>
            <if test="nsummny != null and nsummny != ''"> NSUMMNY , </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="ntotalapplydismny != null and ntotalapplydismny != ''"> NTOTALAPPLYDISMNY , </if>
            <if test="ntotalapplymny != null and ntotalapplymny != ''"> NTOTALAPPLYMNY , </if>
            <if test="ntotalapplynumber != null and ntotalapplynumber != ''"> NTOTALAPPLYNUMBER , </if>
            <if test="ntotalapplysummny != null and ntotalapplysummny != ''"> NTOTALAPPLYSUMMNY , </if>
            <if test="ntotalapplytaxmny != null and ntotalapplytaxmny != ''"> NTOTALAPPLYTAXMNY , </if>
            <if test="ntotalhedgapplydismny != null and ntotalhedgapplydismny != ''"> NTOTALHEDGAPPLYDISMNY , </if>
            <if test="ntotalhedgapplymny != null and ntotalhedgapplymny != ''"> NTOTALHEDGAPPLYMNY , </if>
            <if test="ntotalhedgapplynumber != null and ntotalhedgapplynumber != ''"> NTOTALHEDGAPPLYNUMBER , </if>
            <if test="ntotalhedgapplysummny != null and ntotalhedgapplysummny != ''"> NTOTALHEDGAPPLYSUMMNY , </if>
            <if test="ntotalhedgapplytaxmny != null and ntotalhedgapplytaxmny != ''"> NTOTALHEDGAPPLYTAXMNY , </if>
            <if test="ntotaltoswymny != null and ntotaltoswymny != ''"> NTOTALTOSWYMNY , </if>
            <if test="ntotaltoswynumber != null and ntotaltoswynumber != ''"> NTOTALTOSWYNUMBER , </if>
            <if test="pkCorp != null and pkCorp != ''"> PK_CORP , </if>
            <if test="pkTaxclass != null and pkTaxclass != ''"> PK_TAXCLASS , </if>
            <if test="ts != null and ts != ''"> TS , </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="blargessflag != null and blargessflag != ''"> #{blargessflag} ,</if>
            <if test="cbatchid != null and cbatchid != ''"> #{cbatchid} ,</if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> #{cbodywarehouseid} ,</if>
            <if test="ccalbodyid != null and ccalbodyid != ''"> #{ccalbodyid} ,</if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> #{ccurrencytypeid} ,</if>
            <if test="ccustomerid != null and ccustomerid != ''"> #{ccustomerid} ,</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="cinvoiceBid != null and cinvoiceBid != ''"> #{cinvoiceBid} ,</if>
            <if test="coriginalbillcode != null and coriginalbillcode != ''"> #{coriginalbillcode} ,</if>
            <if test="costsubjid != null and costsubjid != ''"> #{costsubjid} ,</if>
            <if test="cpackunitid != null and cpackunitid != ''"> #{cpackunitid} ,</if>
            <if test="cprolineid != null and cprolineid != ''"> #{cprolineid} ,</if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> #{cquoteunitid} ,</if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> #{creceiptcorpid} ,</if>
            <if test="creceipttype != null and creceipttype != ''"> #{creceipttype} ,</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="ctManageid != null and ctManageid != ''"> #{ctManageid} ,</if>
            <if test="cunitid != null and cunitid != ''"> #{cunitid} ,</if>
            <if test="cupinvoicebillbodyid != null and cupinvoicebillbodyid != ''"> #{cupinvoicebillbodyid} ,</if>
            <if test="cupinvoicebillcode != null and cupinvoicebillcode != ''"> #{cupinvoicebillcode} ,</if>
            <if test="cupinvoicebillid != null and cupinvoicebillid != ''"> #{cupinvoicebillid} ,</if>
            <if test="cupreceipttype != null and cupreceipttype != ''"> #{cupreceipttype} ,</if>
            <if test="cupsourcebillbodyid != null and cupsourcebillbodyid != ''"> #{cupsourcebillbodyid} ,</if>
            <if test="cupsourcebillcode != null and cupsourcebillcode != ''"> #{cupsourcebillcode} ,</if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> #{cupsourcebillid} ,</if>
            <if test="ddeliverdate != null 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 != ''"> #{frownote} ,</if>
            <if test="frowstatus != null and frowstatus != ''"> #{frowstatus} ,</if>
            <if test="inccontimepoint != null and inccontimepoint != ''"> #{inccontimepoint} ,</if>
            <if test="inccontimepointname != null and inccontimepointname != ''"> #{inccontimepointname} ,</if>
            <if test="ncostmny != null and ncostmny != ''"> #{ncostmny} ,</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="ninvoicediscountrate != null and ninvoicediscountrate != ''"> #{ninvoicediscountrate} ,</if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> #{nitemdiscountrate} ,</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="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="nqocurtaxnetpri != null and nqocurtaxnetpri != ''"> #{nqocurtaxnetpri} ,</if>
            <if test="nqunetprice != null and nqunetprice != ''"> #{nqunetprice} ,</if>
            <if test="nquoricurnetpri != null and nquoricurnetpri != ''"> #{nquoricurnetpri} ,</if>
            <if test="nquoricurpri != null and nquoricurpri != ''"> #{nquoricurpri} ,</if>
            <if test="nquoricurtaxpri != null and nquoricurtaxpri != ''"> #{nquoricurtaxpri} ,</if>
            <if test="nquotenumber != null and nquotenumber != ''"> #{nquotenumber} ,</if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> #{nquoteunitrate} ,</if>
            <if test="nquprice != null and nquprice != ''"> #{nquprice} ,</if>
            <if test="nqutaxnetprice != null and nqutaxnetprice != ''"> #{nqutaxnetprice} ,</if>
            <if test="nqutaxprice != null and nqutaxprice != ''"> #{nqutaxprice} ,</if>
            <if test="nsimulatecostmny != null and nsimulatecostmny != ''"> #{nsimulatecostmny} ,</if>
            <if test="nsubcursummny != null and nsubcursummny != ''"> #{nsubcursummny} ,</if>
            <if test="nsubqunetpri != null and nsubqunetpri != ''"> #{nsubqunetpri} ,</if>
            <if test="nsubqupri != null and nsubqupri != ''"> #{nsubqupri} ,</if>
            <if test="nsubqutaxnetpri != null and nsubqutaxnetpri != ''"> #{nsubqutaxnetpri} ,</if>
            <if test="nsubqutaxpri != null and nsubqutaxpri != ''"> #{nsubqutaxpri} ,</if>
            <if test="nsubsummny != null and nsubsummny != ''"> #{nsubsummny} ,</if>
            <if test="nsubtaxnetprice != null and nsubtaxnetprice != ''"> #{nsubtaxnetprice} ,</if>
            <if test="nsummny != null and nsummny != ''"> #{nsummny} ,</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="ntotalapplydismny != null and ntotalapplydismny != ''"> #{ntotalapplydismny} ,</if>
            <if test="ntotalapplymny != null and ntotalapplymny != ''"> #{ntotalapplymny} ,</if>
            <if test="ntotalapplynumber != null and ntotalapplynumber != ''"> #{ntotalapplynumber} ,</if>
            <if test="ntotalapplysummny != null and ntotalapplysummny != ''"> #{ntotalapplysummny} ,</if>
            <if test="ntotalapplytaxmny != null and ntotalapplytaxmny != ''"> #{ntotalapplytaxmny} ,</if>
            <if test="ntotalhedgapplydismny != null and ntotalhedgapplydismny != ''"> #{ntotalhedgapplydismny} ,</if>
            <if test="ntotalhedgapplymny != null and ntotalhedgapplymny != ''"> #{ntotalhedgapplymny} ,</if>
            <if test="ntotalhedgapplynumber != null and ntotalhedgapplynumber != ''"> #{ntotalhedgapplynumber} ,</if>
            <if test="ntotalhedgapplysummny != null and ntotalhedgapplysummny != ''"> #{ntotalhedgapplysummny} ,</if>
            <if test="ntotalhedgapplytaxmny != null and ntotalhedgapplytaxmny != ''"> #{ntotalhedgapplytaxmny} ,</if>
            <if test="ntotaltoswymny != null and ntotaltoswymny != ''"> #{ntotaltoswymny} ,</if>
            <if test="ntotaltoswynumber != null and ntotaltoswynumber != ''"> #{ntotaltoswynumber} ,</if>
            <if test="pkCorp != null and pkCorp != ''"> #{pkCorp} ,</if>
            <if test="pkTaxclass != null and pkTaxclass != ''"> #{pkTaxclass} ,</if>
            <if test="ts != null and ts != ''"> #{ts} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from SO_SALEINVOICE_B a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="cinvoiceBid" useGeneratedKeys="true">
  insert into SO_SALEINVOICE_B(ALRCONFINCOMNY, ALRCONFINCONUM, BLARGESSFLAG, CBATCHID, CBODYWAREHOUSEID, CCALBODYID, CCURRENCYTYPEID, CCUSTOMERID, CFREEZEID, CINVBASDOCID, CINVENTORYID, CORIGINALBILLCODE, COSTSUBJID, CPACKUNITID, CPROLINEID, CQUOTEUNITID, CRECEIPTCORPID, CRECEIPTTYPE, CROWNO, CSALEID, CSOURCEBILLBODYID, CSOURCEBILLID, CT_MANAGEID, CUNITID, CUPINVOICEBILLBODYID, CUPINVOICEBILLCODE, CUPINVOICEBILLID, CUPRECEIPTTYPE, CUPSOURCEBILLBODYID, CUPSOURCEBILLCODE, CUPSOURCEBILLID, DDELIVERDATE, DR, FBATCHSTATUS, FROWNOTE, FROWSTATUS, INCCONTIMEPOINT, INCCONTIMEPOINTNAME, NCOSTMNY, NDISCOUNTMNY, NDISCOUNTRATE, NEXCHANGEOTOBRATE, NINVOICEDISCOUNTRATE, NITEMDISCOUNTRATE, NMNY, NNETPRICE, NNUMBER, NORIGINALCURDISCOUNTMNY, NORIGINALCURMNY, NORIGINALCURNETPRICE, NORIGINALCURPRICE, NORIGINALCURSUMMNY, NORIGINALCURTAXMNY, NORIGINALCURTAXNETPRICE, NORIGINALCURTAXPRICE, NPACKNUMBER, NPRICE, NQOCURTAXNETPRI, NQUNETPRICE, NQUORICURNETPRI, NQUORICURPRI, NQUORICURTAXPRI, NQUOTENUMBER, NQUOTEUNITRATE, NQUPRICE, NQUTAXNETPRICE, NQUTAXPRICE, NSIMULATECOSTMNY, NSUBCURSUMMNY, NSUBQUNETPRI, NSUBQUPRI, NSUBQUTAXNETPRI, NSUBQUTAXPRI, NSUBSUMMNY, NSUBTAXNETPRICE, NSUMMNY, NTAXMNY, NTAXNETPRICE, NTAXPRICE, NTAXRATE, NTOTALAPPLYDISMNY, NTOTALAPPLYMNY, NTOTALAPPLYNUMBER, NTOTALAPPLYSUMMNY, NTOTALAPPLYTAXMNY, NTOTALHEDGAPPLYDISMNY, NTOTALHEDGAPPLYMNY, NTOTALHEDGAPPLYNUMBER, NTOTALHEDGAPPLYSUMMNY, NTOTALHEDGAPPLYTAXMNY, NTOTALTOSWYMNY, NTOTALTOSWYNUMBER, PK_CORP, PK_TAXCLASS, TS,  sts) 
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.alrconfincomny},#{entity.alrconfinconum},#{entity.blargessflag},#{entity.cbatchid},#{entity.cbodywarehouseid},#{entity.ccalbodyid},#{entity.ccurrencytypeid},#{entity.ccustomerid},#{entity.cfreezeid},#{entity.cinvbasdocid},#{entity.cinventoryid},#{entity.coriginalbillcode},#{entity.costsubjid},#{entity.cpackunitid},#{entity.cprolineid},#{entity.cquoteunitid},#{entity.creceiptcorpid},#{entity.creceipttype},#{entity.crowno},#{entity.csaleid},#{entity.csourcebillbodyid},#{entity.csourcebillid},#{entity.ctManageid},#{entity.cunitid},#{entity.cupinvoicebillbodyid},#{entity.cupinvoicebillcode},#{entity.cupinvoicebillid},#{entity.cupreceipttype},#{entity.cupsourcebillbodyid},#{entity.cupsourcebillcode},#{entity.cupsourcebillid},#{entity.ddeliverdate},#{entity.dr},#{entity.fbatchstatus},#{entity.frownote},#{entity.frowstatus},#{entity.inccontimepoint},#{entity.inccontimepointname},#{entity.ncostmny},#{entity.ndiscountmny},#{entity.ndiscountrate},#{entity.nexchangeotobrate},#{entity.ninvoicediscountrate},#{entity.nitemdiscountrate},#{entity.nmny},#{entity.nnetprice},#{entity.nnumber},#{entity.noriginalcurdiscountmny},#{entity.noriginalcurmny},#{entity.noriginalcurnetprice},#{entity.noriginalcurprice},#{entity.noriginalcursummny},#{entity.noriginalcurtaxmny},#{entity.noriginalcurtaxnetprice},#{entity.noriginalcurtaxprice},#{entity.npacknumber},#{entity.nprice},#{entity.nqocurtaxnetpri},#{entity.nqunetprice},#{entity.nquoricurnetpri},#{entity.nquoricurpri},#{entity.nquoricurtaxpri},#{entity.nquotenumber},#{entity.nquoteunitrate},#{entity.nquprice},#{entity.nqutaxnetprice},#{entity.nqutaxprice},#{entity.nsimulatecostmny},#{entity.nsubcursummny},#{entity.nsubqunetpri},#{entity.nsubqupri},#{entity.nsubqutaxnetpri},#{entity.nsubqutaxpri},#{entity.nsubsummny},#{entity.nsubtaxnetprice},#{entity.nsummny},#{entity.ntaxmny},#{entity.ntaxnetprice},#{entity.ntaxprice},#{entity.ntaxrate},#{entity.ntotalapplydismny},#{entity.ntotalapplymny},#{entity.ntotalapplynumber},#{entity.ntotalapplysummny},#{entity.ntotalapplytaxmny},#{entity.ntotalhedgapplydismny},#{entity.ntotalhedgapplymny},#{entity.ntotalhedgapplynumber},#{entity.ntotalhedgapplysummny},#{entity.ntotalhedgapplytaxmny},#{entity.ntotaltoswymny},#{entity.ntotaltoswynumber},#{entity.pkCorp},#{entity.pkTaxclass},#{entity.ts}, 'Y')
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="cinvoiceBid" useGeneratedKeys="true">
    insert into SO_SALEINVOICE_B(ALRCONFINCOMNY, ALRCONFINCONUM, BLARGESSFLAG, CBATCHID, CBODYWAREHOUSEID, CCALBODYID, CCURRENCYTYPEID, CCUSTOMERID, CFREEZEID, CINVBASDOCID, CINVENTORYID, CORIGINALBILLCODE, COSTSUBJID, CPACKUNITID, CPROLINEID, CQUOTEUNITID, CRECEIPTCORPID, CRECEIPTTYPE, CROWNO, CSALEID, CSOURCEBILLBODYID, CSOURCEBILLID, CT_MANAGEID, CUNITID, CUPINVOICEBILLBODYID, CUPINVOICEBILLCODE, CUPINVOICEBILLID, CUPRECEIPTTYPE, CUPSOURCEBILLBODYID, CUPSOURCEBILLCODE, CUPSOURCEBILLID, DDELIVERDATE, DR, FBATCHSTATUS, FROWNOTE, FROWSTATUS, INCCONTIMEPOINT, INCCONTIMEPOINTNAME, NCOSTMNY, NDISCOUNTMNY, NDISCOUNTRATE, NEXCHANGEOTOBRATE, NINVOICEDISCOUNTRATE, NITEMDISCOUNTRATE, NMNY, NNETPRICE, NNUMBER, NORIGINALCURDISCOUNTMNY, NORIGINALCURMNY, NORIGINALCURNETPRICE, NORIGINALCURPRICE, NORIGINALCURSUMMNY, NORIGINALCURTAXMNY, NORIGINALCURTAXNETPRICE, NORIGINALCURTAXPRICE, NPACKNUMBER, NPRICE, NQOCURTAXNETPRI, NQUNETPRICE, NQUORICURNETPRI, NQUORICURPRI, NQUORICURTAXPRI, NQUOTENUMBER, NQUOTEUNITRATE, NQUPRICE, NQUTAXNETPRICE, NQUTAXPRICE, NSIMULATECOSTMNY, NSUBCURSUMMNY, NSUBQUNETPRI, NSUBQUPRI, NSUBQUTAXNETPRI, NSUBQUTAXPRI, NSUBSUMMNY, NSUBTAXNETPRICE, NSUMMNY, NTAXMNY, NTAXNETPRICE, NTAXPRICE, NTAXRATE, NTOTALAPPLYDISMNY, NTOTALAPPLYMNY, NTOTALAPPLYNUMBER, NTOTALAPPLYSUMMNY, NTOTALAPPLYTAXMNY, NTOTALHEDGAPPLYDISMNY, NTOTALHEDGAPPLYMNY, NTOTALHEDGAPPLYNUMBER, NTOTALHEDGAPPLYSUMMNY, NTOTALHEDGAPPLYTAXMNY, NTOTALTOSWYMNY, NTOTALTOSWYNUMBER, PK_CORP, PK_TAXCLASS, TS)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.alrconfincomny},#{entity.alrconfinconum},#{entity.blargessflag},#{entity.cbatchid},#{entity.cbodywarehouseid},#{entity.ccalbodyid},#{entity.ccurrencytypeid},#{entity.ccustomerid},#{entity.cfreezeid},#{entity.cinvbasdocid},#{entity.cinventoryid},#{entity.coriginalbillcode},#{entity.costsubjid},#{entity.cpackunitid},#{entity.cprolineid},#{entity.cquoteunitid},#{entity.creceiptcorpid},#{entity.creceipttype},#{entity.crowno},#{entity.csaleid},#{entity.csourcebillbodyid},#{entity.csourcebillid},#{entity.ctManageid},#{entity.cunitid},#{entity.cupinvoicebillbodyid},#{entity.cupinvoicebillcode},#{entity.cupinvoicebillid},#{entity.cupreceipttype},#{entity.cupsourcebillbodyid},#{entity.cupsourcebillcode},#{entity.cupsourcebillid},#{entity.ddeliverdate},#{entity.dr},#{entity.fbatchstatus},#{entity.frownote},#{entity.frowstatus},#{entity.inccontimepoint},#{entity.inccontimepointname},#{entity.ncostmny},#{entity.ndiscountmny},#{entity.ndiscountrate},#{entity.nexchangeotobrate},#{entity.ninvoicediscountrate},#{entity.nitemdiscountrate},#{entity.nmny},#{entity.nnetprice},#{entity.nnumber},#{entity.noriginalcurdiscountmny},#{entity.noriginalcurmny},#{entity.noriginalcurnetprice},#{entity.noriginalcurprice},#{entity.noriginalcursummny},#{entity.noriginalcurtaxmny},#{entity.noriginalcurtaxnetprice},#{entity.noriginalcurtaxprice},#{entity.npacknumber},#{entity.nprice},#{entity.nqocurtaxnetpri},#{entity.nqunetprice},#{entity.nquoricurnetpri},#{entity.nquoricurpri},#{entity.nquoricurtaxpri},#{entity.nquotenumber},#{entity.nquoteunitrate},#{entity.nquprice},#{entity.nqutaxnetprice},#{entity.nqutaxprice},#{entity.nsimulatecostmny},#{entity.nsubcursummny},#{entity.nsubqunetpri},#{entity.nsubqupri},#{entity.nsubqutaxnetpri},#{entity.nsubqutaxpri},#{entity.nsubsummny},#{entity.nsubtaxnetprice},#{entity.nsummny},#{entity.ntaxmny},#{entity.ntaxnetprice},#{entity.ntaxprice},#{entity.ntaxrate},#{entity.ntotalapplydismny},#{entity.ntotalapplymny},#{entity.ntotalapplynumber},#{entity.ntotalapplysummny},#{entity.ntotalapplytaxmny},#{entity.ntotalhedgapplydismny},#{entity.ntotalhedgapplymny},#{entity.ntotalhedgapplynumber},#{entity.ntotalhedgapplysummny},#{entity.ntotalhedgapplytaxmny},#{entity.ntotaltoswymny},#{entity.ntotaltoswynumber},#{entity.pkCorp},#{entity.pkTaxclass},#{entity.ts})
    </foreach>
    on duplicate key update
    ALRCONFINCOMNY = values(ALRCONFINCOMNY),
    ALRCONFINCONUM = values(ALRCONFINCONUM),
    BLARGESSFLAG = values(BLARGESSFLAG),
    CBATCHID = values(CBATCHID),
    CBODYWAREHOUSEID = values(CBODYWAREHOUSEID),
    CCALBODYID = values(CCALBODYID),
    CCURRENCYTYPEID = values(CCURRENCYTYPEID),
    CCUSTOMERID = values(CCUSTOMERID),
    CFREEZEID = values(CFREEZEID),
    CINVBASDOCID = values(CINVBASDOCID),
    CINVENTORYID = values(CINVENTORYID),
    CORIGINALBILLCODE = values(CORIGINALBILLCODE),
    COSTSUBJID = values(COSTSUBJID),
    CPACKUNITID = values(CPACKUNITID),
    CPROLINEID = values(CPROLINEID),
    CQUOTEUNITID = values(CQUOTEUNITID),
    CRECEIPTCORPID = values(CRECEIPTCORPID),
    CRECEIPTTYPE = values(CRECEIPTTYPE),
    CROWNO = values(CROWNO),
    CSALEID = values(CSALEID),
    CSOURCEBILLBODYID = values(CSOURCEBILLBODYID),
    CSOURCEBILLID = values(CSOURCEBILLID),
    CT_MANAGEID = values(CT_MANAGEID),
    CUNITID = values(CUNITID),
    CUPINVOICEBILLBODYID = values(CUPINVOICEBILLBODYID),
    CUPINVOICEBILLCODE = values(CUPINVOICEBILLCODE),
    CUPINVOICEBILLID = values(CUPINVOICEBILLID),
    CUPRECEIPTTYPE = values(CUPRECEIPTTYPE),
    CUPSOURCEBILLBODYID = values(CUPSOURCEBILLBODYID),
    CUPSOURCEBILLCODE = values(CUPSOURCEBILLCODE),
    CUPSOURCEBILLID = values(CUPSOURCEBILLID),
    DDELIVERDATE = values(DDELIVERDATE),
    DR = values(DR),
    FBATCHSTATUS = values(FBATCHSTATUS),
    FROWNOTE = values(FROWNOTE),
    FROWSTATUS = values(FROWSTATUS),
    INCCONTIMEPOINT = values(INCCONTIMEPOINT),
    INCCONTIMEPOINTNAME = values(INCCONTIMEPOINTNAME),
    NCOSTMNY = values(NCOSTMNY),
    NDISCOUNTMNY = values(NDISCOUNTMNY),
    NDISCOUNTRATE = values(NDISCOUNTRATE),
    NEXCHANGEOTOBRATE = values(NEXCHANGEOTOBRATE),
    NINVOICEDISCOUNTRATE = values(NINVOICEDISCOUNTRATE),
    NITEMDISCOUNTRATE = values(NITEMDISCOUNTRATE),
    NMNY = values(NMNY),
    NNETPRICE = values(NNETPRICE),
    NNUMBER = values(NNUMBER),
    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),
    NQOCURTAXNETPRI = values(NQOCURTAXNETPRI),
    NQUNETPRICE = values(NQUNETPRICE),
    NQUORICURNETPRI = values(NQUORICURNETPRI),
    NQUORICURPRI = values(NQUORICURPRI),
    NQUORICURTAXPRI = values(NQUORICURTAXPRI),
    NQUOTENUMBER = values(NQUOTENUMBER),
    NQUOTEUNITRATE = values(NQUOTEUNITRATE),
    NQUPRICE = values(NQUPRICE),
    NQUTAXNETPRICE = values(NQUTAXNETPRICE),
    NQUTAXPRICE = values(NQUTAXPRICE),
    NSIMULATECOSTMNY = values(NSIMULATECOSTMNY),
    NSUBCURSUMMNY = values(NSUBCURSUMMNY),
    NSUBQUNETPRI = values(NSUBQUNETPRI),
    NSUBQUPRI = values(NSUBQUPRI),
    NSUBQUTAXNETPRI = values(NSUBQUTAXNETPRI),
    NSUBQUTAXPRI = values(NSUBQUTAXPRI),
    NSUBSUMMNY = values(NSUBSUMMNY),
    NSUBTAXNETPRICE = values(NSUBTAXNETPRICE),
    NSUMMNY = values(NSUMMNY),
    NTAXMNY = values(NTAXMNY),
    NTAXNETPRICE = values(NTAXNETPRICE),
    NTAXPRICE = values(NTAXPRICE),
    NTAXRATE = values(NTAXRATE),
    NTOTALAPPLYDISMNY = values(NTOTALAPPLYDISMNY),
    NTOTALAPPLYMNY = values(NTOTALAPPLYMNY),
    NTOTALAPPLYNUMBER = values(NTOTALAPPLYNUMBER),
    NTOTALAPPLYSUMMNY = values(NTOTALAPPLYSUMMNY),
    NTOTALAPPLYTAXMNY = values(NTOTALAPPLYTAXMNY),
    NTOTALHEDGAPPLYDISMNY = values(NTOTALHEDGAPPLYDISMNY),
    NTOTALHEDGAPPLYMNY = values(NTOTALHEDGAPPLYMNY),
    NTOTALHEDGAPPLYNUMBER = values(NTOTALHEDGAPPLYNUMBER),
    NTOTALHEDGAPPLYSUMMNY = values(NTOTALHEDGAPPLYSUMMNY),
    NTOTALHEDGAPPLYTAXMNY = values(NTOTALHEDGAPPLYTAXMNY),
    NTOTALTOSWYMNY = values(NTOTALTOSWYMNY),
    NTOTALTOSWYNUMBER = values(NTOTALTOSWYNUMBER),
    PK_CORP = values(PK_CORP),
    PK_TAXCLASS = values(PK_TAXCLASS),
    TS = values(TS)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleinvoiceBEntity" >
update SO_SALEINVOICE_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="blargessflag != null and blargessflag != ''"> BLARGESSFLAG = #{blargessflag},</if>
  <if test="cbatchid != null and cbatchid != ''"> CBATCHID = #{cbatchid},</if>
  <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> CBODYWAREHOUSEID = #{cbodywarehouseid},</if>
  <if test="ccalbodyid != null and ccalbodyid != ''"> CCALBODYID = #{ccalbodyid},</if>
  <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> CCURRENCYTYPEID = #{ccurrencytypeid},</if>
  <if test="ccustomerid != null and ccustomerid != ''"> CCUSTOMERID = #{ccustomerid},</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="coriginalbillcode != null and coriginalbillcode != ''"> CORIGINALBILLCODE = #{coriginalbillcode},</if>
  <if test="costsubjid != null and costsubjid != ''"> COSTSUBJID = #{costsubjid},</if>
  <if test="cpackunitid != null and cpackunitid != ''"> CPACKUNITID = #{cpackunitid},</if>
  <if test="cprolineid != null and cprolineid != ''"> CPROLINEID = #{cprolineid},</if>
  <if test="cquoteunitid != null and cquoteunitid != ''"> CQUOTEUNITID = #{cquoteunitid},</if>
  <if test="creceiptcorpid != null and creceiptcorpid != ''"> CRECEIPTCORPID = #{creceiptcorpid},</if>
  <if test="creceipttype != null and creceipttype != ''"> CRECEIPTTYPE = #{creceipttype},</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="ctManageid != null and ctManageid != ''"> CT_MANAGEID = #{ctManageid},</if>
  <if test="cunitid != null and cunitid != ''"> CUNITID = #{cunitid},</if>
  <if test="cupinvoicebillbodyid != null and cupinvoicebillbodyid != ''"> CUPINVOICEBILLBODYID = #{cupinvoicebillbodyid},</if>
  <if test="cupinvoicebillcode != null and cupinvoicebillcode != ''"> CUPINVOICEBILLCODE = #{cupinvoicebillcode},</if>
  <if test="cupinvoicebillid != null and cupinvoicebillid != ''"> CUPINVOICEBILLID = #{cupinvoicebillid},</if>
  <if test="cupreceipttype != null and cupreceipttype != ''"> CUPRECEIPTTYPE = #{cupreceipttype},</if>
  <if test="cupsourcebillbodyid != null and cupsourcebillbodyid != ''"> CUPSOURCEBILLBODYID = #{cupsourcebillbodyid},</if>
  <if test="cupsourcebillcode != null and cupsourcebillcode != ''"> CUPSOURCEBILLCODE = #{cupsourcebillcode},</if>
  <if test="cupsourcebillid != null and cupsourcebillid != ''"> CUPSOURCEBILLID = #{cupsourcebillid},</if>
  <if test="ddeliverdate != null and ddeliverdate != ''"> DDELIVERDATE = #{ddeliverdate},</if>
  <if test="dr != null and dr != ''"> DR = #{dr},</if>
  <if test="fbatchstatus != null and fbatchstatus != ''"> FBATCHSTATUS = #{fbatchstatus},</if>
  <if test="frownote != null and frownote != ''"> FROWNOTE = #{frownote},</if>
  <if test="frowstatus != null and frowstatus != ''"> FROWSTATUS = #{frowstatus},</if>
  <if test="inccontimepoint != null and inccontimepoint != ''"> INCCONTIMEPOINT = #{inccontimepoint},</if>
  <if test="inccontimepointname != null and inccontimepointname != ''"> INCCONTIMEPOINTNAME = #{inccontimepointname},</if>
  <if test="ncostmny != null and ncostmny != ''"> NCOSTMNY = #{ncostmny},</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="ninvoicediscountrate != null and ninvoicediscountrate != ''"> NINVOICEDISCOUNTRATE = #{ninvoicediscountrate},</if>
  <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> NITEMDISCOUNTRATE = #{nitemdiscountrate},</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="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="nqocurtaxnetpri != null and nqocurtaxnetpri != ''"> NQOCURTAXNETPRI = #{nqocurtaxnetpri},</if>
  <if test="nqunetprice != null and nqunetprice != ''"> NQUNETPRICE = #{nqunetprice},</if>
  <if test="nquoricurnetpri != null and nquoricurnetpri != ''"> NQUORICURNETPRI = #{nquoricurnetpri},</if>
  <if test="nquoricurpri != null and nquoricurpri != ''"> NQUORICURPRI = #{nquoricurpri},</if>
  <if test="nquoricurtaxpri != null and nquoricurtaxpri != ''"> NQUORICURTAXPRI = #{nquoricurtaxpri},</if>
  <if test="nquotenumber != null and nquotenumber != ''"> NQUOTENUMBER = #{nquotenumber},</if>
  <if test="nquoteunitrate != null and nquoteunitrate != ''"> NQUOTEUNITRATE = #{nquoteunitrate},</if>
  <if test="nquprice != null and nquprice != ''"> NQUPRICE = #{nquprice},</if>
  <if test="nqutaxnetprice != null and nqutaxnetprice != ''"> NQUTAXNETPRICE = #{nqutaxnetprice},</if>
  <if test="nqutaxprice != null and nqutaxprice != ''"> NQUTAXPRICE = #{nqutaxprice},</if>
  <if test="nsimulatecostmny != null and nsimulatecostmny != ''"> NSIMULATECOSTMNY = #{nsimulatecostmny},</if>
  <if test="nsubcursummny != null and nsubcursummny != ''"> NSUBCURSUMMNY = #{nsubcursummny},</if>
  <if test="nsubqunetpri != null and nsubqunetpri != ''"> NSUBQUNETPRI = #{nsubqunetpri},</if>
  <if test="nsubqupri != null and nsubqupri != ''"> NSUBQUPRI = #{nsubqupri},</if>
  <if test="nsubqutaxnetpri != null and nsubqutaxnetpri != ''"> NSUBQUTAXNETPRI = #{nsubqutaxnetpri},</if>
  <if test="nsubqutaxpri != null and nsubqutaxpri != ''"> NSUBQUTAXPRI = #{nsubqutaxpri},</if>
  <if test="nsubsummny != null and nsubsummny != ''"> NSUBSUMMNY = #{nsubsummny},</if>
  <if test="nsubtaxnetprice != null and nsubtaxnetprice != ''"> NSUBTAXNETPRICE = #{nsubtaxnetprice},</if>
  <if test="nsummny != null and nsummny != ''"> NSUMMNY = #{nsummny},</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="ntotalapplydismny != null and ntotalapplydismny != ''"> NTOTALAPPLYDISMNY = #{ntotalapplydismny},</if>
  <if test="ntotalapplymny != null and ntotalapplymny != ''"> NTOTALAPPLYMNY = #{ntotalapplymny},</if>
  <if test="ntotalapplynumber != null and ntotalapplynumber != ''"> NTOTALAPPLYNUMBER = #{ntotalapplynumber},</if>
  <if test="ntotalapplysummny != null and ntotalapplysummny != ''"> NTOTALAPPLYSUMMNY = #{ntotalapplysummny},</if>
  <if test="ntotalapplytaxmny != null and ntotalapplytaxmny != ''"> NTOTALAPPLYTAXMNY = #{ntotalapplytaxmny},</if>
  <if test="ntotalhedgapplydismny != null and ntotalhedgapplydismny != ''"> NTOTALHEDGAPPLYDISMNY = #{ntotalhedgapplydismny},</if>
  <if test="ntotalhedgapplymny != null and ntotalhedgapplymny != ''"> NTOTALHEDGAPPLYMNY = #{ntotalhedgapplymny},</if>
  <if test="ntotalhedgapplynumber != null and ntotalhedgapplynumber != ''"> NTOTALHEDGAPPLYNUMBER = #{ntotalhedgapplynumber},</if>
  <if test="ntotalhedgapplysummny != null and ntotalhedgapplysummny != ''"> NTOTALHEDGAPPLYSUMMNY = #{ntotalhedgapplysummny},</if>
  <if test="ntotalhedgapplytaxmny != null and ntotalhedgapplytaxmny != ''"> NTOTALHEDGAPPLYTAXMNY = #{ntotalhedgapplytaxmny},</if>
  <if test="ntotaltoswymny != null and ntotaltoswymny != ''"> NTOTALTOSWYMNY = #{ntotaltoswymny},</if>
  <if test="ntotaltoswynumber != null and ntotaltoswynumber != ''"> NTOTALTOSWYNUMBER = #{ntotaltoswynumber},</if>
  <if test="pkCorp != null and pkCorp != ''"> PK_CORP = #{pkCorp},</if>
  <if test="pkTaxclass != null and pkTaxclass != ''"> PK_TAXCLASS = #{pkTaxclass},</if>
  <if test="ts != null and ts != ''"> TS = #{ts},</if>
</trim>
where CINVOICE_BID = #{cinvoiceBid}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleinvoiceBEntity" >
update SO_SALEINVOICE_B  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where CINVOICE_BID = #{cinvoiceBid}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.SoSaleinvoiceBEntity" >
update SO_SALEINVOICE_B  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 <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="blargessflag != null and blargessflag != ''"> and BLARGESSFLAG = #{blargessflag} </if>
            <if test="cbatchid != null and cbatchid != ''"> and CBATCHID = #{cbatchid} </if>
            <if test="cbodywarehouseid != null and cbodywarehouseid != ''"> and CBODYWAREHOUSEID = #{cbodywarehouseid} </if>
            <if test="ccalbodyid != null and ccalbodyid != ''"> and CCALBODYID = #{ccalbodyid} </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and CCURRENCYTYPEID = #{ccurrencytypeid} </if>
            <if test="ccustomerid != null and ccustomerid != ''"> and CCUSTOMERID = #{ccustomerid} </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="cinvoiceBid != null and cinvoiceBid != ''"> and CINVOICE_BID = #{cinvoiceBid} </if>
            <if test="coriginalbillcode != null and coriginalbillcode != ''"> and CORIGINALBILLCODE = #{coriginalbillcode} </if>
            <if test="costsubjid != null and costsubjid != ''"> and COSTSUBJID = #{costsubjid} </if>
            <if test="cpackunitid != null and cpackunitid != ''"> and CPACKUNITID = #{cpackunitid} </if>
            <if test="cprolineid != null and cprolineid != ''"> and CPROLINEID = #{cprolineid} </if>
            <if test="cquoteunitid != null and cquoteunitid != ''"> and CQUOTEUNITID = #{cquoteunitid} </if>
            <if test="creceiptcorpid != null and creceiptcorpid != ''"> and CRECEIPTCORPID = #{creceiptcorpid} </if>
            <if test="creceipttype != null and creceipttype != ''"> and CRECEIPTTYPE = #{creceipttype} </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="ctManageid != null and ctManageid != ''"> and CT_MANAGEID = #{ctManageid} </if>
            <if test="cunitid != null and cunitid != ''"> and CUNITID = #{cunitid} </if>
            <if test="cupinvoicebillbodyid != null and cupinvoicebillbodyid != ''"> and CUPINVOICEBILLBODYID = #{cupinvoicebillbodyid} </if>
            <if test="cupinvoicebillcode != null and cupinvoicebillcode != ''"> and CUPINVOICEBILLCODE = #{cupinvoicebillcode} </if>
            <if test="cupinvoicebillid != null and cupinvoicebillid != ''"> and CUPINVOICEBILLID = #{cupinvoicebillid} </if>
            <if test="cupreceipttype != null and cupreceipttype != ''"> and CUPRECEIPTTYPE = #{cupreceipttype} </if>
            <if test="cupsourcebillbodyid != null and cupsourcebillbodyid != ''"> and CUPSOURCEBILLBODYID = #{cupsourcebillbodyid} </if>
            <if test="cupsourcebillcode != null and cupsourcebillcode != ''"> and CUPSOURCEBILLCODE = #{cupsourcebillcode} </if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> and CUPSOURCEBILLID = #{cupsourcebillid} </if>
            <if test="ddeliverdate != null and ddeliverdate != ''"> and DDELIVERDATE = #{ddeliverdate} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="fbatchstatus != null and fbatchstatus != ''"> and FBATCHSTATUS = #{fbatchstatus} </if>
            <if test="frownote != null and frownote != ''"> and FROWNOTE = #{frownote} </if>
            <if test="frowstatus != null and frowstatus != ''"> 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="ncostmny != null and ncostmny != ''"> and NCOSTMNY = #{ncostmny} </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="ninvoicediscountrate != null and ninvoicediscountrate != ''"> and NINVOICEDISCOUNTRATE = #{ninvoicediscountrate} </if>
            <if test="nitemdiscountrate != null and nitemdiscountrate != ''"> and NITEMDISCOUNTRATE = #{nitemdiscountrate} </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="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="nqocurtaxnetpri != null and nqocurtaxnetpri != ''"> and NQOCURTAXNETPRI = #{nqocurtaxnetpri} </if>
            <if test="nqunetprice != null and nqunetprice != ''"> and NQUNETPRICE = #{nqunetprice} </if>
            <if test="nquoricurnetpri != null and nquoricurnetpri != ''"> and NQUORICURNETPRI = #{nquoricurnetpri} </if>
            <if test="nquoricurpri != null and nquoricurpri != ''"> and NQUORICURPRI = #{nquoricurpri} </if>
            <if test="nquoricurtaxpri != null and nquoricurtaxpri != ''"> and NQUORICURTAXPRI = #{nquoricurtaxpri} </if>
            <if test="nquotenumber != null and nquotenumber != ''"> and NQUOTENUMBER = #{nquotenumber} </if>
            <if test="nquoteunitrate != null and nquoteunitrate != ''"> and NQUOTEUNITRATE = #{nquoteunitrate} </if>
            <if test="nquprice != null and nquprice != ''"> and NQUPRICE = #{nquprice} </if>
            <if test="nqutaxnetprice != null and nqutaxnetprice != ''"> and NQUTAXNETPRICE = #{nqutaxnetprice} </if>
            <if test="nqutaxprice != null and nqutaxprice != ''"> and NQUTAXPRICE = #{nqutaxprice} </if>
            <if test="nsimulatecostmny != null and nsimulatecostmny != ''"> and NSIMULATECOSTMNY = #{nsimulatecostmny} </if>
            <if test="nsubcursummny != null and nsubcursummny != ''"> and NSUBCURSUMMNY = #{nsubcursummny} </if>
            <if test="nsubqunetpri != null and nsubqunetpri != ''"> and NSUBQUNETPRI = #{nsubqunetpri} </if>
            <if test="nsubqupri != null and nsubqupri != ''"> and NSUBQUPRI = #{nsubqupri} </if>
            <if test="nsubqutaxnetpri != null and nsubqutaxnetpri != ''"> and NSUBQUTAXNETPRI = #{nsubqutaxnetpri} </if>
            <if test="nsubqutaxpri != null and nsubqutaxpri != ''"> and NSUBQUTAXPRI = #{nsubqutaxpri} </if>
            <if test="nsubsummny != null and nsubsummny != ''"> and NSUBSUMMNY = #{nsubsummny} </if>
            <if test="nsubtaxnetprice != null and nsubtaxnetprice != ''"> and NSUBTAXNETPRICE = #{nsubtaxnetprice} </if>
            <if test="nsummny != null and nsummny != ''"> and NSUMMNY = #{nsummny} </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="ntotalapplydismny != null and ntotalapplydismny != ''"> and NTOTALAPPLYDISMNY = #{ntotalapplydismny} </if>
            <if test="ntotalapplymny != null and ntotalapplymny != ''"> and NTOTALAPPLYMNY = #{ntotalapplymny} </if>
            <if test="ntotalapplynumber != null and ntotalapplynumber != ''"> and NTOTALAPPLYNUMBER = #{ntotalapplynumber} </if>
            <if test="ntotalapplysummny != null and ntotalapplysummny != ''"> and NTOTALAPPLYSUMMNY = #{ntotalapplysummny} </if>
            <if test="ntotalapplytaxmny != null and ntotalapplytaxmny != ''"> and NTOTALAPPLYTAXMNY = #{ntotalapplytaxmny} </if>
            <if test="ntotalhedgapplydismny != null and ntotalhedgapplydismny != ''"> and NTOTALHEDGAPPLYDISMNY = #{ntotalhedgapplydismny} </if>
            <if test="ntotalhedgapplymny != null and ntotalhedgapplymny != ''"> and NTOTALHEDGAPPLYMNY = #{ntotalhedgapplymny} </if>
            <if test="ntotalhedgapplynumber != null and ntotalhedgapplynumber != ''"> and NTOTALHEDGAPPLYNUMBER = #{ntotalhedgapplynumber} </if>
            <if test="ntotalhedgapplysummny != null and ntotalhedgapplysummny != ''"> and NTOTALHEDGAPPLYSUMMNY = #{ntotalhedgapplysummny} </if>
            <if test="ntotalhedgapplytaxmny != null and ntotalhedgapplytaxmny != ''"> and NTOTALHEDGAPPLYTAXMNY = #{ntotalhedgapplytaxmny} </if>
            <if test="ntotaltoswymny != null and ntotaltoswymny != ''"> and NTOTALTOSWYMNY = #{ntotaltoswymny} </if>
            <if test="ntotaltoswynumber != null and ntotaltoswynumber != ''"> and NTOTALTOSWYNUMBER = #{ntotaltoswynumber} </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
            <if test="pkTaxclass != null and pkTaxclass != ''"> and PK_TAXCLASS = #{pkTaxclass} </if>
            <if test="ts != null and ts != ''"> and TS = #{ts} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from SO_SALEINVOICE_B where CINVOICE_BID = #{cinvoiceBid}
</delete>

</mapper>

