<?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.PoOrderDaoImpl">
    <resultMap id="get-PoOrderEntity-result" type="com.hzya.frame.plugin.lets.entity.PoOrderEntity">
        <result property="bcooptoso" column="bcooptoso" jdbcType="VARCHAR"/>
        <result property="bislatest" column="bislatest" jdbcType="VARCHAR"/>
        <result property="bisreplenish" column="bisreplenish" jdbcType="VARCHAR"/>
        <result property="bpubtoec" column="bpubtoec" jdbcType="VARCHAR"/>
        <result property="breturn" column="breturn" jdbcType="VARCHAR"/>
        <result property="bsocooptome" column="bsocooptome" jdbcType="VARCHAR"/>
        <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="ccontracttextpath" column="ccontracttextpath" jdbcType="VARCHAR"/>
        <result property="cdeliveraddress" column="cdeliveraddress" jdbcType="VARCHAR"/>
        <result property="cdeptid" column="cdeptid" jdbcType="VARCHAR"/>
        <result property="cemployeeid" column="cemployeeid" jdbcType="VARCHAR"/>
        <result property="cfreecustid" column="cfreecustid" 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="cpubpsn" column="cpubpsn" jdbcType="VARCHAR"/>
        <result property="cpurorganization" column="cpurorganization" jdbcType="VARCHAR"/>
        <result property="creciever" column="creciever" jdbcType="VARCHAR"/>
        <result property="cresppsn" column="cresppsn" jdbcType="VARCHAR"/>
        <result property="crevisepsn" column="crevisepsn" jdbcType="VARCHAR"/>
        <result property="ctermprotocolid" column="ctermprotocolid" jdbcType="VARCHAR"/>
        <result property="ctransmodeid" column="ctransmodeid" jdbcType="VARCHAR"/>
        <result property="cunfreeze" column="cunfreeze" jdbcType="VARCHAR"/>
        <result property="cvendorbaseid" column="cvendorbaseid" jdbcType="VARCHAR"/>
        <result property="cvendormangid" column="cvendormangid" jdbcType="VARCHAR"/>
        <result property="dauditdate" column="dauditdate" jdbcType="VARCHAR"/>
        <result property="dorderdate" column="dorderdate" jdbcType="VARCHAR"/>
        <result property="dr" column="dr" jdbcType="INTEGER"/>
        <result property="drevisiondate" column="drevisiondate" jdbcType="VARCHAR"/>
        <result property="forderstatus" column="forderstatus" jdbcType="INTEGER"/>
        <result property="iprintcount" column="iprintcount" jdbcType="INTEGER"/>
        <result property="irespstatus" column="irespstatus" jdbcType="INTEGER"/>
        <result property="nprepaymaxmny" column="nprepaymaxmny" jdbcType="VARCHAR"/>
        <result property="nprepaymny" column="nprepaymny" jdbcType="VARCHAR"/>
        <result property="ntotalmny" column="ntotalmny" jdbcType="VARCHAR"/>
        <result property="ntotalnum" column="ntotalnum" jdbcType="VARCHAR"/>
        <result property="nversion" column="nversion" jdbcType="INTEGER"/>
        <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="tpubtime" column="tpubtime" jdbcType="VARCHAR"/>
        <result property="tresptime" column="tresptime" jdbcType="VARCHAR"/>
        <result property="trevisiontime" column="trevisiontime" jdbcType="VARCHAR"/>
        <result property="ts" column="ts" jdbcType="VARCHAR"/>
        <result property="vcoopordercode" column="vcoopordercode" 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"/>
        <result property="vrefusrsn" column="vrefusrsn" jdbcType="VARCHAR"/>
    </resultMap>
    <!-- 查询的字段-->
    <sql id="PoOrderEntity_Base_Column_List">
        bcooptoso
        ,bislatest
        ,bisreplenish 
        ,bpubtoec 
        ,breturn 
        ,bsocooptome 
        ,caccountbankid 
        ,caccountyear 
        ,cauditpsn 
        ,cbiztype 
        ,ccontracttextpath 
        ,cdeliveraddress 
        ,cdeptid 
        ,cemployeeid 
        ,cfreecustid 
        ,cgiveinvoicevendor 
        ,coperator 
        ,corderid 
        ,cpubpsn 
        ,cpurorganization 
        ,creciever 
        ,cresppsn 
        ,crevisepsn 
        ,ctermprotocolid 
        ,ctransmodeid 
        ,cunfreeze 
        ,cvendorbaseid 
        ,cvendormangid 
        ,dauditdate 
        ,dorderdate 
        ,dr 
        ,drevisiondate 
        ,forderstatus 
        ,iprintcount 
        ,irespstatus 
        ,nprepaymaxmny 
        ,nprepaymny 
        ,ntotalmny 
        ,ntotalnum 
        ,nversion 
        ,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 
        ,tpubtime 
        ,tresptime 
        ,trevisiontime 
        ,ts 
        ,vcoopordercode 
        ,vdef1 
        ,vdef10 
        ,vdef11 
        ,vdef12 
        ,vdef13 
        ,vdef14 
        ,vdef15 
        ,vdef16 
        ,vdef17 
        ,vdef18 
        ,vdef19 
        ,vdef2 
        ,vdef20 
        ,vdef3 
        ,vdef4 
        ,vdef5 
        ,vdef6 
        ,vdef7 
        ,vdef8 
        ,vdef9 
        ,vmemo 
        ,vordercode 
        ,vrefusrsn
    </sql>
    <!-- 查询 采用==查询 -->
    <select id="entity_list_base" resultMap="get-PoOrderEntity-result"
            parameterType="com.hzya.frame.plugin.lets.entity.PoOrderEntity">
        select
        <include refid="PoOrderEntity_Base_Column_List"/>
        from po_order
        <trim prefix="where" prefixOverrides="and">
            <if test="bcooptoso != null and bcooptoso != ''">and bcooptoso = #{bcooptoso}</if>
            <if test="bislatest != null and bislatest != ''">and bislatest = #{bislatest}</if>
            <if test="bisreplenish != null and bisreplenish != ''">and bisreplenish = #{bisreplenish}</if>
            <if test="bpubtoec != null and bpubtoec != ''">and bpubtoec = #{bpubtoec}</if>
            <if test="breturn != null and breturn != ''">and breturn = #{breturn}</if>
            <if test="bsocooptome != null and bsocooptome != ''">and bsocooptome = #{bsocooptome}</if>
            <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="ccontracttextpath != null and ccontracttextpath != ''">and ccontracttextpath =
                #{ccontracttextpath}
            </if>
            <if test="cdeliveraddress != null and cdeliveraddress != ''">and cdeliveraddress = #{cdeliveraddress}</if>
            <if test="cdeptid != null and cdeptid != ''">and cdeptid = #{cdeptid}</if>
            <if test="cemployeeid != null and cemployeeid != ''">and cemployeeid = #{cemployeeid}</if>
            <if test="cfreecustid != null and cfreecustid != ''">and cfreecustid = #{cfreecustid}</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="cpubpsn != null and cpubpsn != ''">and cpubpsn = #{cpubpsn}</if>
            <if test="cpurorganization != null and cpurorganization != ''">and cpurorganization = #{cpurorganization}
            </if>
            <if test="creciever != null and creciever != ''">and creciever = #{creciever}</if>
            <if test="cresppsn != null and cresppsn != ''">and cresppsn = #{cresppsn}</if>
            <if test="crevisepsn != null and crevisepsn != ''">and crevisepsn = #{crevisepsn}</if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''">and ctermprotocolid = #{ctermprotocolid}</if>
            <if test="ctransmodeid != null and ctransmodeid != ''">and ctransmodeid = #{ctransmodeid}</if>
            <if test="cunfreeze != null and cunfreeze != ''">and cunfreeze = #{cunfreeze}</if>
            <if test="cvendorbaseid != null and cvendorbaseid != ''">and cvendorbaseid = #{cvendorbaseid}</if>
            <if test="cvendormangid != null and cvendormangid != ''">and cvendormangid = #{cvendormangid}</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 = #{dr}</if>
            <if test="drevisiondate != null and drevisiondate != ''">and drevisiondate = #{drevisiondate}</if>
            <if test="forderstatus != null">and forderstatus = #{forderstatus}</if>
            <if test="iprintcount != null">and iprintcount = #{iprintcount}</if>
            <if test="irespstatus != null">and irespstatus = #{irespstatus}</if>
            <if test="nprepaymaxmny != null and nprepaymaxmny != ''">and nprepaymaxmny = #{nprepaymaxmny}</if>
            <if test="nprepaymny != null and nprepaymny != ''">and nprepaymny = #{nprepaymny}</if>
            <if test="ntotalmny != null and ntotalmny != ''">and ntotalmny = #{ntotalmny}</if>
            <if test="ntotalnum != null and ntotalnum != ''">and ntotalnum = #{ntotalnum}</if>
            <if test="nversion != null">and nversion = #{nversion}</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="tpubtime != null and tpubtime != ''">and tpubtime = #{tpubtime}</if>
            <if test="tresptime != null and tresptime != ''">and tresptime = #{tresptime}</if>
            <if test="trevisiontime != null and trevisiontime != ''">and trevisiontime = #{trevisiontime}</if>
            <if test="ts != null and ts != ''">and ts = #{ts}</if>
            <if test="vcoopordercode != null and vcoopordercode != ''">and vcoopordercode = #{vcoopordercode}</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>
            <if test="vrefusrsn != null and vrefusrsn != ''">and vrefusrsn = #{vrefusrsn}</if>
            <if test="wdt_vordercode!=null and wdt_vordercode!=''">and vordercode + '_' + RIGHT ( corderid, 5 )  = #{wdt_vordercode}</if>
            <if test="start_dauditdate!=null and start_dauditdate!=''">and dauditdate >= #{start_dauditdate}</if>
            <if test="end_dauditdate!=null and end_dauditdate!=''">and dauditdate &lt;= #{end_dauditdate}</if>
        </trim>
        <if test=" sort == ''.toString() ">order by sorts asc</if>
        <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
    </select>

    <!-- 查询符合条件的数量 -->
    <select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.plugin.lets.entity.PoOrderEntity">
        select count(1) from po_order
        <trim prefix="where" prefixOverrides="and">
            <if test="bcooptoso != null and bcooptoso != ''">and bcooptoso = #{bcooptoso}</if>
            <if test="bislatest != null and bislatest != ''">and bislatest = #{bislatest}</if>
            <if test="bisreplenish != null and bisreplenish != ''">and bisreplenish = #{bisreplenish}</if>
            <if test="bpubtoec != null and bpubtoec != ''">and bpubtoec = #{bpubtoec}</if>
            <if test="breturn != null and breturn != ''">and breturn = #{breturn}</if>
            <if test="bsocooptome != null and bsocooptome != ''">and bsocooptome = #{bsocooptome}</if>
            <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="ccontracttextpath != null and ccontracttextpath != ''">and ccontracttextpath =
                #{ccontracttextpath}
            </if>
            <if test="cdeliveraddress != null and cdeliveraddress != ''">and cdeliveraddress = #{cdeliveraddress}</if>
            <if test="cdeptid != null and cdeptid != ''">and cdeptid = #{cdeptid}</if>
            <if test="cemployeeid != null and cemployeeid != ''">and cemployeeid = #{cemployeeid}</if>
            <if test="cfreecustid != null and cfreecustid != ''">and cfreecustid = #{cfreecustid}</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="cpubpsn != null and cpubpsn != ''">and cpubpsn = #{cpubpsn}</if>
            <if test="cpurorganization != null and cpurorganization != ''">and cpurorganization = #{cpurorganization}
            </if>
            <if test="creciever != null and creciever != ''">and creciever = #{creciever}</if>
            <if test="cresppsn != null and cresppsn != ''">and cresppsn = #{cresppsn}</if>
            <if test="crevisepsn != null and crevisepsn != ''">and crevisepsn = #{crevisepsn}</if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''">and ctermprotocolid = #{ctermprotocolid}</if>
            <if test="ctransmodeid != null and ctransmodeid != ''">and ctransmodeid = #{ctransmodeid}</if>
            <if test="cunfreeze != null and cunfreeze != ''">and cunfreeze = #{cunfreeze}</if>
            <if test="cvendorbaseid != null and cvendorbaseid != ''">and cvendorbaseid = #{cvendorbaseid}</if>
            <if test="cvendormangid != null and cvendormangid != ''">and cvendormangid = #{cvendormangid}</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 = #{dr}</if>
            <if test="drevisiondate != null and drevisiondate != ''">and drevisiondate = #{drevisiondate}</if>
            <if test="forderstatus != null">and forderstatus = #{forderstatus}</if>
            <if test="iprintcount != null">and iprintcount = #{iprintcount}</if>
            <if test="irespstatus != null">and irespstatus = #{irespstatus}</if>
            <if test="nprepaymaxmny != null and nprepaymaxmny != ''">and nprepaymaxmny = #{nprepaymaxmny}</if>
            <if test="nprepaymny != null and nprepaymny != ''">and nprepaymny = #{nprepaymny}</if>
            <if test="ntotalmny != null and ntotalmny != ''">and ntotalmny = #{ntotalmny}</if>
            <if test="ntotalnum != null and ntotalnum != ''">and ntotalnum = #{ntotalnum}</if>
            <if test="nversion != null">and nversion = #{nversion}</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="tpubtime != null and tpubtime != ''">and tpubtime = #{tpubtime}</if>
            <if test="tresptime != null and tresptime != ''">and tresptime = #{tresptime}</if>
            <if test="trevisiontime != null and trevisiontime != ''">and trevisiontime = #{trevisiontime}</if>
            <if test="ts != null and ts != ''">and ts = #{ts}</if>
            <if test="vcoopordercode != null and vcoopordercode != ''">and vcoopordercode = #{vcoopordercode}</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>
            <if test="vrefusrsn != null and vrefusrsn != ''">and vrefusrsn = #{vrefusrsn}</if>
        </trim>
        <if test=" sort ==''.toString() ">order by sorts asc</if>
        <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
    </select>

    <!-- 分页查询列表 采用like格式 -->
    <select id="entity_list_like" resultMap="get-PoOrderEntity-result"
            parameterType="com.hzya.frame.plugin.lets.entity.PoOrderEntity">
        select
        <include refid="PoOrderEntity_Base_Column_List"/>
        from po_order
        <trim prefix="where" prefixOverrides="and">
            <if test="bcooptoso != null and bcooptoso != ''">and bcooptoso like concat('%',#{bcooptoso},'%')</if>
            <if test="bislatest != null and bislatest != ''">and bislatest like concat('%',#{bislatest},'%')</if>
            <if test="bisreplenish != null and bisreplenish != ''">and bisreplenish like
                concat('%',#{bisreplenish},'%')
            </if>
            <if test="bpubtoec != null and bpubtoec != ''">and bpubtoec like concat('%',#{bpubtoec},'%')</if>
            <if test="breturn != null and breturn != ''">and breturn like concat('%',#{breturn},'%')</if>
            <if test="bsocooptome != null and bsocooptome != ''">and bsocooptome like concat('%',#{bsocooptome},'%')
            </if>
            <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="ccontracttextpath != null and ccontracttextpath != ''">and ccontracttextpath like
                concat('%',#{ccontracttextpath},'%')
            </if>
            <if test="cdeliveraddress != null and cdeliveraddress != ''">and cdeliveraddress like
                concat('%',#{cdeliveraddress},'%')
            </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="cfreecustid != null and cfreecustid != ''">and cfreecustid like concat('%',#{cfreecustid},'%')
            </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="cpubpsn != null and cpubpsn != ''">and cpubpsn like concat('%',#{cpubpsn},'%')</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="cresppsn != null and cresppsn != ''">and cresppsn like concat('%',#{cresppsn},'%')</if>
            <if test="crevisepsn != null and crevisepsn != ''">and crevisepsn like concat('%',#{crevisepsn},'%')</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="cunfreeze != null and cunfreeze != ''">and cunfreeze like concat('%',#{cunfreeze},'%')</if>
            <if test="cvendorbaseid != null and cvendorbaseid != ''">and cvendorbaseid like
                concat('%',#{cvendorbaseid},'%')
            </if>
            <if test="cvendormangid != null and cvendormangid != ''">and cvendormangid like
                concat('%',#{cvendormangid},'%')
            </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 like concat('%',#{dr},'%')</if>
            <if test="drevisiondate != null and drevisiondate != ''">and drevisiondate like
                concat('%',#{drevisiondate},'%')
            </if>
            <if test="forderstatus != null">and forderstatus like concat('%',#{forderstatus},'%')</if>
            <if test="iprintcount != null">and iprintcount like concat('%',#{iprintcount},'%')</if>
            <if test="irespstatus != null">and irespstatus like concat('%',#{irespstatus},'%')</if>
            <if test="nprepaymaxmny != null and nprepaymaxmny != ''">and nprepaymaxmny like
                concat('%',#{nprepaymaxmny},'%')
            </if>
            <if test="nprepaymny != null and nprepaymny != ''">and nprepaymny like concat('%',#{nprepaymny},'%')</if>
            <if test="ntotalmny != null and ntotalmny != ''">and ntotalmny like concat('%',#{ntotalmny},'%')</if>
            <if test="ntotalnum != null and ntotalnum != ''">and ntotalnum like concat('%',#{ntotalnum},'%')</if>
            <if test="nversion != null">and nversion like concat('%',#{nversion},'%')</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="tpubtime != null and tpubtime != ''">and tpubtime like concat('%',#{tpubtime},'%')</if>
            <if test="tresptime != null and tresptime != ''">and tresptime like concat('%',#{tresptime},'%')</if>
            <if test="trevisiontime != null and trevisiontime != ''">and trevisiontime like
                concat('%',#{trevisiontime},'%')
            </if>
            <if test="ts != null and ts != ''">and ts like concat('%',#{ts},'%')</if>
            <if test="vcoopordercode != null and vcoopordercode != ''">and vcoopordercode like
                concat('%',#{vcoopordercode},'%')
            </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>
            <if test="vrefusrsn != null and vrefusrsn != ''">and vrefusrsn like concat('%',#{vrefusrsn},'%')</if>
        </trim>
        <if test=" sort == ''.toString() ">order by sorts asc</if>
        <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
    </select>

    <!-- 查询列表 字段采用or格式 -->
    <select id="PoOrderentity_list_or" resultMap="get-PoOrderEntity-result"
            parameterType="com.hzya.frame.plugin.lets.entity.PoOrderEntity">
        select
        <include refid="PoOrderEntity_Base_Column_List"/>
        from po_order
        <trim prefix="where" prefixOverrides="and">
            <if test="bcooptoso != null and bcooptoso != ''">or bcooptoso = #{bcooptoso}</if>
            <if test="bislatest != null and bislatest != ''">or bislatest = #{bislatest}</if>
            <if test="bisreplenish != null and bisreplenish != ''">or bisreplenish = #{bisreplenish}</if>
            <if test="bpubtoec != null and bpubtoec != ''">or bpubtoec = #{bpubtoec}</if>
            <if test="breturn != null and breturn != ''">or breturn = #{breturn}</if>
            <if test="bsocooptome != null and bsocooptome != ''">or bsocooptome = #{bsocooptome}</if>
            <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="ccontracttextpath != null and ccontracttextpath != ''">or ccontracttextpath =
                #{ccontracttextpath}
            </if>
            <if test="cdeliveraddress != null and cdeliveraddress != ''">or cdeliveraddress = #{cdeliveraddress}</if>
            <if test="cdeptid != null and cdeptid != ''">or cdeptid = #{cdeptid}</if>
            <if test="cemployeeid != null and cemployeeid != ''">or cemployeeid = #{cemployeeid}</if>
            <if test="cfreecustid != null and cfreecustid != ''">or cfreecustid = #{cfreecustid}</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="cpubpsn != null and cpubpsn != ''">or cpubpsn = #{cpubpsn}</if>
            <if test="cpurorganization != null and cpurorganization != ''">or cpurorganization = #{cpurorganization}
            </if>
            <if test="creciever != null and creciever != ''">or creciever = #{creciever}</if>
            <if test="cresppsn != null and cresppsn != ''">or cresppsn = #{cresppsn}</if>
            <if test="crevisepsn != null and crevisepsn != ''">or crevisepsn = #{crevisepsn}</if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''">or ctermprotocolid = #{ctermprotocolid}</if>
            <if test="ctransmodeid != null and ctransmodeid != ''">or ctransmodeid = #{ctransmodeid}</if>
            <if test="cunfreeze != null and cunfreeze != ''">or cunfreeze = #{cunfreeze}</if>
            <if test="cvendorbaseid != null and cvendorbaseid != ''">or cvendorbaseid = #{cvendorbaseid}</if>
            <if test="cvendormangid != null and cvendormangid != ''">or cvendormangid = #{cvendormangid}</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">or dr = #{dr}</if>
            <if test="drevisiondate != null and drevisiondate != ''">or drevisiondate = #{drevisiondate}</if>
            <if test="forderstatus != null">or forderstatus = #{forderstatus}</if>
            <if test="iprintcount != null">or iprintcount = #{iprintcount}</if>
            <if test="irespstatus != null">or irespstatus = #{irespstatus}</if>
            <if test="nprepaymaxmny != null and nprepaymaxmny != ''">or nprepaymaxmny = #{nprepaymaxmny}</if>
            <if test="nprepaymny != null and nprepaymny != ''">or nprepaymny = #{nprepaymny}</if>
            <if test="ntotalmny != null and ntotalmny != ''">or ntotalmny = #{ntotalmny}</if>
            <if test="ntotalnum != null and ntotalnum != ''">or ntotalnum = #{ntotalnum}</if>
            <if test="nversion != null">or nversion = #{nversion}</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="tpubtime != null and tpubtime != ''">or tpubtime = #{tpubtime}</if>
            <if test="tresptime != null and tresptime != ''">or tresptime = #{tresptime}</if>
            <if test="trevisiontime != null and trevisiontime != ''">or trevisiontime = #{trevisiontime}</if>
            <if test="ts != null and ts != ''">or ts = #{ts}</if>
            <if test="vcoopordercode != null and vcoopordercode != ''">or vcoopordercode = #{vcoopordercode}</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>
            <if test="vrefusrsn != null and vrefusrsn != ''">or vrefusrsn = #{vrefusrsn}</if>
        </trim>
        <if test=" sort == ''.toString() ">order by sorts asc</if>
        <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
    </select>

    <!--新增所有列-->
    <insert id="entity_insert" parameterType="com.hzya.frame.plugin.lets.entity.PoOrderEntity" keyProperty="corderid"
            useGeneratedKeys="true">
        insert into po_order(
        <trim suffix="" suffixOverrides=",">
            <if test="bcooptoso != null and bcooptoso != ''">bcooptoso ,</if>
            <if test="bislatest != null and bislatest != ''">bislatest ,</if>
            <if test="bisreplenish != null and bisreplenish != ''">bisreplenish ,</if>
            <if test="bpubtoec != null and bpubtoec != ''">bpubtoec ,</if>
            <if test="breturn != null and breturn != ''">breturn ,</if>
            <if test="bsocooptome != null and bsocooptome != ''">bsocooptome ,</if>
            <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="ccontracttextpath != null and ccontracttextpath != ''">ccontracttextpath ,</if>
            <if test="cdeliveraddress != null and cdeliveraddress != ''">cdeliveraddress ,</if>
            <if test="cdeptid != null and cdeptid != ''">cdeptid ,</if>
            <if test="cemployeeid != null and cemployeeid != ''">cemployeeid ,</if>
            <if test="cfreecustid != null and cfreecustid != ''">cfreecustid ,</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="cpubpsn != null and cpubpsn != ''">cpubpsn ,</if>
            <if test="cpurorganization != null and cpurorganization != ''">cpurorganization ,</if>
            <if test="creciever != null and creciever != ''">creciever ,</if>
            <if test="cresppsn != null and cresppsn != ''">cresppsn ,</if>
            <if test="crevisepsn != null and crevisepsn != ''">crevisepsn ,</if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''">ctermprotocolid ,</if>
            <if test="ctransmodeid != null and ctransmodeid != ''">ctransmodeid ,</if>
            <if test="cunfreeze != null and cunfreeze != ''">cunfreeze ,</if>
            <if test="cvendorbaseid != null and cvendorbaseid != ''">cvendorbaseid ,</if>
            <if test="cvendormangid != null and cvendormangid != ''">cvendormangid ,</if>
            <if test="dauditdate != null and dauditdate != ''">dauditdate ,</if>
            <if test="dorderdate != null and dorderdate != ''">dorderdate ,</if>
            <if test="dr != null">dr ,</if>
            <if test="drevisiondate != null and drevisiondate != ''">drevisiondate ,</if>
            <if test="forderstatus != null">forderstatus ,</if>
            <if test="iprintcount != null">iprintcount ,</if>
            <if test="irespstatus != null">irespstatus ,</if>
            <if test="nprepaymaxmny != null and nprepaymaxmny != ''">nprepaymaxmny ,</if>
            <if test="nprepaymny != null and nprepaymny != ''">nprepaymny ,</if>
            <if test="ntotalmny != null and ntotalmny != ''">ntotalmny ,</if>
            <if test="ntotalnum != null and ntotalnum != ''">ntotalnum ,</if>
            <if test="nversion != null">nversion ,</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="tpubtime != null and tpubtime != ''">tpubtime ,</if>
            <if test="tresptime != null and tresptime != ''">tresptime ,</if>
            <if test="trevisiontime != null and trevisiontime != ''">trevisiontime ,</if>
            <if test="ts != null and ts != ''">ts ,</if>
            <if test="vcoopordercode != null and vcoopordercode != ''">vcoopordercode ,</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="vrefusrsn != null and vrefusrsn != ''">vrefusrsn ,</if>
            <if test="sorts == null ">sorts,</if>
            <if test="sts == null ">sts,</if>
        </trim>
        )values(
        <trim suffix="" suffixOverrides=",">
            <if test="bcooptoso != null and bcooptoso != ''">#{bcooptoso} ,</if>
            <if test="bislatest != null and bislatest != ''">#{bislatest} ,</if>
            <if test="bisreplenish != null and bisreplenish != ''">#{bisreplenish} ,</if>
            <if test="bpubtoec != null and bpubtoec != ''">#{bpubtoec} ,</if>
            <if test="breturn != null and breturn != ''">#{breturn} ,</if>
            <if test="bsocooptome != null and bsocooptome != ''">#{bsocooptome} ,</if>
            <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="ccontracttextpath != null and ccontracttextpath != ''">#{ccontracttextpath} ,</if>
            <if test="cdeliveraddress != null and cdeliveraddress != ''">#{cdeliveraddress} ,</if>
            <if test="cdeptid != null and cdeptid != ''">#{cdeptid} ,</if>
            <if test="cemployeeid != null and cemployeeid != ''">#{cemployeeid} ,</if>
            <if test="cfreecustid != null and cfreecustid != ''">#{cfreecustid} ,</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="cpubpsn != null and cpubpsn != ''">#{cpubpsn} ,</if>
            <if test="cpurorganization != null and cpurorganization != ''">#{cpurorganization} ,</if>
            <if test="creciever != null and creciever != ''">#{creciever} ,</if>
            <if test="cresppsn != null and cresppsn != ''">#{cresppsn} ,</if>
            <if test="crevisepsn != null and crevisepsn != ''">#{crevisepsn} ,</if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''">#{ctermprotocolid} ,</if>
            <if test="ctransmodeid != null and ctransmodeid != ''">#{ctransmodeid} ,</if>
            <if test="cunfreeze != null and cunfreeze != ''">#{cunfreeze} ,</if>
            <if test="cvendorbaseid != null and cvendorbaseid != ''">#{cvendorbaseid} ,</if>
            <if test="cvendormangid != null and cvendormangid != ''">#{cvendormangid} ,</if>
            <if test="dauditdate != null and dauditdate != ''">#{dauditdate} ,</if>
            <if test="dorderdate != null and dorderdate != ''">#{dorderdate} ,</if>
            <if test="dr != null">#{dr} ,</if>
            <if test="drevisiondate != null and drevisiondate != ''">#{drevisiondate} ,</if>
            <if test="forderstatus != null">#{forderstatus} ,</if>
            <if test="iprintcount != null">#{iprintcount} ,</if>
            <if test="irespstatus != null">#{irespstatus} ,</if>
            <if test="nprepaymaxmny != null and nprepaymaxmny != ''">#{nprepaymaxmny} ,</if>
            <if test="nprepaymny != null and nprepaymny != ''">#{nprepaymny} ,</if>
            <if test="ntotalmny != null and ntotalmny != ''">#{ntotalmny} ,</if>
            <if test="ntotalnum != null and ntotalnum != ''">#{ntotalnum} ,</if>
            <if test="nversion != null">#{nversion} ,</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="tpubtime != null and tpubtime != ''">#{tpubtime} ,</if>
            <if test="tresptime != null and tresptime != ''">#{tresptime} ,</if>
            <if test="trevisiontime != null and trevisiontime != ''">#{trevisiontime} ,</if>
            <if test="ts != null and ts != ''">#{ts} ,</if>
            <if test="vcoopordercode != null and vcoopordercode != ''">#{vcoopordercode} ,</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="vrefusrsn != null and vrefusrsn != ''">#{vrefusrsn} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from po_order a WHERE a.sts = 'Y'
                ),
            </if>
            <if test="sts == null ">'Y',</if>
        </trim>
        )
    </insert>
    <!-- 批量新增 -->
    <insert id="entityInsertBatch" keyProperty="corderid" useGeneratedKeys="true">
        insert into po_order(bcooptoso, bislatest, bisreplenish, bpubtoec, breturn, bsocooptome, caccountbankid,
        caccountyear, cauditpsn, cbiztype, ccontracttextpath, cdeliveraddress, cdeptid, cemployeeid, cfreecustid,
        cgiveinvoicevendor, coperator, cpubpsn, cpurorganization, creciever, cresppsn, crevisepsn, ctermprotocolid,
        ctransmodeid, cunfreeze, cvendorbaseid, cvendormangid, dauditdate, dorderdate, dr, drevisiondate, forderstatus,
        iprintcount, irespstatus, nprepaymaxmny, nprepaymny, ntotalmny, ntotalnum, nversion, 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, tpubtime, tresptime, trevisiontime, ts,
        vcoopordercode, vdef1, vdef10, vdef11, vdef12, vdef13, vdef14, vdef15, vdef16, vdef17, vdef18, vdef19, vdef2,
        vdef20, vdef3, vdef4, vdef5, vdef6, vdef7, vdef8, vdef9, vmemo, vordercode, vrefusrsn, sts)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.bcooptoso},#{entity.bislatest},#{entity.bisreplenish},#{entity.bpubtoec},#{entity.breturn},#{entity.bsocooptome},#{entity.caccountbankid},#{entity.caccountyear},#{entity.cauditpsn},#{entity.cbiztype},#{entity.ccontracttextpath},#{entity.cdeliveraddress},#{entity.cdeptid},#{entity.cemployeeid},#{entity.cfreecustid},#{entity.cgiveinvoicevendor},#{entity.coperator},#{entity.cpubpsn},#{entity.cpurorganization},#{entity.creciever},#{entity.cresppsn},#{entity.crevisepsn},#{entity.ctermprotocolid},#{entity.ctransmodeid},#{entity.cunfreeze},#{entity.cvendorbaseid},#{entity.cvendormangid},#{entity.dauditdate},#{entity.dorderdate},#{entity.dr},#{entity.drevisiondate},#{entity.forderstatus},#{entity.iprintcount},#{entity.irespstatus},#{entity.nprepaymaxmny},#{entity.nprepaymny},#{entity.ntotalmny},#{entity.ntotalnum},#{entity.nversion},#{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.tpubtime},#{entity.tresptime},#{entity.trevisiontime},#{entity.ts},#{entity.vcoopordercode},#{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},#{entity.vrefusrsn},
            'Y')
        </foreach>
    </insert>
    <!-- 批量新增或者修改-->
    <insert id="entityInsertOrUpdateBatch" keyProperty="corderid" useGeneratedKeys="true">
        insert into po_order(bcooptoso, bislatest, bisreplenish, bpubtoec, breturn, bsocooptome, caccountbankid,
        caccountyear, cauditpsn, cbiztype, ccontracttextpath, cdeliveraddress, cdeptid, cemployeeid, cfreecustid,
        cgiveinvoicevendor, coperator, cpubpsn, cpurorganization, creciever, cresppsn, crevisepsn, ctermprotocolid,
        ctransmodeid, cunfreeze, cvendorbaseid, cvendormangid, dauditdate, dorderdate, dr, drevisiondate, forderstatus,
        iprintcount, irespstatus, nprepaymaxmny, nprepaymny, ntotalmny, ntotalnum, nversion, 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, tpubtime, tresptime, trevisiontime, ts,
        vcoopordercode, vdef1, vdef10, vdef11, vdef12, vdef13, vdef14, vdef15, vdef16, vdef17, vdef18, vdef19, vdef2,
        vdef20, vdef3, vdef4, vdef5, vdef6, vdef7, vdef8, vdef9, vmemo, vordercode, vrefusrsn)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.bcooptoso},#{entity.bislatest},#{entity.bisreplenish},#{entity.bpubtoec},#{entity.breturn},#{entity.bsocooptome},#{entity.caccountbankid},#{entity.caccountyear},#{entity.cauditpsn},#{entity.cbiztype},#{entity.ccontracttextpath},#{entity.cdeliveraddress},#{entity.cdeptid},#{entity.cemployeeid},#{entity.cfreecustid},#{entity.cgiveinvoicevendor},#{entity.coperator},#{entity.cpubpsn},#{entity.cpurorganization},#{entity.creciever},#{entity.cresppsn},#{entity.crevisepsn},#{entity.ctermprotocolid},#{entity.ctransmodeid},#{entity.cunfreeze},#{entity.cvendorbaseid},#{entity.cvendormangid},#{entity.dauditdate},#{entity.dorderdate},#{entity.dr},#{entity.drevisiondate},#{entity.forderstatus},#{entity.iprintcount},#{entity.irespstatus},#{entity.nprepaymaxmny},#{entity.nprepaymny},#{entity.ntotalmny},#{entity.ntotalnum},#{entity.nversion},#{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.tpubtime},#{entity.tresptime},#{entity.trevisiontime},#{entity.ts},#{entity.vcoopordercode},#{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},#{entity.vrefusrsn})
        </foreach>
        on duplicate key update
        bcooptoso = values(bcooptoso),
        bislatest = values(bislatest),
        bisreplenish = values(bisreplenish),
        bpubtoec = values(bpubtoec),
        breturn = values(breturn),
        bsocooptome = values(bsocooptome),
        caccountbankid = values(caccountbankid),
        caccountyear = values(caccountyear),
        cauditpsn = values(cauditpsn),
        cbiztype = values(cbiztype),
        ccontracttextpath = values(ccontracttextpath),
        cdeliveraddress = values(cdeliveraddress),
        cdeptid = values(cdeptid),
        cemployeeid = values(cemployeeid),
        cfreecustid = values(cfreecustid),
        cgiveinvoicevendor = values(cgiveinvoicevendor),
        coperator = values(coperator),
        cpubpsn = values(cpubpsn),
        cpurorganization = values(cpurorganization),
        creciever = values(creciever),
        cresppsn = values(cresppsn),
        crevisepsn = values(crevisepsn),
        ctermprotocolid = values(ctermprotocolid),
        ctransmodeid = values(ctransmodeid),
        cunfreeze = values(cunfreeze),
        cvendorbaseid = values(cvendorbaseid),
        cvendormangid = values(cvendormangid),
        dauditdate = values(dauditdate),
        dorderdate = values(dorderdate),
        dr = values(dr),
        drevisiondate = values(drevisiondate),
        forderstatus = values(forderstatus),
        iprintcount = values(iprintcount),
        irespstatus = values(irespstatus),
        nprepaymaxmny = values(nprepaymaxmny),
        nprepaymny = values(nprepaymny),
        ntotalmny = values(ntotalmny),
        ntotalnum = values(ntotalnum),
        nversion = values(nversion),
        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),
        tpubtime = values(tpubtime),
        tresptime = values(tresptime),
        trevisiontime = values(trevisiontime),
        ts = values(ts),
        vcoopordercode = values(vcoopordercode),
        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),
        vrefusrsn = values(vrefusrsn)
    </insert>
    <!--通过主键修改方法-->
    <update id="entity_update" parameterType="com.hzya.frame.plugin.lets.entity.PoOrderEntity">
        update po_order set
        <trim suffix="" suffixOverrides=",">
            <if test="bcooptoso != null and bcooptoso != ''">bcooptoso = #{bcooptoso},</if>
            <if test="bislatest != null and bislatest != ''">bislatest = #{bislatest},</if>
            <if test="bisreplenish != null and bisreplenish != ''">bisreplenish = #{bisreplenish},</if>
            <if test="bpubtoec != null and bpubtoec != ''">bpubtoec = #{bpubtoec},</if>
            <if test="breturn != null and breturn != ''">breturn = #{breturn},</if>
            <if test="bsocooptome != null and bsocooptome != ''">bsocooptome = #{bsocooptome},</if>
            <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="ccontracttextpath != null and ccontracttextpath != ''">ccontracttextpath = #{ccontracttextpath},
            </if>
            <if test="cdeliveraddress != null and cdeliveraddress != ''">cdeliveraddress = #{cdeliveraddress},</if>
            <if test="cdeptid != null and cdeptid != ''">cdeptid = #{cdeptid},</if>
            <if test="cemployeeid != null and cemployeeid != ''">cemployeeid = #{cemployeeid},</if>
            <if test="cfreecustid != null and cfreecustid != ''">cfreecustid = #{cfreecustid},</if>
            <if test="cgiveinvoicevendor != null and cgiveinvoicevendor != ''">cgiveinvoicevendor =
                #{cgiveinvoicevendor},
            </if>
            <if test="coperator != null and coperator != ''">coperator = #{coperator},</if>
            <if test="cpubpsn != null and cpubpsn != ''">cpubpsn = #{cpubpsn},</if>
            <if test="cpurorganization != null and cpurorganization != ''">cpurorganization = #{cpurorganization},</if>
            <if test="creciever != null and creciever != ''">creciever = #{creciever},</if>
            <if test="cresppsn != null and cresppsn != ''">cresppsn = #{cresppsn},</if>
            <if test="crevisepsn != null and crevisepsn != ''">crevisepsn = #{crevisepsn},</if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''">ctermprotocolid = #{ctermprotocolid},</if>
            <if test="ctransmodeid != null and ctransmodeid != ''">ctransmodeid = #{ctransmodeid},</if>
            <if test="cunfreeze != null and cunfreeze != ''">cunfreeze = #{cunfreeze},</if>
            <if test="cvendorbaseid != null and cvendorbaseid != ''">cvendorbaseid = #{cvendorbaseid},</if>
            <if test="cvendormangid != null and cvendormangid != ''">cvendormangid = #{cvendormangid},</if>
            <if test="dauditdate != null and dauditdate != ''">dauditdate = #{dauditdate},</if>
            <if test="dorderdate != null and dorderdate != ''">dorderdate = #{dorderdate},</if>
            <if test="dr != null">dr = #{dr},</if>
            <if test="drevisiondate != null and drevisiondate != ''">drevisiondate = #{drevisiondate},</if>
            <if test="forderstatus != null">forderstatus = #{forderstatus},</if>
            <if test="iprintcount != null">iprintcount = #{iprintcount},</if>
            <if test="irespstatus != null">irespstatus = #{irespstatus},</if>
            <if test="nprepaymaxmny != null and nprepaymaxmny != ''">nprepaymaxmny = #{nprepaymaxmny},</if>
            <if test="nprepaymny != null and nprepaymny != ''">nprepaymny = #{nprepaymny},</if>
            <if test="ntotalmny != null and ntotalmny != ''">ntotalmny = #{ntotalmny},</if>
            <if test="ntotalnum != null and ntotalnum != ''">ntotalnum = #{ntotalnum},</if>
            <if test="nversion != null">nversion = #{nversion},</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="tpubtime != null and tpubtime != ''">tpubtime = #{tpubtime},</if>
            <if test="tresptime != null and tresptime != ''">tresptime = #{tresptime},</if>
            <if test="trevisiontime != null and trevisiontime != ''">trevisiontime = #{trevisiontime},</if>
            <if test="ts != null and ts != ''">ts = #{ts},</if>
            <if test="vcoopordercode != null and vcoopordercode != ''">vcoopordercode = #{vcoopordercode},</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>
            <if test="vrefusrsn != null and vrefusrsn != ''">vrefusrsn = #{vrefusrsn},</if>
        </trim>
        where corderid = #{corderid}
    </update>

    <!-- 逻辑删除 -->
    <update id="entity_logicDelete" parameterType="com.hzya.frame.plugin.lets.entity.PoOrderEntity">
        update po_order
        set sts= 'N'
        where corderid = #{corderid}
    </update>

    <!-- 多条件逻辑删除 -->
    <update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.plugin.lets.entity.PoOrderEntity">
        update po_order set sts= 'N'
        <trim prefix="where" prefixOverrides="and">
            <if test="bcooptoso != null and bcooptoso != ''">and bcooptoso = #{bcooptoso}</if>
            <if test="bislatest != null and bislatest != ''">and bislatest = #{bislatest}</if>
            <if test="bisreplenish != null and bisreplenish != ''">and bisreplenish = #{bisreplenish}</if>
            <if test="bpubtoec != null and bpubtoec != ''">and bpubtoec = #{bpubtoec}</if>
            <if test="breturn != null and breturn != ''">and breturn = #{breturn}</if>
            <if test="bsocooptome != null and bsocooptome != ''">and bsocooptome = #{bsocooptome}</if>
            <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="ccontracttextpath != null and ccontracttextpath != ''">and ccontracttextpath =
                #{ccontracttextpath}
            </if>
            <if test="cdeliveraddress != null and cdeliveraddress != ''">and cdeliveraddress = #{cdeliveraddress}</if>
            <if test="cdeptid != null and cdeptid != ''">and cdeptid = #{cdeptid}</if>
            <if test="cemployeeid != null and cemployeeid != ''">and cemployeeid = #{cemployeeid}</if>
            <if test="cfreecustid != null and cfreecustid != ''">and cfreecustid = #{cfreecustid}</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="cpubpsn != null and cpubpsn != ''">and cpubpsn = #{cpubpsn}</if>
            <if test="cpurorganization != null and cpurorganization != ''">and cpurorganization = #{cpurorganization}
            </if>
            <if test="creciever != null and creciever != ''">and creciever = #{creciever}</if>
            <if test="cresppsn != null and cresppsn != ''">and cresppsn = #{cresppsn}</if>
            <if test="crevisepsn != null and crevisepsn != ''">and crevisepsn = #{crevisepsn}</if>
            <if test="ctermprotocolid != null and ctermprotocolid != ''">and ctermprotocolid = #{ctermprotocolid}</if>
            <if test="ctransmodeid != null and ctransmodeid != ''">and ctransmodeid = #{ctransmodeid}</if>
            <if test="cunfreeze != null and cunfreeze != ''">and cunfreeze = #{cunfreeze}</if>
            <if test="cvendorbaseid != null and cvendorbaseid != ''">and cvendorbaseid = #{cvendorbaseid}</if>
            <if test="cvendormangid != null and cvendormangid != ''">and cvendormangid = #{cvendormangid}</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 = #{dr}</if>
            <if test="drevisiondate != null and drevisiondate != ''">and drevisiondate = #{drevisiondate}</if>
            <if test="forderstatus != null">and forderstatus = #{forderstatus}</if>
            <if test="iprintcount != null">and iprintcount = #{iprintcount}</if>
            <if test="irespstatus != null">and irespstatus = #{irespstatus}</if>
            <if test="nprepaymaxmny != null and nprepaymaxmny != ''">and nprepaymaxmny = #{nprepaymaxmny}</if>
            <if test="nprepaymny != null and nprepaymny != ''">and nprepaymny = #{nprepaymny}</if>
            <if test="ntotalmny != null and ntotalmny != ''">and ntotalmny = #{ntotalmny}</if>
            <if test="ntotalnum != null and ntotalnum != ''">and ntotalnum = #{ntotalnum}</if>
            <if test="nversion != null">and nversion = #{nversion}</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="tpubtime != null and tpubtime != ''">and tpubtime = #{tpubtime}</if>
            <if test="tresptime != null and tresptime != ''">and tresptime = #{tresptime}</if>
            <if test="trevisiontime != null and trevisiontime != ''">and trevisiontime = #{trevisiontime}</if>
            <if test="ts != null and ts != ''">and ts = #{ts}</if>
            <if test="vcoopordercode != null and vcoopordercode != ''">and vcoopordercode = #{vcoopordercode}</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>
            <if test="vrefusrsn != null and vrefusrsn != ''">and vrefusrsn = #{vrefusrsn}</if>
        </trim>
    </update>

    <!--通过主键删除-->
    <delete id="entity_delete">
        delete
        from po_order
        where corderid = #{corderid}
    </delete>

    <!--修改原始订单号-->
    <update id="updateVdef20" parameterType="com.hzya.frame.plugin.lets.entity.PoOrderEntity">
        update po_order set vdef20 = #{vdef20} where corderid = #{corderid} and dr = 0
    </update>
</mapper>

