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

    <resultMap id="get-ScOrderBEntity-result" type="com.hzya.frame.plugin.lets.entity.ScOrderBEntity" >
       <result property="accinstoreassistnum" column="ACCINSTOREASSISTNUM" jdbcType="VARCHAR"/>
           <result property="bisactive" column="BISACTIVE" jdbcType="VARCHAR"/>
           <result property="bomversion" column="BOMVERSION" jdbcType="VARCHAR"/>
           <result property="cassistunit" column="CASSISTUNIT" jdbcType="VARCHAR"/>
           <result property="cbaseid" column="CBASEID" jdbcType="VARCHAR"/>
           <result property="ccontractid" column="CCONTRACTID" jdbcType="VARCHAR"/>
           <result property="ccontractrcode" column="CCONTRACTRCODE" jdbcType="VARCHAR"/>
           <result property="ccontractrowid" column="CCONTRACTROWID" jdbcType="VARCHAR"/>
           <result property="ccurrencytypeid" column="CCURRENCYTYPEID" jdbcType="VARCHAR"/>
           <result property="cmangid" column="CMANGID" jdbcType="VARCHAR"/>
           <result property="coperator" column="COPERATOR" jdbcType="VARCHAR"/>
           <result property="corderBid" column="CORDER_BID" jdbcType="VARCHAR"/>
           <result property="corderid" column="CORDERID" jdbcType="VARCHAR"/>
           <result property="cordersource" column="CORDERSOURCE" jdbcType="VARCHAR"/>
           <result property="cpriceauditBb1id" column="CPRICEAUDIT_BB1ID" jdbcType="VARCHAR"/>
           <result property="cpriceauditBid" column="CPRICEAUDIT_BID" jdbcType="VARCHAR"/>
           <result property="cpriceauditid" column="CPRICEAUDITID" jdbcType="VARCHAR"/>
           <result property="cprojectid" column="CPROJECTID" jdbcType="VARCHAR"/>
           <result property="cprojectphaseid" column="CPROJECTPHASEID" jdbcType="VARCHAR"/>
           <result property="creceiveaddress" column="CRECEIVEADDRESS" jdbcType="VARCHAR"/>
           <result property="crowno" column="CROWNO" jdbcType="VARCHAR"/>
           <result property="csourcebillcode" column="CSOURCEBILLCODE" jdbcType="VARCHAR"/>
           <result property="csourcebillid" column="CSOURCEBILLID" jdbcType="VARCHAR"/>
           <result property="csourcebillrow" column="CSOURCEBILLROW" jdbcType="VARCHAR"/>
           <result property="csourcebillrowno" column="CSOURCEBILLROWNO" jdbcType="VARCHAR"/>
           <result property="cupsourcebillid" column="CUPSOURCEBILLID" jdbcType="VARCHAR"/>
           <result property="cupsourcebillrowid" column="CUPSOURCEBILLROWID" jdbcType="VARCHAR"/>
           <result property="cupsourcebilltype" column="CUPSOURCEBILLTYPE" jdbcType="VARCHAR"/>
           <result property="cwarehouseid" column="CWAREHOUSEID" jdbcType="VARCHAR"/>
           <result property="dplanarrvdate" column="DPLANARRVDATE" jdbcType="VARCHAR"/>
           <result property="dr" column="DR" jdbcType="VARCHAR"/>
           <result property="forderrowstatus" column="FORDERROWSTATUS" jdbcType="VARCHAR"/>
           <result property="idiscounttaxtype" column="IDISCOUNTTAXTYPE" jdbcType="VARCHAR"/>
           <result property="naccumarrvnum" column="NACCUMARRVNUM" jdbcType="VARCHAR"/>
           <result property="naccuminvoicenum" column="NACCUMINVOICENUM" jdbcType="VARCHAR"/>
           <result property="naccumstorenum" column="NACCUMSTORENUM" jdbcType="VARCHAR"/>
           <result property="naccumwastnum" column="NACCUMWASTNUM" jdbcType="VARCHAR"/>
           <result property="nassistnum" column="NASSISTNUM" jdbcType="VARCHAR"/>
           <result property="nbackarrvnum" column="NBACKARRVNUM" jdbcType="VARCHAR"/>
           <result property="nbackstorenum" column="NBACKSTORENUM" jdbcType="VARCHAR"/>
           <result property="ndiscountrate" column="NDISCOUNTRATE" jdbcType="VARCHAR"/>
           <result property="newver" column="NEWVER" jdbcType="VARCHAR"/>
           <result property="nexchangeotobrate" column="NEXCHANGEOTOBRATE" jdbcType="VARCHAR"/>
           <result property="nmoney" column="NMONEY" jdbcType="VARCHAR"/>
           <result property="nordernum" column="NORDERNUM" jdbcType="VARCHAR"/>
           <result property="norgnettaxprice" column="NORGNETTAXPRICE" jdbcType="VARCHAR"/>
           <result property="norgtaxprice" column="NORGTAXPRICE" jdbcType="VARCHAR"/>
           <result property="noriginalcurmny" column="NORIGINALCURMNY" jdbcType="VARCHAR"/>
           <result property="noriginalcurprice" column="NORIGINALCURPRICE" jdbcType="VARCHAR"/>
           <result property="noriginalnetprice" column="NORIGINALNETPRICE" jdbcType="VARCHAR"/>
           <result property="noriginalsummny" column="NORIGINALSUMMNY" jdbcType="VARCHAR"/>
           <result property="noriginaltaxmny" column="NORIGINALTAXMNY" jdbcType="VARCHAR"/>
           <result property="nsummny" column="NSUMMNY" jdbcType="VARCHAR"/>
           <result property="ntaxmny" column="NTAXMNY" jdbcType="VARCHAR"/>
           <result property="ntaxrate" column="NTAXRATE" jdbcType="VARCHAR"/>
           <result property="pkCorp" column="PK_CORP" 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="ts" column="TS" jdbcType="VARCHAR"/>
           <result property="vdef1" column="VDEF1" jdbcType="VARCHAR"/>
           <result property="vdef10" column="VDEF10" jdbcType="VARCHAR"/>
           <result property="vdef11" column="VDEF11" jdbcType="VARCHAR"/>
           <result property="vdef12" column="VDEF12" jdbcType="VARCHAR"/>
           <result property="vdef13" column="VDEF13" jdbcType="VARCHAR"/>
           <result property="vdef14" column="VDEF14" jdbcType="VARCHAR"/>
           <result property="vdef15" column="VDEF15" jdbcType="VARCHAR"/>
           <result property="vdef16" column="VDEF16" jdbcType="VARCHAR"/>
           <result property="vdef17" column="VDEF17" jdbcType="VARCHAR"/>
           <result property="vdef18" column="VDEF18" jdbcType="VARCHAR"/>
           <result property="vdef19" column="VDEF19" jdbcType="VARCHAR"/>
           <result property="vdef2" column="VDEF2" jdbcType="VARCHAR"/>
           <result property="vdef20" column="VDEF20" jdbcType="VARCHAR"/>
           <result property="vdef3" column="VDEF3" jdbcType="VARCHAR"/>
           <result property="vdef4" column="VDEF4" jdbcType="VARCHAR"/>
           <result property="vdef5" column="VDEF5" jdbcType="VARCHAR"/>
           <result property="vdef6" column="VDEF6" jdbcType="VARCHAR"/>
           <result property="vdef7" column="VDEF7" jdbcType="VARCHAR"/>
           <result property="vdef8" column="VDEF8" jdbcType="VARCHAR"/>
           <result property="vdef9" column="VDEF9" 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="vmemo" column="VMEMO" jdbcType="VARCHAR"/>
           <result property="vpriceauditcode" column="VPRICEAUDITCODE" jdbcType="VARCHAR"/>
           <result property="vproducenum" column="VPRODUCENUM" jdbcType="VARCHAR"/>
           <result property="writeoffassistnum" column="WRITEOFFASSISTNUM" jdbcType="VARCHAR"/>
           <result property="writeoffnum" column="WRITEOFFNUM" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "ScOrderBEntity_Base_Column_List">
        ACCINSTOREASSISTNUM
       ,BISACTIVE 
        ,BOMVERSION 
        ,CASSISTUNIT 
        ,CBASEID 
        ,CCONTRACTID 
        ,CCONTRACTRCODE 
        ,CCONTRACTROWID 
        ,CCURRENCYTYPEID 
        ,CMANGID 
        ,COPERATOR 
        ,CORDER_BID 
        ,CORDERID 
        ,CORDERSOURCE 
        ,CPRICEAUDIT_BB1ID 
        ,CPRICEAUDIT_BID 
        ,CPRICEAUDITID 
        ,CPROJECTID 
        ,CPROJECTPHASEID 
        ,CRECEIVEADDRESS 
        ,CROWNO 
        ,CSOURCEBILLCODE 
        ,CSOURCEBILLID 
        ,CSOURCEBILLROW 
        ,CSOURCEBILLROWNO 
        ,CUPSOURCEBILLID 
        ,CUPSOURCEBILLROWID 
        ,CUPSOURCEBILLTYPE 
        ,CWAREHOUSEID 
        ,DPLANARRVDATE 
        ,DR 
        ,FORDERROWSTATUS 
        ,IDISCOUNTTAXTYPE 
        ,NACCUMARRVNUM 
        ,NACCUMINVOICENUM 
        ,NACCUMSTORENUM 
        ,NACCUMWASTNUM 
        ,NASSISTNUM 
        ,NBACKARRVNUM 
        ,NBACKSTORENUM 
        ,NDISCOUNTRATE 
        ,NEWVER 
        ,NEXCHANGEOTOBRATE 
        ,NMONEY 
        ,NORDERNUM 
        ,NORGNETTAXPRICE 
        ,NORGTAXPRICE 
        ,NORIGINALCURMNY 
        ,NORIGINALCURPRICE 
        ,NORIGINALNETPRICE 
        ,NORIGINALSUMMNY 
        ,NORIGINALTAXMNY 
        ,NSUMMNY 
        ,NTAXMNY 
        ,NTAXRATE 
        ,PK_CORP 
        ,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 
        ,TS 
        ,VDEF1 
        ,VDEF10 
        ,VDEF11 
        ,VDEF12 
        ,VDEF13 
        ,VDEF14 
        ,VDEF15 
        ,VDEF16 
        ,VDEF17 
        ,VDEF18 
        ,VDEF19 
        ,VDEF2 
        ,VDEF20 
        ,VDEF3 
        ,VDEF4 
        ,VDEF5 
        ,VDEF6 
        ,VDEF7 
        ,VDEF8 
        ,VDEF9 
        ,VFREE1 
        ,VFREE2 
        ,VFREE3 
        ,VFREE4 
        ,VFREE5 
        ,VMEMO 
        ,VPRICEAUDITCODE 
        ,VPRODUCENUM 
        ,WRITEOFFASSISTNUM 
        ,WRITEOFFNUM 
     </sql>

 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-ScOrderBEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderBEntity">
    select
    <include refid="ScOrderBEntity_Base_Column_List" />
    from SC_ORDER_B
    <trim prefix="where" prefixOverrides="and"> 
        <if test="accinstoreassistnum != null and accinstoreassistnum != ''"> and ACCINSTOREASSISTNUM = #{accinstoreassistnum} </if>
            <if test="bisactive != null and bisactive != ''"> and BISACTIVE = #{bisactive} </if>
            <if test="bomversion != null and bomversion != ''"> and BOMVERSION = #{bomversion} </if>
            <if test="cassistunit != null and cassistunit != ''"> and CASSISTUNIT = #{cassistunit} </if>
            <if test="cbaseid != null and cbaseid != ''"> and CBASEID = #{cbaseid} </if>
            <if test="ccontractid != null and ccontractid != ''"> and CCONTRACTID = #{ccontractid} </if>
            <if test="ccontractrcode != null and ccontractrcode != ''"> and CCONTRACTRCODE = #{ccontractrcode} </if>
            <if test="ccontractrowid != null and ccontractrowid != ''"> and CCONTRACTROWID = #{ccontractrowid} </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and CCURRENCYTYPEID = #{ccurrencytypeid} </if>
            <if test="cmangid != null and cmangid != ''"> and CMANGID = #{cmangid} </if>
            <if test="coperator != null and coperator != ''"> and COPERATOR = #{coperator} </if>
            <if test="corderBid != null and corderBid != ''"> and CORDER_BID = #{corderBid} </if>
            <if test="corderid != null and corderid != ''"> and CORDERID = #{corderid} </if>
            <if test="cordersource != null and cordersource != ''"> and CORDERSOURCE = #{cordersource} </if>
            <if test="cpriceauditBb1id != null and cpriceauditBb1id != ''"> and CPRICEAUDIT_BB1ID = #{cpriceauditBb1id} </if>
            <if test="cpriceauditBid != null and cpriceauditBid != ''"> and CPRICEAUDIT_BID = #{cpriceauditBid} </if>
            <if test="cpriceauditid != null and cpriceauditid != ''"> and CPRICEAUDITID = #{cpriceauditid} </if>
            <if test="cprojectid != null and cprojectid != ''"> and CPROJECTID = #{cprojectid} </if>
            <if test="cprojectphaseid != null and cprojectphaseid != ''"> and CPROJECTPHASEID = #{cprojectphaseid} </if>
            <if test="creceiveaddress != null and creceiveaddress != ''"> and CRECEIVEADDRESS = #{creceiveaddress} </if>
            <if test="crowno != null and crowno != ''"> and CROWNO = #{crowno} </if>
            <if test="csourcebillcode != null and csourcebillcode != ''"> and CSOURCEBILLCODE = #{csourcebillcode} </if>
            <if test="csourcebillid != null and csourcebillid != ''"> and CSOURCEBILLID = #{csourcebillid} </if>
            <if test="csourcebillrow != null and csourcebillrow != ''"> and CSOURCEBILLROW = #{csourcebillrow} </if>
            <if test="csourcebillrowno != null and csourcebillrowno != ''"> and CSOURCEBILLROWNO = #{csourcebillrowno} </if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> and CUPSOURCEBILLID = #{cupsourcebillid} </if>
            <if test="cupsourcebillrowid != null and cupsourcebillrowid != ''"> and CUPSOURCEBILLROWID = #{cupsourcebillrowid} </if>
            <if test="cupsourcebilltype != null and cupsourcebilltype != ''"> and CUPSOURCEBILLTYPE = #{cupsourcebilltype} </if>
            <if test="cwarehouseid != null and cwarehouseid != ''"> and CWAREHOUSEID = #{cwarehouseid} </if>
            <if test="dplanarrvdate != null and dplanarrvdate != ''"> and DPLANARRVDATE = #{dplanarrvdate} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="forderrowstatus != null and forderrowstatus != ''"> and FORDERROWSTATUS = #{forderrowstatus} </if>
            <if test="idiscounttaxtype != null and idiscounttaxtype != ''"> and IDISCOUNTTAXTYPE = #{idiscounttaxtype} </if>
            <if test="naccumarrvnum != null and naccumarrvnum != ''"> and NACCUMARRVNUM = #{naccumarrvnum} </if>
            <if test="naccuminvoicenum != null and naccuminvoicenum != ''"> and NACCUMINVOICENUM = #{naccuminvoicenum} </if>
            <if test="naccumstorenum != null and naccumstorenum != ''"> and NACCUMSTORENUM = #{naccumstorenum} </if>
            <if test="naccumwastnum != null and naccumwastnum != ''"> and NACCUMWASTNUM = #{naccumwastnum} </if>
            <if test="nassistnum != null and nassistnum != ''"> and NASSISTNUM = #{nassistnum} </if>
            <if test="nbackarrvnum != null and nbackarrvnum != ''"> and NBACKARRVNUM = #{nbackarrvnum} </if>
            <if test="nbackstorenum != null and nbackstorenum != ''"> and NBACKSTORENUM = #{nbackstorenum} </if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> and NDISCOUNTRATE = #{ndiscountrate} </if>
            <if test="newver != null and newver != ''"> and NEWVER = #{newver} </if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> and NEXCHANGEOTOBRATE = #{nexchangeotobrate} </if>
            <if test="nmoney != null and nmoney != ''"> and NMONEY = #{nmoney} </if>
            <if test="nordernum != null and nordernum != ''"> and NORDERNUM = #{nordernum} </if>
            <if test="norgnettaxprice != null and norgnettaxprice != ''"> and NORGNETTAXPRICE = #{norgnettaxprice} </if>
            <if test="norgtaxprice != null and norgtaxprice != ''"> and NORGTAXPRICE = #{norgtaxprice} </if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> and NORIGINALCURMNY = #{noriginalcurmny} </if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> and NORIGINALCURPRICE = #{noriginalcurprice} </if>
            <if test="noriginalnetprice != null and noriginalnetprice != ''"> and NORIGINALNETPRICE = #{noriginalnetprice} </if>
            <if test="noriginalsummny != null and noriginalsummny != ''"> and NORIGINALSUMMNY = #{noriginalsummny} </if>
            <if test="noriginaltaxmny != null and noriginaltaxmny != ''"> and NORIGINALTAXMNY = #{noriginaltaxmny} </if>
            <if test="nsummny != null and nsummny != ''"> and NSUMMNY = #{nsummny} </if>
            <if test="ntaxmny != null and ntaxmny != ''"> and NTAXMNY = #{ntaxmny} </if>
            <if test="ntaxrate != null and ntaxrate != ''"> and NTAXRATE = #{ntaxrate} </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </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="ts != null and ts != ''"> and TS = #{ts} </if>
            <if test="vdef1 != null and vdef1 != ''"> and VDEF1 = #{vdef1} </if>
            <if test="vdef10 != null and vdef10 != ''"> and VDEF10 = #{vdef10} </if>
            <if test="vdef11 != null and vdef11 != ''"> and VDEF11 = #{vdef11} </if>
            <if test="vdef12 != null and vdef12 != ''"> and VDEF12 = #{vdef12} </if>
            <if test="vdef13 != null and vdef13 != ''"> and VDEF13 = #{vdef13} </if>
            <if test="vdef14 != null and vdef14 != ''"> and VDEF14 = #{vdef14} </if>
            <if test="vdef15 != null and vdef15 != ''"> and VDEF15 = #{vdef15} </if>
            <if test="vdef16 != null and vdef16 != ''"> and VDEF16 = #{vdef16} </if>
            <if test="vdef17 != null and vdef17 != ''"> and VDEF17 = #{vdef17} </if>
            <if test="vdef18 != null and vdef18 != ''"> and VDEF18 = #{vdef18} </if>
            <if test="vdef19 != null and vdef19 != ''"> and VDEF19 = #{vdef19} </if>
            <if test="vdef2 != null and vdef2 != ''"> and VDEF2 = #{vdef2} </if>
            <if test="vdef20 != null and vdef20 != ''"> and VDEF20 = #{vdef20} </if>
            <if test="vdef3 != null and vdef3 != ''"> and VDEF3 = #{vdef3} </if>
            <if test="vdef4 != null and vdef4 != ''"> and VDEF4 = #{vdef4} </if>
            <if test="vdef5 != null and vdef5 != ''"> and VDEF5 = #{vdef5} </if>
            <if test="vdef6 != null and vdef6 != ''"> and VDEF6 = #{vdef6} </if>
            <if test="vdef7 != null and vdef7 != ''"> and VDEF7 = #{vdef7} </if>
            <if test="vdef8 != null and vdef8 != ''"> and VDEF8 = #{vdef8} </if>
            <if test="vdef9 != null and vdef9 != ''"> and VDEF9 = #{vdef9} </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="vmemo != null and vmemo != ''"> and VMEMO = #{vmemo} </if>
            <if test="vpriceauditcode != null and vpriceauditcode != ''"> and VPRICEAUDITCODE = #{vpriceauditcode} </if>
            <if test="vproducenum != null and vproducenum != ''"> and VPRODUCENUM = #{vproducenum} </if>
            <if test="writeoffassistnum != null and writeoffassistnum != ''"> and WRITEOFFASSISTNUM = #{writeoffassistnum} </if>
            <if test="writeoffnum != null and writeoffnum != ''"> and WRITEOFFNUM = #{writeoffnum} </if>
--             and sts='Y'
    </trim>
<!--    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>-->
<!--    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>-->
</select>
    
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderBEntity">
        select  count(1)   from SC_ORDER_B
    <trim prefix="where" prefixOverrides="and"> 
        <if test="accinstoreassistnum != null and accinstoreassistnum != ''"> and ACCINSTOREASSISTNUM = #{accinstoreassistnum} </if>
            <if test="bisactive != null and bisactive != ''"> and BISACTIVE = #{bisactive} </if>
            <if test="bomversion != null and bomversion != ''"> and BOMVERSION = #{bomversion} </if>
            <if test="cassistunit != null and cassistunit != ''"> and CASSISTUNIT = #{cassistunit} </if>
            <if test="cbaseid != null and cbaseid != ''"> and CBASEID = #{cbaseid} </if>
            <if test="ccontractid != null and ccontractid != ''"> and CCONTRACTID = #{ccontractid} </if>
            <if test="ccontractrcode != null and ccontractrcode != ''"> and CCONTRACTRCODE = #{ccontractrcode} </if>
            <if test="ccontractrowid != null and ccontractrowid != ''"> and CCONTRACTROWID = #{ccontractrowid} </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and CCURRENCYTYPEID = #{ccurrencytypeid} </if>
            <if test="cmangid != null and cmangid != ''"> and CMANGID = #{cmangid} </if>
            <if test="coperator != null and coperator != ''"> and COPERATOR = #{coperator} </if>
            <if test="corderBid != null and corderBid != ''"> and CORDER_BID = #{corderBid} </if>
            <if test="corderid != null and corderid != ''"> and CORDERID = #{corderid} </if>
            <if test="cordersource != null and cordersource != ''"> and CORDERSOURCE = #{cordersource} </if>
            <if test="cpriceauditBb1id != null and cpriceauditBb1id != ''"> and CPRICEAUDIT_BB1ID = #{cpriceauditBb1id} </if>
            <if test="cpriceauditBid != null and cpriceauditBid != ''"> and CPRICEAUDIT_BID = #{cpriceauditBid} </if>
            <if test="cpriceauditid != null and cpriceauditid != ''"> and CPRICEAUDITID = #{cpriceauditid} </if>
            <if test="cprojectid != null and cprojectid != ''"> and CPROJECTID = #{cprojectid} </if>
            <if test="cprojectphaseid != null and cprojectphaseid != ''"> and CPROJECTPHASEID = #{cprojectphaseid} </if>
            <if test="creceiveaddress != null and creceiveaddress != ''"> and CRECEIVEADDRESS = #{creceiveaddress} </if>
            <if test="crowno != null and crowno != ''"> and CROWNO = #{crowno} </if>
            <if test="csourcebillcode != null and csourcebillcode != ''"> and CSOURCEBILLCODE = #{csourcebillcode} </if>
            <if test="csourcebillid != null and csourcebillid != ''"> and CSOURCEBILLID = #{csourcebillid} </if>
            <if test="csourcebillrow != null and csourcebillrow != ''"> and CSOURCEBILLROW = #{csourcebillrow} </if>
            <if test="csourcebillrowno != null and csourcebillrowno != ''"> and CSOURCEBILLROWNO = #{csourcebillrowno} </if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> and CUPSOURCEBILLID = #{cupsourcebillid} </if>
            <if test="cupsourcebillrowid != null and cupsourcebillrowid != ''"> and CUPSOURCEBILLROWID = #{cupsourcebillrowid} </if>
            <if test="cupsourcebilltype != null and cupsourcebilltype != ''"> and CUPSOURCEBILLTYPE = #{cupsourcebilltype} </if>
            <if test="cwarehouseid != null and cwarehouseid != ''"> and CWAREHOUSEID = #{cwarehouseid} </if>
            <if test="dplanarrvdate != null and dplanarrvdate != ''"> and DPLANARRVDATE = #{dplanarrvdate} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="forderrowstatus != null and forderrowstatus != ''"> and FORDERROWSTATUS = #{forderrowstatus} </if>
            <if test="idiscounttaxtype != null and idiscounttaxtype != ''"> and IDISCOUNTTAXTYPE = #{idiscounttaxtype} </if>
            <if test="naccumarrvnum != null and naccumarrvnum != ''"> and NACCUMARRVNUM = #{naccumarrvnum} </if>
            <if test="naccuminvoicenum != null and naccuminvoicenum != ''"> and NACCUMINVOICENUM = #{naccuminvoicenum} </if>
            <if test="naccumstorenum != null and naccumstorenum != ''"> and NACCUMSTORENUM = #{naccumstorenum} </if>
            <if test="naccumwastnum != null and naccumwastnum != ''"> and NACCUMWASTNUM = #{naccumwastnum} </if>
            <if test="nassistnum != null and nassistnum != ''"> and NASSISTNUM = #{nassistnum} </if>
            <if test="nbackarrvnum != null and nbackarrvnum != ''"> and NBACKARRVNUM = #{nbackarrvnum} </if>
            <if test="nbackstorenum != null and nbackstorenum != ''"> and NBACKSTORENUM = #{nbackstorenum} </if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> and NDISCOUNTRATE = #{ndiscountrate} </if>
            <if test="newver != null and newver != ''"> and NEWVER = #{newver} </if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> and NEXCHANGEOTOBRATE = #{nexchangeotobrate} </if>
            <if test="nmoney != null and nmoney != ''"> and NMONEY = #{nmoney} </if>
            <if test="nordernum != null and nordernum != ''"> and NORDERNUM = #{nordernum} </if>
            <if test="norgnettaxprice != null and norgnettaxprice != ''"> and NORGNETTAXPRICE = #{norgnettaxprice} </if>
            <if test="norgtaxprice != null and norgtaxprice != ''"> and NORGTAXPRICE = #{norgtaxprice} </if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> and NORIGINALCURMNY = #{noriginalcurmny} </if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> and NORIGINALCURPRICE = #{noriginalcurprice} </if>
            <if test="noriginalnetprice != null and noriginalnetprice != ''"> and NORIGINALNETPRICE = #{noriginalnetprice} </if>
            <if test="noriginalsummny != null and noriginalsummny != ''"> and NORIGINALSUMMNY = #{noriginalsummny} </if>
            <if test="noriginaltaxmny != null and noriginaltaxmny != ''"> and NORIGINALTAXMNY = #{noriginaltaxmny} </if>
            <if test="nsummny != null and nsummny != ''"> and NSUMMNY = #{nsummny} </if>
            <if test="ntaxmny != null and ntaxmny != ''"> and NTAXMNY = #{ntaxmny} </if>
            <if test="ntaxrate != null and ntaxrate != ''"> and NTAXRATE = #{ntaxrate} </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </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="ts != null and ts != ''"> and TS = #{ts} </if>
            <if test="vdef1 != null and vdef1 != ''"> and VDEF1 = #{vdef1} </if>
            <if test="vdef10 != null and vdef10 != ''"> and VDEF10 = #{vdef10} </if>
            <if test="vdef11 != null and vdef11 != ''"> and VDEF11 = #{vdef11} </if>
            <if test="vdef12 != null and vdef12 != ''"> and VDEF12 = #{vdef12} </if>
            <if test="vdef13 != null and vdef13 != ''"> and VDEF13 = #{vdef13} </if>
            <if test="vdef14 != null and vdef14 != ''"> and VDEF14 = #{vdef14} </if>
            <if test="vdef15 != null and vdef15 != ''"> and VDEF15 = #{vdef15} </if>
            <if test="vdef16 != null and vdef16 != ''"> and VDEF16 = #{vdef16} </if>
            <if test="vdef17 != null and vdef17 != ''"> and VDEF17 = #{vdef17} </if>
            <if test="vdef18 != null and vdef18 != ''"> and VDEF18 = #{vdef18} </if>
            <if test="vdef19 != null and vdef19 != ''"> and VDEF19 = #{vdef19} </if>
            <if test="vdef2 != null and vdef2 != ''"> and VDEF2 = #{vdef2} </if>
            <if test="vdef20 != null and vdef20 != ''"> and VDEF20 = #{vdef20} </if>
            <if test="vdef3 != null and vdef3 != ''"> and VDEF3 = #{vdef3} </if>
            <if test="vdef4 != null and vdef4 != ''"> and VDEF4 = #{vdef4} </if>
            <if test="vdef5 != null and vdef5 != ''"> and VDEF5 = #{vdef5} </if>
            <if test="vdef6 != null and vdef6 != ''"> and VDEF6 = #{vdef6} </if>
            <if test="vdef7 != null and vdef7 != ''"> and VDEF7 = #{vdef7} </if>
            <if test="vdef8 != null and vdef8 != ''"> and VDEF8 = #{vdef8} </if>
            <if test="vdef9 != null and vdef9 != ''"> and VDEF9 = #{vdef9} </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="vmemo != null and vmemo != ''"> and VMEMO = #{vmemo} </if>
            <if test="vpriceauditcode != null and vpriceauditcode != ''"> and VPRICEAUDITCODE = #{vpriceauditcode} </if>
            <if test="vproducenum != null and vproducenum != ''"> and VPRODUCENUM = #{vproducenum} </if>
            <if test="writeoffassistnum != null and writeoffassistnum != ''"> and WRITEOFFASSISTNUM = #{writeoffassistnum} </if>
            <if test="writeoffnum != null and writeoffnum != ''"> and WRITEOFFNUM = #{writeoffnum} </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-ScOrderBEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderBEntity">
    select
    <include refid="ScOrderBEntity_Base_Column_List" />
    from SC_ORDER_B
    <trim prefix="where" prefixOverrides="and"> 
        <if test="accinstoreassistnum != null and accinstoreassistnum != ''"> and ACCINSTOREASSISTNUM like concat('%',#{accinstoreassistnum},'%') </if>
            <if test="bisactive != null and bisactive != ''"> and BISACTIVE like concat('%',#{bisactive},'%') </if>
            <if test="bomversion != null and bomversion != ''"> and BOMVERSION like concat('%',#{bomversion},'%') </if>
            <if test="cassistunit != null and cassistunit != ''"> and CASSISTUNIT like concat('%',#{cassistunit},'%') </if>
            <if test="cbaseid != null and cbaseid != ''"> and CBASEID like concat('%',#{cbaseid},'%') </if>
            <if test="ccontractid != null and ccontractid != ''"> and CCONTRACTID like concat('%',#{ccontractid},'%') </if>
            <if test="ccontractrcode != null and ccontractrcode != ''"> and CCONTRACTRCODE like concat('%',#{ccontractrcode},'%') </if>
            <if test="ccontractrowid != null and ccontractrowid != ''"> and CCONTRACTROWID like concat('%',#{ccontractrowid},'%') </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and CCURRENCYTYPEID like concat('%',#{ccurrencytypeid},'%') </if>
            <if test="cmangid != null and cmangid != ''"> and CMANGID like concat('%',#{cmangid},'%') </if>
            <if test="coperator != null and coperator != ''"> and COPERATOR like concat('%',#{coperator},'%') </if>
            <if test="corderBid != null and corderBid != ''"> and CORDER_BID like concat('%',#{corderBid},'%') </if>
            <if test="corderid != null and corderid != ''"> and CORDERID like concat('%',#{corderid},'%') </if>
            <if test="cordersource != null and cordersource != ''"> and CORDERSOURCE like concat('%',#{cordersource},'%') </if>
            <if test="cpriceauditBb1id != null and cpriceauditBb1id != ''"> and CPRICEAUDIT_BB1ID like concat('%',#{cpriceauditBb1id},'%') </if>
            <if test="cpriceauditBid != null and cpriceauditBid != ''"> and CPRICEAUDIT_BID like concat('%',#{cpriceauditBid},'%') </if>
            <if test="cpriceauditid != null and cpriceauditid != ''"> and CPRICEAUDITID like concat('%',#{cpriceauditid},'%') </if>
            <if test="cprojectid != null and cprojectid != ''"> and CPROJECTID like concat('%',#{cprojectid},'%') </if>
            <if test="cprojectphaseid != null and cprojectphaseid != ''"> and CPROJECTPHASEID like concat('%',#{cprojectphaseid},'%') </if>
            <if test="creceiveaddress != null and creceiveaddress != ''"> and CRECEIVEADDRESS like concat('%',#{creceiveaddress},'%') </if>
            <if test="crowno != null and crowno != ''"> and CROWNO like concat('%',#{crowno},'%') </if>
            <if test="csourcebillcode != null and csourcebillcode != ''"> and CSOURCEBILLCODE like concat('%',#{csourcebillcode},'%') </if>
            <if test="csourcebillid != null and csourcebillid != ''"> and CSOURCEBILLID like concat('%',#{csourcebillid},'%') </if>
            <if test="csourcebillrow != null and csourcebillrow != ''"> and CSOURCEBILLROW like concat('%',#{csourcebillrow},'%') </if>
            <if test="csourcebillrowno != null and csourcebillrowno != ''"> and CSOURCEBILLROWNO like concat('%',#{csourcebillrowno},'%') </if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> and CUPSOURCEBILLID like concat('%',#{cupsourcebillid},'%') </if>
            <if test="cupsourcebillrowid != null and cupsourcebillrowid != ''"> and CUPSOURCEBILLROWID like concat('%',#{cupsourcebillrowid},'%') </if>
            <if test="cupsourcebilltype != null and cupsourcebilltype != ''"> and CUPSOURCEBILLTYPE like concat('%',#{cupsourcebilltype},'%') </if>
            <if test="cwarehouseid != null and cwarehouseid != ''"> and CWAREHOUSEID like concat('%',#{cwarehouseid},'%') </if>
            <if test="dplanarrvdate != null and dplanarrvdate != ''"> and DPLANARRVDATE like concat('%',#{dplanarrvdate},'%') </if>
            <if test="dr != null and dr != ''"> and DR like concat('%',#{dr},'%') </if>
            <if test="forderrowstatus != null and forderrowstatus != ''"> and FORDERROWSTATUS like concat('%',#{forderrowstatus},'%') </if>
            <if test="idiscounttaxtype != null and idiscounttaxtype != ''"> and IDISCOUNTTAXTYPE like concat('%',#{idiscounttaxtype},'%') </if>
            <if test="naccumarrvnum != null and naccumarrvnum != ''"> and NACCUMARRVNUM like concat('%',#{naccumarrvnum},'%') </if>
            <if test="naccuminvoicenum != null and naccuminvoicenum != ''"> and NACCUMINVOICENUM like concat('%',#{naccuminvoicenum},'%') </if>
            <if test="naccumstorenum != null and naccumstorenum != ''"> and NACCUMSTORENUM like concat('%',#{naccumstorenum},'%') </if>
            <if test="naccumwastnum != null and naccumwastnum != ''"> and NACCUMWASTNUM like concat('%',#{naccumwastnum},'%') </if>
            <if test="nassistnum != null and nassistnum != ''"> and NASSISTNUM like concat('%',#{nassistnum},'%') </if>
            <if test="nbackarrvnum != null and nbackarrvnum != ''"> and NBACKARRVNUM like concat('%',#{nbackarrvnum},'%') </if>
            <if test="nbackstorenum != null and nbackstorenum != ''"> and NBACKSTORENUM like concat('%',#{nbackstorenum},'%') </if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> and NDISCOUNTRATE like concat('%',#{ndiscountrate},'%') </if>
            <if test="newver != null and newver != ''"> and NEWVER like concat('%',#{newver},'%') </if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> and NEXCHANGEOTOBRATE like concat('%',#{nexchangeotobrate},'%') </if>
            <if test="nmoney != null and nmoney != ''"> and NMONEY like concat('%',#{nmoney},'%') </if>
            <if test="nordernum != null and nordernum != ''"> and NORDERNUM like concat('%',#{nordernum},'%') </if>
            <if test="norgnettaxprice != null and norgnettaxprice != ''"> and NORGNETTAXPRICE like concat('%',#{norgnettaxprice},'%') </if>
            <if test="norgtaxprice != null and norgtaxprice != ''"> and NORGTAXPRICE like concat('%',#{norgtaxprice},'%') </if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> and NORIGINALCURMNY like concat('%',#{noriginalcurmny},'%') </if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> and NORIGINALCURPRICE like concat('%',#{noriginalcurprice},'%') </if>
            <if test="noriginalnetprice != null and noriginalnetprice != ''"> and NORIGINALNETPRICE like concat('%',#{noriginalnetprice},'%') </if>
            <if test="noriginalsummny != null and noriginalsummny != ''"> and NORIGINALSUMMNY like concat('%',#{noriginalsummny},'%') </if>
            <if test="noriginaltaxmny != null and noriginaltaxmny != ''"> and NORIGINALTAXMNY like concat('%',#{noriginaltaxmny},'%') </if>
            <if test="nsummny != null and nsummny != ''"> and NSUMMNY like concat('%',#{nsummny},'%') </if>
            <if test="ntaxmny != null and ntaxmny != ''"> and NTAXMNY like concat('%',#{ntaxmny},'%') </if>
            <if test="ntaxrate != null and ntaxrate != ''"> and NTAXRATE like concat('%',#{ntaxrate},'%') </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP like concat('%',#{pkCorp},'%') </if>
            <if test="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="ts != null and ts != ''"> and TS like concat('%',#{ts},'%') </if>
            <if test="vdef1 != null and vdef1 != ''"> and VDEF1 like concat('%',#{vdef1},'%') </if>
            <if test="vdef10 != null and vdef10 != ''"> and VDEF10 like concat('%',#{vdef10},'%') </if>
            <if test="vdef11 != null and vdef11 != ''"> and VDEF11 like concat('%',#{vdef11},'%') </if>
            <if test="vdef12 != null and vdef12 != ''"> and VDEF12 like concat('%',#{vdef12},'%') </if>
            <if test="vdef13 != null and vdef13 != ''"> and VDEF13 like concat('%',#{vdef13},'%') </if>
            <if test="vdef14 != null and vdef14 != ''"> and VDEF14 like concat('%',#{vdef14},'%') </if>
            <if test="vdef15 != null and vdef15 != ''"> and VDEF15 like concat('%',#{vdef15},'%') </if>
            <if test="vdef16 != null and vdef16 != ''"> and VDEF16 like concat('%',#{vdef16},'%') </if>
            <if test="vdef17 != null and vdef17 != ''"> and VDEF17 like concat('%',#{vdef17},'%') </if>
            <if test="vdef18 != null and vdef18 != ''"> and VDEF18 like concat('%',#{vdef18},'%') </if>
            <if test="vdef19 != null and vdef19 != ''"> and VDEF19 like concat('%',#{vdef19},'%') </if>
            <if test="vdef2 != null and vdef2 != ''"> and VDEF2 like concat('%',#{vdef2},'%') </if>
            <if test="vdef20 != null and vdef20 != ''"> and VDEF20 like concat('%',#{vdef20},'%') </if>
            <if test="vdef3 != null and vdef3 != ''"> and VDEF3 like concat('%',#{vdef3},'%') </if>
            <if test="vdef4 != null and vdef4 != ''"> and VDEF4 like concat('%',#{vdef4},'%') </if>
            <if test="vdef5 != null and vdef5 != ''"> and VDEF5 like concat('%',#{vdef5},'%') </if>
            <if test="vdef6 != null and vdef6 != ''"> and VDEF6 like concat('%',#{vdef6},'%') </if>
            <if test="vdef7 != null and vdef7 != ''"> and VDEF7 like concat('%',#{vdef7},'%') </if>
            <if test="vdef8 != null and vdef8 != ''"> and VDEF8 like concat('%',#{vdef8},'%') </if>
            <if test="vdef9 != null and vdef9 != ''"> and VDEF9 like concat('%',#{vdef9},'%') </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="vmemo != null and vmemo != ''"> and VMEMO like concat('%',#{vmemo},'%') </if>
            <if test="vpriceauditcode != null and vpriceauditcode != ''"> and VPRICEAUDITCODE like concat('%',#{vpriceauditcode},'%') </if>
            <if test="vproducenum != null and vproducenum != ''"> and VPRODUCENUM like concat('%',#{vproducenum},'%') </if>
            <if test="writeoffassistnum != null and writeoffassistnum != ''"> and WRITEOFFASSISTNUM like concat('%',#{writeoffassistnum},'%') </if>
            <if test="writeoffnum != null and writeoffnum != ''"> and WRITEOFFNUM like concat('%',#{writeoffnum},'%') </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="ScOrderBentity_list_or" resultMap="get-ScOrderBEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderBEntity">
    select
    <include refid="ScOrderBEntity_Base_Column_List" />
    from SC_ORDER_B
    <trim prefix="where" prefixOverrides="and"> 
         <if test="accinstoreassistnum != null and accinstoreassistnum != ''"> or ACCINSTOREASSISTNUM = #{accinstoreassistnum} </if>
             <if test="bisactive != null and bisactive != ''"> or BISACTIVE = #{bisactive} </if>
             <if test="bomversion != null and bomversion != ''"> or BOMVERSION = #{bomversion} </if>
             <if test="cassistunit != null and cassistunit != ''"> or CASSISTUNIT = #{cassistunit} </if>
             <if test="cbaseid != null and cbaseid != ''"> or CBASEID = #{cbaseid} </if>
             <if test="ccontractid != null and ccontractid != ''"> or CCONTRACTID = #{ccontractid} </if>
             <if test="ccontractrcode != null and ccontractrcode != ''"> or CCONTRACTRCODE = #{ccontractrcode} </if>
             <if test="ccontractrowid != null and ccontractrowid != ''"> or CCONTRACTROWID = #{ccontractrowid} </if>
             <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> or CCURRENCYTYPEID = #{ccurrencytypeid} </if>
             <if test="cmangid != null and cmangid != ''"> or CMANGID = #{cmangid} </if>
             <if test="coperator != null and coperator != ''"> or COPERATOR = #{coperator} </if>
             <if test="corderBid != null and corderBid != ''"> or CORDER_BID = #{corderBid} </if>
             <if test="corderid != null and corderid != ''"> or CORDERID = #{corderid} </if>
             <if test="cordersource != null and cordersource != ''"> or CORDERSOURCE = #{cordersource} </if>
             <if test="cpriceauditBb1id != null and cpriceauditBb1id != ''"> or CPRICEAUDIT_BB1ID = #{cpriceauditBb1id} </if>
             <if test="cpriceauditBid != null and cpriceauditBid != ''"> or CPRICEAUDIT_BID = #{cpriceauditBid} </if>
             <if test="cpriceauditid != null and cpriceauditid != ''"> or CPRICEAUDITID = #{cpriceauditid} </if>
             <if test="cprojectid != null and cprojectid != ''"> or CPROJECTID = #{cprojectid} </if>
             <if test="cprojectphaseid != null and cprojectphaseid != ''"> or CPROJECTPHASEID = #{cprojectphaseid} </if>
             <if test="creceiveaddress != null and creceiveaddress != ''"> or CRECEIVEADDRESS = #{creceiveaddress} </if>
             <if test="crowno != null and crowno != ''"> or CROWNO = #{crowno} </if>
             <if test="csourcebillcode != null and csourcebillcode != ''"> or CSOURCEBILLCODE = #{csourcebillcode} </if>
             <if test="csourcebillid != null and csourcebillid != ''"> or CSOURCEBILLID = #{csourcebillid} </if>
             <if test="csourcebillrow != null and csourcebillrow != ''"> or CSOURCEBILLROW = #{csourcebillrow} </if>
             <if test="csourcebillrowno != null and csourcebillrowno != ''"> or CSOURCEBILLROWNO = #{csourcebillrowno} </if>
             <if test="cupsourcebillid != null and cupsourcebillid != ''"> or CUPSOURCEBILLID = #{cupsourcebillid} </if>
             <if test="cupsourcebillrowid != null and cupsourcebillrowid != ''"> or CUPSOURCEBILLROWID = #{cupsourcebillrowid} </if>
             <if test="cupsourcebilltype != null and cupsourcebilltype != ''"> or CUPSOURCEBILLTYPE = #{cupsourcebilltype} </if>
             <if test="cwarehouseid != null and cwarehouseid != ''"> or CWAREHOUSEID = #{cwarehouseid} </if>
             <if test="dplanarrvdate != null and dplanarrvdate != ''"> or DPLANARRVDATE = #{dplanarrvdate} </if>
             <if test="dr != null and dr != ''"> or DR = #{dr} </if>
             <if test="forderrowstatus != null and forderrowstatus != ''"> or FORDERROWSTATUS = #{forderrowstatus} </if>
             <if test="idiscounttaxtype != null and idiscounttaxtype != ''"> or IDISCOUNTTAXTYPE = #{idiscounttaxtype} </if>
             <if test="naccumarrvnum != null and naccumarrvnum != ''"> or NACCUMARRVNUM = #{naccumarrvnum} </if>
             <if test="naccuminvoicenum != null and naccuminvoicenum != ''"> or NACCUMINVOICENUM = #{naccuminvoicenum} </if>
             <if test="naccumstorenum != null and naccumstorenum != ''"> or NACCUMSTORENUM = #{naccumstorenum} </if>
             <if test="naccumwastnum != null and naccumwastnum != ''"> or NACCUMWASTNUM = #{naccumwastnum} </if>
             <if test="nassistnum != null and nassistnum != ''"> or NASSISTNUM = #{nassistnum} </if>
             <if test="nbackarrvnum != null and nbackarrvnum != ''"> or NBACKARRVNUM = #{nbackarrvnum} </if>
             <if test="nbackstorenum != null and nbackstorenum != ''"> or NBACKSTORENUM = #{nbackstorenum} </if>
             <if test="ndiscountrate != null and ndiscountrate != ''"> or NDISCOUNTRATE = #{ndiscountrate} </if>
             <if test="newver != null and newver != ''"> or NEWVER = #{newver} </if>
             <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> or NEXCHANGEOTOBRATE = #{nexchangeotobrate} </if>
             <if test="nmoney != null and nmoney != ''"> or NMONEY = #{nmoney} </if>
             <if test="nordernum != null and nordernum != ''"> or NORDERNUM = #{nordernum} </if>
             <if test="norgnettaxprice != null and norgnettaxprice != ''"> or NORGNETTAXPRICE = #{norgnettaxprice} </if>
             <if test="norgtaxprice != null and norgtaxprice != ''"> or NORGTAXPRICE = #{norgtaxprice} </if>
             <if test="noriginalcurmny != null and noriginalcurmny != ''"> or NORIGINALCURMNY = #{noriginalcurmny} </if>
             <if test="noriginalcurprice != null and noriginalcurprice != ''"> or NORIGINALCURPRICE = #{noriginalcurprice} </if>
             <if test="noriginalnetprice != null and noriginalnetprice != ''"> or NORIGINALNETPRICE = #{noriginalnetprice} </if>
             <if test="noriginalsummny != null and noriginalsummny != ''"> or NORIGINALSUMMNY = #{noriginalsummny} </if>
             <if test="noriginaltaxmny != null and noriginaltaxmny != ''"> or NORIGINALTAXMNY = #{noriginaltaxmny} </if>
             <if test="nsummny != null and nsummny != ''"> or NSUMMNY = #{nsummny} </if>
             <if test="ntaxmny != null and ntaxmny != ''"> or NTAXMNY = #{ntaxmny} </if>
             <if test="ntaxrate != null and ntaxrate != ''"> or NTAXRATE = #{ntaxrate} </if>
             <if test="pkCorp != null and pkCorp != ''"> or PK_CORP = #{pkCorp} </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="ts != null and ts != ''"> or TS = #{ts} </if>
             <if test="vdef1 != null and vdef1 != ''"> or VDEF1 = #{vdef1} </if>
             <if test="vdef10 != null and vdef10 != ''"> or VDEF10 = #{vdef10} </if>
             <if test="vdef11 != null and vdef11 != ''"> or VDEF11 = #{vdef11} </if>
             <if test="vdef12 != null and vdef12 != ''"> or VDEF12 = #{vdef12} </if>
             <if test="vdef13 != null and vdef13 != ''"> or VDEF13 = #{vdef13} </if>
             <if test="vdef14 != null and vdef14 != ''"> or VDEF14 = #{vdef14} </if>
             <if test="vdef15 != null and vdef15 != ''"> or VDEF15 = #{vdef15} </if>
             <if test="vdef16 != null and vdef16 != ''"> or VDEF16 = #{vdef16} </if>
             <if test="vdef17 != null and vdef17 != ''"> or VDEF17 = #{vdef17} </if>
             <if test="vdef18 != null and vdef18 != ''"> or VDEF18 = #{vdef18} </if>
             <if test="vdef19 != null and vdef19 != ''"> or VDEF19 = #{vdef19} </if>
             <if test="vdef2 != null and vdef2 != ''"> or VDEF2 = #{vdef2} </if>
             <if test="vdef20 != null and vdef20 != ''"> or VDEF20 = #{vdef20} </if>
             <if test="vdef3 != null and vdef3 != ''"> or VDEF3 = #{vdef3} </if>
             <if test="vdef4 != null and vdef4 != ''"> or VDEF4 = #{vdef4} </if>
             <if test="vdef5 != null and vdef5 != ''"> or VDEF5 = #{vdef5} </if>
             <if test="vdef6 != null and vdef6 != ''"> or VDEF6 = #{vdef6} </if>
             <if test="vdef7 != null and vdef7 != ''"> or VDEF7 = #{vdef7} </if>
             <if test="vdef8 != null and vdef8 != ''"> or VDEF8 = #{vdef8} </if>
             <if test="vdef9 != null and vdef9 != ''"> or VDEF9 = #{vdef9} </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="vmemo != null and vmemo != ''"> or VMEMO = #{vmemo} </if>
             <if test="vpriceauditcode != null and vpriceauditcode != ''"> or VPRICEAUDITCODE = #{vpriceauditcode} </if>
             <if test="vproducenum != null and vproducenum != ''"> or VPRODUCENUM = #{vproducenum} </if>
             <if test="writeoffassistnum != null and writeoffassistnum != ''"> or WRITEOFFASSISTNUM = #{writeoffassistnum} </if>
             <if test="writeoffnum != null and writeoffnum != ''"> or WRITEOFFNUM = #{writeoffnum} </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.ScOrderBEntity" keyProperty="corderBid" useGeneratedKeys="true">
    insert into SC_ORDER_B(
  <trim suffix="" suffixOverrides=",">
       <if test="accinstoreassistnum != null and accinstoreassistnum != ''"> ACCINSTOREASSISTNUM , </if>
            <if test="bisactive != null and bisactive != ''"> BISACTIVE , </if>
            <if test="bomversion != null and bomversion != ''"> BOMVERSION , </if>
            <if test="cassistunit != null and cassistunit != ''"> CASSISTUNIT , </if>
            <if test="cbaseid != null and cbaseid != ''"> CBASEID , </if>
            <if test="ccontractid != null and ccontractid != ''"> CCONTRACTID , </if>
            <if test="ccontractrcode != null and ccontractrcode != ''"> CCONTRACTRCODE , </if>
            <if test="ccontractrowid != null and ccontractrowid != ''"> CCONTRACTROWID , </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> CCURRENCYTYPEID , </if>
            <if test="cmangid != null and cmangid != ''"> CMANGID , </if>
            <if test="coperator != null and coperator != ''"> COPERATOR , </if>
            <if test="corderBid != null and corderBid != ''"> CORDER_BID , </if>
            <if test="corderid != null and corderid != ''"> CORDERID , </if>
            <if test="cordersource != null and cordersource != ''"> CORDERSOURCE , </if>
            <if test="cpriceauditBb1id != null and cpriceauditBb1id != ''"> CPRICEAUDIT_BB1ID , </if>
            <if test="cpriceauditBid != null and cpriceauditBid != ''"> CPRICEAUDIT_BID , </if>
            <if test="cpriceauditid != null and cpriceauditid != ''"> CPRICEAUDITID , </if>
            <if test="cprojectid != null and cprojectid != ''"> CPROJECTID , </if>
            <if test="cprojectphaseid != null and cprojectphaseid != ''"> CPROJECTPHASEID , </if>
            <if test="creceiveaddress != null and creceiveaddress != ''"> CRECEIVEADDRESS , </if>
            <if test="crowno != null and crowno != ''"> CROWNO , </if>
            <if test="csourcebillcode != null and csourcebillcode != ''"> CSOURCEBILLCODE , </if>
            <if test="csourcebillid != null and csourcebillid != ''"> CSOURCEBILLID , </if>
            <if test="csourcebillrow != null and csourcebillrow != ''"> CSOURCEBILLROW , </if>
            <if test="csourcebillrowno != null and csourcebillrowno != ''"> CSOURCEBILLROWNO , </if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> CUPSOURCEBILLID , </if>
            <if test="cupsourcebillrowid != null and cupsourcebillrowid != ''"> CUPSOURCEBILLROWID , </if>
            <if test="cupsourcebilltype != null and cupsourcebilltype != ''"> CUPSOURCEBILLTYPE , </if>
            <if test="cwarehouseid != null and cwarehouseid != ''"> CWAREHOUSEID , </if>
            <if test="dplanarrvdate != null and dplanarrvdate != ''"> DPLANARRVDATE , </if>
            <if test="dr != null and dr != ''"> DR , </if>
            <if test="forderrowstatus != null and forderrowstatus != ''"> FORDERROWSTATUS , </if>
            <if test="idiscounttaxtype != null and idiscounttaxtype != ''"> IDISCOUNTTAXTYPE , </if>
            <if test="naccumarrvnum != null and naccumarrvnum != ''"> NACCUMARRVNUM , </if>
            <if test="naccuminvoicenum != null and naccuminvoicenum != ''"> NACCUMINVOICENUM , </if>
            <if test="naccumstorenum != null and naccumstorenum != ''"> NACCUMSTORENUM , </if>
            <if test="naccumwastnum != null and naccumwastnum != ''"> NACCUMWASTNUM , </if>
            <if test="nassistnum != null and nassistnum != ''"> NASSISTNUM , </if>
            <if test="nbackarrvnum != null and nbackarrvnum != ''"> NBACKARRVNUM , </if>
            <if test="nbackstorenum != null and nbackstorenum != ''"> NBACKSTORENUM , </if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> NDISCOUNTRATE , </if>
            <if test="newver != null and newver != ''"> NEWVER , </if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> NEXCHANGEOTOBRATE , </if>
            <if test="nmoney != null and nmoney != ''"> NMONEY , </if>
            <if test="nordernum != null and nordernum != ''"> NORDERNUM , </if>
            <if test="norgnettaxprice != null and norgnettaxprice != ''"> NORGNETTAXPRICE , </if>
            <if test="norgtaxprice != null and norgtaxprice != ''"> NORGTAXPRICE , </if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> NORIGINALCURMNY , </if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> NORIGINALCURPRICE , </if>
            <if test="noriginalnetprice != null and noriginalnetprice != ''"> NORIGINALNETPRICE , </if>
            <if test="noriginalsummny != null and noriginalsummny != ''"> NORIGINALSUMMNY , </if>
            <if test="noriginaltaxmny != null and noriginaltaxmny != ''"> NORIGINALTAXMNY , </if>
            <if test="nsummny != null and nsummny != ''"> NSUMMNY , </if>
            <if test="ntaxmny != null and ntaxmny != ''"> NTAXMNY , </if>
            <if test="ntaxrate != null and ntaxrate != ''"> NTAXRATE , </if>
            <if test="pkCorp != null and pkCorp != ''"> PK_CORP , </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="ts != null and ts != ''"> TS , </if>
            <if test="vdef1 != null and vdef1 != ''"> VDEF1 , </if>
            <if test="vdef10 != null and vdef10 != ''"> VDEF10 , </if>
            <if test="vdef11 != null and vdef11 != ''"> VDEF11 , </if>
            <if test="vdef12 != null and vdef12 != ''"> VDEF12 , </if>
            <if test="vdef13 != null and vdef13 != ''"> VDEF13 , </if>
            <if test="vdef14 != null and vdef14 != ''"> VDEF14 , </if>
            <if test="vdef15 != null and vdef15 != ''"> VDEF15 , </if>
            <if test="vdef16 != null and vdef16 != ''"> VDEF16 , </if>
            <if test="vdef17 != null and vdef17 != ''"> VDEF17 , </if>
            <if test="vdef18 != null and vdef18 != ''"> VDEF18 , </if>
            <if test="vdef19 != null and vdef19 != ''"> VDEF19 , </if>
            <if test="vdef2 != null and vdef2 != ''"> VDEF2 , </if>
            <if test="vdef20 != null and vdef20 != ''"> VDEF20 , </if>
            <if test="vdef3 != null and vdef3 != ''"> VDEF3 , </if>
            <if test="vdef4 != null and vdef4 != ''"> VDEF4 , </if>
            <if test="vdef5 != null and vdef5 != ''"> VDEF5 , </if>
            <if test="vdef6 != null and vdef6 != ''"> VDEF6 , </if>
            <if test="vdef7 != null and vdef7 != ''"> VDEF7 , </if>
            <if test="vdef8 != null and vdef8 != ''"> VDEF8 , </if>
            <if test="vdef9 != null and vdef9 != ''"> VDEF9 , </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="vmemo != null and vmemo != ''"> VMEMO , </if>
            <if test="vpriceauditcode != null and vpriceauditcode != ''"> VPRICEAUDITCODE , </if>
            <if test="vproducenum != null and vproducenum != ''"> VPRODUCENUM , </if>
            <if test="writeoffassistnum != null and writeoffassistnum != ''"> WRITEOFFASSISTNUM , </if>
            <if test="writeoffnum != null and writeoffnum != ''"> WRITEOFFNUM , </if>
            <if test="sorts == null ">sorts,</if>
    <if test="sts == null ">sts,</if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <if test="accinstoreassistnum != null and accinstoreassistnum != ''"> #{accinstoreassistnum} ,</if>
            <if test="bisactive != null and bisactive != ''"> #{bisactive} ,</if>
            <if test="bomversion != null and bomversion != ''"> #{bomversion} ,</if>
            <if test="cassistunit != null and cassistunit != ''"> #{cassistunit} ,</if>
            <if test="cbaseid != null and cbaseid != ''"> #{cbaseid} ,</if>
            <if test="ccontractid != null and ccontractid != ''"> #{ccontractid} ,</if>
            <if test="ccontractrcode != null and ccontractrcode != ''"> #{ccontractrcode} ,</if>
            <if test="ccontractrowid != null and ccontractrowid != ''"> #{ccontractrowid} ,</if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> #{ccurrencytypeid} ,</if>
            <if test="cmangid != null and cmangid != ''"> #{cmangid} ,</if>
            <if test="coperator != null and coperator != ''"> #{coperator} ,</if>
            <if test="corderBid != null and corderBid != ''"> #{corderBid} ,</if>
            <if test="corderid != null and corderid != ''"> #{corderid} ,</if>
            <if test="cordersource != null and cordersource != ''"> #{cordersource} ,</if>
            <if test="cpriceauditBb1id != null and cpriceauditBb1id != ''"> #{cpriceauditBb1id} ,</if>
            <if test="cpriceauditBid != null and cpriceauditBid != ''"> #{cpriceauditBid} ,</if>
            <if test="cpriceauditid != null and cpriceauditid != ''"> #{cpriceauditid} ,</if>
            <if test="cprojectid != null and cprojectid != ''"> #{cprojectid} ,</if>
            <if test="cprojectphaseid != null and cprojectphaseid != ''"> #{cprojectphaseid} ,</if>
            <if test="creceiveaddress != null and creceiveaddress != ''"> #{creceiveaddress} ,</if>
            <if test="crowno != null and crowno != ''"> #{crowno} ,</if>
            <if test="csourcebillcode != null and csourcebillcode != ''"> #{csourcebillcode} ,</if>
            <if test="csourcebillid != null and csourcebillid != ''"> #{csourcebillid} ,</if>
            <if test="csourcebillrow != null and csourcebillrow != ''"> #{csourcebillrow} ,</if>
            <if test="csourcebillrowno != null and csourcebillrowno != ''"> #{csourcebillrowno} ,</if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> #{cupsourcebillid} ,</if>
            <if test="cupsourcebillrowid != null and cupsourcebillrowid != ''"> #{cupsourcebillrowid} ,</if>
            <if test="cupsourcebilltype != null and cupsourcebilltype != ''"> #{cupsourcebilltype} ,</if>
            <if test="cwarehouseid != null and cwarehouseid != ''"> #{cwarehouseid} ,</if>
            <if test="dplanarrvdate != null and dplanarrvdate != ''"> #{dplanarrvdate} ,</if>
            <if test="dr != null and dr != ''"> #{dr} ,</if>
            <if test="forderrowstatus != null and forderrowstatus != ''"> #{forderrowstatus} ,</if>
            <if test="idiscounttaxtype != null and idiscounttaxtype != ''"> #{idiscounttaxtype} ,</if>
            <if test="naccumarrvnum != null and naccumarrvnum != ''"> #{naccumarrvnum} ,</if>
            <if test="naccuminvoicenum != null and naccuminvoicenum != ''"> #{naccuminvoicenum} ,</if>
            <if test="naccumstorenum != null and naccumstorenum != ''"> #{naccumstorenum} ,</if>
            <if test="naccumwastnum != null and naccumwastnum != ''"> #{naccumwastnum} ,</if>
            <if test="nassistnum != null and nassistnum != ''"> #{nassistnum} ,</if>
            <if test="nbackarrvnum != null and nbackarrvnum != ''"> #{nbackarrvnum} ,</if>
            <if test="nbackstorenum != null and nbackstorenum != ''"> #{nbackstorenum} ,</if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> #{ndiscountrate} ,</if>
            <if test="newver != null and newver != ''"> #{newver} ,</if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> #{nexchangeotobrate} ,</if>
            <if test="nmoney != null and nmoney != ''"> #{nmoney} ,</if>
            <if test="nordernum != null and nordernum != ''"> #{nordernum} ,</if>
            <if test="norgnettaxprice != null and norgnettaxprice != ''"> #{norgnettaxprice} ,</if>
            <if test="norgtaxprice != null and norgtaxprice != ''"> #{norgtaxprice} ,</if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> #{noriginalcurmny} ,</if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> #{noriginalcurprice} ,</if>
            <if test="noriginalnetprice != null and noriginalnetprice != ''"> #{noriginalnetprice} ,</if>
            <if test="noriginalsummny != null and noriginalsummny != ''"> #{noriginalsummny} ,</if>
            <if test="noriginaltaxmny != null and noriginaltaxmny != ''"> #{noriginaltaxmny} ,</if>
            <if test="nsummny != null and nsummny != ''"> #{nsummny} ,</if>
            <if test="ntaxmny != null and ntaxmny != ''"> #{ntaxmny} ,</if>
            <if test="ntaxrate != null and ntaxrate != ''"> #{ntaxrate} ,</if>
            <if test="pkCorp != null and pkCorp != ''"> #{pkCorp} ,</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="ts != null and ts != ''"> #{ts} ,</if>
            <if test="vdef1 != null and vdef1 != ''"> #{vdef1} ,</if>
            <if test="vdef10 != null and vdef10 != ''"> #{vdef10} ,</if>
            <if test="vdef11 != null and vdef11 != ''"> #{vdef11} ,</if>
            <if test="vdef12 != null and vdef12 != ''"> #{vdef12} ,</if>
            <if test="vdef13 != null and vdef13 != ''"> #{vdef13} ,</if>
            <if test="vdef14 != null and vdef14 != ''"> #{vdef14} ,</if>
            <if test="vdef15 != null and vdef15 != ''"> #{vdef15} ,</if>
            <if test="vdef16 != null and vdef16 != ''"> #{vdef16} ,</if>
            <if test="vdef17 != null and vdef17 != ''"> #{vdef17} ,</if>
            <if test="vdef18 != null and vdef18 != ''"> #{vdef18} ,</if>
            <if test="vdef19 != null and vdef19 != ''"> #{vdef19} ,</if>
            <if test="vdef2 != null and vdef2 != ''"> #{vdef2} ,</if>
            <if test="vdef20 != null and vdef20 != ''"> #{vdef20} ,</if>
            <if test="vdef3 != null and vdef3 != ''"> #{vdef3} ,</if>
            <if test="vdef4 != null and vdef4 != ''"> #{vdef4} ,</if>
            <if test="vdef5 != null and vdef5 != ''"> #{vdef5} ,</if>
            <if test="vdef6 != null and vdef6 != ''"> #{vdef6} ,</if>
            <if test="vdef7 != null and vdef7 != ''"> #{vdef7} ,</if>
            <if test="vdef8 != null and vdef8 != ''"> #{vdef8} ,</if>
            <if test="vdef9 != null and vdef9 != ''"> #{vdef9} ,</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="vmemo != null and vmemo != ''"> #{vmemo} ,</if>
            <if test="vpriceauditcode != null and vpriceauditcode != ''"> #{vpriceauditcode} ,</if>
            <if test="vproducenum != null and vproducenum != ''"> #{vproducenum} ,</if>
            <if test="writeoffassistnum != null and writeoffassistnum != ''"> #{writeoffassistnum} ,</if>
            <if test="writeoffnum != null and writeoffnum != ''"> #{writeoffnum} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from SC_ORDER_B a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="corderBid" useGeneratedKeys="true">
  insert into SC_ORDER_B(ACCINSTOREASSISTNUM, BISACTIVE, BOMVERSION, CASSISTUNIT, CBASEID, CCONTRACTID, CCONTRACTRCODE, CCONTRACTROWID, CCURRENCYTYPEID, CMANGID, COPERATOR, CORDERID, CORDERSOURCE, CPRICEAUDIT_BB1ID, CPRICEAUDIT_BID, CPRICEAUDITID, CPROJECTID, CPROJECTPHASEID, CRECEIVEADDRESS, CROWNO, CSOURCEBILLCODE, CSOURCEBILLID, CSOURCEBILLROW, CSOURCEBILLROWNO, CUPSOURCEBILLID, CUPSOURCEBILLROWID, CUPSOURCEBILLTYPE, CWAREHOUSEID, DPLANARRVDATE, DR, FORDERROWSTATUS, IDISCOUNTTAXTYPE, NACCUMARRVNUM, NACCUMINVOICENUM, NACCUMSTORENUM, NACCUMWASTNUM, NASSISTNUM, NBACKARRVNUM, NBACKSTORENUM, NDISCOUNTRATE, NEWVER, NEXCHANGEOTOBRATE, NMONEY, NORDERNUM, NORGNETTAXPRICE, NORGTAXPRICE, NORIGINALCURMNY, NORIGINALCURPRICE, NORIGINALNETPRICE, NORIGINALSUMMNY, NORIGINALTAXMNY, NSUMMNY, NTAXMNY, NTAXRATE, PK_CORP, 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, TS, VDEF1, VDEF10, VDEF11, VDEF12, VDEF13, VDEF14, VDEF15, VDEF16, VDEF17, VDEF18, VDEF19, VDEF2, VDEF20, VDEF3, VDEF4, VDEF5, VDEF6, VDEF7, VDEF8, VDEF9, VFREE1, VFREE2, VFREE3, VFREE4, VFREE5, VMEMO, VPRICEAUDITCODE, VPRODUCENUM, WRITEOFFASSISTNUM, WRITEOFFNUM,  sts) 
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.accinstoreassistnum},#{entity.bisactive},#{entity.bomversion},#{entity.cassistunit},#{entity.cbaseid},#{entity.ccontractid},#{entity.ccontractrcode},#{entity.ccontractrowid},#{entity.ccurrencytypeid},#{entity.cmangid},#{entity.coperator},#{entity.corderid},#{entity.cordersource},#{entity.cpriceauditBb1id},#{entity.cpriceauditBid},#{entity.cpriceauditid},#{entity.cprojectid},#{entity.cprojectphaseid},#{entity.creceiveaddress},#{entity.crowno},#{entity.csourcebillcode},#{entity.csourcebillid},#{entity.csourcebillrow},#{entity.csourcebillrowno},#{entity.cupsourcebillid},#{entity.cupsourcebillrowid},#{entity.cupsourcebilltype},#{entity.cwarehouseid},#{entity.dplanarrvdate},#{entity.dr},#{entity.forderrowstatus},#{entity.idiscounttaxtype},#{entity.naccumarrvnum},#{entity.naccuminvoicenum},#{entity.naccumstorenum},#{entity.naccumwastnum},#{entity.nassistnum},#{entity.nbackarrvnum},#{entity.nbackstorenum},#{entity.ndiscountrate},#{entity.newver},#{entity.nexchangeotobrate},#{entity.nmoney},#{entity.nordernum},#{entity.norgnettaxprice},#{entity.norgtaxprice},#{entity.noriginalcurmny},#{entity.noriginalcurprice},#{entity.noriginalnetprice},#{entity.noriginalsummny},#{entity.noriginaltaxmny},#{entity.nsummny},#{entity.ntaxmny},#{entity.ntaxrate},#{entity.pkCorp},#{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.ts},#{entity.vdef1},#{entity.vdef10},#{entity.vdef11},#{entity.vdef12},#{entity.vdef13},#{entity.vdef14},#{entity.vdef15},#{entity.vdef16},#{entity.vdef17},#{entity.vdef18},#{entity.vdef19},#{entity.vdef2},#{entity.vdef20},#{entity.vdef3},#{entity.vdef4},#{entity.vdef5},#{entity.vdef6},#{entity.vdef7},#{entity.vdef8},#{entity.vdef9},#{entity.vfree1},#{entity.vfree2},#{entity.vfree3},#{entity.vfree4},#{entity.vfree5},#{entity.vmemo},#{entity.vpriceauditcode},#{entity.vproducenum},#{entity.writeoffassistnum},#{entity.writeoffnum}, 'Y')
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="corderBid" useGeneratedKeys="true">
    insert into SC_ORDER_B(ACCINSTOREASSISTNUM, BISACTIVE, BOMVERSION, CASSISTUNIT, CBASEID, CCONTRACTID, CCONTRACTRCODE, CCONTRACTROWID, CCURRENCYTYPEID, CMANGID, COPERATOR, CORDERID, CORDERSOURCE, CPRICEAUDIT_BB1ID, CPRICEAUDIT_BID, CPRICEAUDITID, CPROJECTID, CPROJECTPHASEID, CRECEIVEADDRESS, CROWNO, CSOURCEBILLCODE, CSOURCEBILLID, CSOURCEBILLROW, CSOURCEBILLROWNO, CUPSOURCEBILLID, CUPSOURCEBILLROWID, CUPSOURCEBILLTYPE, CWAREHOUSEID, DPLANARRVDATE, DR, FORDERROWSTATUS, IDISCOUNTTAXTYPE, NACCUMARRVNUM, NACCUMINVOICENUM, NACCUMSTORENUM, NACCUMWASTNUM, NASSISTNUM, NBACKARRVNUM, NBACKSTORENUM, NDISCOUNTRATE, NEWVER, NEXCHANGEOTOBRATE, NMONEY, NORDERNUM, NORGNETTAXPRICE, NORGTAXPRICE, NORIGINALCURMNY, NORIGINALCURPRICE, NORIGINALNETPRICE, NORIGINALSUMMNY, NORIGINALTAXMNY, NSUMMNY, NTAXMNY, NTAXRATE, PK_CORP, 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, TS, VDEF1, VDEF10, VDEF11, VDEF12, VDEF13, VDEF14, VDEF15, VDEF16, VDEF17, VDEF18, VDEF19, VDEF2, VDEF20, VDEF3, VDEF4, VDEF5, VDEF6, VDEF7, VDEF8, VDEF9, VFREE1, VFREE2, VFREE3, VFREE4, VFREE5, VMEMO, VPRICEAUDITCODE, VPRODUCENUM, WRITEOFFASSISTNUM, WRITEOFFNUM)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.accinstoreassistnum},#{entity.bisactive},#{entity.bomversion},#{entity.cassistunit},#{entity.cbaseid},#{entity.ccontractid},#{entity.ccontractrcode},#{entity.ccontractrowid},#{entity.ccurrencytypeid},#{entity.cmangid},#{entity.coperator},#{entity.corderid},#{entity.cordersource},#{entity.cpriceauditBb1id},#{entity.cpriceauditBid},#{entity.cpriceauditid},#{entity.cprojectid},#{entity.cprojectphaseid},#{entity.creceiveaddress},#{entity.crowno},#{entity.csourcebillcode},#{entity.csourcebillid},#{entity.csourcebillrow},#{entity.csourcebillrowno},#{entity.cupsourcebillid},#{entity.cupsourcebillrowid},#{entity.cupsourcebilltype},#{entity.cwarehouseid},#{entity.dplanarrvdate},#{entity.dr},#{entity.forderrowstatus},#{entity.idiscounttaxtype},#{entity.naccumarrvnum},#{entity.naccuminvoicenum},#{entity.naccumstorenum},#{entity.naccumwastnum},#{entity.nassistnum},#{entity.nbackarrvnum},#{entity.nbackstorenum},#{entity.ndiscountrate},#{entity.newver},#{entity.nexchangeotobrate},#{entity.nmoney},#{entity.nordernum},#{entity.norgnettaxprice},#{entity.norgtaxprice},#{entity.noriginalcurmny},#{entity.noriginalcurprice},#{entity.noriginalnetprice},#{entity.noriginalsummny},#{entity.noriginaltaxmny},#{entity.nsummny},#{entity.ntaxmny},#{entity.ntaxrate},#{entity.pkCorp},#{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.ts},#{entity.vdef1},#{entity.vdef10},#{entity.vdef11},#{entity.vdef12},#{entity.vdef13},#{entity.vdef14},#{entity.vdef15},#{entity.vdef16},#{entity.vdef17},#{entity.vdef18},#{entity.vdef19},#{entity.vdef2},#{entity.vdef20},#{entity.vdef3},#{entity.vdef4},#{entity.vdef5},#{entity.vdef6},#{entity.vdef7},#{entity.vdef8},#{entity.vdef9},#{entity.vfree1},#{entity.vfree2},#{entity.vfree3},#{entity.vfree4},#{entity.vfree5},#{entity.vmemo},#{entity.vpriceauditcode},#{entity.vproducenum},#{entity.writeoffassistnum},#{entity.writeoffnum})
    </foreach>
    on duplicate key update
    ACCINSTOREASSISTNUM = values(ACCINSTOREASSISTNUM),
    BISACTIVE = values(BISACTIVE),
    BOMVERSION = values(BOMVERSION),
    CASSISTUNIT = values(CASSISTUNIT),
    CBASEID = values(CBASEID),
    CCONTRACTID = values(CCONTRACTID),
    CCONTRACTRCODE = values(CCONTRACTRCODE),
    CCONTRACTROWID = values(CCONTRACTROWID),
    CCURRENCYTYPEID = values(CCURRENCYTYPEID),
    CMANGID = values(CMANGID),
    COPERATOR = values(COPERATOR),
    CORDERID = values(CORDERID),
    CORDERSOURCE = values(CORDERSOURCE),
    CPRICEAUDIT_BB1ID = values(CPRICEAUDIT_BB1ID),
    CPRICEAUDIT_BID = values(CPRICEAUDIT_BID),
    CPRICEAUDITID = values(CPRICEAUDITID),
    CPROJECTID = values(CPROJECTID),
    CPROJECTPHASEID = values(CPROJECTPHASEID),
    CRECEIVEADDRESS = values(CRECEIVEADDRESS),
    CROWNO = values(CROWNO),
    CSOURCEBILLCODE = values(CSOURCEBILLCODE),
    CSOURCEBILLID = values(CSOURCEBILLID),
    CSOURCEBILLROW = values(CSOURCEBILLROW),
    CSOURCEBILLROWNO = values(CSOURCEBILLROWNO),
    CUPSOURCEBILLID = values(CUPSOURCEBILLID),
    CUPSOURCEBILLROWID = values(CUPSOURCEBILLROWID),
    CUPSOURCEBILLTYPE = values(CUPSOURCEBILLTYPE),
    CWAREHOUSEID = values(CWAREHOUSEID),
    DPLANARRVDATE = values(DPLANARRVDATE),
    DR = values(DR),
    FORDERROWSTATUS = values(FORDERROWSTATUS),
    IDISCOUNTTAXTYPE = values(IDISCOUNTTAXTYPE),
    NACCUMARRVNUM = values(NACCUMARRVNUM),
    NACCUMINVOICENUM = values(NACCUMINVOICENUM),
    NACCUMSTORENUM = values(NACCUMSTORENUM),
    NACCUMWASTNUM = values(NACCUMWASTNUM),
    NASSISTNUM = values(NASSISTNUM),
    NBACKARRVNUM = values(NBACKARRVNUM),
    NBACKSTORENUM = values(NBACKSTORENUM),
    NDISCOUNTRATE = values(NDISCOUNTRATE),
    NEWVER = values(NEWVER),
    NEXCHANGEOTOBRATE = values(NEXCHANGEOTOBRATE),
    NMONEY = values(NMONEY),
    NORDERNUM = values(NORDERNUM),
    NORGNETTAXPRICE = values(NORGNETTAXPRICE),
    NORGTAXPRICE = values(NORGTAXPRICE),
    NORIGINALCURMNY = values(NORIGINALCURMNY),
    NORIGINALCURPRICE = values(NORIGINALCURPRICE),
    NORIGINALNETPRICE = values(NORIGINALNETPRICE),
    NORIGINALSUMMNY = values(NORIGINALSUMMNY),
    NORIGINALTAXMNY = values(NORIGINALTAXMNY),
    NSUMMNY = values(NSUMMNY),
    NTAXMNY = values(NTAXMNY),
    NTAXRATE = values(NTAXRATE),
    PK_CORP = values(PK_CORP),
    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),
    TS = values(TS),
    VDEF1 = values(VDEF1),
    VDEF10 = values(VDEF10),
    VDEF11 = values(VDEF11),
    VDEF12 = values(VDEF12),
    VDEF13 = values(VDEF13),
    VDEF14 = values(VDEF14),
    VDEF15 = values(VDEF15),
    VDEF16 = values(VDEF16),
    VDEF17 = values(VDEF17),
    VDEF18 = values(VDEF18),
    VDEF19 = values(VDEF19),
    VDEF2 = values(VDEF2),
    VDEF20 = values(VDEF20),
    VDEF3 = values(VDEF3),
    VDEF4 = values(VDEF4),
    VDEF5 = values(VDEF5),
    VDEF6 = values(VDEF6),
    VDEF7 = values(VDEF7),
    VDEF8 = values(VDEF8),
    VDEF9 = values(VDEF9),
    VFREE1 = values(VFREE1),
    VFREE2 = values(VFREE2),
    VFREE3 = values(VFREE3),
    VFREE4 = values(VFREE4),
    VFREE5 = values(VFREE5),
    VMEMO = values(VMEMO),
    VPRICEAUDITCODE = values(VPRICEAUDITCODE),
    VPRODUCENUM = values(VPRODUCENUM),
    WRITEOFFASSISTNUM = values(WRITEOFFASSISTNUM),
    WRITEOFFNUM = values(WRITEOFFNUM)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderBEntity" >
update SC_ORDER_B  set
<trim suffix="" suffixOverrides=",">
  <if test="accinstoreassistnum != null and accinstoreassistnum != ''"> ACCINSTOREASSISTNUM = #{accinstoreassistnum},</if>
  <if test="bisactive != null and bisactive != ''"> BISACTIVE = #{bisactive},</if>
  <if test="bomversion != null and bomversion != ''"> BOMVERSION = #{bomversion},</if>
  <if test="cassistunit != null and cassistunit != ''"> CASSISTUNIT = #{cassistunit},</if>
  <if test="cbaseid != null and cbaseid != ''"> CBASEID = #{cbaseid},</if>
  <if test="ccontractid != null and ccontractid != ''"> CCONTRACTID = #{ccontractid},</if>
  <if test="ccontractrcode != null and ccontractrcode != ''"> CCONTRACTRCODE = #{ccontractrcode},</if>
  <if test="ccontractrowid != null and ccontractrowid != ''"> CCONTRACTROWID = #{ccontractrowid},</if>
  <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> CCURRENCYTYPEID = #{ccurrencytypeid},</if>
  <if test="cmangid != null and cmangid != ''"> CMANGID = #{cmangid},</if>
  <if test="coperator != null and coperator != ''"> COPERATOR = #{coperator},</if>
  <if test="corderid != null and corderid != ''"> CORDERID = #{corderid},</if>
  <if test="cordersource != null and cordersource != ''"> CORDERSOURCE = #{cordersource},</if>
  <if test="cpriceauditBb1id != null and cpriceauditBb1id != ''"> CPRICEAUDIT_BB1ID = #{cpriceauditBb1id},</if>
  <if test="cpriceauditBid != null and cpriceauditBid != ''"> CPRICEAUDIT_BID = #{cpriceauditBid},</if>
  <if test="cpriceauditid != null and cpriceauditid != ''"> CPRICEAUDITID = #{cpriceauditid},</if>
  <if test="cprojectid != null and cprojectid != ''"> CPROJECTID = #{cprojectid},</if>
  <if test="cprojectphaseid != null and cprojectphaseid != ''"> CPROJECTPHASEID = #{cprojectphaseid},</if>
  <if test="creceiveaddress != null and creceiveaddress != ''"> CRECEIVEADDRESS = #{creceiveaddress},</if>
  <if test="crowno != null and crowno != ''"> CROWNO = #{crowno},</if>
  <if test="csourcebillcode != null and csourcebillcode != ''"> CSOURCEBILLCODE = #{csourcebillcode},</if>
  <if test="csourcebillid != null and csourcebillid != ''"> CSOURCEBILLID = #{csourcebillid},</if>
  <if test="csourcebillrow != null and csourcebillrow != ''"> CSOURCEBILLROW = #{csourcebillrow},</if>
  <if test="csourcebillrowno != null and csourcebillrowno != ''"> CSOURCEBILLROWNO = #{csourcebillrowno},</if>
  <if test="cupsourcebillid != null and cupsourcebillid != ''"> CUPSOURCEBILLID = #{cupsourcebillid},</if>
  <if test="cupsourcebillrowid != null and cupsourcebillrowid != ''"> CUPSOURCEBILLROWID = #{cupsourcebillrowid},</if>
  <if test="cupsourcebilltype != null and cupsourcebilltype != ''"> CUPSOURCEBILLTYPE = #{cupsourcebilltype},</if>
  <if test="cwarehouseid != null and cwarehouseid != ''"> CWAREHOUSEID = #{cwarehouseid},</if>
  <if test="dplanarrvdate != null and dplanarrvdate != ''"> DPLANARRVDATE = #{dplanarrvdate},</if>
  <if test="dr != null and dr != ''"> DR = #{dr},</if>
  <if test="forderrowstatus != null and forderrowstatus != ''"> FORDERROWSTATUS = #{forderrowstatus},</if>
  <if test="idiscounttaxtype != null and idiscounttaxtype != ''"> IDISCOUNTTAXTYPE = #{idiscounttaxtype},</if>
  <if test="naccumarrvnum != null and naccumarrvnum != ''"> NACCUMARRVNUM = #{naccumarrvnum},</if>
  <if test="naccuminvoicenum != null and naccuminvoicenum != ''"> NACCUMINVOICENUM = #{naccuminvoicenum},</if>
  <if test="naccumstorenum != null and naccumstorenum != ''"> NACCUMSTORENUM = #{naccumstorenum},</if>
  <if test="naccumwastnum != null and naccumwastnum != ''"> NACCUMWASTNUM = #{naccumwastnum},</if>
  <if test="nassistnum != null and nassistnum != ''"> NASSISTNUM = #{nassistnum},</if>
  <if test="nbackarrvnum != null and nbackarrvnum != ''"> NBACKARRVNUM = #{nbackarrvnum},</if>
  <if test="nbackstorenum != null and nbackstorenum != ''"> NBACKSTORENUM = #{nbackstorenum},</if>
  <if test="ndiscountrate != null and ndiscountrate != ''"> NDISCOUNTRATE = #{ndiscountrate},</if>
  <if test="newver != null and newver != ''"> NEWVER = #{newver},</if>
  <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> NEXCHANGEOTOBRATE = #{nexchangeotobrate},</if>
  <if test="nmoney != null and nmoney != ''"> NMONEY = #{nmoney},</if>
  <if test="nordernum != null and nordernum != ''"> NORDERNUM = #{nordernum},</if>
  <if test="norgnettaxprice != null and norgnettaxprice != ''"> NORGNETTAXPRICE = #{norgnettaxprice},</if>
  <if test="norgtaxprice != null and norgtaxprice != ''"> NORGTAXPRICE = #{norgtaxprice},</if>
  <if test="noriginalcurmny != null and noriginalcurmny != ''"> NORIGINALCURMNY = #{noriginalcurmny},</if>
  <if test="noriginalcurprice != null and noriginalcurprice != ''"> NORIGINALCURPRICE = #{noriginalcurprice},</if>
  <if test="noriginalnetprice != null and noriginalnetprice != ''"> NORIGINALNETPRICE = #{noriginalnetprice},</if>
  <if test="noriginalsummny != null and noriginalsummny != ''"> NORIGINALSUMMNY = #{noriginalsummny},</if>
  <if test="noriginaltaxmny != null and noriginaltaxmny != ''"> NORIGINALTAXMNY = #{noriginaltaxmny},</if>
  <if test="nsummny != null and nsummny != ''"> NSUMMNY = #{nsummny},</if>
  <if test="ntaxmny != null and ntaxmny != ''"> NTAXMNY = #{ntaxmny},</if>
  <if test="ntaxrate != null and ntaxrate != ''"> NTAXRATE = #{ntaxrate},</if>
  <if test="pkCorp != null and pkCorp != ''"> PK_CORP = #{pkCorp},</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="ts != null and ts != ''"> TS = #{ts},</if>
  <if test="vdef1 != null and vdef1 != ''"> VDEF1 = #{vdef1},</if>
  <if test="vdef10 != null and vdef10 != ''"> VDEF10 = #{vdef10},</if>
  <if test="vdef11 != null and vdef11 != ''"> VDEF11 = #{vdef11},</if>
  <if test="vdef12 != null and vdef12 != ''"> VDEF12 = #{vdef12},</if>
  <if test="vdef13 != null and vdef13 != ''"> VDEF13 = #{vdef13},</if>
  <if test="vdef14 != null and vdef14 != ''"> VDEF14 = #{vdef14},</if>
  <if test="vdef15 != null and vdef15 != ''"> VDEF15 = #{vdef15},</if>
  <if test="vdef16 != null and vdef16 != ''"> VDEF16 = #{vdef16},</if>
  <if test="vdef17 != null and vdef17 != ''"> VDEF17 = #{vdef17},</if>
  <if test="vdef18 != null and vdef18 != ''"> VDEF18 = #{vdef18},</if>
  <if test="vdef19 != null and vdef19 != ''"> VDEF19 = #{vdef19},</if>
  <if test="vdef2 != null and vdef2 != ''"> VDEF2 = #{vdef2},</if>
  <if test="vdef20 != null and vdef20 != ''"> VDEF20 = #{vdef20},</if>
  <if test="vdef3 != null and vdef3 != ''"> VDEF3 = #{vdef3},</if>
  <if test="vdef4 != null and vdef4 != ''"> VDEF4 = #{vdef4},</if>
  <if test="vdef5 != null and vdef5 != ''"> VDEF5 = #{vdef5},</if>
  <if test="vdef6 != null and vdef6 != ''"> VDEF6 = #{vdef6},</if>
  <if test="vdef7 != null and vdef7 != ''"> VDEF7 = #{vdef7},</if>
  <if test="vdef8 != null and vdef8 != ''"> VDEF8 = #{vdef8},</if>
  <if test="vdef9 != null and vdef9 != ''"> VDEF9 = #{vdef9},</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="vmemo != null and vmemo != ''"> VMEMO = #{vmemo},</if>
  <if test="vpriceauditcode != null and vpriceauditcode != ''"> VPRICEAUDITCODE = #{vpriceauditcode},</if>
  <if test="vproducenum != null and vproducenum != ''"> VPRODUCENUM = #{vproducenum},</if>
  <if test="writeoffassistnum != null and writeoffassistnum != ''"> WRITEOFFASSISTNUM = #{writeoffassistnum},</if>
  <if test="writeoffnum != null and writeoffnum != ''"> WRITEOFFNUM = #{writeoffnum},</if>
</trim>
where CORDER_BID = #{corderBid}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderBEntity" >
update SC_ORDER_B  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where CORDER_BID = #{corderBid}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderBEntity" >
update SC_ORDER_B  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 <trim prefix="where" prefixOverrides="and"> 
        <if test="accinstoreassistnum != null and accinstoreassistnum != ''"> and ACCINSTOREASSISTNUM = #{accinstoreassistnum} </if>
            <if test="bisactive != null and bisactive != ''"> and BISACTIVE = #{bisactive} </if>
            <if test="bomversion != null and bomversion != ''"> and BOMVERSION = #{bomversion} </if>
            <if test="cassistunit != null and cassistunit != ''"> and CASSISTUNIT = #{cassistunit} </if>
            <if test="cbaseid != null and cbaseid != ''"> and CBASEID = #{cbaseid} </if>
            <if test="ccontractid != null and ccontractid != ''"> and CCONTRACTID = #{ccontractid} </if>
            <if test="ccontractrcode != null and ccontractrcode != ''"> and CCONTRACTRCODE = #{ccontractrcode} </if>
            <if test="ccontractrowid != null and ccontractrowid != ''"> and CCONTRACTROWID = #{ccontractrowid} </if>
            <if test="ccurrencytypeid != null and ccurrencytypeid != ''"> and CCURRENCYTYPEID = #{ccurrencytypeid} </if>
            <if test="cmangid != null and cmangid != ''"> and CMANGID = #{cmangid} </if>
            <if test="coperator != null and coperator != ''"> and COPERATOR = #{coperator} </if>
            <if test="corderBid != null and corderBid != ''"> and CORDER_BID = #{corderBid} </if>
            <if test="corderid != null and corderid != ''"> and CORDERID = #{corderid} </if>
            <if test="cordersource != null and cordersource != ''"> and CORDERSOURCE = #{cordersource} </if>
            <if test="cpriceauditBb1id != null and cpriceauditBb1id != ''"> and CPRICEAUDIT_BB1ID = #{cpriceauditBb1id} </if>
            <if test="cpriceauditBid != null and cpriceauditBid != ''"> and CPRICEAUDIT_BID = #{cpriceauditBid} </if>
            <if test="cpriceauditid != null and cpriceauditid != ''"> and CPRICEAUDITID = #{cpriceauditid} </if>
            <if test="cprojectid != null and cprojectid != ''"> and CPROJECTID = #{cprojectid} </if>
            <if test="cprojectphaseid != null and cprojectphaseid != ''"> and CPROJECTPHASEID = #{cprojectphaseid} </if>
            <if test="creceiveaddress != null and creceiveaddress != ''"> and CRECEIVEADDRESS = #{creceiveaddress} </if>
            <if test="crowno != null and crowno != ''"> and CROWNO = #{crowno} </if>
            <if test="csourcebillcode != null and csourcebillcode != ''"> and CSOURCEBILLCODE = #{csourcebillcode} </if>
            <if test="csourcebillid != null and csourcebillid != ''"> and CSOURCEBILLID = #{csourcebillid} </if>
            <if test="csourcebillrow != null and csourcebillrow != ''"> and CSOURCEBILLROW = #{csourcebillrow} </if>
            <if test="csourcebillrowno != null and csourcebillrowno != ''"> and CSOURCEBILLROWNO = #{csourcebillrowno} </if>
            <if test="cupsourcebillid != null and cupsourcebillid != ''"> and CUPSOURCEBILLID = #{cupsourcebillid} </if>
            <if test="cupsourcebillrowid != null and cupsourcebillrowid != ''"> and CUPSOURCEBILLROWID = #{cupsourcebillrowid} </if>
            <if test="cupsourcebilltype != null and cupsourcebilltype != ''"> and CUPSOURCEBILLTYPE = #{cupsourcebilltype} </if>
            <if test="cwarehouseid != null and cwarehouseid != ''"> and CWAREHOUSEID = #{cwarehouseid} </if>
            <if test="dplanarrvdate != null and dplanarrvdate != ''"> and DPLANARRVDATE = #{dplanarrvdate} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="forderrowstatus != null and forderrowstatus != ''"> and FORDERROWSTATUS = #{forderrowstatus} </if>
            <if test="idiscounttaxtype != null and idiscounttaxtype != ''"> and IDISCOUNTTAXTYPE = #{idiscounttaxtype} </if>
            <if test="naccumarrvnum != null and naccumarrvnum != ''"> and NACCUMARRVNUM = #{naccumarrvnum} </if>
            <if test="naccuminvoicenum != null and naccuminvoicenum != ''"> and NACCUMINVOICENUM = #{naccuminvoicenum} </if>
            <if test="naccumstorenum != null and naccumstorenum != ''"> and NACCUMSTORENUM = #{naccumstorenum} </if>
            <if test="naccumwastnum != null and naccumwastnum != ''"> and NACCUMWASTNUM = #{naccumwastnum} </if>
            <if test="nassistnum != null and nassistnum != ''"> and NASSISTNUM = #{nassistnum} </if>
            <if test="nbackarrvnum != null and nbackarrvnum != ''"> and NBACKARRVNUM = #{nbackarrvnum} </if>
            <if test="nbackstorenum != null and nbackstorenum != ''"> and NBACKSTORENUM = #{nbackstorenum} </if>
            <if test="ndiscountrate != null and ndiscountrate != ''"> and NDISCOUNTRATE = #{ndiscountrate} </if>
            <if test="newver != null and newver != ''"> and NEWVER = #{newver} </if>
            <if test="nexchangeotobrate != null and nexchangeotobrate != ''"> and NEXCHANGEOTOBRATE = #{nexchangeotobrate} </if>
            <if test="nmoney != null and nmoney != ''"> and NMONEY = #{nmoney} </if>
            <if test="nordernum != null and nordernum != ''"> and NORDERNUM = #{nordernum} </if>
            <if test="norgnettaxprice != null and norgnettaxprice != ''"> and NORGNETTAXPRICE = #{norgnettaxprice} </if>
            <if test="norgtaxprice != null and norgtaxprice != ''"> and NORGTAXPRICE = #{norgtaxprice} </if>
            <if test="noriginalcurmny != null and noriginalcurmny != ''"> and NORIGINALCURMNY = #{noriginalcurmny} </if>
            <if test="noriginalcurprice != null and noriginalcurprice != ''"> and NORIGINALCURPRICE = #{noriginalcurprice} </if>
            <if test="noriginalnetprice != null and noriginalnetprice != ''"> and NORIGINALNETPRICE = #{noriginalnetprice} </if>
            <if test="noriginalsummny != null and noriginalsummny != ''"> and NORIGINALSUMMNY = #{noriginalsummny} </if>
            <if test="noriginaltaxmny != null and noriginaltaxmny != ''"> and NORIGINALTAXMNY = #{noriginaltaxmny} </if>
            <if test="nsummny != null and nsummny != ''"> and NSUMMNY = #{nsummny} </if>
            <if test="ntaxmny != null and ntaxmny != ''"> and NTAXMNY = #{ntaxmny} </if>
            <if test="ntaxrate != null and ntaxrate != ''"> and NTAXRATE = #{ntaxrate} </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </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="ts != null and ts != ''"> and TS = #{ts} </if>
            <if test="vdef1 != null and vdef1 != ''"> and VDEF1 = #{vdef1} </if>
            <if test="vdef10 != null and vdef10 != ''"> and VDEF10 = #{vdef10} </if>
            <if test="vdef11 != null and vdef11 != ''"> and VDEF11 = #{vdef11} </if>
            <if test="vdef12 != null and vdef12 != ''"> and VDEF12 = #{vdef12} </if>
            <if test="vdef13 != null and vdef13 != ''"> and VDEF13 = #{vdef13} </if>
            <if test="vdef14 != null and vdef14 != ''"> and VDEF14 = #{vdef14} </if>
            <if test="vdef15 != null and vdef15 != ''"> and VDEF15 = #{vdef15} </if>
            <if test="vdef16 != null and vdef16 != ''"> and VDEF16 = #{vdef16} </if>
            <if test="vdef17 != null and vdef17 != ''"> and VDEF17 = #{vdef17} </if>
            <if test="vdef18 != null and vdef18 != ''"> and VDEF18 = #{vdef18} </if>
            <if test="vdef19 != null and vdef19 != ''"> and VDEF19 = #{vdef19} </if>
            <if test="vdef2 != null and vdef2 != ''"> and VDEF2 = #{vdef2} </if>
            <if test="vdef20 != null and vdef20 != ''"> and VDEF20 = #{vdef20} </if>
            <if test="vdef3 != null and vdef3 != ''"> and VDEF3 = #{vdef3} </if>
            <if test="vdef4 != null and vdef4 != ''"> and VDEF4 = #{vdef4} </if>
            <if test="vdef5 != null and vdef5 != ''"> and VDEF5 = #{vdef5} </if>
            <if test="vdef6 != null and vdef6 != ''"> and VDEF6 = #{vdef6} </if>
            <if test="vdef7 != null and vdef7 != ''"> and VDEF7 = #{vdef7} </if>
            <if test="vdef8 != null and vdef8 != ''"> and VDEF8 = #{vdef8} </if>
            <if test="vdef9 != null and vdef9 != ''"> and VDEF9 = #{vdef9} </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="vmemo != null and vmemo != ''"> and VMEMO = #{vmemo} </if>
            <if test="vpriceauditcode != null and vpriceauditcode != ''"> and VPRICEAUDITCODE = #{vpriceauditcode} </if>
            <if test="vproducenum != null and vproducenum != ''"> and VPRODUCENUM = #{vproducenum} </if>
            <if test="writeoffassistnum != null and writeoffassistnum != ''"> and WRITEOFFASSISTNUM = #{writeoffassistnum} </if>
            <if test="writeoffnum != null and writeoffnum != ''"> and WRITEOFFNUM = #{writeoffnum} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from SC_ORDER_B where CORDER_BID = #{corderBid}
</delete>

</mapper>

