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

    <resultMap id="get-ToBillBEntity-result" type="com.hzya.frame.plugin.lets.entity.ToBillBEntity">
        <result property="barrangedflag" column="barrangedflag" jdbcType="VARCHAR"/>
        <result property="boutendflag" column="boutendflag" jdbcType="VARCHAR"/>
        <result property="bretractflag" column="bretractflag" jdbcType="VARCHAR"/>
        <result property="bsendendflag" column="bsendendflag" jdbcType="VARCHAR"/>
        <result property="bsettleendflag" column="bsettleendflag" jdbcType="VARCHAR"/>
        <result property="btakesettleendflag" column="btakesettleendflag" jdbcType="VARCHAR"/>
        <result property="carrangepersonid" column="carrangepersonid" jdbcType="VARCHAR"/>
        <result property="castunitid" column="castunitid" jdbcType="VARCHAR"/>
        <result property="cbillBid" column="cbill_bid" jdbcType="VARCHAR"/>
        <result property="cbillid" column="cbillid" jdbcType="VARCHAR"/>
        <result property="cbilltype" column="cbilltype" jdbcType="VARCHAR"/>
        <result property="cbiztypeid" column="cbiztypeid" jdbcType="VARCHAR"/>
        <result property="cclosemakerid" column="cclosemakerid" jdbcType="VARCHAR"/>
        <result property="ccorrectbillBid" column="ccorrectbill_bid" jdbcType="VARCHAR"/>
        <result property="cdeletemakerid" column="cdeletemakerid" jdbcType="VARCHAR"/>
        <result property="cfirstbid" column="cfirstbid" jdbcType="VARCHAR"/>
        <result property="cfirstid" column="cfirstid" jdbcType="VARCHAR"/>
        <result property="cfirsttypecode" column="cfirsttypecode" jdbcType="VARCHAR"/>
        <result property="cincbid" column="cincbid" jdbcType="VARCHAR"/>
        <result property="cincorpid" column="cincorpid" jdbcType="VARCHAR"/>
        <result property="cindeptid" column="cindeptid" jdbcType="VARCHAR"/>
        <result property="cininvid" column="cininvid" jdbcType="VARCHAR"/>
        <result property="cinpsnid" column="cinpsnid" jdbcType="VARCHAR"/>
        <result property="cinspaceid" column="cinspaceid" jdbcType="VARCHAR"/>
        <result property="cinvbasid" column="cinvbasid" jdbcType="VARCHAR"/>
        <result property="cinwhid" column="cinwhid" jdbcType="VARCHAR"/>
        <result property="coutcbid" column="coutcbid" jdbcType="VARCHAR"/>
        <result property="coutcorpid" column="coutcorpid" jdbcType="VARCHAR"/>
        <result property="coutdeptid" column="coutdeptid" jdbcType="VARCHAR"/>
        <result property="coutendmakerid" column="coutendmakerid" jdbcType="VARCHAR"/>
        <result property="coutinvid" column="coutinvid" jdbcType="VARCHAR"/>
        <result property="coutpsnid" column="coutpsnid" jdbcType="VARCHAR"/>
        <result property="coutspaceid" column="coutspaceid" jdbcType="VARCHAR"/>
        <result property="coutwhid" column="coutwhid" jdbcType="VARCHAR"/>
        <result property="cprojectid" column="cprojectid" jdbcType="VARCHAR"/>
        <result property="cprojectphase" column="cprojectphase" jdbcType="VARCHAR"/>
        <result property="cquoteunitid" column="cquoteunitid" jdbcType="VARCHAR"/>
        <result property="creceieveid" column="creceieveid" jdbcType="VARCHAR"/>
        <result property="creceiverbasid" column="creceiverbasid" jdbcType="VARCHAR"/>
        <result property="crelationBid" column="crelation_bid" jdbcType="VARCHAR"/>
        <result property="crelationid" column="crelationid" jdbcType="VARCHAR"/>
        <result property="crowno" column="crowno" jdbcType="VARCHAR"/>
        <result property="csendendmakerid" column="csendendmakerid" jdbcType="VARCHAR"/>
        <result property="csourcebid" column="csourcebid" jdbcType="VARCHAR"/>
        <result property="csourceid" column="csourceid" jdbcType="VARCHAR"/>
        <result property="csourcetypecode" column="csourcetypecode" jdbcType="VARCHAR"/>
        <result property="ctakeoutcbid" column="ctakeoutcbid" jdbcType="VARCHAR"/>
        <result property="ctakeoutcorpid" column="ctakeoutcorpid" jdbcType="VARCHAR"/>
        <result property="ctakeoutdeptid" column="ctakeoutdeptid" jdbcType="VARCHAR"/>
        <result property="ctakeoutinvid" column="ctakeoutinvid" jdbcType="VARCHAR"/>
        <result property="ctakeoutpsnid" column="ctakeoutpsnid" jdbcType="VARCHAR"/>
        <result property="ctakeoutspaceid" column="ctakeoutspaceid" jdbcType="VARCHAR"/>
        <result property="ctakeoutwhid" column="ctakeoutwhid" jdbcType="VARCHAR"/>
        <result property="ctakerelationBid" column="ctakerelation_bid" jdbcType="VARCHAR"/>
        <result property="ctakerelationid" column="ctakerelationid" jdbcType="VARCHAR"/>
        <result property="ctypecode" column="ctypecode" jdbcType="VARCHAR"/>
        <result property="cvendorbasid" column="cvendorbasid" jdbcType="VARCHAR"/>
        <result property="cvendorid" column="cvendorid" jdbcType="VARCHAR"/>
        <result property="cworkcenterid" column="cworkcenterid" jdbcType="VARCHAR"/>
        <result property="dplanarrivedate" column="dplanarrivedate" jdbcType="VARCHAR"/>
        <result property="dplanoutdate" column="dplanoutdate" jdbcType="VARCHAR"/>
        <result property="dproducedate" column="dproducedate" jdbcType="VARCHAR"/>
        <result property="dr" column="dr" jdbcType="INTEGER"/>
        <result property="drequiredate" column="drequiredate" jdbcType="VARCHAR"/>
        <result property="dvalidate" column="dvalidate" jdbcType="VARCHAR"/>
        <result property="fallocflag" column="fallocflag" jdbcType="INTEGER"/>
        <result property="flargess" column="flargess" jdbcType="VARCHAR"/>
        <result property="frowstatuflag" column="frowstatuflag" jdbcType="INTEGER"/>
        <result property="ftaxtypeflag" column="ftaxtypeflag" jdbcType="INTEGER"/>
        <result property="naddpricerate" column="naddpricerate" jdbcType="NUMERIC"/>
        <result property="narrangeassnum" column="narrangeassnum" jdbcType="NUMERIC"/>
        <result property="narrangemonum" column="narrangemonum" jdbcType="NUMERIC"/>
        <result property="narrangenum" column="narrangenum" jdbcType="NUMERIC"/>
        <result property="narrangepoapplynum" column="narrangepoapplynum" jdbcType="NUMERIC"/>
        <result property="narrangepoordernum" column="narrangepoordernum" jdbcType="NUMERIC"/>
        <result property="narrangescornum" column="narrangescornum" jdbcType="NUMERIC"/>
        <result property="narrangetoornum" column="narrangetoornum" jdbcType="NUMERIC"/>
        <result property="nasknotaxprice" column="nasknotaxprice" jdbcType="NUMERIC"/>
        <result property="naskprice" column="naskprice" jdbcType="NUMERIC"/>
        <result property="nassistnum" column="nassistnum" jdbcType="NUMERIC"/>
        <result property="nchangerate" column="nchangerate" jdbcType="NUMERIC"/>
        <result property="nfeedbacknum" column="nfeedbacknum" jdbcType="NUMERIC"/>
        <result property="nmny" column="nmny" jdbcType="NUMERIC"/>
        <result property="nnotaxmny" column="nnotaxmny" jdbcType="NUMERIC"/>
        <result property="nnotaxprice" column="nnotaxprice" jdbcType="NUMERIC"/>
        <result property="nnum" column="nnum" jdbcType="NUMERIC"/>
        <result property="norderbackassnum" column="norderbackassnum" jdbcType="NUMERIC"/>
        <result property="norderbacknum" column="norderbacknum" jdbcType="NUMERIC"/>
        <result property="norderinassnum" column="norderinassnum" jdbcType="NUMERIC"/>
        <result property="norderinnum" column="norderinnum" jdbcType="NUMERIC"/>
        <result property="norderinoutmny" column="norderinoutmny" jdbcType="NUMERIC"/>
        <result property="norderinoutnum" column="norderinoutnum" jdbcType="NUMERIC"/>
        <result property="norderoutassnum" column="norderoutassnum" jdbcType="NUMERIC"/>
        <result property="norderoutnum" column="norderoutnum" jdbcType="NUMERIC"/>
        <result property="nordersendassnum" column="nordersendassnum" jdbcType="NUMERIC"/>
        <result property="nordersendnum" column="nordersendnum" jdbcType="NUMERIC"/>
        <result property="nordershouldinnum" column="nordershouldinnum" jdbcType="NUMERIC"/>
        <result property="nordershouldoutnum" column="nordershouldoutnum" jdbcType="NUMERIC"/>
        <result property="nordersignassnum" column="nordersignassnum" jdbcType="NUMERIC"/>
        <result property="nordersignnum" column="nordersignnum" jdbcType="NUMERIC"/>
        <result property="nordertakemny" column="nordertakemny" jdbcType="NUMERIC"/>
        <result property="nordertakenum" column="nordertakenum" jdbcType="NUMERIC"/>
        <result property="norderwaylossassnum" column="norderwaylossassnum" jdbcType="NUMERIC"/>
        <result property="norderwaylossnum" column="norderwaylossnum" jdbcType="NUMERIC"/>
        <result property="norgqtnetprc" column="norgqtnetprc" jdbcType="NUMERIC"/>
        <result property="norgqttaxnetprc" column="norgqttaxnetprc" jdbcType="NUMERIC"/>
        <result property="noutsumnum" column="noutsumnum" jdbcType="NUMERIC"/>
        <result property="nprice" column="nprice" jdbcType="NUMERIC"/>
        <result property="nquoteunitnum" column="nquoteunitnum" jdbcType="NUMERIC"/>
        <result property="nquoteunitrate" column="nquoteunitrate" jdbcType="NUMERIC"/>
        <result property="nsafetystocknum" column="nsafetystocknum" jdbcType="NUMERIC"/>
        <result property="ntaxrate" column="ntaxrate" jdbcType="NUMERIC"/>
        <result property="ntranpoassnum" column="ntranpoassnum" jdbcType="NUMERIC"/>
        <result property="ntranponum" column="ntranponum" jdbcType="NUMERIC"/>
        <result property="ntranstopraynum" column="ntranstopraynum" jdbcType="NUMERIC"/>
        <result property="pkAreacl" column="pk_areacl" jdbcType="VARCHAR"/>
        <result property="pkArrivearea" column="pk_arrivearea" jdbcType="VARCHAR"/>
        <result property="pkDefdoc1" column="pk_defdoc1" jdbcType="VARCHAR"/>
        <result property="pkDefdoc10" column="pk_defdoc10" jdbcType="VARCHAR"/>
        <result property="pkDefdoc11" column="pk_defdoc11" jdbcType="VARCHAR"/>
        <result property="pkDefdoc12" column="pk_defdoc12" jdbcType="VARCHAR"/>
        <result property="pkDefdoc13" column="pk_defdoc13" jdbcType="VARCHAR"/>
        <result property="pkDefdoc14" column="pk_defdoc14" jdbcType="VARCHAR"/>
        <result property="pkDefdoc15" column="pk_defdoc15" jdbcType="VARCHAR"/>
        <result property="pkDefdoc16" column="pk_defdoc16" jdbcType="VARCHAR"/>
        <result property="pkDefdoc17" column="pk_defdoc17" jdbcType="VARCHAR"/>
        <result property="pkDefdoc18" column="pk_defdoc18" jdbcType="VARCHAR"/>
        <result property="pkDefdoc19" column="pk_defdoc19" jdbcType="VARCHAR"/>
        <result property="pkDefdoc2" column="pk_defdoc2" jdbcType="VARCHAR"/>
        <result property="pkDefdoc20" column="pk_defdoc20" jdbcType="VARCHAR"/>
        <result property="pkDefdoc3" column="pk_defdoc3" jdbcType="VARCHAR"/>
        <result property="pkDefdoc4" column="pk_defdoc4" jdbcType="VARCHAR"/>
        <result property="pkDefdoc5" column="pk_defdoc5" jdbcType="VARCHAR"/>
        <result property="pkDefdoc6" column="pk_defdoc6" jdbcType="VARCHAR"/>
        <result property="pkDefdoc7" column="pk_defdoc7" jdbcType="VARCHAR"/>
        <result property="pkDefdoc8" column="pk_defdoc8" jdbcType="VARCHAR"/>
        <result property="pkDefdoc9" column="pk_defdoc9" jdbcType="VARCHAR"/>
        <result property="pkRtBid" column="pk_rt_bid" jdbcType="VARCHAR"/>
        <result property="pkSendtype" column="pk_sendtype" jdbcType="VARCHAR"/>
        <result property="pkTldid" column="pk_tldid" jdbcType="VARCHAR"/>
        <result property="tlastarrangetime" column="tlastarrangetime" jdbcType="VARCHAR"/>
        <result property="tplanarrivetime" column="tplanarrivetime" jdbcType="VARCHAR"/>
        <result property="tplanouttime" column="tplanouttime" jdbcType="VARCHAR"/>
        <result property="trequiretime" column="trequiretime" jdbcType="VARCHAR"/>
        <result property="ts" column="ts" jdbcType="VARCHAR"/>
        <result property="tsclose" column="tsclose" jdbcType="VARCHAR"/>
        <result property="tsdelete" column="tsdelete" jdbcType="VARCHAR"/>
        <result property="tsoutend" column="tsoutend" jdbcType="VARCHAR"/>
        <result property="tssendend" column="tssendend" jdbcType="VARCHAR"/>
        <result property="vbatch" column="vbatch" jdbcType="VARCHAR"/>
        <result property="vbdef1" column="vbdef1" jdbcType="VARCHAR"/>
        <result property="vbdef10" column="vbdef10" jdbcType="VARCHAR"/>
        <result property="vbdef11" column="vbdef11" jdbcType="VARCHAR"/>
        <result property="vbdef12" column="vbdef12" jdbcType="VARCHAR"/>
        <result property="vbdef13" column="vbdef13" jdbcType="VARCHAR"/>
        <result property="vbdef14" column="vbdef14" jdbcType="VARCHAR"/>
        <result property="vbdef15" column="vbdef15" jdbcType="VARCHAR"/>
        <result property="vbdef16" column="vbdef16" jdbcType="VARCHAR"/>
        <result property="vbdef17" column="vbdef17" jdbcType="VARCHAR"/>
        <result property="vbdef18" column="vbdef18" jdbcType="VARCHAR"/>
        <result property="vbdef19" column="vbdef19" jdbcType="VARCHAR"/>
        <result property="vbdef2" column="vbdef2" jdbcType="VARCHAR"/>
        <result property="vbdef20" column="vbdef20" jdbcType="VARCHAR"/>
        <result property="vbdef3" column="vbdef3" jdbcType="VARCHAR"/>
        <result property="vbdef4" column="vbdef4" jdbcType="VARCHAR"/>
        <result property="vbdef5" column="vbdef5" jdbcType="VARCHAR"/>
        <result property="vbdef6" column="vbdef6" jdbcType="VARCHAR"/>
        <result property="vbdef7" column="vbdef7" jdbcType="VARCHAR"/>
        <result property="vbdef8" column="vbdef8" jdbcType="VARCHAR"/>
        <result property="vbdef9" column="vbdef9" jdbcType="VARCHAR"/>
        <result property="vbomcode" column="vbomcode" jdbcType="VARCHAR"/>
        <result property="vbrevisereason" column="vbrevisereason" jdbcType="VARCHAR"/>
        <result property="vcode" column="vcode" jdbcType="VARCHAR"/>
        <result property="vfirstcode" column="vfirstcode" jdbcType="VARCHAR"/>
        <result property="vfirstrowno" column="vfirstrowno" jdbcType="VARCHAR"/>
        <result property="vfree1" column="vfree1" jdbcType="VARCHAR"/>
        <result property="vfree2" column="vfree2" jdbcType="VARCHAR"/>
        <result property="vfree3" column="vfree3" jdbcType="VARCHAR"/>
        <result property="vfree4" column="vfree4" jdbcType="VARCHAR"/>
        <result property="vfree5" column="vfree5" jdbcType="VARCHAR"/>
        <result property="vnote" column="vnote" jdbcType="VARCHAR"/>
        <result property="vproducebatch" column="vproducebatch" jdbcType="VARCHAR"/>
        <result property="vreceiveaddress" column="vreceiveaddress" jdbcType="VARCHAR"/>
        <result property="vsourcecode" column="vsourcecode" jdbcType="VARCHAR"/>
        <result property="vsourcerowno" column="vsourcerowno" jdbcType="VARCHAR"/>
    </resultMap>
    <!-- 查询的字段-->
    <sql id="ToBillBEntity_Base_Column_List">
        barrangedflag
        ,boutendflag
        ,bretractflag
        ,bsendendflag
        ,bsettleendflag
        ,btakesettleendflag
        ,carrangepersonid
        ,castunitid
        ,cbill_bid
        ,cbillid
        ,cbilltype
        ,cbiztypeid
        ,cclosemakerid
        ,ccorrectbill_bid
        ,cdeletemakerid
        ,cfirstbid
        ,cfirstid
        ,cfirsttypecode
        ,cincbid
        ,cincorpid
        ,cindeptid
        ,cininvid
        ,cinpsnid
        ,cinspaceid
        ,cinvbasid
        ,cinwhid
        ,coutcbid
        ,coutcorpid
        ,coutdeptid
        ,coutendmakerid
        ,coutinvid
        ,coutpsnid
        ,coutspaceid
        ,coutwhid
        ,cprojectid
        ,cprojectphase
        ,cquoteunitid
        ,creceieveid
        ,creceiverbasid
        ,crelation_bid
        ,crelationid
        ,crowno
        ,csendendmakerid
        ,csourcebid
        ,csourceid
        ,csourcetypecode
        ,ctakeoutcbid
        ,ctakeoutcorpid
        ,ctakeoutdeptid
        ,ctakeoutinvid
        ,ctakeoutpsnid
        ,ctakeoutspaceid
        ,ctakeoutwhid
        ,ctakerelation_bid
        ,ctakerelationid
        ,ctypecode
        ,cvendorbasid
        ,cvendorid
        ,cworkcenterid
        ,dplanarrivedate
        ,dplanoutdate
        ,dproducedate
        ,dr
        ,drequiredate
        ,dvalidate
        ,fallocflag
        ,flargess
        ,frowstatuflag
        ,ftaxtypeflag
        ,naddpricerate
        ,narrangeassnum
        ,narrangemonum
        ,narrangenum
        ,narrangepoapplynum
        ,narrangepoordernum
        ,narrangescornum
        ,narrangetoornum
        ,nasknotaxprice
        ,naskprice
        ,nassistnum
        ,nchangerate
        ,nfeedbacknum
        ,nmny
        ,nnotaxmny
        ,nnotaxprice
        ,nnum
        ,norderbackassnum
        ,norderbacknum
        ,norderinassnum
        ,norderinnum
        ,norderinoutmny
        ,norderinoutnum
        ,norderoutassnum
        ,norderoutnum
        ,nordersendassnum
        ,nordersendnum
        ,nordershouldinnum
        ,nordershouldoutnum
        ,nordersignassnum
        ,nordersignnum
        ,nordertakemny
        ,nordertakenum
        ,norderwaylossassnum
        ,norderwaylossnum
        ,norgqtnetprc
        ,norgqttaxnetprc
        ,noutsumnum
        ,nprice
        ,nquoteunitnum
        ,nquoteunitrate
        ,nsafetystocknum
        ,ntaxrate
        ,ntranpoassnum
        ,ntranponum
        ,ntranstopraynum
        ,pk_areacl
        ,pk_arrivearea
        ,pk_defdoc1
        ,pk_defdoc10
        ,pk_defdoc11
        ,pk_defdoc12
        ,pk_defdoc13
        ,pk_defdoc14
        ,pk_defdoc15
        ,pk_defdoc16
        ,pk_defdoc17
        ,pk_defdoc18
        ,pk_defdoc19
        ,pk_defdoc2
        ,pk_defdoc20
        ,pk_defdoc3
        ,pk_defdoc4
        ,pk_defdoc5
        ,pk_defdoc6
        ,pk_defdoc7
        ,pk_defdoc8
        ,pk_defdoc9
        ,pk_rt_bid
        ,pk_sendtype
        ,pk_tldid
        ,tlastarrangetime
        ,tplanarrivetime
        ,tplanouttime
        ,trequiretime
        ,ts
        ,tsclose
        ,tsdelete
        ,tsoutend
        ,tssendend
        ,vbatch
        ,vbdef1
        ,vbdef10
        ,vbdef11
        ,vbdef12
        ,vbdef13
        ,vbdef14
        ,vbdef15
        ,vbdef16
        ,vbdef17
        ,vbdef18
        ,vbdef19
        ,vbdef2
        ,vbdef20
        ,vbdef3
        ,vbdef4
        ,vbdef5
        ,vbdef6
        ,vbdef7
        ,vbdef8
        ,vbdef9
        ,vbomcode
        ,vbrevisereason
        ,vcode
        ,vfirstcode
        ,vfirstrowno
        ,vfree1
        ,vfree2
        ,vfree3
        ,vfree4
        ,vfree5
        ,vnote
        ,vproducebatch
        ,vreceiveaddress
        ,vsourcecode
        ,vsourcerowno
    </sql>
    <!-- 查询 采用==查询 -->
    <select id="entity_list_base" resultMap="get-ToBillBEntity-result"
            parameterType="com.hzya.frame.plugin.lets.entity.ToBillBEntity">
        select
        <include refid="ToBillBEntity_Base_Column_List"/>
        from to_bill_b
        <trim prefix="where" prefixOverrides="and">
            <if test="barrangedflag != null and barrangedflag != ''">and barrangedflag = #{barrangedflag}</if>
            <if test="boutendflag != null and boutendflag != ''">and boutendflag = #{boutendflag}</if>
            <if test="bretractflag != null and bretractflag != ''">and bretractflag = #{bretractflag}</if>
            <if test="bsendendflag != null and bsendendflag != ''">and bsendendflag = #{bsendendflag}</if>
            <if test="bsettleendflag != null and bsettleendflag != ''">and bsettleendflag = #{bsettleendflag}</if>
            <if test="btakesettleendflag != null and btakesettleendflag != ''">and btakesettleendflag =
                #{btakesettleendflag}
            </if>
            <if test="carrangepersonid != null and carrangepersonid != ''">and carrangepersonid = #{carrangepersonid}
            </if>
            <if test="castunitid != null and castunitid != ''">and castunitid = #{castunitid}</if>
            <if test="cbillBid != null and cbillBid != ''">and cbill_bid = #{cbillBid}</if>
            <if test="cbillid != null and cbillid != ''">and cbillid = #{cbillid}</if>
            <if test="cbilltype != null and cbilltype != ''">and cbilltype = #{cbilltype}</if>
            <if test="cbiztypeid != null and cbiztypeid != ''">and cbiztypeid = #{cbiztypeid}</if>
            <if test="cclosemakerid != null and cclosemakerid != ''">and cclosemakerid = #{cclosemakerid}</if>
            <if test="ccorrectbillBid != null and ccorrectbillBid != ''">and ccorrectbill_bid = #{ccorrectbillBid}</if>
            <if test="cdeletemakerid != null and cdeletemakerid != ''">and cdeletemakerid = #{cdeletemakerid}</if>
            <if test="cfirstbid != null and cfirstbid != ''">and cfirstbid = #{cfirstbid}</if>
            <if test="cfirstid != null and cfirstid != ''">and cfirstid = #{cfirstid}</if>
            <if test="cfirsttypecode != null and cfirsttypecode != ''">and cfirsttypecode = #{cfirsttypecode}</if>
            <if test="cincbid != null and cincbid != ''">and cincbid = #{cincbid}</if>
            <if test="cincorpid != null and cincorpid != ''">and cincorpid = #{cincorpid}</if>
            <if test="cindeptid != null and cindeptid != ''">and cindeptid = #{cindeptid}</if>
            <if test="cininvid != null and cininvid != ''">and cininvid = #{cininvid}</if>
            <if test="cinpsnid != null and cinpsnid != ''">and cinpsnid = #{cinpsnid}</if>
            <if test="cinspaceid != null and cinspaceid != ''">and cinspaceid = #{cinspaceid}</if>
            <if test="cinvbasid != null and cinvbasid != ''">and cinvbasid = #{cinvbasid}</if>
            <if test="cinwhid != null and cinwhid != ''">and cinwhid = #{cinwhid}</if>
            <if test="coutcbid != null and coutcbid != ''">and coutcbid = #{coutcbid}</if>
            <if test="coutcorpid != null and coutcorpid != ''">and coutcorpid = #{coutcorpid}</if>
            <if test="coutdeptid != null and coutdeptid != ''">and coutdeptid = #{coutdeptid}</if>
            <if test="coutendmakerid != null and coutendmakerid != ''">and coutendmakerid = #{coutendmakerid}</if>
            <if test="coutinvid != null and coutinvid != ''">and coutinvid = #{coutinvid}</if>
            <if test="coutpsnid != null and coutpsnid != ''">and coutpsnid = #{coutpsnid}</if>
            <if test="coutspaceid != null and coutspaceid != ''">and coutspaceid = #{coutspaceid}</if>
            <if test="coutwhid != null and coutwhid != ''">and coutwhid = #{coutwhid}</if>
            <if test="cprojectid != null and cprojectid != ''">and cprojectid = #{cprojectid}</if>
            <if test="cprojectphase != null and cprojectphase != ''">and cprojectphase = #{cprojectphase}</if>
            <if test="cquoteunitid != null and cquoteunitid != ''">and cquoteunitid = #{cquoteunitid}</if>
            <if test="creceieveid != null and creceieveid != ''">and creceieveid = #{creceieveid}</if>
            <if test="creceiverbasid != null and creceiverbasid != ''">and creceiverbasid = #{creceiverbasid}</if>
            <if test="crelationBid != null and crelationBid != ''">and crelation_bid = #{crelationBid}</if>
            <if test="crelationid != null and crelationid != ''">and crelationid = #{crelationid}</if>
            <if test="crowno != null and crowno != ''">and crowno = #{crowno}</if>
            <if test="csendendmakerid != null and csendendmakerid != ''">and csendendmakerid = #{csendendmakerid}</if>
            <if test="csourcebid != null and csourcebid != ''">and csourcebid = #{csourcebid}</if>
            <if test="csourceid != null and csourceid != ''">and csourceid = #{csourceid}</if>
            <if test="csourcetypecode != null and csourcetypecode != ''">and csourcetypecode = #{csourcetypecode}</if>
            <if test="ctakeoutcbid != null and ctakeoutcbid != ''">and ctakeoutcbid = #{ctakeoutcbid}</if>
            <if test="ctakeoutcorpid != null and ctakeoutcorpid != ''">and ctakeoutcorpid = #{ctakeoutcorpid}</if>
            <if test="ctakeoutdeptid != null and ctakeoutdeptid != ''">and ctakeoutdeptid = #{ctakeoutdeptid}</if>
            <if test="ctakeoutinvid != null and ctakeoutinvid != ''">and ctakeoutinvid = #{ctakeoutinvid}</if>
            <if test="ctakeoutpsnid != null and ctakeoutpsnid != ''">and ctakeoutpsnid = #{ctakeoutpsnid}</if>
            <if test="ctakeoutspaceid != null and ctakeoutspaceid != ''">and ctakeoutspaceid = #{ctakeoutspaceid}</if>
            <if test="ctakeoutwhid != null and ctakeoutwhid != ''">and ctakeoutwhid = #{ctakeoutwhid}</if>
            <if test="ctakerelationBid != null and ctakerelationBid != ''">and ctakerelation_bid = #{ctakerelationBid}
            </if>
            <if test="ctakerelationid != null and ctakerelationid != ''">and ctakerelationid = #{ctakerelationid}</if>
            <if test="ctypecode != null and ctypecode != ''">and ctypecode = #{ctypecode}</if>
            <if test="cvendorbasid != null and cvendorbasid != ''">and cvendorbasid = #{cvendorbasid}</if>
            <if test="cvendorid != null and cvendorid != ''">and cvendorid = #{cvendorid}</if>
            <if test="cworkcenterid != null and cworkcenterid != ''">and cworkcenterid = #{cworkcenterid}</if>
            <if test="dplanarrivedate != null and dplanarrivedate != ''">and dplanarrivedate = #{dplanarrivedate}</if>
            <if test="dplanoutdate != null and dplanoutdate != ''">and dplanoutdate = #{dplanoutdate}</if>
            <if test="dproducedate != null and dproducedate != ''">and dproducedate = #{dproducedate}</if>
            <if test="dr != null">and dr = #{dr}</if>
            <if test="drequiredate != null and drequiredate != ''">and drequiredate = #{drequiredate}</if>
            <if test="dvalidate != null and dvalidate != ''">and dvalidate = #{dvalidate}</if>
            <if test="fallocflag != null">and fallocflag = #{fallocflag}</if>
            <if test="flargess != null and flargess != ''">and flargess = #{flargess}</if>
            <if test="frowstatuflag != null">and frowstatuflag = #{frowstatuflag}</if>
            <if test="ftaxtypeflag != null">and ftaxtypeflag = #{ftaxtypeflag}</if>
            <if test="naddpricerate != null">and naddpricerate = #{naddpricerate}</if>
            <if test="narrangeassnum != null">and narrangeassnum = #{narrangeassnum}</if>
            <if test="narrangemonum != null">and narrangemonum = #{narrangemonum}</if>
            <if test="narrangenum != null">and narrangenum = #{narrangenum}</if>
            <if test="narrangepoapplynum != null">and narrangepoapplynum = #{narrangepoapplynum}</if>
            <if test="narrangepoordernum != null">and narrangepoordernum = #{narrangepoordernum}</if>
            <if test="narrangescornum != null">and narrangescornum = #{narrangescornum}</if>
            <if test="narrangetoornum != null">and narrangetoornum = #{narrangetoornum}</if>
            <if test="nasknotaxprice != null">and nasknotaxprice = #{nasknotaxprice}</if>
            <if test="naskprice != null">and naskprice = #{naskprice}</if>
            <if test="nassistnum != null">and nassistnum = #{nassistnum}</if>
            <if test="nchangerate != null">and nchangerate = #{nchangerate}</if>
            <if test="nfeedbacknum != null">and nfeedbacknum = #{nfeedbacknum}</if>
            <if test="nmny != null">and nmny = #{nmny}</if>
            <if test="nnotaxmny != null">and nnotaxmny = #{nnotaxmny}</if>
            <if test="nnotaxprice != null">and nnotaxprice = #{nnotaxprice}</if>
            <if test="nnum != null">and nnum = #{nnum}</if>
            <if test="norderbackassnum != null">and norderbackassnum = #{norderbackassnum}</if>
            <if test="norderbacknum != null">and norderbacknum = #{norderbacknum}</if>
            <if test="norderinassnum != null">and norderinassnum = #{norderinassnum}</if>
            <if test="norderinnum != null">and norderinnum = #{norderinnum}</if>
            <if test="norderinoutmny != null">and norderinoutmny = #{norderinoutmny}</if>
            <if test="norderinoutnum != null">and norderinoutnum = #{norderinoutnum}</if>
            <if test="norderoutassnum != null">and norderoutassnum = #{norderoutassnum}</if>
            <if test="norderoutnum != null">and norderoutnum = #{norderoutnum}</if>
            <if test="nordersendassnum != null">and nordersendassnum = #{nordersendassnum}</if>
            <if test="nordersendnum != null">and nordersendnum = #{nordersendnum}</if>
            <if test="nordershouldinnum != null">and nordershouldinnum = #{nordershouldinnum}</if>
            <if test="nordershouldoutnum != null">and nordershouldoutnum = #{nordershouldoutnum}</if>
            <if test="nordersignassnum != null">and nordersignassnum = #{nordersignassnum}</if>
            <if test="nordersignnum != null">and nordersignnum = #{nordersignnum}</if>
            <if test="nordertakemny != null">and nordertakemny = #{nordertakemny}</if>
            <if test="nordertakenum != null">and nordertakenum = #{nordertakenum}</if>
            <if test="norderwaylossassnum != null">and norderwaylossassnum = #{norderwaylossassnum}</if>
            <if test="norderwaylossnum != null">and norderwaylossnum = #{norderwaylossnum}</if>
            <if test="norgqtnetprc != null">and norgqtnetprc = #{norgqtnetprc}</if>
            <if test="norgqttaxnetprc != null">and norgqttaxnetprc = #{norgqttaxnetprc}</if>
            <if test="noutsumnum != null">and noutsumnum = #{noutsumnum}</if>
            <if test="nprice != null">and nprice = #{nprice}</if>
            <if test="nquoteunitnum != null">and nquoteunitnum = #{nquoteunitnum}</if>
            <if test="nquoteunitrate != null">and nquoteunitrate = #{nquoteunitrate}</if>
            <if test="nsafetystocknum != null">and nsafetystocknum = #{nsafetystocknum}</if>
            <if test="ntaxrate != null">and ntaxrate = #{ntaxrate}</if>
            <if test="ntranpoassnum != null">and ntranpoassnum = #{ntranpoassnum}</if>
            <if test="ntranponum != null">and ntranponum = #{ntranponum}</if>
            <if test="ntranstopraynum != null">and ntranstopraynum = #{ntranstopraynum}</if>
            <if test="pkAreacl != null and pkAreacl != ''">and pk_areacl = #{pkAreacl}</if>
            <if test="pkArrivearea != null and pkArrivearea != ''">and pk_arrivearea = #{pkArrivearea}</if>
            <if test="pkDefdoc1 != null and pkDefdoc1 != ''">and pk_defdoc1 = #{pkDefdoc1}</if>
            <if test="pkDefdoc10 != null and pkDefdoc10 != ''">and pk_defdoc10 = #{pkDefdoc10}</if>
            <if test="pkDefdoc11 != null and pkDefdoc11 != ''">and pk_defdoc11 = #{pkDefdoc11}</if>
            <if test="pkDefdoc12 != null and pkDefdoc12 != ''">and pk_defdoc12 = #{pkDefdoc12}</if>
            <if test="pkDefdoc13 != null and pkDefdoc13 != ''">and pk_defdoc13 = #{pkDefdoc13}</if>
            <if test="pkDefdoc14 != null and pkDefdoc14 != ''">and pk_defdoc14 = #{pkDefdoc14}</if>
            <if test="pkDefdoc15 != null and pkDefdoc15 != ''">and pk_defdoc15 = #{pkDefdoc15}</if>
            <if test="pkDefdoc16 != null and pkDefdoc16 != ''">and pk_defdoc16 = #{pkDefdoc16}</if>
            <if test="pkDefdoc17 != null and pkDefdoc17 != ''">and pk_defdoc17 = #{pkDefdoc17}</if>
            <if test="pkDefdoc18 != null and pkDefdoc18 != ''">and pk_defdoc18 = #{pkDefdoc18}</if>
            <if test="pkDefdoc19 != null and pkDefdoc19 != ''">and pk_defdoc19 = #{pkDefdoc19}</if>
            <if test="pkDefdoc2 != null and pkDefdoc2 != ''">and pk_defdoc2 = #{pkDefdoc2}</if>
            <if test="pkDefdoc20 != null and pkDefdoc20 != ''">and pk_defdoc20 = #{pkDefdoc20}</if>
            <if test="pkDefdoc3 != null and pkDefdoc3 != ''">and pk_defdoc3 = #{pkDefdoc3}</if>
            <if test="pkDefdoc4 != null and pkDefdoc4 != ''">and pk_defdoc4 = #{pkDefdoc4}</if>
            <if test="pkDefdoc5 != null and pkDefdoc5 != ''">and pk_defdoc5 = #{pkDefdoc5}</if>
            <if test="pkDefdoc6 != null and pkDefdoc6 != ''">and pk_defdoc6 = #{pkDefdoc6}</if>
            <if test="pkDefdoc7 != null and pkDefdoc7 != ''">and pk_defdoc7 = #{pkDefdoc7}</if>
            <if test="pkDefdoc8 != null and pkDefdoc8 != ''">and pk_defdoc8 = #{pkDefdoc8}</if>
            <if test="pkDefdoc9 != null and pkDefdoc9 != ''">and pk_defdoc9 = #{pkDefdoc9}</if>
            <if test="pkRtBid != null and pkRtBid != ''">and pk_rt_bid = #{pkRtBid}</if>
            <if test="pkSendtype != null and pkSendtype != ''">and pk_sendtype = #{pkSendtype}</if>
            <if test="pkTldid != null and pkTldid != ''">and pk_tldid = #{pkTldid}</if>
            <if test="tlastarrangetime != null and tlastarrangetime != ''">and tlastarrangetime = #{tlastarrangetime}
            </if>
            <if test="tplanarrivetime != null and tplanarrivetime != ''">and tplanarrivetime = #{tplanarrivetime}</if>
            <if test="tplanouttime != null and tplanouttime != ''">and tplanouttime = #{tplanouttime}</if>
            <if test="trequiretime != null and trequiretime != ''">and trequiretime = #{trequiretime}</if>
            <if test="ts != null and ts != ''">and ts = #{ts}</if>
            <if test="tsclose != null and tsclose != ''">and tsclose = #{tsclose}</if>
            <if test="tsdelete != null and tsdelete != ''">and tsdelete = #{tsdelete}</if>
            <if test="tsoutend != null and tsoutend != ''">and tsoutend = #{tsoutend}</if>
            <if test="tssendend != null and tssendend != ''">and tssendend = #{tssendend}</if>
            <if test="vbatch != null and vbatch != ''">and vbatch = #{vbatch}</if>
            <if test="vbdef1 != null and vbdef1 != ''">and vbdef1 = #{vbdef1}</if>
            <if test="vbdef10 != null and vbdef10 != ''">and vbdef10 = #{vbdef10}</if>
            <if test="vbdef11 != null and vbdef11 != ''">and vbdef11 = #{vbdef11}</if>
            <if test="vbdef12 != null and vbdef12 != ''">and vbdef12 = #{vbdef12}</if>
            <if test="vbdef13 != null and vbdef13 != ''">and vbdef13 = #{vbdef13}</if>
            <if test="vbdef14 != null and vbdef14 != ''">and vbdef14 = #{vbdef14}</if>
            <if test="vbdef15 != null and vbdef15 != ''">and vbdef15 = #{vbdef15}</if>
            <if test="vbdef16 != null and vbdef16 != ''">and vbdef16 = #{vbdef16}</if>
            <if test="vbdef17 != null and vbdef17 != ''">and vbdef17 = #{vbdef17}</if>
            <if test="vbdef18 != null and vbdef18 != ''">and vbdef18 = #{vbdef18}</if>
            <if test="vbdef19 != null and vbdef19 != ''">and vbdef19 = #{vbdef19}</if>
            <if test="vbdef2 != null and vbdef2 != ''">and vbdef2 = #{vbdef2}</if>
            <if test="vbdef20 != null and vbdef20 != ''">and vbdef20 = #{vbdef20}</if>
            <if test="vbdef3 != null and vbdef3 != ''">and vbdef3 = #{vbdef3}</if>
            <if test="vbdef4 != null and vbdef4 != ''">and vbdef4 = #{vbdef4}</if>
            <if test="vbdef5 != null and vbdef5 != ''">and vbdef5 = #{vbdef5}</if>
            <if test="vbdef6 != null and vbdef6 != ''">and vbdef6 = #{vbdef6}</if>
            <if test="vbdef7 != null and vbdef7 != ''">and vbdef7 = #{vbdef7}</if>
            <if test="vbdef8 != null and vbdef8 != ''">and vbdef8 = #{vbdef8}</if>
            <if test="vbdef9 != null and vbdef9 != ''">and vbdef9 = #{vbdef9}</if>
            <if test="vbomcode != null and vbomcode != ''">and vbomcode = #{vbomcode}</if>
            <if test="vbrevisereason != null and vbrevisereason != ''">and vbrevisereason = #{vbrevisereason}</if>
            <if test="vcode != null and vcode != ''">and vcode = #{vcode}</if>
            <if test="vfirstcode != null and vfirstcode != ''">and vfirstcode = #{vfirstcode}</if>
            <if test="vfirstrowno != null and vfirstrowno != ''">and vfirstrowno = #{vfirstrowno}</if>
            <if test="vfree1 != null and vfree1 != ''">and vfree1 = #{vfree1}</if>
            <if test="vfree2 != null and vfree2 != ''">and vfree2 = #{vfree2}</if>
            <if test="vfree3 != null and vfree3 != ''">and vfree3 = #{vfree3}</if>
            <if test="vfree4 != null and vfree4 != ''">and vfree4 = #{vfree4}</if>
            <if test="vfree5 != null and vfree5 != ''">and vfree5 = #{vfree5}</if>
            <if test="vnote != null and vnote != ''">and vnote = #{vnote}</if>
            <if test="vproducebatch != null and vproducebatch != ''">and vproducebatch = #{vproducebatch}</if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''">and vreceiveaddress = #{vreceiveaddress}</if>
            <if test="vsourcecode != null and vsourcecode != ''">and vsourcecode = #{vsourcecode}</if>
            <if test="vsourcerowno != null and vsourcerowno != ''">and vsourcerowno = #{vsourcerowno}</if>
            and dr='0'
        </trim>
    </select>

    <!-- 查询符合条件的数量 -->
    <select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.plugin.lets.entity.ToBillBEntity">
        select count(1) from to_bill_b
        <trim prefix="where" prefixOverrides="and">
            <if test="barrangedflag != null and barrangedflag != ''">and barrangedflag = #{barrangedflag}</if>
            <if test="boutendflag != null and boutendflag != ''">and boutendflag = #{boutendflag}</if>
            <if test="bretractflag != null and bretractflag != ''">and bretractflag = #{bretractflag}</if>
            <if test="bsendendflag != null and bsendendflag != ''">and bsendendflag = #{bsendendflag}</if>
            <if test="bsettleendflag != null and bsettleendflag != ''">and bsettleendflag = #{bsettleendflag}</if>
            <if test="btakesettleendflag != null and btakesettleendflag != ''">and btakesettleendflag =
                #{btakesettleendflag}
            </if>
            <if test="carrangepersonid != null and carrangepersonid != ''">and carrangepersonid = #{carrangepersonid}
            </if>
            <if test="castunitid != null and castunitid != ''">and castunitid = #{castunitid}</if>
            <if test="cbillBid != null and cbillBid != ''">and cbill_bid = #{cbillBid}</if>
            <if test="cbillid != null and cbillid != ''">and cbillid = #{cbillid}</if>
            <if test="cbilltype != null and cbilltype != ''">and cbilltype = #{cbilltype}</if>
            <if test="cbiztypeid != null and cbiztypeid != ''">and cbiztypeid = #{cbiztypeid}</if>
            <if test="cclosemakerid != null and cclosemakerid != ''">and cclosemakerid = #{cclosemakerid}</if>
            <if test="ccorrectbillBid != null and ccorrectbillBid != ''">and ccorrectbill_bid = #{ccorrectbillBid}</if>
            <if test="cdeletemakerid != null and cdeletemakerid != ''">and cdeletemakerid = #{cdeletemakerid}</if>
            <if test="cfirstbid != null and cfirstbid != ''">and cfirstbid = #{cfirstbid}</if>
            <if test="cfirstid != null and cfirstid != ''">and cfirstid = #{cfirstid}</if>
            <if test="cfirsttypecode != null and cfirsttypecode != ''">and cfirsttypecode = #{cfirsttypecode}</if>
            <if test="cincbid != null and cincbid != ''">and cincbid = #{cincbid}</if>
            <if test="cincorpid != null and cincorpid != ''">and cincorpid = #{cincorpid}</if>
            <if test="cindeptid != null and cindeptid != ''">and cindeptid = #{cindeptid}</if>
            <if test="cininvid != null and cininvid != ''">and cininvid = #{cininvid}</if>
            <if test="cinpsnid != null and cinpsnid != ''">and cinpsnid = #{cinpsnid}</if>
            <if test="cinspaceid != null and cinspaceid != ''">and cinspaceid = #{cinspaceid}</if>
            <if test="cinvbasid != null and cinvbasid != ''">and cinvbasid = #{cinvbasid}</if>
            <if test="cinwhid != null and cinwhid != ''">and cinwhid = #{cinwhid}</if>
            <if test="coutcbid != null and coutcbid != ''">and coutcbid = #{coutcbid}</if>
            <if test="coutcorpid != null and coutcorpid != ''">and coutcorpid = #{coutcorpid}</if>
            <if test="coutdeptid != null and coutdeptid != ''">and coutdeptid = #{coutdeptid}</if>
            <if test="coutendmakerid != null and coutendmakerid != ''">and coutendmakerid = #{coutendmakerid}</if>
            <if test="coutinvid != null and coutinvid != ''">and coutinvid = #{coutinvid}</if>
            <if test="coutpsnid != null and coutpsnid != ''">and coutpsnid = #{coutpsnid}</if>
            <if test="coutspaceid != null and coutspaceid != ''">and coutspaceid = #{coutspaceid}</if>
            <if test="coutwhid != null and coutwhid != ''">and coutwhid = #{coutwhid}</if>
            <if test="cprojectid != null and cprojectid != ''">and cprojectid = #{cprojectid}</if>
            <if test="cprojectphase != null and cprojectphase != ''">and cprojectphase = #{cprojectphase}</if>
            <if test="cquoteunitid != null and cquoteunitid != ''">and cquoteunitid = #{cquoteunitid}</if>
            <if test="creceieveid != null and creceieveid != ''">and creceieveid = #{creceieveid}</if>
            <if test="creceiverbasid != null and creceiverbasid != ''">and creceiverbasid = #{creceiverbasid}</if>
            <if test="crelationBid != null and crelationBid != ''">and crelation_bid = #{crelationBid}</if>
            <if test="crelationid != null and crelationid != ''">and crelationid = #{crelationid}</if>
            <if test="crowno != null and crowno != ''">and crowno = #{crowno}</if>
            <if test="csendendmakerid != null and csendendmakerid != ''">and csendendmakerid = #{csendendmakerid}</if>
            <if test="csourcebid != null and csourcebid != ''">and csourcebid = #{csourcebid}</if>
            <if test="csourceid != null and csourceid != ''">and csourceid = #{csourceid}</if>
            <if test="csourcetypecode != null and csourcetypecode != ''">and csourcetypecode = #{csourcetypecode}</if>
            <if test="ctakeoutcbid != null and ctakeoutcbid != ''">and ctakeoutcbid = #{ctakeoutcbid}</if>
            <if test="ctakeoutcorpid != null and ctakeoutcorpid != ''">and ctakeoutcorpid = #{ctakeoutcorpid}</if>
            <if test="ctakeoutdeptid != null and ctakeoutdeptid != ''">and ctakeoutdeptid = #{ctakeoutdeptid}</if>
            <if test="ctakeoutinvid != null and ctakeoutinvid != ''">and ctakeoutinvid = #{ctakeoutinvid}</if>
            <if test="ctakeoutpsnid != null and ctakeoutpsnid != ''">and ctakeoutpsnid = #{ctakeoutpsnid}</if>
            <if test="ctakeoutspaceid != null and ctakeoutspaceid != ''">and ctakeoutspaceid = #{ctakeoutspaceid}</if>
            <if test="ctakeoutwhid != null and ctakeoutwhid != ''">and ctakeoutwhid = #{ctakeoutwhid}</if>
            <if test="ctakerelationBid != null and ctakerelationBid != ''">and ctakerelation_bid = #{ctakerelationBid}
            </if>
            <if test="ctakerelationid != null and ctakerelationid != ''">and ctakerelationid = #{ctakerelationid}</if>
            <if test="ctypecode != null and ctypecode != ''">and ctypecode = #{ctypecode}</if>
            <if test="cvendorbasid != null and cvendorbasid != ''">and cvendorbasid = #{cvendorbasid}</if>
            <if test="cvendorid != null and cvendorid != ''">and cvendorid = #{cvendorid}</if>
            <if test="cworkcenterid != null and cworkcenterid != ''">and cworkcenterid = #{cworkcenterid}</if>
            <if test="dplanarrivedate != null and dplanarrivedate != ''">and dplanarrivedate = #{dplanarrivedate}</if>
            <if test="dplanoutdate != null and dplanoutdate != ''">and dplanoutdate = #{dplanoutdate}</if>
            <if test="dproducedate != null and dproducedate != ''">and dproducedate = #{dproducedate}</if>
            <if test="dr != null">and dr = #{dr}</if>
            <if test="drequiredate != null and drequiredate != ''">and drequiredate = #{drequiredate}</if>
            <if test="dvalidate != null and dvalidate != ''">and dvalidate = #{dvalidate}</if>
            <if test="fallocflag != null">and fallocflag = #{fallocflag}</if>
            <if test="flargess != null and flargess != ''">and flargess = #{flargess}</if>
            <if test="frowstatuflag != null">and frowstatuflag = #{frowstatuflag}</if>
            <if test="ftaxtypeflag != null">and ftaxtypeflag = #{ftaxtypeflag}</if>
            <if test="naddpricerate != null">and naddpricerate = #{naddpricerate}</if>
            <if test="narrangeassnum != null">and narrangeassnum = #{narrangeassnum}</if>
            <if test="narrangemonum != null">and narrangemonum = #{narrangemonum}</if>
            <if test="narrangenum != null">and narrangenum = #{narrangenum}</if>
            <if test="narrangepoapplynum != null">and narrangepoapplynum = #{narrangepoapplynum}</if>
            <if test="narrangepoordernum != null">and narrangepoordernum = #{narrangepoordernum}</if>
            <if test="narrangescornum != null">and narrangescornum = #{narrangescornum}</if>
            <if test="narrangetoornum != null">and narrangetoornum = #{narrangetoornum}</if>
            <if test="nasknotaxprice != null">and nasknotaxprice = #{nasknotaxprice}</if>
            <if test="naskprice != null">and naskprice = #{naskprice}</if>
            <if test="nassistnum != null">and nassistnum = #{nassistnum}</if>
            <if test="nchangerate != null">and nchangerate = #{nchangerate}</if>
            <if test="nfeedbacknum != null">and nfeedbacknum = #{nfeedbacknum}</if>
            <if test="nmny != null">and nmny = #{nmny}</if>
            <if test="nnotaxmny != null">and nnotaxmny = #{nnotaxmny}</if>
            <if test="nnotaxprice != null">and nnotaxprice = #{nnotaxprice}</if>
            <if test="nnum != null">and nnum = #{nnum}</if>
            <if test="norderbackassnum != null">and norderbackassnum = #{norderbackassnum}</if>
            <if test="norderbacknum != null">and norderbacknum = #{norderbacknum}</if>
            <if test="norderinassnum != null">and norderinassnum = #{norderinassnum}</if>
            <if test="norderinnum != null">and norderinnum = #{norderinnum}</if>
            <if test="norderinoutmny != null">and norderinoutmny = #{norderinoutmny}</if>
            <if test="norderinoutnum != null">and norderinoutnum = #{norderinoutnum}</if>
            <if test="norderoutassnum != null">and norderoutassnum = #{norderoutassnum}</if>
            <if test="norderoutnum != null">and norderoutnum = #{norderoutnum}</if>
            <if test="nordersendassnum != null">and nordersendassnum = #{nordersendassnum}</if>
            <if test="nordersendnum != null">and nordersendnum = #{nordersendnum}</if>
            <if test="nordershouldinnum != null">and nordershouldinnum = #{nordershouldinnum}</if>
            <if test="nordershouldoutnum != null">and nordershouldoutnum = #{nordershouldoutnum}</if>
            <if test="nordersignassnum != null">and nordersignassnum = #{nordersignassnum}</if>
            <if test="nordersignnum != null">and nordersignnum = #{nordersignnum}</if>
            <if test="nordertakemny != null">and nordertakemny = #{nordertakemny}</if>
            <if test="nordertakenum != null">and nordertakenum = #{nordertakenum}</if>
            <if test="norderwaylossassnum != null">and norderwaylossassnum = #{norderwaylossassnum}</if>
            <if test="norderwaylossnum != null">and norderwaylossnum = #{norderwaylossnum}</if>
            <if test="norgqtnetprc != null">and norgqtnetprc = #{norgqtnetprc}</if>
            <if test="norgqttaxnetprc != null">and norgqttaxnetprc = #{norgqttaxnetprc}</if>
            <if test="noutsumnum != null">and noutsumnum = #{noutsumnum}</if>
            <if test="nprice != null">and nprice = #{nprice}</if>
            <if test="nquoteunitnum != null">and nquoteunitnum = #{nquoteunitnum}</if>
            <if test="nquoteunitrate != null">and nquoteunitrate = #{nquoteunitrate}</if>
            <if test="nsafetystocknum != null">and nsafetystocknum = #{nsafetystocknum}</if>
            <if test="ntaxrate != null">and ntaxrate = #{ntaxrate}</if>
            <if test="ntranpoassnum != null">and ntranpoassnum = #{ntranpoassnum}</if>
            <if test="ntranponum != null">and ntranponum = #{ntranponum}</if>
            <if test="ntranstopraynum != null">and ntranstopraynum = #{ntranstopraynum}</if>
            <if test="pkAreacl != null and pkAreacl != ''">and pk_areacl = #{pkAreacl}</if>
            <if test="pkArrivearea != null and pkArrivearea != ''">and pk_arrivearea = #{pkArrivearea}</if>
            <if test="pkDefdoc1 != null and pkDefdoc1 != ''">and pk_defdoc1 = #{pkDefdoc1}</if>
            <if test="pkDefdoc10 != null and pkDefdoc10 != ''">and pk_defdoc10 = #{pkDefdoc10}</if>
            <if test="pkDefdoc11 != null and pkDefdoc11 != ''">and pk_defdoc11 = #{pkDefdoc11}</if>
            <if test="pkDefdoc12 != null and pkDefdoc12 != ''">and pk_defdoc12 = #{pkDefdoc12}</if>
            <if test="pkDefdoc13 != null and pkDefdoc13 != ''">and pk_defdoc13 = #{pkDefdoc13}</if>
            <if test="pkDefdoc14 != null and pkDefdoc14 != ''">and pk_defdoc14 = #{pkDefdoc14}</if>
            <if test="pkDefdoc15 != null and pkDefdoc15 != ''">and pk_defdoc15 = #{pkDefdoc15}</if>
            <if test="pkDefdoc16 != null and pkDefdoc16 != ''">and pk_defdoc16 = #{pkDefdoc16}</if>
            <if test="pkDefdoc17 != null and pkDefdoc17 != ''">and pk_defdoc17 = #{pkDefdoc17}</if>
            <if test="pkDefdoc18 != null and pkDefdoc18 != ''">and pk_defdoc18 = #{pkDefdoc18}</if>
            <if test="pkDefdoc19 != null and pkDefdoc19 != ''">and pk_defdoc19 = #{pkDefdoc19}</if>
            <if test="pkDefdoc2 != null and pkDefdoc2 != ''">and pk_defdoc2 = #{pkDefdoc2}</if>
            <if test="pkDefdoc20 != null and pkDefdoc20 != ''">and pk_defdoc20 = #{pkDefdoc20}</if>
            <if test="pkDefdoc3 != null and pkDefdoc3 != ''">and pk_defdoc3 = #{pkDefdoc3}</if>
            <if test="pkDefdoc4 != null and pkDefdoc4 != ''">and pk_defdoc4 = #{pkDefdoc4}</if>
            <if test="pkDefdoc5 != null and pkDefdoc5 != ''">and pk_defdoc5 = #{pkDefdoc5}</if>
            <if test="pkDefdoc6 != null and pkDefdoc6 != ''">and pk_defdoc6 = #{pkDefdoc6}</if>
            <if test="pkDefdoc7 != null and pkDefdoc7 != ''">and pk_defdoc7 = #{pkDefdoc7}</if>
            <if test="pkDefdoc8 != null and pkDefdoc8 != ''">and pk_defdoc8 = #{pkDefdoc8}</if>
            <if test="pkDefdoc9 != null and pkDefdoc9 != ''">and pk_defdoc9 = #{pkDefdoc9}</if>
            <if test="pkRtBid != null and pkRtBid != ''">and pk_rt_bid = #{pkRtBid}</if>
            <if test="pkSendtype != null and pkSendtype != ''">and pk_sendtype = #{pkSendtype}</if>
            <if test="pkTldid != null and pkTldid != ''">and pk_tldid = #{pkTldid}</if>
            <if test="tlastarrangetime != null and tlastarrangetime != ''">and tlastarrangetime = #{tlastarrangetime}
            </if>
            <if test="tplanarrivetime != null and tplanarrivetime != ''">and tplanarrivetime = #{tplanarrivetime}</if>
            <if test="tplanouttime != null and tplanouttime != ''">and tplanouttime = #{tplanouttime}</if>
            <if test="trequiretime != null and trequiretime != ''">and trequiretime = #{trequiretime}</if>
            <if test="ts != null and ts != ''">and ts = #{ts}</if>
            <if test="tsclose != null and tsclose != ''">and tsclose = #{tsclose}</if>
            <if test="tsdelete != null and tsdelete != ''">and tsdelete = #{tsdelete}</if>
            <if test="tsoutend != null and tsoutend != ''">and tsoutend = #{tsoutend}</if>
            <if test="tssendend != null and tssendend != ''">and tssendend = #{tssendend}</if>
            <if test="vbatch != null and vbatch != ''">and vbatch = #{vbatch}</if>
            <if test="vbdef1 != null and vbdef1 != ''">and vbdef1 = #{vbdef1}</if>
            <if test="vbdef10 != null and vbdef10 != ''">and vbdef10 = #{vbdef10}</if>
            <if test="vbdef11 != null and vbdef11 != ''">and vbdef11 = #{vbdef11}</if>
            <if test="vbdef12 != null and vbdef12 != ''">and vbdef12 = #{vbdef12}</if>
            <if test="vbdef13 != null and vbdef13 != ''">and vbdef13 = #{vbdef13}</if>
            <if test="vbdef14 != null and vbdef14 != ''">and vbdef14 = #{vbdef14}</if>
            <if test="vbdef15 != null and vbdef15 != ''">and vbdef15 = #{vbdef15}</if>
            <if test="vbdef16 != null and vbdef16 != ''">and vbdef16 = #{vbdef16}</if>
            <if test="vbdef17 != null and vbdef17 != ''">and vbdef17 = #{vbdef17}</if>
            <if test="vbdef18 != null and vbdef18 != ''">and vbdef18 = #{vbdef18}</if>
            <if test="vbdef19 != null and vbdef19 != ''">and vbdef19 = #{vbdef19}</if>
            <if test="vbdef2 != null and vbdef2 != ''">and vbdef2 = #{vbdef2}</if>
            <if test="vbdef20 != null and vbdef20 != ''">and vbdef20 = #{vbdef20}</if>
            <if test="vbdef3 != null and vbdef3 != ''">and vbdef3 = #{vbdef3}</if>
            <if test="vbdef4 != null and vbdef4 != ''">and vbdef4 = #{vbdef4}</if>
            <if test="vbdef5 != null and vbdef5 != ''">and vbdef5 = #{vbdef5}</if>
            <if test="vbdef6 != null and vbdef6 != ''">and vbdef6 = #{vbdef6}</if>
            <if test="vbdef7 != null and vbdef7 != ''">and vbdef7 = #{vbdef7}</if>
            <if test="vbdef8 != null and vbdef8 != ''">and vbdef8 = #{vbdef8}</if>
            <if test="vbdef9 != null and vbdef9 != ''">and vbdef9 = #{vbdef9}</if>
            <if test="vbomcode != null and vbomcode != ''">and vbomcode = #{vbomcode}</if>
            <if test="vbrevisereason != null and vbrevisereason != ''">and vbrevisereason = #{vbrevisereason}</if>
            <if test="vcode != null and vcode != ''">and vcode = #{vcode}</if>
            <if test="vfirstcode != null and vfirstcode != ''">and vfirstcode = #{vfirstcode}</if>
            <if test="vfirstrowno != null and vfirstrowno != ''">and vfirstrowno = #{vfirstrowno}</if>
            <if test="vfree1 != null and vfree1 != ''">and vfree1 = #{vfree1}</if>
            <if test="vfree2 != null and vfree2 != ''">and vfree2 = #{vfree2}</if>
            <if test="vfree3 != null and vfree3 != ''">and vfree3 = #{vfree3}</if>
            <if test="vfree4 != null and vfree4 != ''">and vfree4 = #{vfree4}</if>
            <if test="vfree5 != null and vfree5 != ''">and vfree5 = #{vfree5}</if>
            <if test="vnote != null and vnote != ''">and vnote = #{vnote}</if>
            <if test="vproducebatch != null and vproducebatch != ''">and vproducebatch = #{vproducebatch}</if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''">and vreceiveaddress = #{vreceiveaddress}</if>
            <if test="vsourcecode != null and vsourcecode != ''">and vsourcecode = #{vsourcecode}</if>
            <if test="vsourcerowno != null and vsourcerowno != ''">and vsourcerowno = #{vsourcerowno}</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-ToBillBEntity-result"
            parameterType="com.hzya.frame.plugin.lets.entity.ToBillBEntity">
        select
        <include refid="ToBillBEntity_Base_Column_List"/>
        from to_bill_b
        <trim prefix="where" prefixOverrides="and">
            <if test="barrangedflag != null and barrangedflag != ''">and barrangedflag like
                concat('%',#{barrangedflag},'%')
            </if>
            <if test="boutendflag != null and boutendflag != ''">and boutendflag like concat('%',#{boutendflag},'%')
            </if>
            <if test="bretractflag != null and bretractflag != ''">and bretractflag like
                concat('%',#{bretractflag},'%')
            </if>
            <if test="bsendendflag != null and bsendendflag != ''">and bsendendflag like
                concat('%',#{bsendendflag},'%')
            </if>
            <if test="bsettleendflag != null and bsettleendflag != ''">and bsettleendflag like
                concat('%',#{bsettleendflag},'%')
            </if>
            <if test="btakesettleendflag != null and btakesettleendflag != ''">and btakesettleendflag like
                concat('%',#{btakesettleendflag},'%')
            </if>
            <if test="carrangepersonid != null and carrangepersonid != ''">and carrangepersonid like
                concat('%',#{carrangepersonid},'%')
            </if>
            <if test="castunitid != null and castunitid != ''">and castunitid like concat('%',#{castunitid},'%')</if>
            <if test="cbillBid != null and cbillBid != ''">and cbill_bid like concat('%',#{cbillBid},'%')</if>
            <if test="cbillid != null and cbillid != ''">and cbillid like concat('%',#{cbillid},'%')</if>
            <if test="cbilltype != null and cbilltype != ''">and cbilltype like concat('%',#{cbilltype},'%')</if>
            <if test="cbiztypeid != null and cbiztypeid != ''">and cbiztypeid like concat('%',#{cbiztypeid},'%')</if>
            <if test="cclosemakerid != null and cclosemakerid != ''">and cclosemakerid like
                concat('%',#{cclosemakerid},'%')
            </if>
            <if test="ccorrectbillBid != null and ccorrectbillBid != ''">and ccorrectbill_bid like
                concat('%',#{ccorrectbillBid},'%')
            </if>
            <if test="cdeletemakerid != null and cdeletemakerid != ''">and cdeletemakerid like
                concat('%',#{cdeletemakerid},'%')
            </if>
            <if test="cfirstbid != null and cfirstbid != ''">and cfirstbid like concat('%',#{cfirstbid},'%')</if>
            <if test="cfirstid != null and cfirstid != ''">and cfirstid like concat('%',#{cfirstid},'%')</if>
            <if test="cfirsttypecode != null and cfirsttypecode != ''">and cfirsttypecode like
                concat('%',#{cfirsttypecode},'%')
            </if>
            <if test="cincbid != null and cincbid != ''">and cincbid like concat('%',#{cincbid},'%')</if>
            <if test="cincorpid != null and cincorpid != ''">and cincorpid like concat('%',#{cincorpid},'%')</if>
            <if test="cindeptid != null and cindeptid != ''">and cindeptid like concat('%',#{cindeptid},'%')</if>
            <if test="cininvid != null and cininvid != ''">and cininvid like concat('%',#{cininvid},'%')</if>
            <if test="cinpsnid != null and cinpsnid != ''">and cinpsnid like concat('%',#{cinpsnid},'%')</if>
            <if test="cinspaceid != null and cinspaceid != ''">and cinspaceid like concat('%',#{cinspaceid},'%')</if>
            <if test="cinvbasid != null and cinvbasid != ''">and cinvbasid like concat('%',#{cinvbasid},'%')</if>
            <if test="cinwhid != null and cinwhid != ''">and cinwhid like concat('%',#{cinwhid},'%')</if>
            <if test="coutcbid != null and coutcbid != ''">and coutcbid like concat('%',#{coutcbid},'%')</if>
            <if test="coutcorpid != null and coutcorpid != ''">and coutcorpid like concat('%',#{coutcorpid},'%')</if>
            <if test="coutdeptid != null and coutdeptid != ''">and coutdeptid like concat('%',#{coutdeptid},'%')</if>
            <if test="coutendmakerid != null and coutendmakerid != ''">and coutendmakerid like
                concat('%',#{coutendmakerid},'%')
            </if>
            <if test="coutinvid != null and coutinvid != ''">and coutinvid like concat('%',#{coutinvid},'%')</if>
            <if test="coutpsnid != null and coutpsnid != ''">and coutpsnid like concat('%',#{coutpsnid},'%')</if>
            <if test="coutspaceid != null and coutspaceid != ''">and coutspaceid like concat('%',#{coutspaceid},'%')
            </if>
            <if test="coutwhid != null and coutwhid != ''">and coutwhid like concat('%',#{coutwhid},'%')</if>
            <if test="cprojectid != null and cprojectid != ''">and cprojectid like concat('%',#{cprojectid},'%')</if>
            <if test="cprojectphase != null and cprojectphase != ''">and cprojectphase like
                concat('%',#{cprojectphase},'%')
            </if>
            <if test="cquoteunitid != null and cquoteunitid != ''">and cquoteunitid like
                concat('%',#{cquoteunitid},'%')
            </if>
            <if test="creceieveid != null and creceieveid != ''">and creceieveid like concat('%',#{creceieveid},'%')
            </if>
            <if test="creceiverbasid != null and creceiverbasid != ''">and creceiverbasid like
                concat('%',#{creceiverbasid},'%')
            </if>
            <if test="crelationBid != null and crelationBid != ''">and crelation_bid like
                concat('%',#{crelationBid},'%')
            </if>
            <if test="crelationid != null and crelationid != ''">and crelationid like concat('%',#{crelationid},'%')
            </if>
            <if test="crowno != null and crowno != ''">and crowno like concat('%',#{crowno},'%')</if>
            <if test="csendendmakerid != null and csendendmakerid != ''">and csendendmakerid like
                concat('%',#{csendendmakerid},'%')
            </if>
            <if test="csourcebid != null and csourcebid != ''">and csourcebid like concat('%',#{csourcebid},'%')</if>
            <if test="csourceid != null and csourceid != ''">and csourceid like concat('%',#{csourceid},'%')</if>
            <if test="csourcetypecode != null and csourcetypecode != ''">and csourcetypecode like
                concat('%',#{csourcetypecode},'%')
            </if>
            <if test="ctakeoutcbid != null and ctakeoutcbid != ''">and ctakeoutcbid like
                concat('%',#{ctakeoutcbid},'%')
            </if>
            <if test="ctakeoutcorpid != null and ctakeoutcorpid != ''">and ctakeoutcorpid like
                concat('%',#{ctakeoutcorpid},'%')
            </if>
            <if test="ctakeoutdeptid != null and ctakeoutdeptid != ''">and ctakeoutdeptid like
                concat('%',#{ctakeoutdeptid},'%')
            </if>
            <if test="ctakeoutinvid != null and ctakeoutinvid != ''">and ctakeoutinvid like
                concat('%',#{ctakeoutinvid},'%')
            </if>
            <if test="ctakeoutpsnid != null and ctakeoutpsnid != ''">and ctakeoutpsnid like
                concat('%',#{ctakeoutpsnid},'%')
            </if>
            <if test="ctakeoutspaceid != null and ctakeoutspaceid != ''">and ctakeoutspaceid like
                concat('%',#{ctakeoutspaceid},'%')
            </if>
            <if test="ctakeoutwhid != null and ctakeoutwhid != ''">and ctakeoutwhid like
                concat('%',#{ctakeoutwhid},'%')
            </if>
            <if test="ctakerelationBid != null and ctakerelationBid != ''">and ctakerelation_bid like
                concat('%',#{ctakerelationBid},'%')
            </if>
            <if test="ctakerelationid != null and ctakerelationid != ''">and ctakerelationid like
                concat('%',#{ctakerelationid},'%')
            </if>
            <if test="ctypecode != null and ctypecode != ''">and ctypecode like concat('%',#{ctypecode},'%')</if>
            <if test="cvendorbasid != null and cvendorbasid != ''">and cvendorbasid like
                concat('%',#{cvendorbasid},'%')
            </if>
            <if test="cvendorid != null and cvendorid != ''">and cvendorid like concat('%',#{cvendorid},'%')</if>
            <if test="cworkcenterid != null and cworkcenterid != ''">and cworkcenterid like
                concat('%',#{cworkcenterid},'%')
            </if>
            <if test="dplanarrivedate != null and dplanarrivedate != ''">and dplanarrivedate like
                concat('%',#{dplanarrivedate},'%')
            </if>
            <if test="dplanoutdate != null and dplanoutdate != ''">and dplanoutdate like
                concat('%',#{dplanoutdate},'%')
            </if>
            <if test="dproducedate != null and dproducedate != ''">and dproducedate like
                concat('%',#{dproducedate},'%')
            </if>
            <if test="dr != null">and dr like concat('%',#{dr},'%')</if>
            <if test="drequiredate != null and drequiredate != ''">and drequiredate like
                concat('%',#{drequiredate},'%')
            </if>
            <if test="dvalidate != null and dvalidate != ''">and dvalidate like concat('%',#{dvalidate},'%')</if>
            <if test="fallocflag != null">and fallocflag like concat('%',#{fallocflag},'%')</if>
            <if test="flargess != null and flargess != ''">and flargess like concat('%',#{flargess},'%')</if>
            <if test="frowstatuflag != null">and frowstatuflag like concat('%',#{frowstatuflag},'%')</if>
            <if test="ftaxtypeflag != null">and ftaxtypeflag like concat('%',#{ftaxtypeflag},'%')</if>
            <if test="naddpricerate != null">and naddpricerate like concat('%',#{naddpricerate},'%')</if>
            <if test="narrangeassnum != null">and narrangeassnum like concat('%',#{narrangeassnum},'%')</if>
            <if test="narrangemonum != null">and narrangemonum like concat('%',#{narrangemonum},'%')</if>
            <if test="narrangenum != null">and narrangenum like concat('%',#{narrangenum},'%')</if>
            <if test="narrangepoapplynum != null">and narrangepoapplynum like concat('%',#{narrangepoapplynum},'%')</if>
            <if test="narrangepoordernum != null">and narrangepoordernum like concat('%',#{narrangepoordernum},'%')</if>
            <if test="narrangescornum != null">and narrangescornum like concat('%',#{narrangescornum},'%')</if>
            <if test="narrangetoornum != null">and narrangetoornum like concat('%',#{narrangetoornum},'%')</if>
            <if test="nasknotaxprice != null">and nasknotaxprice like concat('%',#{nasknotaxprice},'%')</if>
            <if test="naskprice != null">and naskprice like concat('%',#{naskprice},'%')</if>
            <if test="nassistnum != null">and nassistnum like concat('%',#{nassistnum},'%')</if>
            <if test="nchangerate != null">and nchangerate like concat('%',#{nchangerate},'%')</if>
            <if test="nfeedbacknum != null">and nfeedbacknum like concat('%',#{nfeedbacknum},'%')</if>
            <if test="nmny != null">and nmny like concat('%',#{nmny},'%')</if>
            <if test="nnotaxmny != null">and nnotaxmny like concat('%',#{nnotaxmny},'%')</if>
            <if test="nnotaxprice != null">and nnotaxprice like concat('%',#{nnotaxprice},'%')</if>
            <if test="nnum != null">and nnum like concat('%',#{nnum},'%')</if>
            <if test="norderbackassnum != null">and norderbackassnum like concat('%',#{norderbackassnum},'%')</if>
            <if test="norderbacknum != null">and norderbacknum like concat('%',#{norderbacknum},'%')</if>
            <if test="norderinassnum != null">and norderinassnum like concat('%',#{norderinassnum},'%')</if>
            <if test="norderinnum != null">and norderinnum like concat('%',#{norderinnum},'%')</if>
            <if test="norderinoutmny != null">and norderinoutmny like concat('%',#{norderinoutmny},'%')</if>
            <if test="norderinoutnum != null">and norderinoutnum like concat('%',#{norderinoutnum},'%')</if>
            <if test="norderoutassnum != null">and norderoutassnum like concat('%',#{norderoutassnum},'%')</if>
            <if test="norderoutnum != null">and norderoutnum like concat('%',#{norderoutnum},'%')</if>
            <if test="nordersendassnum != null">and nordersendassnum like concat('%',#{nordersendassnum},'%')</if>
            <if test="nordersendnum != null">and nordersendnum like concat('%',#{nordersendnum},'%')</if>
            <if test="nordershouldinnum != null">and nordershouldinnum like concat('%',#{nordershouldinnum},'%')</if>
            <if test="nordershouldoutnum != null">and nordershouldoutnum like concat('%',#{nordershouldoutnum},'%')</if>
            <if test="nordersignassnum != null">and nordersignassnum like concat('%',#{nordersignassnum},'%')</if>
            <if test="nordersignnum != null">and nordersignnum like concat('%',#{nordersignnum},'%')</if>
            <if test="nordertakemny != null">and nordertakemny like concat('%',#{nordertakemny},'%')</if>
            <if test="nordertakenum != null">and nordertakenum like concat('%',#{nordertakenum},'%')</if>
            <if test="norderwaylossassnum != null">and norderwaylossassnum like concat('%',#{norderwaylossassnum},'%')
            </if>
            <if test="norderwaylossnum != null">and norderwaylossnum like concat('%',#{norderwaylossnum},'%')</if>
            <if test="norgqtnetprc != null">and norgqtnetprc like concat('%',#{norgqtnetprc},'%')</if>
            <if test="norgqttaxnetprc != null">and norgqttaxnetprc like concat('%',#{norgqttaxnetprc},'%')</if>
            <if test="noutsumnum != null">and noutsumnum like concat('%',#{noutsumnum},'%')</if>
            <if test="nprice != null">and nprice like concat('%',#{nprice},'%')</if>
            <if test="nquoteunitnum != null">and nquoteunitnum like concat('%',#{nquoteunitnum},'%')</if>
            <if test="nquoteunitrate != null">and nquoteunitrate like concat('%',#{nquoteunitrate},'%')</if>
            <if test="nsafetystocknum != null">and nsafetystocknum like concat('%',#{nsafetystocknum},'%')</if>
            <if test="ntaxrate != null">and ntaxrate like concat('%',#{ntaxrate},'%')</if>
            <if test="ntranpoassnum != null">and ntranpoassnum like concat('%',#{ntranpoassnum},'%')</if>
            <if test="ntranponum != null">and ntranponum like concat('%',#{ntranponum},'%')</if>
            <if test="ntranstopraynum != null">and ntranstopraynum like concat('%',#{ntranstopraynum},'%')</if>
            <if test="pkAreacl != null and pkAreacl != ''">and pk_areacl like concat('%',#{pkAreacl},'%')</if>
            <if test="pkArrivearea != null and pkArrivearea != ''">and pk_arrivearea like
                concat('%',#{pkArrivearea},'%')
            </if>
            <if test="pkDefdoc1 != null and pkDefdoc1 != ''">and pk_defdoc1 like concat('%',#{pkDefdoc1},'%')</if>
            <if test="pkDefdoc10 != null and pkDefdoc10 != ''">and pk_defdoc10 like concat('%',#{pkDefdoc10},'%')</if>
            <if test="pkDefdoc11 != null and pkDefdoc11 != ''">and pk_defdoc11 like concat('%',#{pkDefdoc11},'%')</if>
            <if test="pkDefdoc12 != null and pkDefdoc12 != ''">and pk_defdoc12 like concat('%',#{pkDefdoc12},'%')</if>
            <if test="pkDefdoc13 != null and pkDefdoc13 != ''">and pk_defdoc13 like concat('%',#{pkDefdoc13},'%')</if>
            <if test="pkDefdoc14 != null and pkDefdoc14 != ''">and pk_defdoc14 like concat('%',#{pkDefdoc14},'%')</if>
            <if test="pkDefdoc15 != null and pkDefdoc15 != ''">and pk_defdoc15 like concat('%',#{pkDefdoc15},'%')</if>
            <if test="pkDefdoc16 != null and pkDefdoc16 != ''">and pk_defdoc16 like concat('%',#{pkDefdoc16},'%')</if>
            <if test="pkDefdoc17 != null and pkDefdoc17 != ''">and pk_defdoc17 like concat('%',#{pkDefdoc17},'%')</if>
            <if test="pkDefdoc18 != null and pkDefdoc18 != ''">and pk_defdoc18 like concat('%',#{pkDefdoc18},'%')</if>
            <if test="pkDefdoc19 != null and pkDefdoc19 != ''">and pk_defdoc19 like concat('%',#{pkDefdoc19},'%')</if>
            <if test="pkDefdoc2 != null and pkDefdoc2 != ''">and pk_defdoc2 like concat('%',#{pkDefdoc2},'%')</if>
            <if test="pkDefdoc20 != null and pkDefdoc20 != ''">and pk_defdoc20 like concat('%',#{pkDefdoc20},'%')</if>
            <if test="pkDefdoc3 != null and pkDefdoc3 != ''">and pk_defdoc3 like concat('%',#{pkDefdoc3},'%')</if>
            <if test="pkDefdoc4 != null and pkDefdoc4 != ''">and pk_defdoc4 like concat('%',#{pkDefdoc4},'%')</if>
            <if test="pkDefdoc5 != null and pkDefdoc5 != ''">and pk_defdoc5 like concat('%',#{pkDefdoc5},'%')</if>
            <if test="pkDefdoc6 != null and pkDefdoc6 != ''">and pk_defdoc6 like concat('%',#{pkDefdoc6},'%')</if>
            <if test="pkDefdoc7 != null and pkDefdoc7 != ''">and pk_defdoc7 like concat('%',#{pkDefdoc7},'%')</if>
            <if test="pkDefdoc8 != null and pkDefdoc8 != ''">and pk_defdoc8 like concat('%',#{pkDefdoc8},'%')</if>
            <if test="pkDefdoc9 != null and pkDefdoc9 != ''">and pk_defdoc9 like concat('%',#{pkDefdoc9},'%')</if>
            <if test="pkRtBid != null and pkRtBid != ''">and pk_rt_bid like concat('%',#{pkRtBid},'%')</if>
            <if test="pkSendtype != null and pkSendtype != ''">and pk_sendtype like concat('%',#{pkSendtype},'%')</if>
            <if test="pkTldid != null and pkTldid != ''">and pk_tldid like concat('%',#{pkTldid},'%')</if>
            <if test="tlastarrangetime != null and tlastarrangetime != ''">and tlastarrangetime like
                concat('%',#{tlastarrangetime},'%')
            </if>
            <if test="tplanarrivetime != null and tplanarrivetime != ''">and tplanarrivetime like
                concat('%',#{tplanarrivetime},'%')
            </if>
            <if test="tplanouttime != null and tplanouttime != ''">and tplanouttime like
                concat('%',#{tplanouttime},'%')
            </if>
            <if test="trequiretime != null and trequiretime != ''">and trequiretime like
                concat('%',#{trequiretime},'%')
            </if>
            <if test="ts != null and ts != ''">and ts like concat('%',#{ts},'%')</if>
            <if test="tsclose != null and tsclose != ''">and tsclose like concat('%',#{tsclose},'%')</if>
            <if test="tsdelete != null and tsdelete != ''">and tsdelete like concat('%',#{tsdelete},'%')</if>
            <if test="tsoutend != null and tsoutend != ''">and tsoutend like concat('%',#{tsoutend},'%')</if>
            <if test="tssendend != null and tssendend != ''">and tssendend like concat('%',#{tssendend},'%')</if>
            <if test="vbatch != null and vbatch != ''">and vbatch like concat('%',#{vbatch},'%')</if>
            <if test="vbdef1 != null and vbdef1 != ''">and vbdef1 like concat('%',#{vbdef1},'%')</if>
            <if test="vbdef10 != null and vbdef10 != ''">and vbdef10 like concat('%',#{vbdef10},'%')</if>
            <if test="vbdef11 != null and vbdef11 != ''">and vbdef11 like concat('%',#{vbdef11},'%')</if>
            <if test="vbdef12 != null and vbdef12 != ''">and vbdef12 like concat('%',#{vbdef12},'%')</if>
            <if test="vbdef13 != null and vbdef13 != ''">and vbdef13 like concat('%',#{vbdef13},'%')</if>
            <if test="vbdef14 != null and vbdef14 != ''">and vbdef14 like concat('%',#{vbdef14},'%')</if>
            <if test="vbdef15 != null and vbdef15 != ''">and vbdef15 like concat('%',#{vbdef15},'%')</if>
            <if test="vbdef16 != null and vbdef16 != ''">and vbdef16 like concat('%',#{vbdef16},'%')</if>
            <if test="vbdef17 != null and vbdef17 != ''">and vbdef17 like concat('%',#{vbdef17},'%')</if>
            <if test="vbdef18 != null and vbdef18 != ''">and vbdef18 like concat('%',#{vbdef18},'%')</if>
            <if test="vbdef19 != null and vbdef19 != ''">and vbdef19 like concat('%',#{vbdef19},'%')</if>
            <if test="vbdef2 != null and vbdef2 != ''">and vbdef2 like concat('%',#{vbdef2},'%')</if>
            <if test="vbdef20 != null and vbdef20 != ''">and vbdef20 like concat('%',#{vbdef20},'%')</if>
            <if test="vbdef3 != null and vbdef3 != ''">and vbdef3 like concat('%',#{vbdef3},'%')</if>
            <if test="vbdef4 != null and vbdef4 != ''">and vbdef4 like concat('%',#{vbdef4},'%')</if>
            <if test="vbdef5 != null and vbdef5 != ''">and vbdef5 like concat('%',#{vbdef5},'%')</if>
            <if test="vbdef6 != null and vbdef6 != ''">and vbdef6 like concat('%',#{vbdef6},'%')</if>
            <if test="vbdef7 != null and vbdef7 != ''">and vbdef7 like concat('%',#{vbdef7},'%')</if>
            <if test="vbdef8 != null and vbdef8 != ''">and vbdef8 like concat('%',#{vbdef8},'%')</if>
            <if test="vbdef9 != null and vbdef9 != ''">and vbdef9 like concat('%',#{vbdef9},'%')</if>
            <if test="vbomcode != null and vbomcode != ''">and vbomcode like concat('%',#{vbomcode},'%')</if>
            <if test="vbrevisereason != null and vbrevisereason != ''">and vbrevisereason like
                concat('%',#{vbrevisereason},'%')
            </if>
            <if test="vcode != null and vcode != ''">and vcode like concat('%',#{vcode},'%')</if>
            <if test="vfirstcode != null and vfirstcode != ''">and vfirstcode like concat('%',#{vfirstcode},'%')</if>
            <if test="vfirstrowno != null and vfirstrowno != ''">and vfirstrowno like concat('%',#{vfirstrowno},'%')
            </if>
            <if test="vfree1 != null and vfree1 != ''">and vfree1 like concat('%',#{vfree1},'%')</if>
            <if test="vfree2 != null and vfree2 != ''">and vfree2 like concat('%',#{vfree2},'%')</if>
            <if test="vfree3 != null and vfree3 != ''">and vfree3 like concat('%',#{vfree3},'%')</if>
            <if test="vfree4 != null and vfree4 != ''">and vfree4 like concat('%',#{vfree4},'%')</if>
            <if test="vfree5 != null and vfree5 != ''">and vfree5 like concat('%',#{vfree5},'%')</if>
            <if test="vnote != null and vnote != ''">and vnote like concat('%',#{vnote},'%')</if>
            <if test="vproducebatch != null and vproducebatch != ''">and vproducebatch like
                concat('%',#{vproducebatch},'%')
            </if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''">and vreceiveaddress like
                concat('%',#{vreceiveaddress},'%')
            </if>
            <if test="vsourcecode != null and vsourcecode != ''">and vsourcecode like concat('%',#{vsourcecode},'%')
            </if>
            <if test="vsourcerowno != null and vsourcerowno != ''">and vsourcerowno like
                concat('%',#{vsourcerowno},'%')
            </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="ToBillBentity_list_or" resultMap="get-ToBillBEntity-result"
            parameterType="com.hzya.frame.plugin.lets.entity.ToBillBEntity">
        select
        <include refid="ToBillBEntity_Base_Column_List"/>
        from to_bill_b
        <trim prefix="where" prefixOverrides="and">
            <if test="barrangedflag != null and barrangedflag != ''">or barrangedflag = #{barrangedflag}</if>
            <if test="boutendflag != null and boutendflag != ''">or boutendflag = #{boutendflag}</if>
            <if test="bretractflag != null and bretractflag != ''">or bretractflag = #{bretractflag}</if>
            <if test="bsendendflag != null and bsendendflag != ''">or bsendendflag = #{bsendendflag}</if>
            <if test="bsettleendflag != null and bsettleendflag != ''">or bsettleendflag = #{bsettleendflag}</if>
            <if test="btakesettleendflag != null and btakesettleendflag != ''">or btakesettleendflag =
                #{btakesettleendflag}
            </if>
            <if test="carrangepersonid != null and carrangepersonid != ''">or carrangepersonid = #{carrangepersonid}
            </if>
            <if test="castunitid != null and castunitid != ''">or castunitid = #{castunitid}</if>
            <if test="cbillBid != null and cbillBid != ''">or cbill_bid = #{cbillBid}</if>
            <if test="cbillid != null and cbillid != ''">or cbillid = #{cbillid}</if>
            <if test="cbilltype != null and cbilltype != ''">or cbilltype = #{cbilltype}</if>
            <if test="cbiztypeid != null and cbiztypeid != ''">or cbiztypeid = #{cbiztypeid}</if>
            <if test="cclosemakerid != null and cclosemakerid != ''">or cclosemakerid = #{cclosemakerid}</if>
            <if test="ccorrectbillBid != null and ccorrectbillBid != ''">or ccorrectbill_bid = #{ccorrectbillBid}</if>
            <if test="cdeletemakerid != null and cdeletemakerid != ''">or cdeletemakerid = #{cdeletemakerid}</if>
            <if test="cfirstbid != null and cfirstbid != ''">or cfirstbid = #{cfirstbid}</if>
            <if test="cfirstid != null and cfirstid != ''">or cfirstid = #{cfirstid}</if>
            <if test="cfirsttypecode != null and cfirsttypecode != ''">or cfirsttypecode = #{cfirsttypecode}</if>
            <if test="cincbid != null and cincbid != ''">or cincbid = #{cincbid}</if>
            <if test="cincorpid != null and cincorpid != ''">or cincorpid = #{cincorpid}</if>
            <if test="cindeptid != null and cindeptid != ''">or cindeptid = #{cindeptid}</if>
            <if test="cininvid != null and cininvid != ''">or cininvid = #{cininvid}</if>
            <if test="cinpsnid != null and cinpsnid != ''">or cinpsnid = #{cinpsnid}</if>
            <if test="cinspaceid != null and cinspaceid != ''">or cinspaceid = #{cinspaceid}</if>
            <if test="cinvbasid != null and cinvbasid != ''">or cinvbasid = #{cinvbasid}</if>
            <if test="cinwhid != null and cinwhid != ''">or cinwhid = #{cinwhid}</if>
            <if test="coutcbid != null and coutcbid != ''">or coutcbid = #{coutcbid}</if>
            <if test="coutcorpid != null and coutcorpid != ''">or coutcorpid = #{coutcorpid}</if>
            <if test="coutdeptid != null and coutdeptid != ''">or coutdeptid = #{coutdeptid}</if>
            <if test="coutendmakerid != null and coutendmakerid != ''">or coutendmakerid = #{coutendmakerid}</if>
            <if test="coutinvid != null and coutinvid != ''">or coutinvid = #{coutinvid}</if>
            <if test="coutpsnid != null and coutpsnid != ''">or coutpsnid = #{coutpsnid}</if>
            <if test="coutspaceid != null and coutspaceid != ''">or coutspaceid = #{coutspaceid}</if>
            <if test="coutwhid != null and coutwhid != ''">or coutwhid = #{coutwhid}</if>
            <if test="cprojectid != null and cprojectid != ''">or cprojectid = #{cprojectid}</if>
            <if test="cprojectphase != null and cprojectphase != ''">or cprojectphase = #{cprojectphase}</if>
            <if test="cquoteunitid != null and cquoteunitid != ''">or cquoteunitid = #{cquoteunitid}</if>
            <if test="creceieveid != null and creceieveid != ''">or creceieveid = #{creceieveid}</if>
            <if test="creceiverbasid != null and creceiverbasid != ''">or creceiverbasid = #{creceiverbasid}</if>
            <if test="crelationBid != null and crelationBid != ''">or crelation_bid = #{crelationBid}</if>
            <if test="crelationid != null and crelationid != ''">or crelationid = #{crelationid}</if>
            <if test="crowno != null and crowno != ''">or crowno = #{crowno}</if>
            <if test="csendendmakerid != null and csendendmakerid != ''">or csendendmakerid = #{csendendmakerid}</if>
            <if test="csourcebid != null and csourcebid != ''">or csourcebid = #{csourcebid}</if>
            <if test="csourceid != null and csourceid != ''">or csourceid = #{csourceid}</if>
            <if test="csourcetypecode != null and csourcetypecode != ''">or csourcetypecode = #{csourcetypecode}</if>
            <if test="ctakeoutcbid != null and ctakeoutcbid != ''">or ctakeoutcbid = #{ctakeoutcbid}</if>
            <if test="ctakeoutcorpid != null and ctakeoutcorpid != ''">or ctakeoutcorpid = #{ctakeoutcorpid}</if>
            <if test="ctakeoutdeptid != null and ctakeoutdeptid != ''">or ctakeoutdeptid = #{ctakeoutdeptid}</if>
            <if test="ctakeoutinvid != null and ctakeoutinvid != ''">or ctakeoutinvid = #{ctakeoutinvid}</if>
            <if test="ctakeoutpsnid != null and ctakeoutpsnid != ''">or ctakeoutpsnid = #{ctakeoutpsnid}</if>
            <if test="ctakeoutspaceid != null and ctakeoutspaceid != ''">or ctakeoutspaceid = #{ctakeoutspaceid}</if>
            <if test="ctakeoutwhid != null and ctakeoutwhid != ''">or ctakeoutwhid = #{ctakeoutwhid}</if>
            <if test="ctakerelationBid != null and ctakerelationBid != ''">or ctakerelation_bid = #{ctakerelationBid}
            </if>
            <if test="ctakerelationid != null and ctakerelationid != ''">or ctakerelationid = #{ctakerelationid}</if>
            <if test="ctypecode != null and ctypecode != ''">or ctypecode = #{ctypecode}</if>
            <if test="cvendorbasid != null and cvendorbasid != ''">or cvendorbasid = #{cvendorbasid}</if>
            <if test="cvendorid != null and cvendorid != ''">or cvendorid = #{cvendorid}</if>
            <if test="cworkcenterid != null and cworkcenterid != ''">or cworkcenterid = #{cworkcenterid}</if>
            <if test="dplanarrivedate != null and dplanarrivedate != ''">or dplanarrivedate = #{dplanarrivedate}</if>
            <if test="dplanoutdate != null and dplanoutdate != ''">or dplanoutdate = #{dplanoutdate}</if>
            <if test="dproducedate != null and dproducedate != ''">or dproducedate = #{dproducedate}</if>
            <if test="dr != null">or dr = #{dr}</if>
            <if test="drequiredate != null and drequiredate != ''">or drequiredate = #{drequiredate}</if>
            <if test="dvalidate != null and dvalidate != ''">or dvalidate = #{dvalidate}</if>
            <if test="fallocflag != null">or fallocflag = #{fallocflag}</if>
            <if test="flargess != null and flargess != ''">or flargess = #{flargess}</if>
            <if test="frowstatuflag != null">or frowstatuflag = #{frowstatuflag}</if>
            <if test="ftaxtypeflag != null">or ftaxtypeflag = #{ftaxtypeflag}</if>
            <if test="naddpricerate != null">or naddpricerate = #{naddpricerate}</if>
            <if test="narrangeassnum != null">or narrangeassnum = #{narrangeassnum}</if>
            <if test="narrangemonum != null">or narrangemonum = #{narrangemonum}</if>
            <if test="narrangenum != null">or narrangenum = #{narrangenum}</if>
            <if test="narrangepoapplynum != null">or narrangepoapplynum = #{narrangepoapplynum}</if>
            <if test="narrangepoordernum != null">or narrangepoordernum = #{narrangepoordernum}</if>
            <if test="narrangescornum != null">or narrangescornum = #{narrangescornum}</if>
            <if test="narrangetoornum != null">or narrangetoornum = #{narrangetoornum}</if>
            <if test="nasknotaxprice != null">or nasknotaxprice = #{nasknotaxprice}</if>
            <if test="naskprice != null">or naskprice = #{naskprice}</if>
            <if test="nassistnum != null">or nassistnum = #{nassistnum}</if>
            <if test="nchangerate != null">or nchangerate = #{nchangerate}</if>
            <if test="nfeedbacknum != null">or nfeedbacknum = #{nfeedbacknum}</if>
            <if test="nmny != null">or nmny = #{nmny}</if>
            <if test="nnotaxmny != null">or nnotaxmny = #{nnotaxmny}</if>
            <if test="nnotaxprice != null">or nnotaxprice = #{nnotaxprice}</if>
            <if test="nnum != null">or nnum = #{nnum}</if>
            <if test="norderbackassnum != null">or norderbackassnum = #{norderbackassnum}</if>
            <if test="norderbacknum != null">or norderbacknum = #{norderbacknum}</if>
            <if test="norderinassnum != null">or norderinassnum = #{norderinassnum}</if>
            <if test="norderinnum != null">or norderinnum = #{norderinnum}</if>
            <if test="norderinoutmny != null">or norderinoutmny = #{norderinoutmny}</if>
            <if test="norderinoutnum != null">or norderinoutnum = #{norderinoutnum}</if>
            <if test="norderoutassnum != null">or norderoutassnum = #{norderoutassnum}</if>
            <if test="norderoutnum != null">or norderoutnum = #{norderoutnum}</if>
            <if test="nordersendassnum != null">or nordersendassnum = #{nordersendassnum}</if>
            <if test="nordersendnum != null">or nordersendnum = #{nordersendnum}</if>
            <if test="nordershouldinnum != null">or nordershouldinnum = #{nordershouldinnum}</if>
            <if test="nordershouldoutnum != null">or nordershouldoutnum = #{nordershouldoutnum}</if>
            <if test="nordersignassnum != null">or nordersignassnum = #{nordersignassnum}</if>
            <if test="nordersignnum != null">or nordersignnum = #{nordersignnum}</if>
            <if test="nordertakemny != null">or nordertakemny = #{nordertakemny}</if>
            <if test="nordertakenum != null">or nordertakenum = #{nordertakenum}</if>
            <if test="norderwaylossassnum != null">or norderwaylossassnum = #{norderwaylossassnum}</if>
            <if test="norderwaylossnum != null">or norderwaylossnum = #{norderwaylossnum}</if>
            <if test="norgqtnetprc != null">or norgqtnetprc = #{norgqtnetprc}</if>
            <if test="norgqttaxnetprc != null">or norgqttaxnetprc = #{norgqttaxnetprc}</if>
            <if test="noutsumnum != null">or noutsumnum = #{noutsumnum}</if>
            <if test="nprice != null">or nprice = #{nprice}</if>
            <if test="nquoteunitnum != null">or nquoteunitnum = #{nquoteunitnum}</if>
            <if test="nquoteunitrate != null">or nquoteunitrate = #{nquoteunitrate}</if>
            <if test="nsafetystocknum != null">or nsafetystocknum = #{nsafetystocknum}</if>
            <if test="ntaxrate != null">or ntaxrate = #{ntaxrate}</if>
            <if test="ntranpoassnum != null">or ntranpoassnum = #{ntranpoassnum}</if>
            <if test="ntranponum != null">or ntranponum = #{ntranponum}</if>
            <if test="ntranstopraynum != null">or ntranstopraynum = #{ntranstopraynum}</if>
            <if test="pkAreacl != null and pkAreacl != ''">or pk_areacl = #{pkAreacl}</if>
            <if test="pkArrivearea != null and pkArrivearea != ''">or pk_arrivearea = #{pkArrivearea}</if>
            <if test="pkDefdoc1 != null and pkDefdoc1 != ''">or pk_defdoc1 = #{pkDefdoc1}</if>
            <if test="pkDefdoc10 != null and pkDefdoc10 != ''">or pk_defdoc10 = #{pkDefdoc10}</if>
            <if test="pkDefdoc11 != null and pkDefdoc11 != ''">or pk_defdoc11 = #{pkDefdoc11}</if>
            <if test="pkDefdoc12 != null and pkDefdoc12 != ''">or pk_defdoc12 = #{pkDefdoc12}</if>
            <if test="pkDefdoc13 != null and pkDefdoc13 != ''">or pk_defdoc13 = #{pkDefdoc13}</if>
            <if test="pkDefdoc14 != null and pkDefdoc14 != ''">or pk_defdoc14 = #{pkDefdoc14}</if>
            <if test="pkDefdoc15 != null and pkDefdoc15 != ''">or pk_defdoc15 = #{pkDefdoc15}</if>
            <if test="pkDefdoc16 != null and pkDefdoc16 != ''">or pk_defdoc16 = #{pkDefdoc16}</if>
            <if test="pkDefdoc17 != null and pkDefdoc17 != ''">or pk_defdoc17 = #{pkDefdoc17}</if>
            <if test="pkDefdoc18 != null and pkDefdoc18 != ''">or pk_defdoc18 = #{pkDefdoc18}</if>
            <if test="pkDefdoc19 != null and pkDefdoc19 != ''">or pk_defdoc19 = #{pkDefdoc19}</if>
            <if test="pkDefdoc2 != null and pkDefdoc2 != ''">or pk_defdoc2 = #{pkDefdoc2}</if>
            <if test="pkDefdoc20 != null and pkDefdoc20 != ''">or pk_defdoc20 = #{pkDefdoc20}</if>
            <if test="pkDefdoc3 != null and pkDefdoc3 != ''">or pk_defdoc3 = #{pkDefdoc3}</if>
            <if test="pkDefdoc4 != null and pkDefdoc4 != ''">or pk_defdoc4 = #{pkDefdoc4}</if>
            <if test="pkDefdoc5 != null and pkDefdoc5 != ''">or pk_defdoc5 = #{pkDefdoc5}</if>
            <if test="pkDefdoc6 != null and pkDefdoc6 != ''">or pk_defdoc6 = #{pkDefdoc6}</if>
            <if test="pkDefdoc7 != null and pkDefdoc7 != ''">or pk_defdoc7 = #{pkDefdoc7}</if>
            <if test="pkDefdoc8 != null and pkDefdoc8 != ''">or pk_defdoc8 = #{pkDefdoc8}</if>
            <if test="pkDefdoc9 != null and pkDefdoc9 != ''">or pk_defdoc9 = #{pkDefdoc9}</if>
            <if test="pkRtBid != null and pkRtBid != ''">or pk_rt_bid = #{pkRtBid}</if>
            <if test="pkSendtype != null and pkSendtype != ''">or pk_sendtype = #{pkSendtype}</if>
            <if test="pkTldid != null and pkTldid != ''">or pk_tldid = #{pkTldid}</if>
            <if test="tlastarrangetime != null and tlastarrangetime != ''">or tlastarrangetime = #{tlastarrangetime}
            </if>
            <if test="tplanarrivetime != null and tplanarrivetime != ''">or tplanarrivetime = #{tplanarrivetime}</if>
            <if test="tplanouttime != null and tplanouttime != ''">or tplanouttime = #{tplanouttime}</if>
            <if test="trequiretime != null and trequiretime != ''">or trequiretime = #{trequiretime}</if>
            <if test="ts != null and ts != ''">or ts = #{ts}</if>
            <if test="tsclose != null and tsclose != ''">or tsclose = #{tsclose}</if>
            <if test="tsdelete != null and tsdelete != ''">or tsdelete = #{tsdelete}</if>
            <if test="tsoutend != null and tsoutend != ''">or tsoutend = #{tsoutend}</if>
            <if test="tssendend != null and tssendend != ''">or tssendend = #{tssendend}</if>
            <if test="vbatch != null and vbatch != ''">or vbatch = #{vbatch}</if>
            <if test="vbdef1 != null and vbdef1 != ''">or vbdef1 = #{vbdef1}</if>
            <if test="vbdef10 != null and vbdef10 != ''">or vbdef10 = #{vbdef10}</if>
            <if test="vbdef11 != null and vbdef11 != ''">or vbdef11 = #{vbdef11}</if>
            <if test="vbdef12 != null and vbdef12 != ''">or vbdef12 = #{vbdef12}</if>
            <if test="vbdef13 != null and vbdef13 != ''">or vbdef13 = #{vbdef13}</if>
            <if test="vbdef14 != null and vbdef14 != ''">or vbdef14 = #{vbdef14}</if>
            <if test="vbdef15 != null and vbdef15 != ''">or vbdef15 = #{vbdef15}</if>
            <if test="vbdef16 != null and vbdef16 != ''">or vbdef16 = #{vbdef16}</if>
            <if test="vbdef17 != null and vbdef17 != ''">or vbdef17 = #{vbdef17}</if>
            <if test="vbdef18 != null and vbdef18 != ''">or vbdef18 = #{vbdef18}</if>
            <if test="vbdef19 != null and vbdef19 != ''">or vbdef19 = #{vbdef19}</if>
            <if test="vbdef2 != null and vbdef2 != ''">or vbdef2 = #{vbdef2}</if>
            <if test="vbdef20 != null and vbdef20 != ''">or vbdef20 = #{vbdef20}</if>
            <if test="vbdef3 != null and vbdef3 != ''">or vbdef3 = #{vbdef3}</if>
            <if test="vbdef4 != null and vbdef4 != ''">or vbdef4 = #{vbdef4}</if>
            <if test="vbdef5 != null and vbdef5 != ''">or vbdef5 = #{vbdef5}</if>
            <if test="vbdef6 != null and vbdef6 != ''">or vbdef6 = #{vbdef6}</if>
            <if test="vbdef7 != null and vbdef7 != ''">or vbdef7 = #{vbdef7}</if>
            <if test="vbdef8 != null and vbdef8 != ''">or vbdef8 = #{vbdef8}</if>
            <if test="vbdef9 != null and vbdef9 != ''">or vbdef9 = #{vbdef9}</if>
            <if test="vbomcode != null and vbomcode != ''">or vbomcode = #{vbomcode}</if>
            <if test="vbrevisereason != null and vbrevisereason != ''">or vbrevisereason = #{vbrevisereason}</if>
            <if test="vcode != null and vcode != ''">or vcode = #{vcode}</if>
            <if test="vfirstcode != null and vfirstcode != ''">or vfirstcode = #{vfirstcode}</if>
            <if test="vfirstrowno != null and vfirstrowno != ''">or vfirstrowno = #{vfirstrowno}</if>
            <if test="vfree1 != null and vfree1 != ''">or vfree1 = #{vfree1}</if>
            <if test="vfree2 != null and vfree2 != ''">or vfree2 = #{vfree2}</if>
            <if test="vfree3 != null and vfree3 != ''">or vfree3 = #{vfree3}</if>
            <if test="vfree4 != null and vfree4 != ''">or vfree4 = #{vfree4}</if>
            <if test="vfree5 != null and vfree5 != ''">or vfree5 = #{vfree5}</if>
            <if test="vnote != null and vnote != ''">or vnote = #{vnote}</if>
            <if test="vproducebatch != null and vproducebatch != ''">or vproducebatch = #{vproducebatch}</if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''">or vreceiveaddress = #{vreceiveaddress}</if>
            <if test="vsourcecode != null and vsourcecode != ''">or vsourcecode = #{vsourcecode}</if>
            <if test="vsourcerowno != null and vsourcerowno != ''">or vsourcerowno = #{vsourcerowno}</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.ToBillBEntity" keyProperty="cbillBid"
            useGeneratedKeys="true">
        insert into to_bill_b(
        <trim suffix="" suffixOverrides=",">
            <if test="barrangedflag != null and barrangedflag != ''">barrangedflag ,</if>
            <if test="boutendflag != null and boutendflag != ''">boutendflag ,</if>
            <if test="bretractflag != null and bretractflag != ''">bretractflag ,</if>
            <if test="bsendendflag != null and bsendendflag != ''">bsendendflag ,</if>
            <if test="bsettleendflag != null and bsettleendflag != ''">bsettleendflag ,</if>
            <if test="btakesettleendflag != null and btakesettleendflag != ''">btakesettleendflag ,</if>
            <if test="carrangepersonid != null and carrangepersonid != ''">carrangepersonid ,</if>
            <if test="castunitid != null and castunitid != ''">castunitid ,</if>
            <if test="cbillBid != null and cbillBid != ''">cbill_bid ,</if>
            <if test="cbillid != null and cbillid != ''">cbillid ,</if>
            <if test="cbilltype != null and cbilltype != ''">cbilltype ,</if>
            <if test="cbiztypeid != null and cbiztypeid != ''">cbiztypeid ,</if>
            <if test="cclosemakerid != null and cclosemakerid != ''">cclosemakerid ,</if>
            <if test="ccorrectbillBid != null and ccorrectbillBid != ''">ccorrectbill_bid ,</if>
            <if test="cdeletemakerid != null and cdeletemakerid != ''">cdeletemakerid ,</if>
            <if test="cfirstbid != null and cfirstbid != ''">cfirstbid ,</if>
            <if test="cfirstid != null and cfirstid != ''">cfirstid ,</if>
            <if test="cfirsttypecode != null and cfirsttypecode != ''">cfirsttypecode ,</if>
            <if test="cincbid != null and cincbid != ''">cincbid ,</if>
            <if test="cincorpid != null and cincorpid != ''">cincorpid ,</if>
            <if test="cindeptid != null and cindeptid != ''">cindeptid ,</if>
            <if test="cininvid != null and cininvid != ''">cininvid ,</if>
            <if test="cinpsnid != null and cinpsnid != ''">cinpsnid ,</if>
            <if test="cinspaceid != null and cinspaceid != ''">cinspaceid ,</if>
            <if test="cinvbasid != null and cinvbasid != ''">cinvbasid ,</if>
            <if test="cinwhid != null and cinwhid != ''">cinwhid ,</if>
            <if test="coutcbid != null and coutcbid != ''">coutcbid ,</if>
            <if test="coutcorpid != null and coutcorpid != ''">coutcorpid ,</if>
            <if test="coutdeptid != null and coutdeptid != ''">coutdeptid ,</if>
            <if test="coutendmakerid != null and coutendmakerid != ''">coutendmakerid ,</if>
            <if test="coutinvid != null and coutinvid != ''">coutinvid ,</if>
            <if test="coutpsnid != null and coutpsnid != ''">coutpsnid ,</if>
            <if test="coutspaceid != null and coutspaceid != ''">coutspaceid ,</if>
            <if test="coutwhid != null and coutwhid != ''">coutwhid ,</if>
            <if test="cprojectid != null and cprojectid != ''">cprojectid ,</if>
            <if test="cprojectphase != null and cprojectphase != ''">cprojectphase ,</if>
            <if test="cquoteunitid != null and cquoteunitid != ''">cquoteunitid ,</if>
            <if test="creceieveid != null and creceieveid != ''">creceieveid ,</if>
            <if test="creceiverbasid != null and creceiverbasid != ''">creceiverbasid ,</if>
            <if test="crelationBid != null and crelationBid != ''">crelation_bid ,</if>
            <if test="crelationid != null and crelationid != ''">crelationid ,</if>
            <if test="crowno != null and crowno != ''">crowno ,</if>
            <if test="csendendmakerid != null and csendendmakerid != ''">csendendmakerid ,</if>
            <if test="csourcebid != null and csourcebid != ''">csourcebid ,</if>
            <if test="csourceid != null and csourceid != ''">csourceid ,</if>
            <if test="csourcetypecode != null and csourcetypecode != ''">csourcetypecode ,</if>
            <if test="ctakeoutcbid != null and ctakeoutcbid != ''">ctakeoutcbid ,</if>
            <if test="ctakeoutcorpid != null and ctakeoutcorpid != ''">ctakeoutcorpid ,</if>
            <if test="ctakeoutdeptid != null and ctakeoutdeptid != ''">ctakeoutdeptid ,</if>
            <if test="ctakeoutinvid != null and ctakeoutinvid != ''">ctakeoutinvid ,</if>
            <if test="ctakeoutpsnid != null and ctakeoutpsnid != ''">ctakeoutpsnid ,</if>
            <if test="ctakeoutspaceid != null and ctakeoutspaceid != ''">ctakeoutspaceid ,</if>
            <if test="ctakeoutwhid != null and ctakeoutwhid != ''">ctakeoutwhid ,</if>
            <if test="ctakerelationBid != null and ctakerelationBid != ''">ctakerelation_bid ,</if>
            <if test="ctakerelationid != null and ctakerelationid != ''">ctakerelationid ,</if>
            <if test="ctypecode != null and ctypecode != ''">ctypecode ,</if>
            <if test="cvendorbasid != null and cvendorbasid != ''">cvendorbasid ,</if>
            <if test="cvendorid != null and cvendorid != ''">cvendorid ,</if>
            <if test="cworkcenterid != null and cworkcenterid != ''">cworkcenterid ,</if>
            <if test="dplanarrivedate != null and dplanarrivedate != ''">dplanarrivedate ,</if>
            <if test="dplanoutdate != null and dplanoutdate != ''">dplanoutdate ,</if>
            <if test="dproducedate != null and dproducedate != ''">dproducedate ,</if>
            <if test="dr != null">dr ,</if>
            <if test="drequiredate != null and drequiredate != ''">drequiredate ,</if>
            <if test="dvalidate != null and dvalidate != ''">dvalidate ,</if>
            <if test="fallocflag != null">fallocflag ,</if>
            <if test="flargess != null and flargess != ''">flargess ,</if>
            <if test="frowstatuflag != null">frowstatuflag ,</if>
            <if test="ftaxtypeflag != null">ftaxtypeflag ,</if>
            <if test="naddpricerate != null">naddpricerate ,</if>
            <if test="narrangeassnum != null">narrangeassnum ,</if>
            <if test="narrangemonum != null">narrangemonum ,</if>
            <if test="narrangenum != null">narrangenum ,</if>
            <if test="narrangepoapplynum != null">narrangepoapplynum ,</if>
            <if test="narrangepoordernum != null">narrangepoordernum ,</if>
            <if test="narrangescornum != null">narrangescornum ,</if>
            <if test="narrangetoornum != null">narrangetoornum ,</if>
            <if test="nasknotaxprice != null">nasknotaxprice ,</if>
            <if test="naskprice != null">naskprice ,</if>
            <if test="nassistnum != null">nassistnum ,</if>
            <if test="nchangerate != null">nchangerate ,</if>
            <if test="nfeedbacknum != null">nfeedbacknum ,</if>
            <if test="nmny != null">nmny ,</if>
            <if test="nnotaxmny != null">nnotaxmny ,</if>
            <if test="nnotaxprice != null">nnotaxprice ,</if>
            <if test="nnum != null">nnum ,</if>
            <if test="norderbackassnum != null">norderbackassnum ,</if>
            <if test="norderbacknum != null">norderbacknum ,</if>
            <if test="norderinassnum != null">norderinassnum ,</if>
            <if test="norderinnum != null">norderinnum ,</if>
            <if test="norderinoutmny != null">norderinoutmny ,</if>
            <if test="norderinoutnum != null">norderinoutnum ,</if>
            <if test="norderoutassnum != null">norderoutassnum ,</if>
            <if test="norderoutnum != null">norderoutnum ,</if>
            <if test="nordersendassnum != null">nordersendassnum ,</if>
            <if test="nordersendnum != null">nordersendnum ,</if>
            <if test="nordershouldinnum != null">nordershouldinnum ,</if>
            <if test="nordershouldoutnum != null">nordershouldoutnum ,</if>
            <if test="nordersignassnum != null">nordersignassnum ,</if>
            <if test="nordersignnum != null">nordersignnum ,</if>
            <if test="nordertakemny != null">nordertakemny ,</if>
            <if test="nordertakenum != null">nordertakenum ,</if>
            <if test="norderwaylossassnum != null">norderwaylossassnum ,</if>
            <if test="norderwaylossnum != null">norderwaylossnum ,</if>
            <if test="norgqtnetprc != null">norgqtnetprc ,</if>
            <if test="norgqttaxnetprc != null">norgqttaxnetprc ,</if>
            <if test="noutsumnum != null">noutsumnum ,</if>
            <if test="nprice != null">nprice ,</if>
            <if test="nquoteunitnum != null">nquoteunitnum ,</if>
            <if test="nquoteunitrate != null">nquoteunitrate ,</if>
            <if test="nsafetystocknum != null">nsafetystocknum ,</if>
            <if test="ntaxrate != null">ntaxrate ,</if>
            <if test="ntranpoassnum != null">ntranpoassnum ,</if>
            <if test="ntranponum != null">ntranponum ,</if>
            <if test="ntranstopraynum != null">ntranstopraynum ,</if>
            <if test="pkAreacl != null and pkAreacl != ''">pk_areacl ,</if>
            <if test="pkArrivearea != null and pkArrivearea != ''">pk_arrivearea ,</if>
            <if test="pkDefdoc1 != null and pkDefdoc1 != ''">pk_defdoc1 ,</if>
            <if test="pkDefdoc10 != null and pkDefdoc10 != ''">pk_defdoc10 ,</if>
            <if test="pkDefdoc11 != null and pkDefdoc11 != ''">pk_defdoc11 ,</if>
            <if test="pkDefdoc12 != null and pkDefdoc12 != ''">pk_defdoc12 ,</if>
            <if test="pkDefdoc13 != null and pkDefdoc13 != ''">pk_defdoc13 ,</if>
            <if test="pkDefdoc14 != null and pkDefdoc14 != ''">pk_defdoc14 ,</if>
            <if test="pkDefdoc15 != null and pkDefdoc15 != ''">pk_defdoc15 ,</if>
            <if test="pkDefdoc16 != null and pkDefdoc16 != ''">pk_defdoc16 ,</if>
            <if test="pkDefdoc17 != null and pkDefdoc17 != ''">pk_defdoc17 ,</if>
            <if test="pkDefdoc18 != null and pkDefdoc18 != ''">pk_defdoc18 ,</if>
            <if test="pkDefdoc19 != null and pkDefdoc19 != ''">pk_defdoc19 ,</if>
            <if test="pkDefdoc2 != null and pkDefdoc2 != ''">pk_defdoc2 ,</if>
            <if test="pkDefdoc20 != null and pkDefdoc20 != ''">pk_defdoc20 ,</if>
            <if test="pkDefdoc3 != null and pkDefdoc3 != ''">pk_defdoc3 ,</if>
            <if test="pkDefdoc4 != null and pkDefdoc4 != ''">pk_defdoc4 ,</if>
            <if test="pkDefdoc5 != null and pkDefdoc5 != ''">pk_defdoc5 ,</if>
            <if test="pkDefdoc6 != null and pkDefdoc6 != ''">pk_defdoc6 ,</if>
            <if test="pkDefdoc7 != null and pkDefdoc7 != ''">pk_defdoc7 ,</if>
            <if test="pkDefdoc8 != null and pkDefdoc8 != ''">pk_defdoc8 ,</if>
            <if test="pkDefdoc9 != null and pkDefdoc9 != ''">pk_defdoc9 ,</if>
            <if test="pkRtBid != null and pkRtBid != ''">pk_rt_bid ,</if>
            <if test="pkSendtype != null and pkSendtype != ''">pk_sendtype ,</if>
            <if test="pkTldid != null and pkTldid != ''">pk_tldid ,</if>
            <if test="tlastarrangetime != null and tlastarrangetime != ''">tlastarrangetime ,</if>
            <if test="tplanarrivetime != null and tplanarrivetime != ''">tplanarrivetime ,</if>
            <if test="tplanouttime != null and tplanouttime != ''">tplanouttime ,</if>
            <if test="trequiretime != null and trequiretime != ''">trequiretime ,</if>
            <if test="ts != null and ts != ''">ts ,</if>
            <if test="tsclose != null and tsclose != ''">tsclose ,</if>
            <if test="tsdelete != null and tsdelete != ''">tsdelete ,</if>
            <if test="tsoutend != null and tsoutend != ''">tsoutend ,</if>
            <if test="tssendend != null and tssendend != ''">tssendend ,</if>
            <if test="vbatch != null and vbatch != ''">vbatch ,</if>
            <if test="vbdef1 != null and vbdef1 != ''">vbdef1 ,</if>
            <if test="vbdef10 != null and vbdef10 != ''">vbdef10 ,</if>
            <if test="vbdef11 != null and vbdef11 != ''">vbdef11 ,</if>
            <if test="vbdef12 != null and vbdef12 != ''">vbdef12 ,</if>
            <if test="vbdef13 != null and vbdef13 != ''">vbdef13 ,</if>
            <if test="vbdef14 != null and vbdef14 != ''">vbdef14 ,</if>
            <if test="vbdef15 != null and vbdef15 != ''">vbdef15 ,</if>
            <if test="vbdef16 != null and vbdef16 != ''">vbdef16 ,</if>
            <if test="vbdef17 != null and vbdef17 != ''">vbdef17 ,</if>
            <if test="vbdef18 != null and vbdef18 != ''">vbdef18 ,</if>
            <if test="vbdef19 != null and vbdef19 != ''">vbdef19 ,</if>
            <if test="vbdef2 != null and vbdef2 != ''">vbdef2 ,</if>
            <if test="vbdef20 != null and vbdef20 != ''">vbdef20 ,</if>
            <if test="vbdef3 != null and vbdef3 != ''">vbdef3 ,</if>
            <if test="vbdef4 != null and vbdef4 != ''">vbdef4 ,</if>
            <if test="vbdef5 != null and vbdef5 != ''">vbdef5 ,</if>
            <if test="vbdef6 != null and vbdef6 != ''">vbdef6 ,</if>
            <if test="vbdef7 != null and vbdef7 != ''">vbdef7 ,</if>
            <if test="vbdef8 != null and vbdef8 != ''">vbdef8 ,</if>
            <if test="vbdef9 != null and vbdef9 != ''">vbdef9 ,</if>
            <if test="vbomcode != null and vbomcode != ''">vbomcode ,</if>
            <if test="vbrevisereason != null and vbrevisereason != ''">vbrevisereason ,</if>
            <if test="vcode != null and vcode != ''">vcode ,</if>
            <if test="vfirstcode != null and vfirstcode != ''">vfirstcode ,</if>
            <if test="vfirstrowno != null and vfirstrowno != ''">vfirstrowno ,</if>
            <if test="vfree1 != null and vfree1 != ''">vfree1 ,</if>
            <if test="vfree2 != null and vfree2 != ''">vfree2 ,</if>
            <if test="vfree3 != null and vfree3 != ''">vfree3 ,</if>
            <if test="vfree4 != null and vfree4 != ''">vfree4 ,</if>
            <if test="vfree5 != null and vfree5 != ''">vfree5 ,</if>
            <if test="vnote != null and vnote != ''">vnote ,</if>
            <if test="vproducebatch != null and vproducebatch != ''">vproducebatch ,</if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''">vreceiveaddress ,</if>
            <if test="vsourcecode != null and vsourcecode != ''">vsourcecode ,</if>
            <if test="vsourcerowno != null and vsourcerowno != ''">vsourcerowno ,</if>
            <if test="sorts == null ">sorts,</if>
            <if test="sts == null ">sts,</if>
        </trim>
        )values(
        <trim suffix="" suffixOverrides=",">
            <if test="barrangedflag != null and barrangedflag != ''">#{barrangedflag} ,</if>
            <if test="boutendflag != null and boutendflag != ''">#{boutendflag} ,</if>
            <if test="bretractflag != null and bretractflag != ''">#{bretractflag} ,</if>
            <if test="bsendendflag != null and bsendendflag != ''">#{bsendendflag} ,</if>
            <if test="bsettleendflag != null and bsettleendflag != ''">#{bsettleendflag} ,</if>
            <if test="btakesettleendflag != null and btakesettleendflag != ''">#{btakesettleendflag} ,</if>
            <if test="carrangepersonid != null and carrangepersonid != ''">#{carrangepersonid} ,</if>
            <if test="castunitid != null and castunitid != ''">#{castunitid} ,</if>
            <if test="cbillBid != null and cbillBid != ''">#{cbillBid} ,</if>
            <if test="cbillid != null and cbillid != ''">#{cbillid} ,</if>
            <if test="cbilltype != null and cbilltype != ''">#{cbilltype} ,</if>
            <if test="cbiztypeid != null and cbiztypeid != ''">#{cbiztypeid} ,</if>
            <if test="cclosemakerid != null and cclosemakerid != ''">#{cclosemakerid} ,</if>
            <if test="ccorrectbillBid != null and ccorrectbillBid != ''">#{ccorrectbillBid} ,</if>
            <if test="cdeletemakerid != null and cdeletemakerid != ''">#{cdeletemakerid} ,</if>
            <if test="cfirstbid != null and cfirstbid != ''">#{cfirstbid} ,</if>
            <if test="cfirstid != null and cfirstid != ''">#{cfirstid} ,</if>
            <if test="cfirsttypecode != null and cfirsttypecode != ''">#{cfirsttypecode} ,</if>
            <if test="cincbid != null and cincbid != ''">#{cincbid} ,</if>
            <if test="cincorpid != null and cincorpid != ''">#{cincorpid} ,</if>
            <if test="cindeptid != null and cindeptid != ''">#{cindeptid} ,</if>
            <if test="cininvid != null and cininvid != ''">#{cininvid} ,</if>
            <if test="cinpsnid != null and cinpsnid != ''">#{cinpsnid} ,</if>
            <if test="cinspaceid != null and cinspaceid != ''">#{cinspaceid} ,</if>
            <if test="cinvbasid != null and cinvbasid != ''">#{cinvbasid} ,</if>
            <if test="cinwhid != null and cinwhid != ''">#{cinwhid} ,</if>
            <if test="coutcbid != null and coutcbid != ''">#{coutcbid} ,</if>
            <if test="coutcorpid != null and coutcorpid != ''">#{coutcorpid} ,</if>
            <if test="coutdeptid != null and coutdeptid != ''">#{coutdeptid} ,</if>
            <if test="coutendmakerid != null and coutendmakerid != ''">#{coutendmakerid} ,</if>
            <if test="coutinvid != null and coutinvid != ''">#{coutinvid} ,</if>
            <if test="coutpsnid != null and coutpsnid != ''">#{coutpsnid} ,</if>
            <if test="coutspaceid != null and coutspaceid != ''">#{coutspaceid} ,</if>
            <if test="coutwhid != null and coutwhid != ''">#{coutwhid} ,</if>
            <if test="cprojectid != null and cprojectid != ''">#{cprojectid} ,</if>
            <if test="cprojectphase != null and cprojectphase != ''">#{cprojectphase} ,</if>
            <if test="cquoteunitid != null and cquoteunitid != ''">#{cquoteunitid} ,</if>
            <if test="creceieveid != null and creceieveid != ''">#{creceieveid} ,</if>
            <if test="creceiverbasid != null and creceiverbasid != ''">#{creceiverbasid} ,</if>
            <if test="crelationBid != null and crelationBid != ''">#{crelationBid} ,</if>
            <if test="crelationid != null and crelationid != ''">#{crelationid} ,</if>
            <if test="crowno != null and crowno != ''">#{crowno} ,</if>
            <if test="csendendmakerid != null and csendendmakerid != ''">#{csendendmakerid} ,</if>
            <if test="csourcebid != null and csourcebid != ''">#{csourcebid} ,</if>
            <if test="csourceid != null and csourceid != ''">#{csourceid} ,</if>
            <if test="csourcetypecode != null and csourcetypecode != ''">#{csourcetypecode} ,</if>
            <if test="ctakeoutcbid != null and ctakeoutcbid != ''">#{ctakeoutcbid} ,</if>
            <if test="ctakeoutcorpid != null and ctakeoutcorpid != ''">#{ctakeoutcorpid} ,</if>
            <if test="ctakeoutdeptid != null and ctakeoutdeptid != ''">#{ctakeoutdeptid} ,</if>
            <if test="ctakeoutinvid != null and ctakeoutinvid != ''">#{ctakeoutinvid} ,</if>
            <if test="ctakeoutpsnid != null and ctakeoutpsnid != ''">#{ctakeoutpsnid} ,</if>
            <if test="ctakeoutspaceid != null and ctakeoutspaceid != ''">#{ctakeoutspaceid} ,</if>
            <if test="ctakeoutwhid != null and ctakeoutwhid != ''">#{ctakeoutwhid} ,</if>
            <if test="ctakerelationBid != null and ctakerelationBid != ''">#{ctakerelationBid} ,</if>
            <if test="ctakerelationid != null and ctakerelationid != ''">#{ctakerelationid} ,</if>
            <if test="ctypecode != null and ctypecode != ''">#{ctypecode} ,</if>
            <if test="cvendorbasid != null and cvendorbasid != ''">#{cvendorbasid} ,</if>
            <if test="cvendorid != null and cvendorid != ''">#{cvendorid} ,</if>
            <if test="cworkcenterid != null and cworkcenterid != ''">#{cworkcenterid} ,</if>
            <if test="dplanarrivedate != null and dplanarrivedate != ''">#{dplanarrivedate} ,</if>
            <if test="dplanoutdate != null and dplanoutdate != ''">#{dplanoutdate} ,</if>
            <if test="dproducedate != null and dproducedate != ''">#{dproducedate} ,</if>
            <if test="dr != null">#{dr} ,</if>
            <if test="drequiredate != null and drequiredate != ''">#{drequiredate} ,</if>
            <if test="dvalidate != null and dvalidate != ''">#{dvalidate} ,</if>
            <if test="fallocflag != null">#{fallocflag} ,</if>
            <if test="flargess != null and flargess != ''">#{flargess} ,</if>
            <if test="frowstatuflag != null">#{frowstatuflag} ,</if>
            <if test="ftaxtypeflag != null">#{ftaxtypeflag} ,</if>
            <if test="naddpricerate != null">#{naddpricerate} ,</if>
            <if test="narrangeassnum != null">#{narrangeassnum} ,</if>
            <if test="narrangemonum != null">#{narrangemonum} ,</if>
            <if test="narrangenum != null">#{narrangenum} ,</if>
            <if test="narrangepoapplynum != null">#{narrangepoapplynum} ,</if>
            <if test="narrangepoordernum != null">#{narrangepoordernum} ,</if>
            <if test="narrangescornum != null">#{narrangescornum} ,</if>
            <if test="narrangetoornum != null">#{narrangetoornum} ,</if>
            <if test="nasknotaxprice != null">#{nasknotaxprice} ,</if>
            <if test="naskprice != null">#{naskprice} ,</if>
            <if test="nassistnum != null">#{nassistnum} ,</if>
            <if test="nchangerate != null">#{nchangerate} ,</if>
            <if test="nfeedbacknum != null">#{nfeedbacknum} ,</if>
            <if test="nmny != null">#{nmny} ,</if>
            <if test="nnotaxmny != null">#{nnotaxmny} ,</if>
            <if test="nnotaxprice != null">#{nnotaxprice} ,</if>
            <if test="nnum != null">#{nnum} ,</if>
            <if test="norderbackassnum != null">#{norderbackassnum} ,</if>
            <if test="norderbacknum != null">#{norderbacknum} ,</if>
            <if test="norderinassnum != null">#{norderinassnum} ,</if>
            <if test="norderinnum != null">#{norderinnum} ,</if>
            <if test="norderinoutmny != null">#{norderinoutmny} ,</if>
            <if test="norderinoutnum != null">#{norderinoutnum} ,</if>
            <if test="norderoutassnum != null">#{norderoutassnum} ,</if>
            <if test="norderoutnum != null">#{norderoutnum} ,</if>
            <if test="nordersendassnum != null">#{nordersendassnum} ,</if>
            <if test="nordersendnum != null">#{nordersendnum} ,</if>
            <if test="nordershouldinnum != null">#{nordershouldinnum} ,</if>
            <if test="nordershouldoutnum != null">#{nordershouldoutnum} ,</if>
            <if test="nordersignassnum != null">#{nordersignassnum} ,</if>
            <if test="nordersignnum != null">#{nordersignnum} ,</if>
            <if test="nordertakemny != null">#{nordertakemny} ,</if>
            <if test="nordertakenum != null">#{nordertakenum} ,</if>
            <if test="norderwaylossassnum != null">#{norderwaylossassnum} ,</if>
            <if test="norderwaylossnum != null">#{norderwaylossnum} ,</if>
            <if test="norgqtnetprc != null">#{norgqtnetprc} ,</if>
            <if test="norgqttaxnetprc != null">#{norgqttaxnetprc} ,</if>
            <if test="noutsumnum != null">#{noutsumnum} ,</if>
            <if test="nprice != null">#{nprice} ,</if>
            <if test="nquoteunitnum != null">#{nquoteunitnum} ,</if>
            <if test="nquoteunitrate != null">#{nquoteunitrate} ,</if>
            <if test="nsafetystocknum != null">#{nsafetystocknum} ,</if>
            <if test="ntaxrate != null">#{ntaxrate} ,</if>
            <if test="ntranpoassnum != null">#{ntranpoassnum} ,</if>
            <if test="ntranponum != null">#{ntranponum} ,</if>
            <if test="ntranstopraynum != null">#{ntranstopraynum} ,</if>
            <if test="pkAreacl != null and pkAreacl != ''">#{pkAreacl} ,</if>
            <if test="pkArrivearea != null and pkArrivearea != ''">#{pkArrivearea} ,</if>
            <if test="pkDefdoc1 != null and pkDefdoc1 != ''">#{pkDefdoc1} ,</if>
            <if test="pkDefdoc10 != null and pkDefdoc10 != ''">#{pkDefdoc10} ,</if>
            <if test="pkDefdoc11 != null and pkDefdoc11 != ''">#{pkDefdoc11} ,</if>
            <if test="pkDefdoc12 != null and pkDefdoc12 != ''">#{pkDefdoc12} ,</if>
            <if test="pkDefdoc13 != null and pkDefdoc13 != ''">#{pkDefdoc13} ,</if>
            <if test="pkDefdoc14 != null and pkDefdoc14 != ''">#{pkDefdoc14} ,</if>
            <if test="pkDefdoc15 != null and pkDefdoc15 != ''">#{pkDefdoc15} ,</if>
            <if test="pkDefdoc16 != null and pkDefdoc16 != ''">#{pkDefdoc16} ,</if>
            <if test="pkDefdoc17 != null and pkDefdoc17 != ''">#{pkDefdoc17} ,</if>
            <if test="pkDefdoc18 != null and pkDefdoc18 != ''">#{pkDefdoc18} ,</if>
            <if test="pkDefdoc19 != null and pkDefdoc19 != ''">#{pkDefdoc19} ,</if>
            <if test="pkDefdoc2 != null and pkDefdoc2 != ''">#{pkDefdoc2} ,</if>
            <if test="pkDefdoc20 != null and pkDefdoc20 != ''">#{pkDefdoc20} ,</if>
            <if test="pkDefdoc3 != null and pkDefdoc3 != ''">#{pkDefdoc3} ,</if>
            <if test="pkDefdoc4 != null and pkDefdoc4 != ''">#{pkDefdoc4} ,</if>
            <if test="pkDefdoc5 != null and pkDefdoc5 != ''">#{pkDefdoc5} ,</if>
            <if test="pkDefdoc6 != null and pkDefdoc6 != ''">#{pkDefdoc6} ,</if>
            <if test="pkDefdoc7 != null and pkDefdoc7 != ''">#{pkDefdoc7} ,</if>
            <if test="pkDefdoc8 != null and pkDefdoc8 != ''">#{pkDefdoc8} ,</if>
            <if test="pkDefdoc9 != null and pkDefdoc9 != ''">#{pkDefdoc9} ,</if>
            <if test="pkRtBid != null and pkRtBid != ''">#{pkRtBid} ,</if>
            <if test="pkSendtype != null and pkSendtype != ''">#{pkSendtype} ,</if>
            <if test="pkTldid != null and pkTldid != ''">#{pkTldid} ,</if>
            <if test="tlastarrangetime != null and tlastarrangetime != ''">#{tlastarrangetime} ,</if>
            <if test="tplanarrivetime != null and tplanarrivetime != ''">#{tplanarrivetime} ,</if>
            <if test="tplanouttime != null and tplanouttime != ''">#{tplanouttime} ,</if>
            <if test="trequiretime != null and trequiretime != ''">#{trequiretime} ,</if>
            <if test="ts != null and ts != ''">#{ts} ,</if>
            <if test="tsclose != null and tsclose != ''">#{tsclose} ,</if>
            <if test="tsdelete != null and tsdelete != ''">#{tsdelete} ,</if>
            <if test="tsoutend != null and tsoutend != ''">#{tsoutend} ,</if>
            <if test="tssendend != null and tssendend != ''">#{tssendend} ,</if>
            <if test="vbatch != null and vbatch != ''">#{vbatch} ,</if>
            <if test="vbdef1 != null and vbdef1 != ''">#{vbdef1} ,</if>
            <if test="vbdef10 != null and vbdef10 != ''">#{vbdef10} ,</if>
            <if test="vbdef11 != null and vbdef11 != ''">#{vbdef11} ,</if>
            <if test="vbdef12 != null and vbdef12 != ''">#{vbdef12} ,</if>
            <if test="vbdef13 != null and vbdef13 != ''">#{vbdef13} ,</if>
            <if test="vbdef14 != null and vbdef14 != ''">#{vbdef14} ,</if>
            <if test="vbdef15 != null and vbdef15 != ''">#{vbdef15} ,</if>
            <if test="vbdef16 != null and vbdef16 != ''">#{vbdef16} ,</if>
            <if test="vbdef17 != null and vbdef17 != ''">#{vbdef17} ,</if>
            <if test="vbdef18 != null and vbdef18 != ''">#{vbdef18} ,</if>
            <if test="vbdef19 != null and vbdef19 != ''">#{vbdef19} ,</if>
            <if test="vbdef2 != null and vbdef2 != ''">#{vbdef2} ,</if>
            <if test="vbdef20 != null and vbdef20 != ''">#{vbdef20} ,</if>
            <if test="vbdef3 != null and vbdef3 != ''">#{vbdef3} ,</if>
            <if test="vbdef4 != null and vbdef4 != ''">#{vbdef4} ,</if>
            <if test="vbdef5 != null and vbdef5 != ''">#{vbdef5} ,</if>
            <if test="vbdef6 != null and vbdef6 != ''">#{vbdef6} ,</if>
            <if test="vbdef7 != null and vbdef7 != ''">#{vbdef7} ,</if>
            <if test="vbdef8 != null and vbdef8 != ''">#{vbdef8} ,</if>
            <if test="vbdef9 != null and vbdef9 != ''">#{vbdef9} ,</if>
            <if test="vbomcode != null and vbomcode != ''">#{vbomcode} ,</if>
            <if test="vbrevisereason != null and vbrevisereason != ''">#{vbrevisereason} ,</if>
            <if test="vcode != null and vcode != ''">#{vcode} ,</if>
            <if test="vfirstcode != null and vfirstcode != ''">#{vfirstcode} ,</if>
            <if test="vfirstrowno != null and vfirstrowno != ''">#{vfirstrowno} ,</if>
            <if test="vfree1 != null and vfree1 != ''">#{vfree1} ,</if>
            <if test="vfree2 != null and vfree2 != ''">#{vfree2} ,</if>
            <if test="vfree3 != null and vfree3 != ''">#{vfree3} ,</if>
            <if test="vfree4 != null and vfree4 != ''">#{vfree4} ,</if>
            <if test="vfree5 != null and vfree5 != ''">#{vfree5} ,</if>
            <if test="vnote != null and vnote != ''">#{vnote} ,</if>
            <if test="vproducebatch != null and vproducebatch != ''">#{vproducebatch} ,</if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''">#{vreceiveaddress} ,</if>
            <if test="vsourcecode != null and vsourcecode != ''">#{vsourcecode} ,</if>
            <if test="vsourcerowno != null and vsourcerowno != ''">#{vsourcerowno} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from to_bill_b a WHERE a.sts = 'Y'
                ),
            </if>
            <if test="sts == null ">'Y',</if>
        </trim>
        )
    </insert>
    <!-- 批量新增 -->
    <insert id="entityInsertBatch" keyProperty="cbillBid" useGeneratedKeys="true">
        insert into to_bill_b(barrangedflag, boutendflag, bretractflag, bsendendflag, bsettleendflag,
        btakesettleendflag, carrangepersonid, castunitid, cbillid, cbilltype, cbiztypeid, cclosemakerid,
        ccorrectbill_bid, cdeletemakerid, cfirstbid, cfirstid, cfirsttypecode, cincbid, cincorpid, cindeptid, cininvid,
        cinpsnid, cinspaceid, cinvbasid, cinwhid, coutcbid, coutcorpid, coutdeptid, coutendmakerid, coutinvid,
        coutpsnid, coutspaceid, coutwhid, cprojectid, cprojectphase, cquoteunitid, creceieveid, creceiverbasid,
        crelation_bid, crelationid, crowno, csendendmakerid, csourcebid, csourceid, csourcetypecode, ctakeoutcbid,
        ctakeoutcorpid, ctakeoutdeptid, ctakeoutinvid, ctakeoutpsnid, ctakeoutspaceid, ctakeoutwhid, ctakerelation_bid,
        ctakerelationid, ctypecode, cvendorbasid, cvendorid, cworkcenterid, dplanarrivedate, dplanoutdate, dproducedate,
        dr, drequiredate, dvalidate, fallocflag, flargess, frowstatuflag, ftaxtypeflag, naddpricerate, narrangeassnum,
        narrangemonum, narrangenum, narrangepoapplynum, narrangepoordernum, narrangescornum, narrangetoornum,
        nasknotaxprice, naskprice, nassistnum, nchangerate, nfeedbacknum, nmny, nnotaxmny, nnotaxprice, nnum,
        norderbackassnum, norderbacknum, norderinassnum, norderinnum, norderinoutmny, norderinoutnum, norderoutassnum,
        norderoutnum, nordersendassnum, nordersendnum, nordershouldinnum, nordershouldoutnum, nordersignassnum,
        nordersignnum, nordertakemny, nordertakenum, norderwaylossassnum, norderwaylossnum, norgqtnetprc,
        norgqttaxnetprc, noutsumnum, nprice, nquoteunitnum, nquoteunitrate, nsafetystocknum, ntaxrate, ntranpoassnum,
        ntranponum, ntranstopraynum, pk_areacl, pk_arrivearea, pk_defdoc1, pk_defdoc10, pk_defdoc11, pk_defdoc12,
        pk_defdoc13, pk_defdoc14, pk_defdoc15, pk_defdoc16, pk_defdoc17, pk_defdoc18, pk_defdoc19, pk_defdoc2,
        pk_defdoc20, pk_defdoc3, pk_defdoc4, pk_defdoc5, pk_defdoc6, pk_defdoc7, pk_defdoc8, pk_defdoc9, pk_rt_bid,
        pk_sendtype, pk_tldid, tlastarrangetime, tplanarrivetime, tplanouttime, trequiretime, ts, tsclose, tsdelete,
        tsoutend, tssendend, vbatch, vbdef1, vbdef10, vbdef11, vbdef12, vbdef13, vbdef14, vbdef15, vbdef16, vbdef17,
        vbdef18, vbdef19, vbdef2, vbdef20, vbdef3, vbdef4, vbdef5, vbdef6, vbdef7, vbdef8, vbdef9, vbomcode,
        vbrevisereason, vcode, vfirstcode, vfirstrowno, vfree1, vfree2, vfree3, vfree4, vfree5, vnote, vproducebatch,
        vreceiveaddress, vsourcecode, vsourcerowno, sts)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.barrangedflag},#{entity.boutendflag},#{entity.bretractflag},#{entity.bsendendflag},#{entity.bsettleendflag},#{entity.btakesettleendflag},#{entity.carrangepersonid},#{entity.castunitid},#{entity.cbillid},#{entity.cbilltype},#{entity.cbiztypeid},#{entity.cclosemakerid},#{entity.ccorrectbillBid},#{entity.cdeletemakerid},#{entity.cfirstbid},#{entity.cfirstid},#{entity.cfirsttypecode},#{entity.cincbid},#{entity.cincorpid},#{entity.cindeptid},#{entity.cininvid},#{entity.cinpsnid},#{entity.cinspaceid},#{entity.cinvbasid},#{entity.cinwhid},#{entity.coutcbid},#{entity.coutcorpid},#{entity.coutdeptid},#{entity.coutendmakerid},#{entity.coutinvid},#{entity.coutpsnid},#{entity.coutspaceid},#{entity.coutwhid},#{entity.cprojectid},#{entity.cprojectphase},#{entity.cquoteunitid},#{entity.creceieveid},#{entity.creceiverbasid},#{entity.crelationBid},#{entity.crelationid},#{entity.crowno},#{entity.csendendmakerid},#{entity.csourcebid},#{entity.csourceid},#{entity.csourcetypecode},#{entity.ctakeoutcbid},#{entity.ctakeoutcorpid},#{entity.ctakeoutdeptid},#{entity.ctakeoutinvid},#{entity.ctakeoutpsnid},#{entity.ctakeoutspaceid},#{entity.ctakeoutwhid},#{entity.ctakerelationBid},#{entity.ctakerelationid},#{entity.ctypecode},#{entity.cvendorbasid},#{entity.cvendorid},#{entity.cworkcenterid},#{entity.dplanarrivedate},#{entity.dplanoutdate},#{entity.dproducedate},#{entity.dr},#{entity.drequiredate},#{entity.dvalidate},#{entity.fallocflag},#{entity.flargess},#{entity.frowstatuflag},#{entity.ftaxtypeflag},#{entity.naddpricerate},#{entity.narrangeassnum},#{entity.narrangemonum},#{entity.narrangenum},#{entity.narrangepoapplynum},#{entity.narrangepoordernum},#{entity.narrangescornum},#{entity.narrangetoornum},#{entity.nasknotaxprice},#{entity.naskprice},#{entity.nassistnum},#{entity.nchangerate},#{entity.nfeedbacknum},#{entity.nmny},#{entity.nnotaxmny},#{entity.nnotaxprice},#{entity.nnum},#{entity.norderbackassnum},#{entity.norderbacknum},#{entity.norderinassnum},#{entity.norderinnum},#{entity.norderinoutmny},#{entity.norderinoutnum},#{entity.norderoutassnum},#{entity.norderoutnum},#{entity.nordersendassnum},#{entity.nordersendnum},#{entity.nordershouldinnum},#{entity.nordershouldoutnum},#{entity.nordersignassnum},#{entity.nordersignnum},#{entity.nordertakemny},#{entity.nordertakenum},#{entity.norderwaylossassnum},#{entity.norderwaylossnum},#{entity.norgqtnetprc},#{entity.norgqttaxnetprc},#{entity.noutsumnum},#{entity.nprice},#{entity.nquoteunitnum},#{entity.nquoteunitrate},#{entity.nsafetystocknum},#{entity.ntaxrate},#{entity.ntranpoassnum},#{entity.ntranponum},#{entity.ntranstopraynum},#{entity.pkAreacl},#{entity.pkArrivearea},#{entity.pkDefdoc1},#{entity.pkDefdoc10},#{entity.pkDefdoc11},#{entity.pkDefdoc12},#{entity.pkDefdoc13},#{entity.pkDefdoc14},#{entity.pkDefdoc15},#{entity.pkDefdoc16},#{entity.pkDefdoc17},#{entity.pkDefdoc18},#{entity.pkDefdoc19},#{entity.pkDefdoc2},#{entity.pkDefdoc20},#{entity.pkDefdoc3},#{entity.pkDefdoc4},#{entity.pkDefdoc5},#{entity.pkDefdoc6},#{entity.pkDefdoc7},#{entity.pkDefdoc8},#{entity.pkDefdoc9},#{entity.pkRtBid},#{entity.pkSendtype},#{entity.pkTldid},#{entity.tlastarrangetime},#{entity.tplanarrivetime},#{entity.tplanouttime},#{entity.trequiretime},#{entity.ts},#{entity.tsclose},#{entity.tsdelete},#{entity.tsoutend},#{entity.tssendend},#{entity.vbatch},#{entity.vbdef1},#{entity.vbdef10},#{entity.vbdef11},#{entity.vbdef12},#{entity.vbdef13},#{entity.vbdef14},#{entity.vbdef15},#{entity.vbdef16},#{entity.vbdef17},#{entity.vbdef18},#{entity.vbdef19},#{entity.vbdef2},#{entity.vbdef20},#{entity.vbdef3},#{entity.vbdef4},#{entity.vbdef5},#{entity.vbdef6},#{entity.vbdef7},#{entity.vbdef8},#{entity.vbdef9},#{entity.vbomcode},#{entity.vbrevisereason},#{entity.vcode},#{entity.vfirstcode},#{entity.vfirstrowno},#{entity.vfree1},#{entity.vfree2},#{entity.vfree3},#{entity.vfree4},#{entity.vfree5},#{entity.vnote},#{entity.vproducebatch},#{entity.vreceiveaddress},#{entity.vsourcecode},#{entity.vsourcerowno},
            'Y')
        </foreach>
    </insert>
    <!-- 批量新增或者修改-->
    <insert id="entityInsertOrUpdateBatch" keyProperty="cbillBid" useGeneratedKeys="true">
        insert into to_bill_b(barrangedflag, boutendflag, bretractflag, bsendendflag, bsettleendflag,
        btakesettleendflag, carrangepersonid, castunitid, cbillid, cbilltype, cbiztypeid, cclosemakerid,
        ccorrectbill_bid, cdeletemakerid, cfirstbid, cfirstid, cfirsttypecode, cincbid, cincorpid, cindeptid, cininvid,
        cinpsnid, cinspaceid, cinvbasid, cinwhid, coutcbid, coutcorpid, coutdeptid, coutendmakerid, coutinvid,
        coutpsnid, coutspaceid, coutwhid, cprojectid, cprojectphase, cquoteunitid, creceieveid, creceiverbasid,
        crelation_bid, crelationid, crowno, csendendmakerid, csourcebid, csourceid, csourcetypecode, ctakeoutcbid,
        ctakeoutcorpid, ctakeoutdeptid, ctakeoutinvid, ctakeoutpsnid, ctakeoutspaceid, ctakeoutwhid, ctakerelation_bid,
        ctakerelationid, ctypecode, cvendorbasid, cvendorid, cworkcenterid, dplanarrivedate, dplanoutdate, dproducedate,
        dr, drequiredate, dvalidate, fallocflag, flargess, frowstatuflag, ftaxtypeflag, naddpricerate, narrangeassnum,
        narrangemonum, narrangenum, narrangepoapplynum, narrangepoordernum, narrangescornum, narrangetoornum,
        nasknotaxprice, naskprice, nassistnum, nchangerate, nfeedbacknum, nmny, nnotaxmny, nnotaxprice, nnum,
        norderbackassnum, norderbacknum, norderinassnum, norderinnum, norderinoutmny, norderinoutnum, norderoutassnum,
        norderoutnum, nordersendassnum, nordersendnum, nordershouldinnum, nordershouldoutnum, nordersignassnum,
        nordersignnum, nordertakemny, nordertakenum, norderwaylossassnum, norderwaylossnum, norgqtnetprc,
        norgqttaxnetprc, noutsumnum, nprice, nquoteunitnum, nquoteunitrate, nsafetystocknum, ntaxrate, ntranpoassnum,
        ntranponum, ntranstopraynum, pk_areacl, pk_arrivearea, pk_defdoc1, pk_defdoc10, pk_defdoc11, pk_defdoc12,
        pk_defdoc13, pk_defdoc14, pk_defdoc15, pk_defdoc16, pk_defdoc17, pk_defdoc18, pk_defdoc19, pk_defdoc2,
        pk_defdoc20, pk_defdoc3, pk_defdoc4, pk_defdoc5, pk_defdoc6, pk_defdoc7, pk_defdoc8, pk_defdoc9, pk_rt_bid,
        pk_sendtype, pk_tldid, tlastarrangetime, tplanarrivetime, tplanouttime, trequiretime, ts, tsclose, tsdelete,
        tsoutend, tssendend, vbatch, vbdef1, vbdef10, vbdef11, vbdef12, vbdef13, vbdef14, vbdef15, vbdef16, vbdef17,
        vbdef18, vbdef19, vbdef2, vbdef20, vbdef3, vbdef4, vbdef5, vbdef6, vbdef7, vbdef8, vbdef9, vbomcode,
        vbrevisereason, vcode, vfirstcode, vfirstrowno, vfree1, vfree2, vfree3, vfree4, vfree5, vnote, vproducebatch,
        vreceiveaddress, vsourcecode, vsourcerowno)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.barrangedflag},#{entity.boutendflag},#{entity.bretractflag},#{entity.bsendendflag},#{entity.bsettleendflag},#{entity.btakesettleendflag},#{entity.carrangepersonid},#{entity.castunitid},#{entity.cbillid},#{entity.cbilltype},#{entity.cbiztypeid},#{entity.cclosemakerid},#{entity.ccorrectbillBid},#{entity.cdeletemakerid},#{entity.cfirstbid},#{entity.cfirstid},#{entity.cfirsttypecode},#{entity.cincbid},#{entity.cincorpid},#{entity.cindeptid},#{entity.cininvid},#{entity.cinpsnid},#{entity.cinspaceid},#{entity.cinvbasid},#{entity.cinwhid},#{entity.coutcbid},#{entity.coutcorpid},#{entity.coutdeptid},#{entity.coutendmakerid},#{entity.coutinvid},#{entity.coutpsnid},#{entity.coutspaceid},#{entity.coutwhid},#{entity.cprojectid},#{entity.cprojectphase},#{entity.cquoteunitid},#{entity.creceieveid},#{entity.creceiverbasid},#{entity.crelationBid},#{entity.crelationid},#{entity.crowno},#{entity.csendendmakerid},#{entity.csourcebid},#{entity.csourceid},#{entity.csourcetypecode},#{entity.ctakeoutcbid},#{entity.ctakeoutcorpid},#{entity.ctakeoutdeptid},#{entity.ctakeoutinvid},#{entity.ctakeoutpsnid},#{entity.ctakeoutspaceid},#{entity.ctakeoutwhid},#{entity.ctakerelationBid},#{entity.ctakerelationid},#{entity.ctypecode},#{entity.cvendorbasid},#{entity.cvendorid},#{entity.cworkcenterid},#{entity.dplanarrivedate},#{entity.dplanoutdate},#{entity.dproducedate},#{entity.dr},#{entity.drequiredate},#{entity.dvalidate},#{entity.fallocflag},#{entity.flargess},#{entity.frowstatuflag},#{entity.ftaxtypeflag},#{entity.naddpricerate},#{entity.narrangeassnum},#{entity.narrangemonum},#{entity.narrangenum},#{entity.narrangepoapplynum},#{entity.narrangepoordernum},#{entity.narrangescornum},#{entity.narrangetoornum},#{entity.nasknotaxprice},#{entity.naskprice},#{entity.nassistnum},#{entity.nchangerate},#{entity.nfeedbacknum},#{entity.nmny},#{entity.nnotaxmny},#{entity.nnotaxprice},#{entity.nnum},#{entity.norderbackassnum},#{entity.norderbacknum},#{entity.norderinassnum},#{entity.norderinnum},#{entity.norderinoutmny},#{entity.norderinoutnum},#{entity.norderoutassnum},#{entity.norderoutnum},#{entity.nordersendassnum},#{entity.nordersendnum},#{entity.nordershouldinnum},#{entity.nordershouldoutnum},#{entity.nordersignassnum},#{entity.nordersignnum},#{entity.nordertakemny},#{entity.nordertakenum},#{entity.norderwaylossassnum},#{entity.norderwaylossnum},#{entity.norgqtnetprc},#{entity.norgqttaxnetprc},#{entity.noutsumnum},#{entity.nprice},#{entity.nquoteunitnum},#{entity.nquoteunitrate},#{entity.nsafetystocknum},#{entity.ntaxrate},#{entity.ntranpoassnum},#{entity.ntranponum},#{entity.ntranstopraynum},#{entity.pkAreacl},#{entity.pkArrivearea},#{entity.pkDefdoc1},#{entity.pkDefdoc10},#{entity.pkDefdoc11},#{entity.pkDefdoc12},#{entity.pkDefdoc13},#{entity.pkDefdoc14},#{entity.pkDefdoc15},#{entity.pkDefdoc16},#{entity.pkDefdoc17},#{entity.pkDefdoc18},#{entity.pkDefdoc19},#{entity.pkDefdoc2},#{entity.pkDefdoc20},#{entity.pkDefdoc3},#{entity.pkDefdoc4},#{entity.pkDefdoc5},#{entity.pkDefdoc6},#{entity.pkDefdoc7},#{entity.pkDefdoc8},#{entity.pkDefdoc9},#{entity.pkRtBid},#{entity.pkSendtype},#{entity.pkTldid},#{entity.tlastarrangetime},#{entity.tplanarrivetime},#{entity.tplanouttime},#{entity.trequiretime},#{entity.ts},#{entity.tsclose},#{entity.tsdelete},#{entity.tsoutend},#{entity.tssendend},#{entity.vbatch},#{entity.vbdef1},#{entity.vbdef10},#{entity.vbdef11},#{entity.vbdef12},#{entity.vbdef13},#{entity.vbdef14},#{entity.vbdef15},#{entity.vbdef16},#{entity.vbdef17},#{entity.vbdef18},#{entity.vbdef19},#{entity.vbdef2},#{entity.vbdef20},#{entity.vbdef3},#{entity.vbdef4},#{entity.vbdef5},#{entity.vbdef6},#{entity.vbdef7},#{entity.vbdef8},#{entity.vbdef9},#{entity.vbomcode},#{entity.vbrevisereason},#{entity.vcode},#{entity.vfirstcode},#{entity.vfirstrowno},#{entity.vfree1},#{entity.vfree2},#{entity.vfree3},#{entity.vfree4},#{entity.vfree5},#{entity.vnote},#{entity.vproducebatch},#{entity.vreceiveaddress},#{entity.vsourcecode},#{entity.vsourcerowno})
        </foreach>
        on duplicate key update
        barrangedflag = values(barrangedflag),
        boutendflag = values(boutendflag),
        bretractflag = values(bretractflag),
        bsendendflag = values(bsendendflag),
        bsettleendflag = values(bsettleendflag),
        btakesettleendflag = values(btakesettleendflag),
        carrangepersonid = values(carrangepersonid),
        castunitid = values(castunitid),
        cbillid = values(cbillid),
        cbilltype = values(cbilltype),
        cbiztypeid = values(cbiztypeid),
        cclosemakerid = values(cclosemakerid),
        ccorrectbill_bid = values(ccorrectbill_bid),
        cdeletemakerid = values(cdeletemakerid),
        cfirstbid = values(cfirstbid),
        cfirstid = values(cfirstid),
        cfirsttypecode = values(cfirsttypecode),
        cincbid = values(cincbid),
        cincorpid = values(cincorpid),
        cindeptid = values(cindeptid),
        cininvid = values(cininvid),
        cinpsnid = values(cinpsnid),
        cinspaceid = values(cinspaceid),
        cinvbasid = values(cinvbasid),
        cinwhid = values(cinwhid),
        coutcbid = values(coutcbid),
        coutcorpid = values(coutcorpid),
        coutdeptid = values(coutdeptid),
        coutendmakerid = values(coutendmakerid),
        coutinvid = values(coutinvid),
        coutpsnid = values(coutpsnid),
        coutspaceid = values(coutspaceid),
        coutwhid = values(coutwhid),
        cprojectid = values(cprojectid),
        cprojectphase = values(cprojectphase),
        cquoteunitid = values(cquoteunitid),
        creceieveid = values(creceieveid),
        creceiverbasid = values(creceiverbasid),
        crelation_bid = values(crelation_bid),
        crelationid = values(crelationid),
        crowno = values(crowno),
        csendendmakerid = values(csendendmakerid),
        csourcebid = values(csourcebid),
        csourceid = values(csourceid),
        csourcetypecode = values(csourcetypecode),
        ctakeoutcbid = values(ctakeoutcbid),
        ctakeoutcorpid = values(ctakeoutcorpid),
        ctakeoutdeptid = values(ctakeoutdeptid),
        ctakeoutinvid = values(ctakeoutinvid),
        ctakeoutpsnid = values(ctakeoutpsnid),
        ctakeoutspaceid = values(ctakeoutspaceid),
        ctakeoutwhid = values(ctakeoutwhid),
        ctakerelation_bid = values(ctakerelation_bid),
        ctakerelationid = values(ctakerelationid),
        ctypecode = values(ctypecode),
        cvendorbasid = values(cvendorbasid),
        cvendorid = values(cvendorid),
        cworkcenterid = values(cworkcenterid),
        dplanarrivedate = values(dplanarrivedate),
        dplanoutdate = values(dplanoutdate),
        dproducedate = values(dproducedate),
        dr = values(dr),
        drequiredate = values(drequiredate),
        dvalidate = values(dvalidate),
        fallocflag = values(fallocflag),
        flargess = values(flargess),
        frowstatuflag = values(frowstatuflag),
        ftaxtypeflag = values(ftaxtypeflag),
        naddpricerate = values(naddpricerate),
        narrangeassnum = values(narrangeassnum),
        narrangemonum = values(narrangemonum),
        narrangenum = values(narrangenum),
        narrangepoapplynum = values(narrangepoapplynum),
        narrangepoordernum = values(narrangepoordernum),
        narrangescornum = values(narrangescornum),
        narrangetoornum = values(narrangetoornum),
        nasknotaxprice = values(nasknotaxprice),
        naskprice = values(naskprice),
        nassistnum = values(nassistnum),
        nchangerate = values(nchangerate),
        nfeedbacknum = values(nfeedbacknum),
        nmny = values(nmny),
        nnotaxmny = values(nnotaxmny),
        nnotaxprice = values(nnotaxprice),
        nnum = values(nnum),
        norderbackassnum = values(norderbackassnum),
        norderbacknum = values(norderbacknum),
        norderinassnum = values(norderinassnum),
        norderinnum = values(norderinnum),
        norderinoutmny = values(norderinoutmny),
        norderinoutnum = values(norderinoutnum),
        norderoutassnum = values(norderoutassnum),
        norderoutnum = values(norderoutnum),
        nordersendassnum = values(nordersendassnum),
        nordersendnum = values(nordersendnum),
        nordershouldinnum = values(nordershouldinnum),
        nordershouldoutnum = values(nordershouldoutnum),
        nordersignassnum = values(nordersignassnum),
        nordersignnum = values(nordersignnum),
        nordertakemny = values(nordertakemny),
        nordertakenum = values(nordertakenum),
        norderwaylossassnum = values(norderwaylossassnum),
        norderwaylossnum = values(norderwaylossnum),
        norgqtnetprc = values(norgqtnetprc),
        norgqttaxnetprc = values(norgqttaxnetprc),
        noutsumnum = values(noutsumnum),
        nprice = values(nprice),
        nquoteunitnum = values(nquoteunitnum),
        nquoteunitrate = values(nquoteunitrate),
        nsafetystocknum = values(nsafetystocknum),
        ntaxrate = values(ntaxrate),
        ntranpoassnum = values(ntranpoassnum),
        ntranponum = values(ntranponum),
        ntranstopraynum = values(ntranstopraynum),
        pk_areacl = values(pk_areacl),
        pk_arrivearea = values(pk_arrivearea),
        pk_defdoc1 = values(pk_defdoc1),
        pk_defdoc10 = values(pk_defdoc10),
        pk_defdoc11 = values(pk_defdoc11),
        pk_defdoc12 = values(pk_defdoc12),
        pk_defdoc13 = values(pk_defdoc13),
        pk_defdoc14 = values(pk_defdoc14),
        pk_defdoc15 = values(pk_defdoc15),
        pk_defdoc16 = values(pk_defdoc16),
        pk_defdoc17 = values(pk_defdoc17),
        pk_defdoc18 = values(pk_defdoc18),
        pk_defdoc19 = values(pk_defdoc19),
        pk_defdoc2 = values(pk_defdoc2),
        pk_defdoc20 = values(pk_defdoc20),
        pk_defdoc3 = values(pk_defdoc3),
        pk_defdoc4 = values(pk_defdoc4),
        pk_defdoc5 = values(pk_defdoc5),
        pk_defdoc6 = values(pk_defdoc6),
        pk_defdoc7 = values(pk_defdoc7),
        pk_defdoc8 = values(pk_defdoc8),
        pk_defdoc9 = values(pk_defdoc9),
        pk_rt_bid = values(pk_rt_bid),
        pk_sendtype = values(pk_sendtype),
        pk_tldid = values(pk_tldid),
        tlastarrangetime = values(tlastarrangetime),
        tplanarrivetime = values(tplanarrivetime),
        tplanouttime = values(tplanouttime),
        trequiretime = values(trequiretime),
        ts = values(ts),
        tsclose = values(tsclose),
        tsdelete = values(tsdelete),
        tsoutend = values(tsoutend),
        tssendend = values(tssendend),
        vbatch = values(vbatch),
        vbdef1 = values(vbdef1),
        vbdef10 = values(vbdef10),
        vbdef11 = values(vbdef11),
        vbdef12 = values(vbdef12),
        vbdef13 = values(vbdef13),
        vbdef14 = values(vbdef14),
        vbdef15 = values(vbdef15),
        vbdef16 = values(vbdef16),
        vbdef17 = values(vbdef17),
        vbdef18 = values(vbdef18),
        vbdef19 = values(vbdef19),
        vbdef2 = values(vbdef2),
        vbdef20 = values(vbdef20),
        vbdef3 = values(vbdef3),
        vbdef4 = values(vbdef4),
        vbdef5 = values(vbdef5),
        vbdef6 = values(vbdef6),
        vbdef7 = values(vbdef7),
        vbdef8 = values(vbdef8),
        vbdef9 = values(vbdef9),
        vbomcode = values(vbomcode),
        vbrevisereason = values(vbrevisereason),
        vcode = values(vcode),
        vfirstcode = values(vfirstcode),
        vfirstrowno = values(vfirstrowno),
        vfree1 = values(vfree1),
        vfree2 = values(vfree2),
        vfree3 = values(vfree3),
        vfree4 = values(vfree4),
        vfree5 = values(vfree5),
        vnote = values(vnote),
        vproducebatch = values(vproducebatch),
        vreceiveaddress = values(vreceiveaddress),
        vsourcecode = values(vsourcecode),
        vsourcerowno = values(vsourcerowno)
    </insert>
    <!--通过主键修改方法-->
    <update id="entity_update" parameterType="com.hzya.frame.plugin.lets.entity.ToBillBEntity">
        update to_bill_b set
        <trim suffix="" suffixOverrides=",">
            <if test="barrangedflag != null and barrangedflag != ''">barrangedflag = #{barrangedflag},</if>
            <if test="boutendflag != null and boutendflag != ''">boutendflag = #{boutendflag},</if>
            <if test="bretractflag != null and bretractflag != ''">bretractflag = #{bretractflag},</if>
            <if test="bsendendflag != null and bsendendflag != ''">bsendendflag = #{bsendendflag},</if>
            <if test="bsettleendflag != null and bsettleendflag != ''">bsettleendflag = #{bsettleendflag},</if>
            <if test="btakesettleendflag != null and btakesettleendflag != ''">btakesettleendflag =
                #{btakesettleendflag},
            </if>
            <if test="carrangepersonid != null and carrangepersonid != ''">carrangepersonid = #{carrangepersonid},</if>
            <if test="castunitid != null and castunitid != ''">castunitid = #{castunitid},</if>
            <if test="cbillid != null and cbillid != ''">cbillid = #{cbillid},</if>
            <if test="cbilltype != null and cbilltype != ''">cbilltype = #{cbilltype},</if>
            <if test="cbiztypeid != null and cbiztypeid != ''">cbiztypeid = #{cbiztypeid},</if>
            <if test="cclosemakerid != null and cclosemakerid != ''">cclosemakerid = #{cclosemakerid},</if>
            <if test="ccorrectbillBid != null and ccorrectbillBid != ''">ccorrectbill_bid = #{ccorrectbillBid},</if>
            <if test="cdeletemakerid != null and cdeletemakerid != ''">cdeletemakerid = #{cdeletemakerid},</if>
            <if test="cfirstbid != null and cfirstbid != ''">cfirstbid = #{cfirstbid},</if>
            <if test="cfirstid != null and cfirstid != ''">cfirstid = #{cfirstid},</if>
            <if test="cfirsttypecode != null and cfirsttypecode != ''">cfirsttypecode = #{cfirsttypecode},</if>
            <if test="cincbid != null and cincbid != ''">cincbid = #{cincbid},</if>
            <if test="cincorpid != null and cincorpid != ''">cincorpid = #{cincorpid},</if>
            <if test="cindeptid != null and cindeptid != ''">cindeptid = #{cindeptid},</if>
            <if test="cininvid != null and cininvid != ''">cininvid = #{cininvid},</if>
            <if test="cinpsnid != null and cinpsnid != ''">cinpsnid = #{cinpsnid},</if>
            <if test="cinspaceid != null and cinspaceid != ''">cinspaceid = #{cinspaceid},</if>
            <if test="cinvbasid != null and cinvbasid != ''">cinvbasid = #{cinvbasid},</if>
            <if test="cinwhid != null and cinwhid != ''">cinwhid = #{cinwhid},</if>
            <if test="coutcbid != null and coutcbid != ''">coutcbid = #{coutcbid},</if>
            <if test="coutcorpid != null and coutcorpid != ''">coutcorpid = #{coutcorpid},</if>
            <if test="coutdeptid != null and coutdeptid != ''">coutdeptid = #{coutdeptid},</if>
            <if test="coutendmakerid != null and coutendmakerid != ''">coutendmakerid = #{coutendmakerid},</if>
            <if test="coutinvid != null and coutinvid != ''">coutinvid = #{coutinvid},</if>
            <if test="coutpsnid != null and coutpsnid != ''">coutpsnid = #{coutpsnid},</if>
            <if test="coutspaceid != null and coutspaceid != ''">coutspaceid = #{coutspaceid},</if>
            <if test="coutwhid != null and coutwhid != ''">coutwhid = #{coutwhid},</if>
            <if test="cprojectid != null and cprojectid != ''">cprojectid = #{cprojectid},</if>
            <if test="cprojectphase != null and cprojectphase != ''">cprojectphase = #{cprojectphase},</if>
            <if test="cquoteunitid != null and cquoteunitid != ''">cquoteunitid = #{cquoteunitid},</if>
            <if test="creceieveid != null and creceieveid != ''">creceieveid = #{creceieveid},</if>
            <if test="creceiverbasid != null and creceiverbasid != ''">creceiverbasid = #{creceiverbasid},</if>
            <if test="crelationBid != null and crelationBid != ''">crelation_bid = #{crelationBid},</if>
            <if test="crelationid != null and crelationid != ''">crelationid = #{crelationid},</if>
            <if test="crowno != null and crowno != ''">crowno = #{crowno},</if>
            <if test="csendendmakerid != null and csendendmakerid != ''">csendendmakerid = #{csendendmakerid},</if>
            <if test="csourcebid != null and csourcebid != ''">csourcebid = #{csourcebid},</if>
            <if test="csourceid != null and csourceid != ''">csourceid = #{csourceid},</if>
            <if test="csourcetypecode != null and csourcetypecode != ''">csourcetypecode = #{csourcetypecode},</if>
            <if test="ctakeoutcbid != null and ctakeoutcbid != ''">ctakeoutcbid = #{ctakeoutcbid},</if>
            <if test="ctakeoutcorpid != null and ctakeoutcorpid != ''">ctakeoutcorpid = #{ctakeoutcorpid},</if>
            <if test="ctakeoutdeptid != null and ctakeoutdeptid != ''">ctakeoutdeptid = #{ctakeoutdeptid},</if>
            <if test="ctakeoutinvid != null and ctakeoutinvid != ''">ctakeoutinvid = #{ctakeoutinvid},</if>
            <if test="ctakeoutpsnid != null and ctakeoutpsnid != ''">ctakeoutpsnid = #{ctakeoutpsnid},</if>
            <if test="ctakeoutspaceid != null and ctakeoutspaceid != ''">ctakeoutspaceid = #{ctakeoutspaceid},</if>
            <if test="ctakeoutwhid != null and ctakeoutwhid != ''">ctakeoutwhid = #{ctakeoutwhid},</if>
            <if test="ctakerelationBid != null and ctakerelationBid != ''">ctakerelation_bid = #{ctakerelationBid},</if>
            <if test="ctakerelationid != null and ctakerelationid != ''">ctakerelationid = #{ctakerelationid},</if>
            <if test="ctypecode != null and ctypecode != ''">ctypecode = #{ctypecode},</if>
            <if test="cvendorbasid != null and cvendorbasid != ''">cvendorbasid = #{cvendorbasid},</if>
            <if test="cvendorid != null and cvendorid != ''">cvendorid = #{cvendorid},</if>
            <if test="cworkcenterid != null and cworkcenterid != ''">cworkcenterid = #{cworkcenterid},</if>
            <if test="dplanarrivedate != null and dplanarrivedate != ''">dplanarrivedate = #{dplanarrivedate},</if>
            <if test="dplanoutdate != null and dplanoutdate != ''">dplanoutdate = #{dplanoutdate},</if>
            <if test="dproducedate != null and dproducedate != ''">dproducedate = #{dproducedate},</if>
            <if test="dr != null">dr = #{dr},</if>
            <if test="drequiredate != null and drequiredate != ''">drequiredate = #{drequiredate},</if>
            <if test="dvalidate != null and dvalidate != ''">dvalidate = #{dvalidate},</if>
            <if test="fallocflag != null">fallocflag = #{fallocflag},</if>
            <if test="flargess != null and flargess != ''">flargess = #{flargess},</if>
            <if test="frowstatuflag != null">frowstatuflag = #{frowstatuflag},</if>
            <if test="ftaxtypeflag != null">ftaxtypeflag = #{ftaxtypeflag},</if>
            <if test="naddpricerate != null">naddpricerate = #{naddpricerate},</if>
            <if test="narrangeassnum != null">narrangeassnum = #{narrangeassnum},</if>
            <if test="narrangemonum != null">narrangemonum = #{narrangemonum},</if>
            <if test="narrangenum != null">narrangenum = #{narrangenum},</if>
            <if test="narrangepoapplynum != null">narrangepoapplynum = #{narrangepoapplynum},</if>
            <if test="narrangepoordernum != null">narrangepoordernum = #{narrangepoordernum},</if>
            <if test="narrangescornum != null">narrangescornum = #{narrangescornum},</if>
            <if test="narrangetoornum != null">narrangetoornum = #{narrangetoornum},</if>
            <if test="nasknotaxprice != null">nasknotaxprice = #{nasknotaxprice},</if>
            <if test="naskprice != null">naskprice = #{naskprice},</if>
            <if test="nassistnum != null">nassistnum = #{nassistnum},</if>
            <if test="nchangerate != null">nchangerate = #{nchangerate},</if>
            <if test="nfeedbacknum != null">nfeedbacknum = #{nfeedbacknum},</if>
            <if test="nmny != null">nmny = #{nmny},</if>
            <if test="nnotaxmny != null">nnotaxmny = #{nnotaxmny},</if>
            <if test="nnotaxprice != null">nnotaxprice = #{nnotaxprice},</if>
            <if test="nnum != null">nnum = #{nnum},</if>
            <if test="norderbackassnum != null">norderbackassnum = #{norderbackassnum},</if>
            <if test="norderbacknum != null">norderbacknum = #{norderbacknum},</if>
            <if test="norderinassnum != null">norderinassnum = #{norderinassnum},</if>
            <if test="norderinnum != null">norderinnum = #{norderinnum},</if>
            <if test="norderinoutmny != null">norderinoutmny = #{norderinoutmny},</if>
            <if test="norderinoutnum != null">norderinoutnum = #{norderinoutnum},</if>
            <if test="norderoutassnum != null">norderoutassnum = #{norderoutassnum},</if>
            <if test="norderoutnum != null">norderoutnum = #{norderoutnum},</if>
            <if test="nordersendassnum != null">nordersendassnum = #{nordersendassnum},</if>
            <if test="nordersendnum != null">nordersendnum = #{nordersendnum},</if>
            <if test="nordershouldinnum != null">nordershouldinnum = #{nordershouldinnum},</if>
            <if test="nordershouldoutnum != null">nordershouldoutnum = #{nordershouldoutnum},</if>
            <if test="nordersignassnum != null">nordersignassnum = #{nordersignassnum},</if>
            <if test="nordersignnum != null">nordersignnum = #{nordersignnum},</if>
            <if test="nordertakemny != null">nordertakemny = #{nordertakemny},</if>
            <if test="nordertakenum != null">nordertakenum = #{nordertakenum},</if>
            <if test="norderwaylossassnum != null">norderwaylossassnum = #{norderwaylossassnum},</if>
            <if test="norderwaylossnum != null">norderwaylossnum = #{norderwaylossnum},</if>
            <if test="norgqtnetprc != null">norgqtnetprc = #{norgqtnetprc},</if>
            <if test="norgqttaxnetprc != null">norgqttaxnetprc = #{norgqttaxnetprc},</if>
            <if test="noutsumnum != null">noutsumnum = #{noutsumnum},</if>
            <if test="nprice != null">nprice = #{nprice},</if>
            <if test="nquoteunitnum != null">nquoteunitnum = #{nquoteunitnum},</if>
            <if test="nquoteunitrate != null">nquoteunitrate = #{nquoteunitrate},</if>
            <if test="nsafetystocknum != null">nsafetystocknum = #{nsafetystocknum},</if>
            <if test="ntaxrate != null">ntaxrate = #{ntaxrate},</if>
            <if test="ntranpoassnum != null">ntranpoassnum = #{ntranpoassnum},</if>
            <if test="ntranponum != null">ntranponum = #{ntranponum},</if>
            <if test="ntranstopraynum != null">ntranstopraynum = #{ntranstopraynum},</if>
            <if test="pkAreacl != null and pkAreacl != ''">pk_areacl = #{pkAreacl},</if>
            <if test="pkArrivearea != null and pkArrivearea != ''">pk_arrivearea = #{pkArrivearea},</if>
            <if test="pkDefdoc1 != null and pkDefdoc1 != ''">pk_defdoc1 = #{pkDefdoc1},</if>
            <if test="pkDefdoc10 != null and pkDefdoc10 != ''">pk_defdoc10 = #{pkDefdoc10},</if>
            <if test="pkDefdoc11 != null and pkDefdoc11 != ''">pk_defdoc11 = #{pkDefdoc11},</if>
            <if test="pkDefdoc12 != null and pkDefdoc12 != ''">pk_defdoc12 = #{pkDefdoc12},</if>
            <if test="pkDefdoc13 != null and pkDefdoc13 != ''">pk_defdoc13 = #{pkDefdoc13},</if>
            <if test="pkDefdoc14 != null and pkDefdoc14 != ''">pk_defdoc14 = #{pkDefdoc14},</if>
            <if test="pkDefdoc15 != null and pkDefdoc15 != ''">pk_defdoc15 = #{pkDefdoc15},</if>
            <if test="pkDefdoc16 != null and pkDefdoc16 != ''">pk_defdoc16 = #{pkDefdoc16},</if>
            <if test="pkDefdoc17 != null and pkDefdoc17 != ''">pk_defdoc17 = #{pkDefdoc17},</if>
            <if test="pkDefdoc18 != null and pkDefdoc18 != ''">pk_defdoc18 = #{pkDefdoc18},</if>
            <if test="pkDefdoc19 != null and pkDefdoc19 != ''">pk_defdoc19 = #{pkDefdoc19},</if>
            <if test="pkDefdoc2 != null and pkDefdoc2 != ''">pk_defdoc2 = #{pkDefdoc2},</if>
            <if test="pkDefdoc20 != null and pkDefdoc20 != ''">pk_defdoc20 = #{pkDefdoc20},</if>
            <if test="pkDefdoc3 != null and pkDefdoc3 != ''">pk_defdoc3 = #{pkDefdoc3},</if>
            <if test="pkDefdoc4 != null and pkDefdoc4 != ''">pk_defdoc4 = #{pkDefdoc4},</if>
            <if test="pkDefdoc5 != null and pkDefdoc5 != ''">pk_defdoc5 = #{pkDefdoc5},</if>
            <if test="pkDefdoc6 != null and pkDefdoc6 != ''">pk_defdoc6 = #{pkDefdoc6},</if>
            <if test="pkDefdoc7 != null and pkDefdoc7 != ''">pk_defdoc7 = #{pkDefdoc7},</if>
            <if test="pkDefdoc8 != null and pkDefdoc8 != ''">pk_defdoc8 = #{pkDefdoc8},</if>
            <if test="pkDefdoc9 != null and pkDefdoc9 != ''">pk_defdoc9 = #{pkDefdoc9},</if>
            <if test="pkRtBid != null and pkRtBid != ''">pk_rt_bid = #{pkRtBid},</if>
            <if test="pkSendtype != null and pkSendtype != ''">pk_sendtype = #{pkSendtype},</if>
            <if test="pkTldid != null and pkTldid != ''">pk_tldid = #{pkTldid},</if>
            <if test="tlastarrangetime != null and tlastarrangetime != ''">tlastarrangetime = #{tlastarrangetime},</if>
            <if test="tplanarrivetime != null and tplanarrivetime != ''">tplanarrivetime = #{tplanarrivetime},</if>
            <if test="tplanouttime != null and tplanouttime != ''">tplanouttime = #{tplanouttime},</if>
            <if test="trequiretime != null and trequiretime != ''">trequiretime = #{trequiretime},</if>
            <if test="ts != null and ts != ''">ts = #{ts},</if>
            <if test="tsclose != null and tsclose != ''">tsclose = #{tsclose},</if>
            <if test="tsdelete != null and tsdelete != ''">tsdelete = #{tsdelete},</if>
            <if test="tsoutend != null and tsoutend != ''">tsoutend = #{tsoutend},</if>
            <if test="tssendend != null and tssendend != ''">tssendend = #{tssendend},</if>
            <if test="vbatch != null and vbatch != ''">vbatch = #{vbatch},</if>
            <if test="vbdef1 != null and vbdef1 != ''">vbdef1 = #{vbdef1},</if>
            <if test="vbdef10 != null and vbdef10 != ''">vbdef10 = #{vbdef10},</if>
            <if test="vbdef11 != null and vbdef11 != ''">vbdef11 = #{vbdef11},</if>
            <if test="vbdef12 != null and vbdef12 != ''">vbdef12 = #{vbdef12},</if>
            <if test="vbdef13 != null and vbdef13 != ''">vbdef13 = #{vbdef13},</if>
            <if test="vbdef14 != null and vbdef14 != ''">vbdef14 = #{vbdef14},</if>
            <if test="vbdef15 != null and vbdef15 != ''">vbdef15 = #{vbdef15},</if>
            <if test="vbdef16 != null and vbdef16 != ''">vbdef16 = #{vbdef16},</if>
            <if test="vbdef17 != null and vbdef17 != ''">vbdef17 = #{vbdef17},</if>
            <if test="vbdef18 != null and vbdef18 != ''">vbdef18 = #{vbdef18},</if>
            <if test="vbdef19 != null and vbdef19 != ''">vbdef19 = #{vbdef19},</if>
            <if test="vbdef2 != null and vbdef2 != ''">vbdef2 = #{vbdef2},</if>
            <if test="vbdef20 != null and vbdef20 != ''">vbdef20 = #{vbdef20},</if>
            <if test="vbdef3 != null and vbdef3 != ''">vbdef3 = #{vbdef3},</if>
            <if test="vbdef4 != null and vbdef4 != ''">vbdef4 = #{vbdef4},</if>
            <if test="vbdef5 != null and vbdef5 != ''">vbdef5 = #{vbdef5},</if>
            <if test="vbdef6 != null and vbdef6 != ''">vbdef6 = #{vbdef6},</if>
            <if test="vbdef7 != null and vbdef7 != ''">vbdef7 = #{vbdef7},</if>
            <if test="vbdef8 != null and vbdef8 != ''">vbdef8 = #{vbdef8},</if>
            <if test="vbdef9 != null and vbdef9 != ''">vbdef9 = #{vbdef9},</if>
            <if test="vbomcode != null and vbomcode != ''">vbomcode = #{vbomcode},</if>
            <if test="vbrevisereason != null and vbrevisereason != ''">vbrevisereason = #{vbrevisereason},</if>
            <if test="vcode != null and vcode != ''">vcode = #{vcode},</if>
            <if test="vfirstcode != null and vfirstcode != ''">vfirstcode = #{vfirstcode},</if>
            <if test="vfirstrowno != null and vfirstrowno != ''">vfirstrowno = #{vfirstrowno},</if>
            <if test="vfree1 != null and vfree1 != ''">vfree1 = #{vfree1},</if>
            <if test="vfree2 != null and vfree2 != ''">vfree2 = #{vfree2},</if>
            <if test="vfree3 != null and vfree3 != ''">vfree3 = #{vfree3},</if>
            <if test="vfree4 != null and vfree4 != ''">vfree4 = #{vfree4},</if>
            <if test="vfree5 != null and vfree5 != ''">vfree5 = #{vfree5},</if>
            <if test="vnote != null and vnote != ''">vnote = #{vnote},</if>
            <if test="vproducebatch != null and vproducebatch != ''">vproducebatch = #{vproducebatch},</if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''">vreceiveaddress = #{vreceiveaddress},</if>
            <if test="vsourcecode != null and vsourcecode != ''">vsourcecode = #{vsourcecode},</if>
            <if test="vsourcerowno != null and vsourcerowno != ''">vsourcerowno = #{vsourcerowno},</if>
        </trim>
        where cbill_bid = #{cbillBid}
    </update>
    <!-- 逻辑删除 -->
    <update id="entity_logicDelete" parameterType="com.hzya.frame.plugin.lets.entity.ToBillBEntity">
        update to_bill_b
        set sts= 'N',
            modify_time = #{modify_time},
            modify_user_id = #{modify_user_id}
        where cbill_bid = #{cbillBid}
    </update>
    <!-- 多条件逻辑删除 -->
    <update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.plugin.lets.entity.ToBillBEntity">
        update to_bill_b set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
        <trim prefix="where" prefixOverrides="and">
            <if test="barrangedflag != null and barrangedflag != ''">and barrangedflag = #{barrangedflag}</if>
            <if test="boutendflag != null and boutendflag != ''">and boutendflag = #{boutendflag}</if>
            <if test="bretractflag != null and bretractflag != ''">and bretractflag = #{bretractflag}</if>
            <if test="bsendendflag != null and bsendendflag != ''">and bsendendflag = #{bsendendflag}</if>
            <if test="bsettleendflag != null and bsettleendflag != ''">and bsettleendflag = #{bsettleendflag}</if>
            <if test="btakesettleendflag != null and btakesettleendflag != ''">and btakesettleendflag =
                #{btakesettleendflag}
            </if>
            <if test="carrangepersonid != null and carrangepersonid != ''">and carrangepersonid = #{carrangepersonid}
            </if>
            <if test="castunitid != null and castunitid != ''">and castunitid = #{castunitid}</if>
            <if test="cbillBid != null and cbillBid != ''">and cbill_bid = #{cbillBid}</if>
            <if test="cbillid != null and cbillid != ''">and cbillid = #{cbillid}</if>
            <if test="cbilltype != null and cbilltype != ''">and cbilltype = #{cbilltype}</if>
            <if test="cbiztypeid != null and cbiztypeid != ''">and cbiztypeid = #{cbiztypeid}</if>
            <if test="cclosemakerid != null and cclosemakerid != ''">and cclosemakerid = #{cclosemakerid}</if>
            <if test="ccorrectbillBid != null and ccorrectbillBid != ''">and ccorrectbill_bid = #{ccorrectbillBid}</if>
            <if test="cdeletemakerid != null and cdeletemakerid != ''">and cdeletemakerid = #{cdeletemakerid}</if>
            <if test="cfirstbid != null and cfirstbid != ''">and cfirstbid = #{cfirstbid}</if>
            <if test="cfirstid != null and cfirstid != ''">and cfirstid = #{cfirstid}</if>
            <if test="cfirsttypecode != null and cfirsttypecode != ''">and cfirsttypecode = #{cfirsttypecode}</if>
            <if test="cincbid != null and cincbid != ''">and cincbid = #{cincbid}</if>
            <if test="cincorpid != null and cincorpid != ''">and cincorpid = #{cincorpid}</if>
            <if test="cindeptid != null and cindeptid != ''">and cindeptid = #{cindeptid}</if>
            <if test="cininvid != null and cininvid != ''">and cininvid = #{cininvid}</if>
            <if test="cinpsnid != null and cinpsnid != ''">and cinpsnid = #{cinpsnid}</if>
            <if test="cinspaceid != null and cinspaceid != ''">and cinspaceid = #{cinspaceid}</if>
            <if test="cinvbasid != null and cinvbasid != ''">and cinvbasid = #{cinvbasid}</if>
            <if test="cinwhid != null and cinwhid != ''">and cinwhid = #{cinwhid}</if>
            <if test="coutcbid != null and coutcbid != ''">and coutcbid = #{coutcbid}</if>
            <if test="coutcorpid != null and coutcorpid != ''">and coutcorpid = #{coutcorpid}</if>
            <if test="coutdeptid != null and coutdeptid != ''">and coutdeptid = #{coutdeptid}</if>
            <if test="coutendmakerid != null and coutendmakerid != ''">and coutendmakerid = #{coutendmakerid}</if>
            <if test="coutinvid != null and coutinvid != ''">and coutinvid = #{coutinvid}</if>
            <if test="coutpsnid != null and coutpsnid != ''">and coutpsnid = #{coutpsnid}</if>
            <if test="coutspaceid != null and coutspaceid != ''">and coutspaceid = #{coutspaceid}</if>
            <if test="coutwhid != null and coutwhid != ''">and coutwhid = #{coutwhid}</if>
            <if test="cprojectid != null and cprojectid != ''">and cprojectid = #{cprojectid}</if>
            <if test="cprojectphase != null and cprojectphase != ''">and cprojectphase = #{cprojectphase}</if>
            <if test="cquoteunitid != null and cquoteunitid != ''">and cquoteunitid = #{cquoteunitid}</if>
            <if test="creceieveid != null and creceieveid != ''">and creceieveid = #{creceieveid}</if>
            <if test="creceiverbasid != null and creceiverbasid != ''">and creceiverbasid = #{creceiverbasid}</if>
            <if test="crelationBid != null and crelationBid != ''">and crelation_bid = #{crelationBid}</if>
            <if test="crelationid != null and crelationid != ''">and crelationid = #{crelationid}</if>
            <if test="crowno != null and crowno != ''">and crowno = #{crowno}</if>
            <if test="csendendmakerid != null and csendendmakerid != ''">and csendendmakerid = #{csendendmakerid}</if>
            <if test="csourcebid != null and csourcebid != ''">and csourcebid = #{csourcebid}</if>
            <if test="csourceid != null and csourceid != ''">and csourceid = #{csourceid}</if>
            <if test="csourcetypecode != null and csourcetypecode != ''">and csourcetypecode = #{csourcetypecode}</if>
            <if test="ctakeoutcbid != null and ctakeoutcbid != ''">and ctakeoutcbid = #{ctakeoutcbid}</if>
            <if test="ctakeoutcorpid != null and ctakeoutcorpid != ''">and ctakeoutcorpid = #{ctakeoutcorpid}</if>
            <if test="ctakeoutdeptid != null and ctakeoutdeptid != ''">and ctakeoutdeptid = #{ctakeoutdeptid}</if>
            <if test="ctakeoutinvid != null and ctakeoutinvid != ''">and ctakeoutinvid = #{ctakeoutinvid}</if>
            <if test="ctakeoutpsnid != null and ctakeoutpsnid != ''">and ctakeoutpsnid = #{ctakeoutpsnid}</if>
            <if test="ctakeoutspaceid != null and ctakeoutspaceid != ''">and ctakeoutspaceid = #{ctakeoutspaceid}</if>
            <if test="ctakeoutwhid != null and ctakeoutwhid != ''">and ctakeoutwhid = #{ctakeoutwhid}</if>
            <if test="ctakerelationBid != null and ctakerelationBid != ''">and ctakerelation_bid = #{ctakerelationBid}
            </if>
            <if test="ctakerelationid != null and ctakerelationid != ''">and ctakerelationid = #{ctakerelationid}</if>
            <if test="ctypecode != null and ctypecode != ''">and ctypecode = #{ctypecode}</if>
            <if test="cvendorbasid != null and cvendorbasid != ''">and cvendorbasid = #{cvendorbasid}</if>
            <if test="cvendorid != null and cvendorid != ''">and cvendorid = #{cvendorid}</if>
            <if test="cworkcenterid != null and cworkcenterid != ''">and cworkcenterid = #{cworkcenterid}</if>
            <if test="dplanarrivedate != null and dplanarrivedate != ''">and dplanarrivedate = #{dplanarrivedate}</if>
            <if test="dplanoutdate != null and dplanoutdate != ''">and dplanoutdate = #{dplanoutdate}</if>
            <if test="dproducedate != null and dproducedate != ''">and dproducedate = #{dproducedate}</if>
            <if test="dr != null">and dr = #{dr}</if>
            <if test="drequiredate != null and drequiredate != ''">and drequiredate = #{drequiredate}</if>
            <if test="dvalidate != null and dvalidate != ''">and dvalidate = #{dvalidate}</if>
            <if test="fallocflag != null">and fallocflag = #{fallocflag}</if>
            <if test="flargess != null and flargess != ''">and flargess = #{flargess}</if>
            <if test="frowstatuflag != null">and frowstatuflag = #{frowstatuflag}</if>
            <if test="ftaxtypeflag != null">and ftaxtypeflag = #{ftaxtypeflag}</if>
            <if test="naddpricerate != null">and naddpricerate = #{naddpricerate}</if>
            <if test="narrangeassnum != null">and narrangeassnum = #{narrangeassnum}</if>
            <if test="narrangemonum != null">and narrangemonum = #{narrangemonum}</if>
            <if test="narrangenum != null">and narrangenum = #{narrangenum}</if>
            <if test="narrangepoapplynum != null">and narrangepoapplynum = #{narrangepoapplynum}</if>
            <if test="narrangepoordernum != null">and narrangepoordernum = #{narrangepoordernum}</if>
            <if test="narrangescornum != null">and narrangescornum = #{narrangescornum}</if>
            <if test="narrangetoornum != null">and narrangetoornum = #{narrangetoornum}</if>
            <if test="nasknotaxprice != null">and nasknotaxprice = #{nasknotaxprice}</if>
            <if test="naskprice != null">and naskprice = #{naskprice}</if>
            <if test="nassistnum != null">and nassistnum = #{nassistnum}</if>
            <if test="nchangerate != null">and nchangerate = #{nchangerate}</if>
            <if test="nfeedbacknum != null">and nfeedbacknum = #{nfeedbacknum}</if>
            <if test="nmny != null">and nmny = #{nmny}</if>
            <if test="nnotaxmny != null">and nnotaxmny = #{nnotaxmny}</if>
            <if test="nnotaxprice != null">and nnotaxprice = #{nnotaxprice}</if>
            <if test="nnum != null">and nnum = #{nnum}</if>
            <if test="norderbackassnum != null">and norderbackassnum = #{norderbackassnum}</if>
            <if test="norderbacknum != null">and norderbacknum = #{norderbacknum}</if>
            <if test="norderinassnum != null">and norderinassnum = #{norderinassnum}</if>
            <if test="norderinnum != null">and norderinnum = #{norderinnum}</if>
            <if test="norderinoutmny != null">and norderinoutmny = #{norderinoutmny}</if>
            <if test="norderinoutnum != null">and norderinoutnum = #{norderinoutnum}</if>
            <if test="norderoutassnum != null">and norderoutassnum = #{norderoutassnum}</if>
            <if test="norderoutnum != null">and norderoutnum = #{norderoutnum}</if>
            <if test="nordersendassnum != null">and nordersendassnum = #{nordersendassnum}</if>
            <if test="nordersendnum != null">and nordersendnum = #{nordersendnum}</if>
            <if test="nordershouldinnum != null">and nordershouldinnum = #{nordershouldinnum}</if>
            <if test="nordershouldoutnum != null">and nordershouldoutnum = #{nordershouldoutnum}</if>
            <if test="nordersignassnum != null">and nordersignassnum = #{nordersignassnum}</if>
            <if test="nordersignnum != null">and nordersignnum = #{nordersignnum}</if>
            <if test="nordertakemny != null">and nordertakemny = #{nordertakemny}</if>
            <if test="nordertakenum != null">and nordertakenum = #{nordertakenum}</if>
            <if test="norderwaylossassnum != null">and norderwaylossassnum = #{norderwaylossassnum}</if>
            <if test="norderwaylossnum != null">and norderwaylossnum = #{norderwaylossnum}</if>
            <if test="norgqtnetprc != null">and norgqtnetprc = #{norgqtnetprc}</if>
            <if test="norgqttaxnetprc != null">and norgqttaxnetprc = #{norgqttaxnetprc}</if>
            <if test="noutsumnum != null">and noutsumnum = #{noutsumnum}</if>
            <if test="nprice != null">and nprice = #{nprice}</if>
            <if test="nquoteunitnum != null">and nquoteunitnum = #{nquoteunitnum}</if>
            <if test="nquoteunitrate != null">and nquoteunitrate = #{nquoteunitrate}</if>
            <if test="nsafetystocknum != null">and nsafetystocknum = #{nsafetystocknum}</if>
            <if test="ntaxrate != null">and ntaxrate = #{ntaxrate}</if>
            <if test="ntranpoassnum != null">and ntranpoassnum = #{ntranpoassnum}</if>
            <if test="ntranponum != null">and ntranponum = #{ntranponum}</if>
            <if test="ntranstopraynum != null">and ntranstopraynum = #{ntranstopraynum}</if>
            <if test="pkAreacl != null and pkAreacl != ''">and pk_areacl = #{pkAreacl}</if>
            <if test="pkArrivearea != null and pkArrivearea != ''">and pk_arrivearea = #{pkArrivearea}</if>
            <if test="pkDefdoc1 != null and pkDefdoc1 != ''">and pk_defdoc1 = #{pkDefdoc1}</if>
            <if test="pkDefdoc10 != null and pkDefdoc10 != ''">and pk_defdoc10 = #{pkDefdoc10}</if>
            <if test="pkDefdoc11 != null and pkDefdoc11 != ''">and pk_defdoc11 = #{pkDefdoc11}</if>
            <if test="pkDefdoc12 != null and pkDefdoc12 != ''">and pk_defdoc12 = #{pkDefdoc12}</if>
            <if test="pkDefdoc13 != null and pkDefdoc13 != ''">and pk_defdoc13 = #{pkDefdoc13}</if>
            <if test="pkDefdoc14 != null and pkDefdoc14 != ''">and pk_defdoc14 = #{pkDefdoc14}</if>
            <if test="pkDefdoc15 != null and pkDefdoc15 != ''">and pk_defdoc15 = #{pkDefdoc15}</if>
            <if test="pkDefdoc16 != null and pkDefdoc16 != ''">and pk_defdoc16 = #{pkDefdoc16}</if>
            <if test="pkDefdoc17 != null and pkDefdoc17 != ''">and pk_defdoc17 = #{pkDefdoc17}</if>
            <if test="pkDefdoc18 != null and pkDefdoc18 != ''">and pk_defdoc18 = #{pkDefdoc18}</if>
            <if test="pkDefdoc19 != null and pkDefdoc19 != ''">and pk_defdoc19 = #{pkDefdoc19}</if>
            <if test="pkDefdoc2 != null and pkDefdoc2 != ''">and pk_defdoc2 = #{pkDefdoc2}</if>
            <if test="pkDefdoc20 != null and pkDefdoc20 != ''">and pk_defdoc20 = #{pkDefdoc20}</if>
            <if test="pkDefdoc3 != null and pkDefdoc3 != ''">and pk_defdoc3 = #{pkDefdoc3}</if>
            <if test="pkDefdoc4 != null and pkDefdoc4 != ''">and pk_defdoc4 = #{pkDefdoc4}</if>
            <if test="pkDefdoc5 != null and pkDefdoc5 != ''">and pk_defdoc5 = #{pkDefdoc5}</if>
            <if test="pkDefdoc6 != null and pkDefdoc6 != ''">and pk_defdoc6 = #{pkDefdoc6}</if>
            <if test="pkDefdoc7 != null and pkDefdoc7 != ''">and pk_defdoc7 = #{pkDefdoc7}</if>
            <if test="pkDefdoc8 != null and pkDefdoc8 != ''">and pk_defdoc8 = #{pkDefdoc8}</if>
            <if test="pkDefdoc9 != null and pkDefdoc9 != ''">and pk_defdoc9 = #{pkDefdoc9}</if>
            <if test="pkRtBid != null and pkRtBid != ''">and pk_rt_bid = #{pkRtBid}</if>
            <if test="pkSendtype != null and pkSendtype != ''">and pk_sendtype = #{pkSendtype}</if>
            <if test="pkTldid != null and pkTldid != ''">and pk_tldid = #{pkTldid}</if>
            <if test="tlastarrangetime != null and tlastarrangetime != ''">and tlastarrangetime = #{tlastarrangetime}
            </if>
            <if test="tplanarrivetime != null and tplanarrivetime != ''">and tplanarrivetime = #{tplanarrivetime}</if>
            <if test="tplanouttime != null and tplanouttime != ''">and tplanouttime = #{tplanouttime}</if>
            <if test="trequiretime != null and trequiretime != ''">and trequiretime = #{trequiretime}</if>
            <if test="ts != null and ts != ''">and ts = #{ts}</if>
            <if test="tsclose != null and tsclose != ''">and tsclose = #{tsclose}</if>
            <if test="tsdelete != null and tsdelete != ''">and tsdelete = #{tsdelete}</if>
            <if test="tsoutend != null and tsoutend != ''">and tsoutend = #{tsoutend}</if>
            <if test="tssendend != null and tssendend != ''">and tssendend = #{tssendend}</if>
            <if test="vbatch != null and vbatch != ''">and vbatch = #{vbatch}</if>
            <if test="vbdef1 != null and vbdef1 != ''">and vbdef1 = #{vbdef1}</if>
            <if test="vbdef10 != null and vbdef10 != ''">and vbdef10 = #{vbdef10}</if>
            <if test="vbdef11 != null and vbdef11 != ''">and vbdef11 = #{vbdef11}</if>
            <if test="vbdef12 != null and vbdef12 != ''">and vbdef12 = #{vbdef12}</if>
            <if test="vbdef13 != null and vbdef13 != ''">and vbdef13 = #{vbdef13}</if>
            <if test="vbdef14 != null and vbdef14 != ''">and vbdef14 = #{vbdef14}</if>
            <if test="vbdef15 != null and vbdef15 != ''">and vbdef15 = #{vbdef15}</if>
            <if test="vbdef16 != null and vbdef16 != ''">and vbdef16 = #{vbdef16}</if>
            <if test="vbdef17 != null and vbdef17 != ''">and vbdef17 = #{vbdef17}</if>
            <if test="vbdef18 != null and vbdef18 != ''">and vbdef18 = #{vbdef18}</if>
            <if test="vbdef19 != null and vbdef19 != ''">and vbdef19 = #{vbdef19}</if>
            <if test="vbdef2 != null and vbdef2 != ''">and vbdef2 = #{vbdef2}</if>
            <if test="vbdef20 != null and vbdef20 != ''">and vbdef20 = #{vbdef20}</if>
            <if test="vbdef3 != null and vbdef3 != ''">and vbdef3 = #{vbdef3}</if>
            <if test="vbdef4 != null and vbdef4 != ''">and vbdef4 = #{vbdef4}</if>
            <if test="vbdef5 != null and vbdef5 != ''">and vbdef5 = #{vbdef5}</if>
            <if test="vbdef6 != null and vbdef6 != ''">and vbdef6 = #{vbdef6}</if>
            <if test="vbdef7 != null and vbdef7 != ''">and vbdef7 = #{vbdef7}</if>
            <if test="vbdef8 != null and vbdef8 != ''">and vbdef8 = #{vbdef8}</if>
            <if test="vbdef9 != null and vbdef9 != ''">and vbdef9 = #{vbdef9}</if>
            <if test="vbomcode != null and vbomcode != ''">and vbomcode = #{vbomcode}</if>
            <if test="vbrevisereason != null and vbrevisereason != ''">and vbrevisereason = #{vbrevisereason}</if>
            <if test="vcode != null and vcode != ''">and vcode = #{vcode}</if>
            <if test="vfirstcode != null and vfirstcode != ''">and vfirstcode = #{vfirstcode}</if>
            <if test="vfirstrowno != null and vfirstrowno != ''">and vfirstrowno = #{vfirstrowno}</if>
            <if test="vfree1 != null and vfree1 != ''">and vfree1 = #{vfree1}</if>
            <if test="vfree2 != null and vfree2 != ''">and vfree2 = #{vfree2}</if>
            <if test="vfree3 != null and vfree3 != ''">and vfree3 = #{vfree3}</if>
            <if test="vfree4 != null and vfree4 != ''">and vfree4 = #{vfree4}</if>
            <if test="vfree5 != null and vfree5 != ''">and vfree5 = #{vfree5}</if>
            <if test="vnote != null and vnote != ''">and vnote = #{vnote}</if>
            <if test="vproducebatch != null and vproducebatch != ''">and vproducebatch = #{vproducebatch}</if>
            <if test="vreceiveaddress != null and vreceiveaddress != ''">and vreceiveaddress = #{vreceiveaddress}</if>
            <if test="vsourcecode != null and vsourcecode != ''">and vsourcecode = #{vsourcecode}</if>
            <if test="vsourcerowno != null and vsourcerowno != ''">and vsourcerowno = #{vsourcerowno}</if>
            and sts='Y'
        </trim>
    </update>
    <!--通过主键删除-->
    <delete id="entity_delete">
        delete
        from to_bill_b
        where cbill_bid = #{cbillBid}
    </delete>

</mapper>

