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

    <resultMap id="get-ScOrderEntity-result" type="com.hzya.frame.plugin.lets.entity.ScOrderEntity" >
       <result property="caccountbankid" column="CACCOUNTBANKID" jdbcType="VARCHAR"/>
           <result property="caccountyear" column="CACCOUNTYEAR" jdbcType="VARCHAR"/>
           <result property="cauditpsn" column="CAUDITPSN" jdbcType="VARCHAR"/>
           <result property="cbiztype" column="CBIZTYPE" jdbcType="VARCHAR"/>
           <result property="cdeptid" column="CDEPTID" jdbcType="VARCHAR"/>
           <result property="cemployeeid" column="CEMPLOYEEID" jdbcType="VARCHAR"/>
           <result property="cgiveinvoicevendor" column="CGIVEINVOICEVENDOR" jdbcType="VARCHAR"/>
           <result property="coperator" column="COPERATOR" jdbcType="VARCHAR"/>
           <result property="corderid" column="CORDERID" jdbcType="VARCHAR"/>
           <result property="cpurorganization" column="CPURORGANIZATION" jdbcType="VARCHAR"/>
           <result property="creciever" column="CRECIEVER" jdbcType="VARCHAR"/>
           <result property="ctermprotocolid" column="CTERMPROTOCOLID" jdbcType="VARCHAR"/>
           <result property="ctransmodeid" column="CTRANSMODEID" jdbcType="VARCHAR"/>
           <result property="cvendorid" column="CVENDORID" jdbcType="VARCHAR"/>
           <result property="cvendormangid" column="CVENDORMANGID" jdbcType="VARCHAR"/>
           <result property="cwareid" column="CWAREID" jdbcType="VARCHAR"/>
           <result property="dauditdate" column="DAUDITDATE" jdbcType="VARCHAR"/>
           <result property="dorderdate" column="DORDERDATE" jdbcType="VARCHAR"/>
           <result property="dr" column="DR" jdbcType="VARCHAR"/>
           <result property="ibillstatus" column="IBILLSTATUS" jdbcType="VARCHAR"/>
           <result property="iprintcount" column="IPRINTCOUNT" 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="taudittime" column="TAUDITTIME" jdbcType="VARCHAR"/>
           <result property="tlastmaketime" column="TLASTMAKETIME" jdbcType="VARCHAR"/>
           <result property="tmaketime" column="TMAKETIME" 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="vmemo" column="VMEMO" jdbcType="VARCHAR"/>
           <result property="vordercode" column="VORDERCODE" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "ScOrderEntity_Base_Column_List">
        CACCOUNTBANKID
       ,CACCOUNTYEAR 
        ,CAUDITPSN 
        ,CBIZTYPE 
        ,CDEPTID 
        ,CEMPLOYEEID 
        ,CGIVEINVOICEVENDOR 
        ,COPERATOR 
        ,CORDERID 
        ,CPURORGANIZATION 
        ,CRECIEVER 
        ,CTERMPROTOCOLID 
        ,CTRANSMODEID 
        ,CVENDORID 
        ,CVENDORMANGID 
        ,CWAREID 
        ,DAUDITDATE 
        ,DORDERDATE 
        ,DR 
        ,IBILLSTATUS 
        ,IPRINTCOUNT 
        ,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 
        ,TAUDITTIME 
        ,TLASTMAKETIME 
        ,TMAKETIME 
        ,TS 
        ,VDEF1 
        ,VDEF10 
        ,VDEF11 
        ,VDEF12 
        ,VDEF13 
        ,VDEF14 
        ,VDEF15 
        ,VDEF16 
        ,VDEF17 
        ,VDEF18 
        ,VDEF19 
        ,VDEF2 
        ,VDEF20 
        ,VDEF3 
        ,VDEF4 
        ,VDEF5 
        ,VDEF6 
        ,VDEF7 
        ,VDEF8 
        ,VDEF9 
        ,VMEMO 
        ,VORDERCODE 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-ScOrderEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderEntity">
    select
    <include refid="ScOrderEntity_Base_Column_List" />
    from SC_ORDER
    <trim prefix="where" prefixOverrides="and"> 
        <if test="caccountbankid != null and caccountbankid != ''"> and CACCOUNTBANKID = #{caccountbankid} </if>
            <if test="caccountyear != null and caccountyear != ''"> and CACCOUNTYEAR = #{caccountyear} </if>
            <if test="cauditpsn != null and cauditpsn != ''"> and CAUDITPSN = #{cauditpsn} </if>
            <if test="cbiztype != null and cbiztype != ''"> and CBIZTYPE = #{cbiztype} </if>
            <if test="cdeptid != null and cdeptid != ''"> and CDEPTID = #{cdeptid} </if>
            <if test="cemployeeid != null and cemployeeid != ''"> and CEMPLOYEEID = #{cemployeeid} </if>
            <if test="cgiveinvoicevendor != null and cgiveinvoicevendor != ''"> and CGIVEINVOICEVENDOR = #{cgiveinvoicevendor} </if>
            <if test="coperator != null and coperator != ''"> and COPERATOR = #{coperator} </if>
            <if test="corderid != null and corderid != ''"> and CORDERID = #{corderid} </if>
            <if test="cpurorganization != null and cpurorganization != ''"> and CPURORGANIZATION = #{cpurorganization} </if>
            <if test="creciever != null and creciever != ''"> and CRECIEVER = #{creciever} </if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''"> and CTERMPROTOCOLID = #{ctermprotocolid} </if>
            <if test="ctransmodeid != null and ctransmodeid != ''"> and CTRANSMODEID = #{ctransmodeid} </if>
            <if test="cvendorid != null and cvendorid != ''"> and CVENDORID = #{cvendorid} </if>
            <if test="cvendormangid != null and cvendormangid != ''"> and CVENDORMANGID = #{cvendormangid} </if>
            <if test="cwareid != null and cwareid != ''"> and CWAREID = #{cwareid} </if>
            <if test="dauditdate != null and dauditdate != ''"> and DAUDITDATE = #{dauditdate} </if>
            <if test="dorderdate != null and dorderdate != ''"> and DORDERDATE = #{dorderdate} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="ibillstatus != null and ibillstatus != ''"> and IBILLSTATUS = #{ibillstatus} </if>
            <if test="iprintcount != null and iprintcount != ''"> and IPRINTCOUNT = #{iprintcount} </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="taudittime != null and taudittime != ''"> and TAUDITTIME = #{taudittime} </if>
            <if test="tlastmaketime != null and tlastmaketime != ''"> and TLASTMAKETIME = #{tlastmaketime} </if>
            <if test="tmaketime != null and tmaketime != ''"> and TMAKETIME = #{tmaketime} </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="vmemo != null and vmemo != ''"> and VMEMO = #{vmemo} </if>
            <if test="vordercode != null and vordercode != ''"> and VORDERCODE = #{vordercode} </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.ScOrderEntity">
        select  count(1)   from SC_ORDER
    <trim prefix="where" prefixOverrides="and"> 
        <if test="caccountbankid != null and caccountbankid != ''"> and CACCOUNTBANKID = #{caccountbankid} </if>
            <if test="caccountyear != null and caccountyear != ''"> and CACCOUNTYEAR = #{caccountyear} </if>
            <if test="cauditpsn != null and cauditpsn != ''"> and CAUDITPSN = #{cauditpsn} </if>
            <if test="cbiztype != null and cbiztype != ''"> and CBIZTYPE = #{cbiztype} </if>
            <if test="cdeptid != null and cdeptid != ''"> and CDEPTID = #{cdeptid} </if>
            <if test="cemployeeid != null and cemployeeid != ''"> and CEMPLOYEEID = #{cemployeeid} </if>
            <if test="cgiveinvoicevendor != null and cgiveinvoicevendor != ''"> and CGIVEINVOICEVENDOR = #{cgiveinvoicevendor} </if>
            <if test="coperator != null and coperator != ''"> and COPERATOR = #{coperator} </if>
            <if test="corderid != null and corderid != ''"> and CORDERID = #{corderid} </if>
            <if test="cpurorganization != null and cpurorganization != ''"> and CPURORGANIZATION = #{cpurorganization} </if>
            <if test="creciever != null and creciever != ''"> and CRECIEVER = #{creciever} </if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''"> and CTERMPROTOCOLID = #{ctermprotocolid} </if>
            <if test="ctransmodeid != null and ctransmodeid != ''"> and CTRANSMODEID = #{ctransmodeid} </if>
            <if test="cvendorid != null and cvendorid != ''"> and CVENDORID = #{cvendorid} </if>
            <if test="cvendormangid != null and cvendormangid != ''"> and CVENDORMANGID = #{cvendormangid} </if>
            <if test="cwareid != null and cwareid != ''"> and CWAREID = #{cwareid} </if>
            <if test="dauditdate != null and dauditdate != ''"> and DAUDITDATE = #{dauditdate} </if>
            <if test="dorderdate != null and dorderdate != ''"> and DORDERDATE = #{dorderdate} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="ibillstatus != null and ibillstatus != ''"> and IBILLSTATUS = #{ibillstatus} </if>
            <if test="iprintcount != null and iprintcount != ''"> and IPRINTCOUNT = #{iprintcount} </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="taudittime != null and taudittime != ''"> and TAUDITTIME = #{taudittime} </if>
            <if test="tlastmaketime != null and tlastmaketime != ''"> and TLASTMAKETIME = #{tlastmaketime} </if>
            <if test="tmaketime != null and tmaketime != ''"> and TMAKETIME = #{tmaketime} </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="vmemo != null and vmemo != ''"> and VMEMO = #{vmemo} </if>
            <if test="vordercode != null and vordercode != ''"> and VORDERCODE = #{vordercode} </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-ScOrderEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderEntity">
    select
    <include refid="ScOrderEntity_Base_Column_List" />
    from SC_ORDER
    <trim prefix="where" prefixOverrides="and"> 
        <if test="caccountbankid != null and caccountbankid != ''"> and CACCOUNTBANKID like concat('%',#{caccountbankid},'%') </if>
            <if test="caccountyear != null and caccountyear != ''"> and CACCOUNTYEAR like concat('%',#{caccountyear},'%') </if>
            <if test="cauditpsn != null and cauditpsn != ''"> and CAUDITPSN like concat('%',#{cauditpsn},'%') </if>
            <if test="cbiztype != null and cbiztype != ''"> and CBIZTYPE like concat('%',#{cbiztype},'%') </if>
            <if test="cdeptid != null and cdeptid != ''"> and CDEPTID like concat('%',#{cdeptid},'%') </if>
            <if test="cemployeeid != null and cemployeeid != ''"> and CEMPLOYEEID like concat('%',#{cemployeeid},'%') </if>
            <if test="cgiveinvoicevendor != null and cgiveinvoicevendor != ''"> and CGIVEINVOICEVENDOR like concat('%',#{cgiveinvoicevendor},'%') </if>
            <if test="coperator != null and coperator != ''"> and COPERATOR like concat('%',#{coperator},'%') </if>
            <if test="corderid != null and corderid != ''"> and CORDERID like concat('%',#{corderid},'%') </if>
            <if test="cpurorganization != null and cpurorganization != ''"> and CPURORGANIZATION like concat('%',#{cpurorganization},'%') </if>
            <if test="creciever != null and creciever != ''"> and CRECIEVER like concat('%',#{creciever},'%') </if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''"> and CTERMPROTOCOLID like concat('%',#{ctermprotocolid},'%') </if>
            <if test="ctransmodeid != null and ctransmodeid != ''"> and CTRANSMODEID like concat('%',#{ctransmodeid},'%') </if>
            <if test="cvendorid != null and cvendorid != ''"> and CVENDORID like concat('%',#{cvendorid},'%') </if>
            <if test="cvendormangid != null and cvendormangid != ''"> and CVENDORMANGID like concat('%',#{cvendormangid},'%') </if>
            <if test="cwareid != null and cwareid != ''"> and CWAREID like concat('%',#{cwareid},'%') </if>
            <if test="dauditdate != null and dauditdate != ''"> and DAUDITDATE like concat('%',#{dauditdate},'%') </if>
            <if test="dorderdate != null and dorderdate != ''"> and DORDERDATE like concat('%',#{dorderdate},'%') </if>
            <if test="dr != null and dr != ''"> and DR like concat('%',#{dr},'%') </if>
            <if test="ibillstatus != null and ibillstatus != ''"> and IBILLSTATUS like concat('%',#{ibillstatus},'%') </if>
            <if test="iprintcount != null and iprintcount != ''"> and IPRINTCOUNT like concat('%',#{iprintcount},'%') </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="taudittime != null and taudittime != ''"> and TAUDITTIME like concat('%',#{taudittime},'%') </if>
            <if test="tlastmaketime != null and tlastmaketime != ''"> and TLASTMAKETIME like concat('%',#{tlastmaketime},'%') </if>
            <if test="tmaketime != null and tmaketime != ''"> and TMAKETIME like concat('%',#{tmaketime},'%') </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="vmemo != null and vmemo != ''"> and VMEMO like concat('%',#{vmemo},'%') </if>
            <if test="vordercode != null and vordercode != ''"> and VORDERCODE like concat('%',#{vordercode},'%') </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="ScOrderentity_list_or" resultMap="get-ScOrderEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderEntity">
    select
    <include refid="ScOrderEntity_Base_Column_List" />
    from SC_ORDER
    <trim prefix="where" prefixOverrides="and"> 
         <if test="caccountbankid != null and caccountbankid != ''"> or CACCOUNTBANKID = #{caccountbankid} </if>
             <if test="caccountyear != null and caccountyear != ''"> or CACCOUNTYEAR = #{caccountyear} </if>
             <if test="cauditpsn != null and cauditpsn != ''"> or CAUDITPSN = #{cauditpsn} </if>
             <if test="cbiztype != null and cbiztype != ''"> or CBIZTYPE = #{cbiztype} </if>
             <if test="cdeptid != null and cdeptid != ''"> or CDEPTID = #{cdeptid} </if>
             <if test="cemployeeid != null and cemployeeid != ''"> or CEMPLOYEEID = #{cemployeeid} </if>
             <if test="cgiveinvoicevendor != null and cgiveinvoicevendor != ''"> or CGIVEINVOICEVENDOR = #{cgiveinvoicevendor} </if>
             <if test="coperator != null and coperator != ''"> or COPERATOR = #{coperator} </if>
             <if test="corderid != null and corderid != ''"> or CORDERID = #{corderid} </if>
             <if test="cpurorganization != null and cpurorganization != ''"> or CPURORGANIZATION = #{cpurorganization} </if>
             <if test="creciever != null and creciever != ''"> or CRECIEVER = #{creciever} </if>
             <if test="ctermprotocolid != null and ctermprotocolid != ''"> or CTERMPROTOCOLID = #{ctermprotocolid} </if>
             <if test="ctransmodeid != null and ctransmodeid != ''"> or CTRANSMODEID = #{ctransmodeid} </if>
             <if test="cvendorid != null and cvendorid != ''"> or CVENDORID = #{cvendorid} </if>
             <if test="cvendormangid != null and cvendormangid != ''"> or CVENDORMANGID = #{cvendormangid} </if>
             <if test="cwareid != null and cwareid != ''"> or CWAREID = #{cwareid} </if>
             <if test="dauditdate != null and dauditdate != ''"> or DAUDITDATE = #{dauditdate} </if>
             <if test="dorderdate != null and dorderdate != ''"> or DORDERDATE = #{dorderdate} </if>
             <if test="dr != null and dr != ''"> or DR = #{dr} </if>
             <if test="ibillstatus != null and ibillstatus != ''"> or IBILLSTATUS = #{ibillstatus} </if>
             <if test="iprintcount != null and iprintcount != ''"> or IPRINTCOUNT = #{iprintcount} </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="taudittime != null and taudittime != ''"> or TAUDITTIME = #{taudittime} </if>
             <if test="tlastmaketime != null and tlastmaketime != ''"> or TLASTMAKETIME = #{tlastmaketime} </if>
             <if test="tmaketime != null and tmaketime != ''"> or TMAKETIME = #{tmaketime} </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="vmemo != null and vmemo != ''"> or VMEMO = #{vmemo} </if>
             <if test="vordercode != null and vordercode != ''"> or VORDERCODE = #{vordercode} </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.ScOrderEntity" keyProperty="corderid" useGeneratedKeys="true">
    insert into SC_ORDER(
  <trim suffix="" suffixOverrides=",">
       <if test="caccountbankid != null and caccountbankid != ''"> CACCOUNTBANKID , </if>
            <if test="caccountyear != null and caccountyear != ''"> CACCOUNTYEAR , </if>
            <if test="cauditpsn != null and cauditpsn != ''"> CAUDITPSN , </if>
            <if test="cbiztype != null and cbiztype != ''"> CBIZTYPE , </if>
            <if test="cdeptid != null and cdeptid != ''"> CDEPTID , </if>
            <if test="cemployeeid != null and cemployeeid != ''"> CEMPLOYEEID , </if>
            <if test="cgiveinvoicevendor != null and cgiveinvoicevendor != ''"> CGIVEINVOICEVENDOR , </if>
            <if test="coperator != null and coperator != ''"> COPERATOR , </if>
            <if test="corderid != null and corderid != ''"> CORDERID , </if>
            <if test="cpurorganization != null and cpurorganization != ''"> CPURORGANIZATION , </if>
            <if test="creciever != null and creciever != ''"> CRECIEVER , </if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''"> CTERMPROTOCOLID , </if>
            <if test="ctransmodeid != null and ctransmodeid != ''"> CTRANSMODEID , </if>
            <if test="cvendorid != null and cvendorid != ''"> CVENDORID , </if>
            <if test="cvendormangid != null and cvendormangid != ''"> CVENDORMANGID , </if>
            <if test="cwareid != null and cwareid != ''"> CWAREID , </if>
            <if test="dauditdate != null and dauditdate != ''"> DAUDITDATE , </if>
            <if test="dorderdate != null and dorderdate != ''"> DORDERDATE , </if>
            <if test="dr != null and dr != ''"> DR , </if>
            <if test="ibillstatus != null and ibillstatus != ''"> IBILLSTATUS , </if>
            <if test="iprintcount != null and iprintcount != ''"> IPRINTCOUNT , </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="taudittime != null and taudittime != ''"> TAUDITTIME , </if>
            <if test="tlastmaketime != null and tlastmaketime != ''"> TLASTMAKETIME , </if>
            <if test="tmaketime != null and tmaketime != ''"> TMAKETIME , </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="vmemo != null and vmemo != ''"> VMEMO , </if>
            <if test="vordercode != null and vordercode != ''"> VORDERCODE , </if>
            <if test="sorts == null ">sorts,</if>
    <if test="sts == null ">sts,</if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <if test="caccountbankid != null and caccountbankid != ''"> #{caccountbankid} ,</if>
            <if test="caccountyear != null and caccountyear != ''"> #{caccountyear} ,</if>
            <if test="cauditpsn != null and cauditpsn != ''"> #{cauditpsn} ,</if>
            <if test="cbiztype != null and cbiztype != ''"> #{cbiztype} ,</if>
            <if test="cdeptid != null and cdeptid != ''"> #{cdeptid} ,</if>
            <if test="cemployeeid != null and cemployeeid != ''"> #{cemployeeid} ,</if>
            <if test="cgiveinvoicevendor != null and cgiveinvoicevendor != ''"> #{cgiveinvoicevendor} ,</if>
            <if test="coperator != null and coperator != ''"> #{coperator} ,</if>
            <if test="corderid != null and corderid != ''"> #{corderid} ,</if>
            <if test="cpurorganization != null and cpurorganization != ''"> #{cpurorganization} ,</if>
            <if test="creciever != null and creciever != ''"> #{creciever} ,</if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''"> #{ctermprotocolid} ,</if>
            <if test="ctransmodeid != null and ctransmodeid != ''"> #{ctransmodeid} ,</if>
            <if test="cvendorid != null and cvendorid != ''"> #{cvendorid} ,</if>
            <if test="cvendormangid != null and cvendormangid != ''"> #{cvendormangid} ,</if>
            <if test="cwareid != null and cwareid != ''"> #{cwareid} ,</if>
            <if test="dauditdate != null and dauditdate != ''"> #{dauditdate} ,</if>
            <if test="dorderdate != null and dorderdate != ''"> #{dorderdate} ,</if>
            <if test="dr != null and dr != ''"> #{dr} ,</if>
            <if test="ibillstatus != null and ibillstatus != ''"> #{ibillstatus} ,</if>
            <if test="iprintcount != null and iprintcount != ''"> #{iprintcount} ,</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="taudittime != null and taudittime != ''"> #{taudittime} ,</if>
            <if test="tlastmaketime != null and tlastmaketime != ''"> #{tlastmaketime} ,</if>
            <if test="tmaketime != null and tmaketime != ''"> #{tmaketime} ,</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="vmemo != null and vmemo != ''"> #{vmemo} ,</if>
            <if test="vordercode != null and vordercode != ''"> #{vordercode} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from SC_ORDER a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="corderid" useGeneratedKeys="true">
  insert into SC_ORDER(CACCOUNTBANKID, CACCOUNTYEAR, CAUDITPSN, CBIZTYPE, CDEPTID, CEMPLOYEEID, CGIVEINVOICEVENDOR, COPERATOR, CPURORGANIZATION, CRECIEVER, CTERMPROTOCOLID, CTRANSMODEID, CVENDORID, CVENDORMANGID, CWAREID, DAUDITDATE, DORDERDATE, DR, IBILLSTATUS, IPRINTCOUNT, 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, TAUDITTIME, TLASTMAKETIME, TMAKETIME, TS, VDEF1, VDEF10, VDEF11, VDEF12, VDEF13, VDEF14, VDEF15, VDEF16, VDEF17, VDEF18, VDEF19, VDEF2, VDEF20, VDEF3, VDEF4, VDEF5, VDEF6, VDEF7, VDEF8, VDEF9, VMEMO, VORDERCODE,  sts) 
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.caccountbankid},#{entity.caccountyear},#{entity.cauditpsn},#{entity.cbiztype},#{entity.cdeptid},#{entity.cemployeeid},#{entity.cgiveinvoicevendor},#{entity.coperator},#{entity.cpurorganization},#{entity.creciever},#{entity.ctermprotocolid},#{entity.ctransmodeid},#{entity.cvendorid},#{entity.cvendormangid},#{entity.cwareid},#{entity.dauditdate},#{entity.dorderdate},#{entity.dr},#{entity.ibillstatus},#{entity.iprintcount},#{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.taudittime},#{entity.tlastmaketime},#{entity.tmaketime},#{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.vmemo},#{entity.vordercode}, 'Y')
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="corderid" useGeneratedKeys="true">
    insert into SC_ORDER(CACCOUNTBANKID, CACCOUNTYEAR, CAUDITPSN, CBIZTYPE, CDEPTID, CEMPLOYEEID, CGIVEINVOICEVENDOR, COPERATOR, CPURORGANIZATION, CRECIEVER, CTERMPROTOCOLID, CTRANSMODEID, CVENDORID, CVENDORMANGID, CWAREID, DAUDITDATE, DORDERDATE, DR, IBILLSTATUS, IPRINTCOUNT, 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, TAUDITTIME, TLASTMAKETIME, TMAKETIME, TS, VDEF1, VDEF10, VDEF11, VDEF12, VDEF13, VDEF14, VDEF15, VDEF16, VDEF17, VDEF18, VDEF19, VDEF2, VDEF20, VDEF3, VDEF4, VDEF5, VDEF6, VDEF7, VDEF8, VDEF9, VMEMO, VORDERCODE)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.caccountbankid},#{entity.caccountyear},#{entity.cauditpsn},#{entity.cbiztype},#{entity.cdeptid},#{entity.cemployeeid},#{entity.cgiveinvoicevendor},#{entity.coperator},#{entity.cpurorganization},#{entity.creciever},#{entity.ctermprotocolid},#{entity.ctransmodeid},#{entity.cvendorid},#{entity.cvendormangid},#{entity.cwareid},#{entity.dauditdate},#{entity.dorderdate},#{entity.dr},#{entity.ibillstatus},#{entity.iprintcount},#{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.taudittime},#{entity.tlastmaketime},#{entity.tmaketime},#{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.vmemo},#{entity.vordercode})
    </foreach>
    on duplicate key update
    CACCOUNTBANKID = values(CACCOUNTBANKID),
    CACCOUNTYEAR = values(CACCOUNTYEAR),
    CAUDITPSN = values(CAUDITPSN),
    CBIZTYPE = values(CBIZTYPE),
    CDEPTID = values(CDEPTID),
    CEMPLOYEEID = values(CEMPLOYEEID),
    CGIVEINVOICEVENDOR = values(CGIVEINVOICEVENDOR),
    COPERATOR = values(COPERATOR),
    CPURORGANIZATION = values(CPURORGANIZATION),
    CRECIEVER = values(CRECIEVER),
    CTERMPROTOCOLID = values(CTERMPROTOCOLID),
    CTRANSMODEID = values(CTRANSMODEID),
    CVENDORID = values(CVENDORID),
    CVENDORMANGID = values(CVENDORMANGID),
    CWAREID = values(CWAREID),
    DAUDITDATE = values(DAUDITDATE),
    DORDERDATE = values(DORDERDATE),
    DR = values(DR),
    IBILLSTATUS = values(IBILLSTATUS),
    IPRINTCOUNT = values(IPRINTCOUNT),
    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),
    TAUDITTIME = values(TAUDITTIME),
    TLASTMAKETIME = values(TLASTMAKETIME),
    TMAKETIME = values(TMAKETIME),
    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),
    VMEMO = values(VMEMO),
    VORDERCODE = values(VORDERCODE)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderEntity" >
update SC_ORDER  set
<trim suffix="" suffixOverrides=",">
  <if test="caccountbankid != null and caccountbankid != ''"> CACCOUNTBANKID = #{caccountbankid},</if>
  <if test="caccountyear != null and caccountyear != ''"> CACCOUNTYEAR = #{caccountyear},</if>
  <if test="cauditpsn != null and cauditpsn != ''"> CAUDITPSN = #{cauditpsn},</if>
  <if test="cbiztype != null and cbiztype != ''"> CBIZTYPE = #{cbiztype},</if>
  <if test="cdeptid != null and cdeptid != ''"> CDEPTID = #{cdeptid},</if>
  <if test="cemployeeid != null and cemployeeid != ''"> CEMPLOYEEID = #{cemployeeid},</if>
  <if test="cgiveinvoicevendor != null and cgiveinvoicevendor != ''"> CGIVEINVOICEVENDOR = #{cgiveinvoicevendor},</if>
  <if test="coperator != null and coperator != ''"> COPERATOR = #{coperator},</if>
  <if test="cpurorganization != null and cpurorganization != ''"> CPURORGANIZATION = #{cpurorganization},</if>
  <if test="creciever != null and creciever != ''"> CRECIEVER = #{creciever},</if>
  <if test="ctermprotocolid != null and ctermprotocolid != ''"> CTERMPROTOCOLID = #{ctermprotocolid},</if>
  <if test="ctransmodeid != null and ctransmodeid != ''"> CTRANSMODEID = #{ctransmodeid},</if>
  <if test="cvendorid != null and cvendorid != ''"> CVENDORID = #{cvendorid},</if>
  <if test="cvendormangid != null and cvendormangid != ''"> CVENDORMANGID = #{cvendormangid},</if>
  <if test="cwareid != null and cwareid != ''"> CWAREID = #{cwareid},</if>
  <if test="dauditdate != null and dauditdate != ''"> DAUDITDATE = #{dauditdate},</if>
  <if test="dorderdate != null and dorderdate != ''"> DORDERDATE = #{dorderdate},</if>
  <if test="dr != null and dr != ''"> DR = #{dr},</if>
  <if test="ibillstatus != null and ibillstatus != ''"> IBILLSTATUS = #{ibillstatus},</if>
  <if test="iprintcount != null and iprintcount != ''"> IPRINTCOUNT = #{iprintcount},</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="taudittime != null and taudittime != ''"> TAUDITTIME = #{taudittime},</if>
  <if test="tlastmaketime != null and tlastmaketime != ''"> TLASTMAKETIME = #{tlastmaketime},</if>
  <if test="tmaketime != null and tmaketime != ''"> TMAKETIME = #{tmaketime},</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="vmemo != null and vmemo != ''"> VMEMO = #{vmemo},</if>
  <if test="vordercode != null and vordercode != ''"> VORDERCODE = #{vordercode},</if>
</trim>
where CORDERID = #{corderid}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderEntity" >
update SC_ORDER  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where CORDERID = #{corderid}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.ScOrderEntity" >
update SC_ORDER  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 <trim prefix="where" prefixOverrides="and"> 
        <if test="caccountbankid != null and caccountbankid != ''"> and CACCOUNTBANKID = #{caccountbankid} </if>
            <if test="caccountyear != null and caccountyear != ''"> and CACCOUNTYEAR = #{caccountyear} </if>
            <if test="cauditpsn != null and cauditpsn != ''"> and CAUDITPSN = #{cauditpsn} </if>
            <if test="cbiztype != null and cbiztype != ''"> and CBIZTYPE = #{cbiztype} </if>
            <if test="cdeptid != null and cdeptid != ''"> and CDEPTID = #{cdeptid} </if>
            <if test="cemployeeid != null and cemployeeid != ''"> and CEMPLOYEEID = #{cemployeeid} </if>
            <if test="cgiveinvoicevendor != null and cgiveinvoicevendor != ''"> and CGIVEINVOICEVENDOR = #{cgiveinvoicevendor} </if>
            <if test="coperator != null and coperator != ''"> and COPERATOR = #{coperator} </if>
            <if test="corderid != null and corderid != ''"> and CORDERID = #{corderid} </if>
            <if test="cpurorganization != null and cpurorganization != ''"> and CPURORGANIZATION = #{cpurorganization} </if>
            <if test="creciever != null and creciever != ''"> and CRECIEVER = #{creciever} </if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''"> and CTERMPROTOCOLID = #{ctermprotocolid} </if>
            <if test="ctransmodeid != null and ctransmodeid != ''"> and CTRANSMODEID = #{ctransmodeid} </if>
            <if test="cvendorid != null and cvendorid != ''"> and CVENDORID = #{cvendorid} </if>
            <if test="cvendormangid != null and cvendormangid != ''"> and CVENDORMANGID = #{cvendormangid} </if>
            <if test="cwareid != null and cwareid != ''"> and CWAREID = #{cwareid} </if>
            <if test="dauditdate != null and dauditdate != ''"> and DAUDITDATE = #{dauditdate} </if>
            <if test="dorderdate != null and dorderdate != ''"> and DORDERDATE = #{dorderdate} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="ibillstatus != null and ibillstatus != ''"> and IBILLSTATUS = #{ibillstatus} </if>
            <if test="iprintcount != null and iprintcount != ''"> and IPRINTCOUNT = #{iprintcount} </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="taudittime != null and taudittime != ''"> and TAUDITTIME = #{taudittime} </if>
            <if test="tlastmaketime != null and tlastmaketime != ''"> and TLASTMAKETIME = #{tlastmaketime} </if>
            <if test="tmaketime != null and tmaketime != ''"> and TMAKETIME = #{tmaketime} </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="vmemo != null and vmemo != ''"> and VMEMO = #{vmemo} </if>
            <if test="vordercode != null and vordercode != ''"> and VORDERCODE = #{vordercode} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from SC_ORDER where CORDERID = #{corderid}
</delete>

</mapper>

