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

    <resultMap id="get-BdInvbasdocEntity-result" type="com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity" >
       <result property="asset" column="asset" jdbcType="VARCHAR"/>
           <result property="assistunit" column="assistunit" jdbcType="VARCHAR"/>
           <result property="autobalancemeas" column="autobalancemeas" jdbcType="VARCHAR"/>
           <result property="billtemplet" column="billtemplet" jdbcType="VARCHAR"/>
           <result property="createtime" column="createtime" jdbcType="VARCHAR"/>
           <result property="creator" column="creator" jdbcType="VARCHAR"/>
           <result property="def1" column="def1" jdbcType="VARCHAR"/>
           <result property="def10" column="def10" jdbcType="VARCHAR"/>
           <result property="def11" column="def11" jdbcType="VARCHAR"/>
           <result property="def12" column="def12" jdbcType="VARCHAR"/>
           <result property="def13" column="def13" jdbcType="VARCHAR"/>
           <result property="def14" column="def14" jdbcType="VARCHAR"/>
           <result property="def15" column="def15" jdbcType="VARCHAR"/>
           <result property="def16" column="def16" jdbcType="VARCHAR"/>
           <result property="def17" column="def17" jdbcType="VARCHAR"/>
           <result property="def18" column="def18" jdbcType="VARCHAR"/>
           <result property="def19" column="def19" jdbcType="VARCHAR"/>
           <result property="def2" column="def2" jdbcType="VARCHAR"/>
           <result property="def20" column="def20" jdbcType="VARCHAR"/>
           <result property="def3" column="def3" jdbcType="VARCHAR"/>
           <result property="def4" column="def4" jdbcType="VARCHAR"/>
           <result property="def5" column="def5" jdbcType="VARCHAR"/>
           <result property="def6" column="def6" jdbcType="VARCHAR"/>
           <result property="def7" column="def7" jdbcType="VARCHAR"/>
           <result property="def8" column="def8" jdbcType="VARCHAR"/>
           <result property="def9" column="def9" jdbcType="VARCHAR"/>
           <result property="discountflag" column="discountflag" jdbcType="VARCHAR"/>
           <result property="dr" column="dr" jdbcType="INTEGER"/>
           <result property="faset" column="faset" jdbcType="VARCHAR"/>
           <result property="forinvname" column="forinvname" jdbcType="VARCHAR"/>
           <result property="free1" column="free1" jdbcType="VARCHAR"/>
           <result property="free10" column="free10" jdbcType="VARCHAR"/>
           <result property="free2" column="free2" jdbcType="VARCHAR"/>
           <result property="free3" column="free3" jdbcType="VARCHAR"/>
           <result property="free4" column="free4" jdbcType="VARCHAR"/>
           <result property="free5" column="free5" jdbcType="VARCHAR"/>
           <result property="free6" column="free6" jdbcType="VARCHAR"/>
           <result property="free7" column="free7" jdbcType="VARCHAR"/>
           <result property="free8" column="free8" jdbcType="VARCHAR"/>
           <result property="free9" column="free9" jdbcType="VARCHAR"/>
           <result property="graphid" column="graphid" jdbcType="VARCHAR"/>
           <result property="height" column="height" jdbcType="VARCHAR"/>
           <result property="invbarcode" column="invbarcode" jdbcType="VARCHAR"/>
           <result property="invcode" column="invcode" jdbcType="VARCHAR"/>
           <result property="invmnecode" column="invmnecode" jdbcType="VARCHAR"/>
           <result property="invname" column="invname" jdbcType="VARCHAR"/>
           <result property="invpinpai" column="invpinpai" jdbcType="VARCHAR"/>
           <result property="invshortname" column="invshortname" jdbcType="VARCHAR"/>
           <result property="invspec" column="invspec" jdbcType="VARCHAR"/>
           <result property="invtype" column="invtype" jdbcType="VARCHAR"/>
           <result property="iselectrans" column="iselectrans" jdbcType="VARCHAR"/>
           <result property="ismngstockbygrswt" column="ismngstockbygrswt" jdbcType="VARCHAR"/>
           <result property="isretail" column="isretail" jdbcType="VARCHAR"/>
           <result property="isstorebyconvert" column="isstorebyconvert" jdbcType="VARCHAR"/>
           <result property="laborflag" column="laborflag" jdbcType="VARCHAR"/>
           <result property="length" column="length" jdbcType="VARCHAR"/>
           <result property="memo" column="memo" jdbcType="VARCHAR"/>
           <result property="modifier" column="modifier" jdbcType="VARCHAR"/>
           <result property="modifytime" column="modifytime" jdbcType="VARCHAR"/>
           <result property="pkAssetcategory" column="pk_assetcategory" jdbcType="VARCHAR"/>
           <result property="pkCorp" column="pk_corp" jdbcType="VARCHAR"/>
           <result property="pkInvbasdoc" column="pk_invbasdoc" jdbcType="VARCHAR"/>
           <result property="pkInvcl" column="pk_invcl" jdbcType="VARCHAR"/>
           <result property="pkMeasdoc" column="pk_measdoc" jdbcType="VARCHAR"/>
           <result property="pkMeasdoc1" column="pk_measdoc1" jdbcType="VARCHAR"/>
           <result property="pkMeasdoc2" column="pk_measdoc2" jdbcType="VARCHAR"/>
           <result property="pkMeasdoc3" column="pk_measdoc3" jdbcType="VARCHAR"/>
           <result property="pkMeasdoc5" column="pk_measdoc5" jdbcType="VARCHAR"/>
           <result property="pkMeasdoc6" column="pk_measdoc6" jdbcType="VARCHAR"/>
           <result property="pkProdline" column="pk_prodline" jdbcType="VARCHAR"/>
           <result property="pkTaxitems" column="pk_taxitems" jdbcType="VARCHAR"/>
           <result property="sealflag" column="sealflag" jdbcType="VARCHAR"/>
           <result property="setpartsflag" column="setpartsflag" jdbcType="VARCHAR"/>
           <result property="shipunitnum" column="shipunitnum" jdbcType="VARCHAR"/>
           <result property="storeunitnum" column="storeunitnum" jdbcType="VARCHAR"/>
           <result property="ts" column="ts" jdbcType="VARCHAR"/>
           <result property="unitvolume" column="unitvolume" jdbcType="VARCHAR"/>
           <result property="unitweight" column="unitweight" jdbcType="VARCHAR"/>
           <result property="weitunitnum" column="weitunitnum" jdbcType="VARCHAR"/>
           <result property="width" column="width" jdbcType="VARCHAR"/>

            <result property="pk_invmandoc" column="pk_invmandoc" jdbcType="VARCHAR"/>
            <result property="pk_corp_man" column="pk_corp_man" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "BdInvbasdocEntity_Base_Column_List">
        asset
       ,assistunit 
        ,autobalancemeas 
        ,billtemplet 
        ,createtime 
        ,creator 
        ,def1 
        ,def10 
        ,def11 
        ,def12 
        ,def13 
        ,def14 
        ,def15 
        ,def16 
        ,def17 
        ,def18 
        ,def19 
        ,def2 
        ,def20 
        ,def3 
        ,def4 
        ,def5 
        ,def6 
        ,def7 
        ,def8 
        ,def9 
        ,discountflag 
        ,dr 
        ,faset 
        ,forinvname 
        ,free1 
        ,free10 
        ,free2 
        ,free3 
        ,free4 
        ,free5 
        ,free6 
        ,free7 
        ,free8 
        ,free9 
        ,graphid 
        ,height 
        ,invbarcode 
        ,invcode 
        ,invmnecode 
        ,invname 
        ,invpinpai 
        ,invshortname 
        ,invspec 
        ,invtype 
        ,iselectrans 
        ,ismngstockbygrswt 
        ,isretail 
        ,isstorebyconvert 
        ,laborflag 
        ,length 
        ,memo 
        ,modifier 
        ,modifytime 
        ,pk_assetcategory 
        ,pk_corp 
        ,pk_invbasdoc 
        ,pk_invcl 
        ,pk_measdoc 
        ,pk_measdoc1 
        ,pk_measdoc2 
        ,pk_measdoc3 
        ,pk_measdoc5 
        ,pk_measdoc6 
        ,pk_prodline 
        ,pk_taxitems 
        ,sealflag 
        ,setpartsflag 
        ,shipunitnum 
        ,storeunitnum 
        ,ts 
        ,unitvolume 
        ,unitweight 
        ,weitunitnum 
        ,width 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-BdInvbasdocEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity">
    select
    <include refid="BdInvbasdocEntity_Base_Column_List" />
    from bd_invbasdoc
    <trim prefix="where" prefixOverrides="and"> 
        <if test="asset != null and asset != ''"> and asset = #{asset} </if>
            <if test="assistunit != null and assistunit != ''"> and assistunit = #{assistunit} </if>
            <if test="autobalancemeas != null and autobalancemeas != ''"> and autobalancemeas = #{autobalancemeas} </if>
            <if test="billtemplet != null and billtemplet != ''"> and billtemplet = #{billtemplet} </if>
            <if test="createtime != null and createtime != ''"> and createtime = #{createtime} </if>
            <if test="creator != null and creator != ''"> and creator = #{creator} </if>
            <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
            <if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
            <if test="def11 != null and def11 != ''"> and def11 = #{def11} </if>
            <if test="def12 != null and def12 != ''"> and def12 = #{def12} </if>
            <if test="def13 != null and def13 != ''"> and def13 = #{def13} </if>
            <if test="def14 != null and def14 != ''"> and def14 = #{def14} </if>
            <if test="def15 != null and def15 != ''"> and def15 = #{def15} </if>
            <if test="def16 != null and def16 != ''"> and def16 = #{def16} </if>
            <if test="def17 != null and def17 != ''"> and def17 = #{def17} </if>
            <if test="def18 != null and def18 != ''"> and def18 = #{def18} </if>
            <if test="def19 != null and def19 != ''"> and def19 = #{def19} </if>
            <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
            <if test="def20 != null and def20 != ''"> and def20 = #{def20} </if>
            <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
            <if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
            <if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
            <if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
            <if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
            <if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
            <if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
            <if test="discountflag != null and discountflag != ''"> and discountflag = #{discountflag} </if>
            <if test="dr != null"> and dr = #{dr} </if>
            <if test="faset != null and faset != ''"> and faset = #{faset} </if>
            <if test="forinvname != null and forinvname != ''"> and forinvname = #{forinvname} </if>
            <if test="free1 != null and free1 != ''"> and free1 = #{free1} </if>
            <if test="free10 != null and free10 != ''"> and free10 = #{free10} </if>
            <if test="free2 != null and free2 != ''"> and free2 = #{free2} </if>
            <if test="free3 != null and free3 != ''"> and free3 = #{free3} </if>
            <if test="free4 != null and free4 != ''"> and free4 = #{free4} </if>
            <if test="free5 != null and free5 != ''"> and free5 = #{free5} </if>
            <if test="free6 != null and free6 != ''"> and free6 = #{free6} </if>
            <if test="free7 != null and free7 != ''"> and free7 = #{free7} </if>
            <if test="free8 != null and free8 != ''"> and free8 = #{free8} </if>
            <if test="free9 != null and free9 != ''"> and free9 = #{free9} </if>
            <if test="graphid != null and graphid != ''"> and graphid = #{graphid} </if>
            <if test="height != null and height != ''"> and height = #{height} </if>
            <if test="invbarcode != null and invbarcode != ''"> and invbarcode = #{invbarcode} </if>
            <if test="invcode != null and invcode != ''"> and invcode = #{invcode} </if>
            <if test="invmnecode != null and invmnecode != ''"> and invmnecode = #{invmnecode} </if>
            <if test="invname != null and invname != ''"> and invname = #{invname} </if>
            <if test="invpinpai != null and invpinpai != ''"> and invpinpai = #{invpinpai} </if>
            <if test="invshortname != null and invshortname != ''"> and invshortname = #{invshortname} </if>
            <if test="invspec != null and invspec != ''"> and invspec = #{invspec} </if>
            <if test="invtype != null and invtype != ''"> and invtype = #{invtype} </if>
            <if test="iselectrans != null and iselectrans != ''"> and iselectrans = #{iselectrans} </if>
            <if test="ismngstockbygrswt != null and ismngstockbygrswt != ''"> and ismngstockbygrswt = #{ismngstockbygrswt} </if>
            <if test="isretail != null and isretail != ''"> and isretail = #{isretail} </if>
            <if test="isstorebyconvert != null and isstorebyconvert != ''"> and isstorebyconvert = #{isstorebyconvert} </if>
            <if test="laborflag != null and laborflag != ''"> and laborflag = #{laborflag} </if>
            <if test="length != null and length != ''"> and length = #{length} </if>
            <if test="memo != null and memo != ''"> and memo = #{memo} </if>
            <if test="modifier != null and modifier != ''"> and modifier = #{modifier} </if>
            <if test="modifytime != null and modifytime != ''"> and modifytime = #{modifytime} </if>
            <if test="pkAssetcategory != null and pkAssetcategory != ''"> and pk_assetcategory = #{pkAssetcategory} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="pkInvbasdoc != null and pkInvbasdoc != ''"> and pk_invbasdoc = #{pkInvbasdoc} </if>
            <if test="pkInvcl != null and pkInvcl != ''"> and pk_invcl = #{pkInvcl} </if>
            <if test="pkMeasdoc != null and pkMeasdoc != ''"> and pk_measdoc = #{pkMeasdoc} </if>
            <if test="pkMeasdoc1 != null and pkMeasdoc1 != ''"> and pk_measdoc1 = #{pkMeasdoc1} </if>
            <if test="pkMeasdoc2 != null and pkMeasdoc2 != ''"> and pk_measdoc2 = #{pkMeasdoc2} </if>
            <if test="pkMeasdoc3 != null and pkMeasdoc3 != ''"> and pk_measdoc3 = #{pkMeasdoc3} </if>
            <if test="pkMeasdoc5 != null and pkMeasdoc5 != ''"> and pk_measdoc5 = #{pkMeasdoc5} </if>
            <if test="pkMeasdoc6 != null and pkMeasdoc6 != ''"> and pk_measdoc6 = #{pkMeasdoc6} </if>
            <if test="pkProdline != null and pkProdline != ''"> and pk_prodline = #{pkProdline} </if>
            <if test="pkTaxitems != null and pkTaxitems != ''"> and pk_taxitems = #{pkTaxitems} </if>
            <if test="sealflag != null and sealflag != ''"> and sealflag = #{sealflag} </if>
            <if test="setpartsflag != null and setpartsflag != ''"> and setpartsflag = #{setpartsflag} </if>
            <if test="shipunitnum != null and shipunitnum != ''"> and shipunitnum = #{shipunitnum} </if>
            <if test="storeunitnum != null and storeunitnum != ''"> and storeunitnum = #{storeunitnum} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
            <if test="unitvolume != null and unitvolume != ''"> and unitvolume = #{unitvolume} </if>
            <if test="unitweight != null and unitweight != ''"> and unitweight = #{unitweight} </if>
            <if test="weitunitnum != null and weitunitnum != ''"> and weitunitnum = #{weitunitnum} </if>
            <if test="width != null and width != ''"> and width = #{width} </if>

            <if test="createtime_start_time!=null and createtime_start_time!=''">and createtime >= #{createtime_start_time}</if>
            <if test="createtime_end_time!=null and createtime_end_time!=''">and createtime &lt;= #{createtime_end_time}</if>

            <if test="modifytime_start_time!=null and modifytime_start_time!=''">and ts >= #{modifytime_start_time}</if>
            <if test="modifytime_end_time!=null and modifytime_end_time!=''">and ts &lt;= #{modifytime_end_time}</if>
    and dr=0
    </trim>
    <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.BdInvbasdocEntity">
        select  count(1)   from bd_invbasdoc
    <trim prefix="where" prefixOverrides="and"> 
        <if test="asset != null and asset != ''"> and asset = #{asset} </if>
            <if test="assistunit != null and assistunit != ''"> and assistunit = #{assistunit} </if>
            <if test="autobalancemeas != null and autobalancemeas != ''"> and autobalancemeas = #{autobalancemeas} </if>
            <if test="billtemplet != null and billtemplet != ''"> and billtemplet = #{billtemplet} </if>
            <if test="createtime != null and createtime != ''"> and createtime = #{createtime} </if>
            <if test="creator != null and creator != ''"> and creator = #{creator} </if>
            <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
            <if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
            <if test="def11 != null and def11 != ''"> and def11 = #{def11} </if>
            <if test="def12 != null and def12 != ''"> and def12 = #{def12} </if>
            <if test="def13 != null and def13 != ''"> and def13 = #{def13} </if>
            <if test="def14 != null and def14 != ''"> and def14 = #{def14} </if>
            <if test="def15 != null and def15 != ''"> and def15 = #{def15} </if>
            <if test="def16 != null and def16 != ''"> and def16 = #{def16} </if>
            <if test="def17 != null and def17 != ''"> and def17 = #{def17} </if>
            <if test="def18 != null and def18 != ''"> and def18 = #{def18} </if>
            <if test="def19 != null and def19 != ''"> and def19 = #{def19} </if>
            <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
            <if test="def20 != null and def20 != ''"> and def20 = #{def20} </if>
            <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
            <if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
            <if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
            <if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
            <if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
            <if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
            <if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
            <if test="discountflag != null and discountflag != ''"> and discountflag = #{discountflag} </if>
            <if test="dr != null"> and dr = #{dr} </if>
            <if test="faset != null and faset != ''"> and faset = #{faset} </if>
            <if test="forinvname != null and forinvname != ''"> and forinvname = #{forinvname} </if>
            <if test="free1 != null and free1 != ''"> and free1 = #{free1} </if>
            <if test="free10 != null and free10 != ''"> and free10 = #{free10} </if>
            <if test="free2 != null and free2 != ''"> and free2 = #{free2} </if>
            <if test="free3 != null and free3 != ''"> and free3 = #{free3} </if>
            <if test="free4 != null and free4 != ''"> and free4 = #{free4} </if>
            <if test="free5 != null and free5 != ''"> and free5 = #{free5} </if>
            <if test="free6 != null and free6 != ''"> and free6 = #{free6} </if>
            <if test="free7 != null and free7 != ''"> and free7 = #{free7} </if>
            <if test="free8 != null and free8 != ''"> and free8 = #{free8} </if>
            <if test="free9 != null and free9 != ''"> and free9 = #{free9} </if>
            <if test="graphid != null and graphid != ''"> and graphid = #{graphid} </if>
            <if test="height != null and height != ''"> and height = #{height} </if>
            <if test="invbarcode != null and invbarcode != ''"> and invbarcode = #{invbarcode} </if>
            <if test="invcode != null and invcode != ''"> and invcode = #{invcode} </if>
            <if test="invmnecode != null and invmnecode != ''"> and invmnecode = #{invmnecode} </if>
            <if test="invname != null and invname != ''"> and invname = #{invname} </if>
            <if test="invpinpai != null and invpinpai != ''"> and invpinpai = #{invpinpai} </if>
            <if test="invshortname != null and invshortname != ''"> and invshortname = #{invshortname} </if>
            <if test="invspec != null and invspec != ''"> and invspec = #{invspec} </if>
            <if test="invtype != null and invtype != ''"> and invtype = #{invtype} </if>
            <if test="iselectrans != null and iselectrans != ''"> and iselectrans = #{iselectrans} </if>
            <if test="ismngstockbygrswt != null and ismngstockbygrswt != ''"> and ismngstockbygrswt = #{ismngstockbygrswt} </if>
            <if test="isretail != null and isretail != ''"> and isretail = #{isretail} </if>
            <if test="isstorebyconvert != null and isstorebyconvert != ''"> and isstorebyconvert = #{isstorebyconvert} </if>
            <if test="laborflag != null and laborflag != ''"> and laborflag = #{laborflag} </if>
            <if test="length != null and length != ''"> and length = #{length} </if>
            <if test="memo != null and memo != ''"> and memo = #{memo} </if>
            <if test="modifier != null and modifier != ''"> and modifier = #{modifier} </if>
            <if test="modifytime != null and modifytime != ''"> and modifytime = #{modifytime} </if>
            <if test="pkAssetcategory != null and pkAssetcategory != ''"> and pk_assetcategory = #{pkAssetcategory} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="pkInvbasdoc != null and pkInvbasdoc != ''"> and pk_invbasdoc = #{pkInvbasdoc} </if>
            <if test="pkInvcl != null and pkInvcl != ''"> and pk_invcl = #{pkInvcl} </if>
            <if test="pkMeasdoc != null and pkMeasdoc != ''"> and pk_measdoc = #{pkMeasdoc} </if>
            <if test="pkMeasdoc1 != null and pkMeasdoc1 != ''"> and pk_measdoc1 = #{pkMeasdoc1} </if>
            <if test="pkMeasdoc2 != null and pkMeasdoc2 != ''"> and pk_measdoc2 = #{pkMeasdoc2} </if>
            <if test="pkMeasdoc3 != null and pkMeasdoc3 != ''"> and pk_measdoc3 = #{pkMeasdoc3} </if>
            <if test="pkMeasdoc5 != null and pkMeasdoc5 != ''"> and pk_measdoc5 = #{pkMeasdoc5} </if>
            <if test="pkMeasdoc6 != null and pkMeasdoc6 != ''"> and pk_measdoc6 = #{pkMeasdoc6} </if>
            <if test="pkProdline != null and pkProdline != ''"> and pk_prodline = #{pkProdline} </if>
            <if test="pkTaxitems != null and pkTaxitems != ''"> and pk_taxitems = #{pkTaxitems} </if>
            <if test="sealflag != null and sealflag != ''"> and sealflag = #{sealflag} </if>
            <if test="setpartsflag != null and setpartsflag != ''"> and setpartsflag = #{setpartsflag} </if>
            <if test="shipunitnum != null and shipunitnum != ''"> and shipunitnum = #{shipunitnum} </if>
            <if test="storeunitnum != null and storeunitnum != ''"> and storeunitnum = #{storeunitnum} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
            <if test="unitvolume != null and unitvolume != ''"> and unitvolume = #{unitvolume} </if>
            <if test="unitweight != null and unitweight != ''"> and unitweight = #{unitweight} </if>
            <if test="weitunitnum != null and weitunitnum != ''"> and weitunitnum = #{weitunitnum} </if>
            <if test="width != null and width != ''"> and width = #{width} </if>
            and sts='Y'
    </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-BdInvbasdocEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity">
    select
    <include refid="BdInvbasdocEntity_Base_Column_List" />
    from bd_invbasdoc
    <trim prefix="where" prefixOverrides="and"> 
        <if test="asset != null and asset != ''"> and asset like concat('%',#{asset},'%') </if>
            <if test="assistunit != null and assistunit != ''"> and assistunit like concat('%',#{assistunit},'%') </if>
            <if test="autobalancemeas != null and autobalancemeas != ''"> and autobalancemeas like concat('%',#{autobalancemeas},'%') </if>
            <if test="billtemplet != null and billtemplet != ''"> and billtemplet like concat('%',#{billtemplet},'%') </if>
            <if test="createtime != null and createtime != ''"> and createtime like concat('%',#{createtime},'%') </if>
            <if test="creator != null and creator != ''"> and creator like concat('%',#{creator},'%') </if>
            <if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if>
            <if test="def10 != null and def10 != ''"> and def10 like concat('%',#{def10},'%') </if>
            <if test="def11 != null and def11 != ''"> and def11 like concat('%',#{def11},'%') </if>
            <if test="def12 != null and def12 != ''"> and def12 like concat('%',#{def12},'%') </if>
            <if test="def13 != null and def13 != ''"> and def13 like concat('%',#{def13},'%') </if>
            <if test="def14 != null and def14 != ''"> and def14 like concat('%',#{def14},'%') </if>
            <if test="def15 != null and def15 != ''"> and def15 like concat('%',#{def15},'%') </if>
            <if test="def16 != null and def16 != ''"> and def16 like concat('%',#{def16},'%') </if>
            <if test="def17 != null and def17 != ''"> and def17 like concat('%',#{def17},'%') </if>
            <if test="def18 != null and def18 != ''"> and def18 like concat('%',#{def18},'%') </if>
            <if test="def19 != null and def19 != ''"> and def19 like concat('%',#{def19},'%') </if>
            <if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if>
            <if test="def20 != null and def20 != ''"> and def20 like concat('%',#{def20},'%') </if>
            <if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if>
            <if test="def4 != null and def4 != ''"> and def4 like concat('%',#{def4},'%') </if>
            <if test="def5 != null and def5 != ''"> and def5 like concat('%',#{def5},'%') </if>
            <if test="def6 != null and def6 != ''"> and def6 like concat('%',#{def6},'%') </if>
            <if test="def7 != null and def7 != ''"> and def7 like concat('%',#{def7},'%') </if>
            <if test="def8 != null and def8 != ''"> and def8 like concat('%',#{def8},'%') </if>
            <if test="def9 != null and def9 != ''"> and def9 like concat('%',#{def9},'%') </if>
            <if test="discountflag != null and discountflag != ''"> and discountflag like concat('%',#{discountflag},'%') </if>
            <if test="dr != null"> and dr like concat('%',#{dr},'%') </if>
            <if test="faset != null and faset != ''"> and faset like concat('%',#{faset},'%') </if>
            <if test="forinvname != null and forinvname != ''"> and forinvname like concat('%',#{forinvname},'%') </if>
            <if test="free1 != null and free1 != ''"> and free1 like concat('%',#{free1},'%') </if>
            <if test="free10 != null and free10 != ''"> and free10 like concat('%',#{free10},'%') </if>
            <if test="free2 != null and free2 != ''"> and free2 like concat('%',#{free2},'%') </if>
            <if test="free3 != null and free3 != ''"> and free3 like concat('%',#{free3},'%') </if>
            <if test="free4 != null and free4 != ''"> and free4 like concat('%',#{free4},'%') </if>
            <if test="free5 != null and free5 != ''"> and free5 like concat('%',#{free5},'%') </if>
            <if test="free6 != null and free6 != ''"> and free6 like concat('%',#{free6},'%') </if>
            <if test="free7 != null and free7 != ''"> and free7 like concat('%',#{free7},'%') </if>
            <if test="free8 != null and free8 != ''"> and free8 like concat('%',#{free8},'%') </if>
            <if test="free9 != null and free9 != ''"> and free9 like concat('%',#{free9},'%') </if>
            <if test="graphid != null and graphid != ''"> and graphid like concat('%',#{graphid},'%') </if>
            <if test="height != null and height != ''"> and height like concat('%',#{height},'%') </if>
            <if test="invbarcode != null and invbarcode != ''"> and invbarcode like concat('%',#{invbarcode},'%') </if>
            <if test="invcode != null and invcode != ''"> and invcode like concat('%',#{invcode},'%') </if>
            <if test="invmnecode != null and invmnecode != ''"> and invmnecode like concat('%',#{invmnecode},'%') </if>
            <if test="invname != null and invname != ''"> and invname like concat('%',#{invname},'%') </if>
            <if test="invpinpai != null and invpinpai != ''"> and invpinpai like concat('%',#{invpinpai},'%') </if>
            <if test="invshortname != null and invshortname != ''"> and invshortname like concat('%',#{invshortname},'%') </if>
            <if test="invspec != null and invspec != ''"> and invspec like concat('%',#{invspec},'%') </if>
            <if test="invtype != null and invtype != ''"> and invtype like concat('%',#{invtype},'%') </if>
            <if test="iselectrans != null and iselectrans != ''"> and iselectrans like concat('%',#{iselectrans},'%') </if>
            <if test="ismngstockbygrswt != null and ismngstockbygrswt != ''"> and ismngstockbygrswt like concat('%',#{ismngstockbygrswt},'%') </if>
            <if test="isretail != null and isretail != ''"> and isretail like concat('%',#{isretail},'%') </if>
            <if test="isstorebyconvert != null and isstorebyconvert != ''"> and isstorebyconvert like concat('%',#{isstorebyconvert},'%') </if>
            <if test="laborflag != null and laborflag != ''"> and laborflag like concat('%',#{laborflag},'%') </if>
            <if test="length != null and length != ''"> and length like concat('%',#{length},'%') </if>
            <if test="memo != null and memo != ''"> and memo like concat('%',#{memo},'%') </if>
            <if test="modifier != null and modifier != ''"> and modifier like concat('%',#{modifier},'%') </if>
            <if test="modifytime != null and modifytime != ''"> and modifytime like concat('%',#{modifytime},'%') </if>
            <if test="pkAssetcategory != null and pkAssetcategory != ''"> and pk_assetcategory like concat('%',#{pkAssetcategory},'%') </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp like concat('%',#{pkCorp},'%') </if>
            <if test="pkInvbasdoc != null and pkInvbasdoc != ''"> and pk_invbasdoc like concat('%',#{pkInvbasdoc},'%') </if>
            <if test="pkInvcl != null and pkInvcl != ''"> and pk_invcl like concat('%',#{pkInvcl},'%') </if>
            <if test="pkMeasdoc != null and pkMeasdoc != ''"> and pk_measdoc like concat('%',#{pkMeasdoc},'%') </if>
            <if test="pkMeasdoc1 != null and pkMeasdoc1 != ''"> and pk_measdoc1 like concat('%',#{pkMeasdoc1},'%') </if>
            <if test="pkMeasdoc2 != null and pkMeasdoc2 != ''"> and pk_measdoc2 like concat('%',#{pkMeasdoc2},'%') </if>
            <if test="pkMeasdoc3 != null and pkMeasdoc3 != ''"> and pk_measdoc3 like concat('%',#{pkMeasdoc3},'%') </if>
            <if test="pkMeasdoc5 != null and pkMeasdoc5 != ''"> and pk_measdoc5 like concat('%',#{pkMeasdoc5},'%') </if>
            <if test="pkMeasdoc6 != null and pkMeasdoc6 != ''"> and pk_measdoc6 like concat('%',#{pkMeasdoc6},'%') </if>
            <if test="pkProdline != null and pkProdline != ''"> and pk_prodline like concat('%',#{pkProdline},'%') </if>
            <if test="pkTaxitems != null and pkTaxitems != ''"> and pk_taxitems like concat('%',#{pkTaxitems},'%') </if>
            <if test="sealflag != null and sealflag != ''"> and sealflag like concat('%',#{sealflag},'%') </if>
            <if test="setpartsflag != null and setpartsflag != ''"> and setpartsflag like concat('%',#{setpartsflag},'%') </if>
            <if test="shipunitnum != null and shipunitnum != ''"> and shipunitnum like concat('%',#{shipunitnum},'%') </if>
            <if test="storeunitnum != null and storeunitnum != ''"> and storeunitnum like concat('%',#{storeunitnum},'%') </if>
            <if test="ts != null and ts != ''"> and ts like concat('%',#{ts},'%') </if>
            <if test="unitvolume != null and unitvolume != ''"> and unitvolume like concat('%',#{unitvolume},'%') </if>
            <if test="unitweight != null and unitweight != ''"> and unitweight like concat('%',#{unitweight},'%') </if>
            <if test="weitunitnum != null and weitunitnum != ''"> and weitunitnum like concat('%',#{weitunitnum},'%') </if>
            <if test="width != null and width != ''"> and width like concat('%',#{width},'%') </if>
            and sts='Y'
    </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="BdInvbasdocentity_list_or" resultMap="get-BdInvbasdocEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity">
    select
    <include refid="BdInvbasdocEntity_Base_Column_List" />
    from bd_invbasdoc
    <trim prefix="where" prefixOverrides="and"> 
         <if test="asset != null and asset != ''"> or asset = #{asset} </if>
             <if test="assistunit != null and assistunit != ''"> or assistunit = #{assistunit} </if>
             <if test="autobalancemeas != null and autobalancemeas != ''"> or autobalancemeas = #{autobalancemeas} </if>
             <if test="billtemplet != null and billtemplet != ''"> or billtemplet = #{billtemplet} </if>
             <if test="createtime != null and createtime != ''"> or createtime = #{createtime} </if>
             <if test="creator != null and creator != ''"> or creator = #{creator} </if>
             <if test="def1 != null and def1 != ''"> or def1 = #{def1} </if>
             <if test="def10 != null and def10 != ''"> or def10 = #{def10} </if>
             <if test="def11 != null and def11 != ''"> or def11 = #{def11} </if>
             <if test="def12 != null and def12 != ''"> or def12 = #{def12} </if>
             <if test="def13 != null and def13 != ''"> or def13 = #{def13} </if>
             <if test="def14 != null and def14 != ''"> or def14 = #{def14} </if>
             <if test="def15 != null and def15 != ''"> or def15 = #{def15} </if>
             <if test="def16 != null and def16 != ''"> or def16 = #{def16} </if>
             <if test="def17 != null and def17 != ''"> or def17 = #{def17} </if>
             <if test="def18 != null and def18 != ''"> or def18 = #{def18} </if>
             <if test="def19 != null and def19 != ''"> or def19 = #{def19} </if>
             <if test="def2 != null and def2 != ''"> or def2 = #{def2} </if>
             <if test="def20 != null and def20 != ''"> or def20 = #{def20} </if>
             <if test="def3 != null and def3 != ''"> or def3 = #{def3} </if>
             <if test="def4 != null and def4 != ''"> or def4 = #{def4} </if>
             <if test="def5 != null and def5 != ''"> or def5 = #{def5} </if>
             <if test="def6 != null and def6 != ''"> or def6 = #{def6} </if>
             <if test="def7 != null and def7 != ''"> or def7 = #{def7} </if>
             <if test="def8 != null and def8 != ''"> or def8 = #{def8} </if>
             <if test="def9 != null and def9 != ''"> or def9 = #{def9} </if>
             <if test="discountflag != null and discountflag != ''"> or discountflag = #{discountflag} </if>
             <if test="dr != null"> or dr = #{dr} </if>
             <if test="faset != null and faset != ''"> or faset = #{faset} </if>
             <if test="forinvname != null and forinvname != ''"> or forinvname = #{forinvname} </if>
             <if test="free1 != null and free1 != ''"> or free1 = #{free1} </if>
             <if test="free10 != null and free10 != ''"> or free10 = #{free10} </if>
             <if test="free2 != null and free2 != ''"> or free2 = #{free2} </if>
             <if test="free3 != null and free3 != ''"> or free3 = #{free3} </if>
             <if test="free4 != null and free4 != ''"> or free4 = #{free4} </if>
             <if test="free5 != null and free5 != ''"> or free5 = #{free5} </if>
             <if test="free6 != null and free6 != ''"> or free6 = #{free6} </if>
             <if test="free7 != null and free7 != ''"> or free7 = #{free7} </if>
             <if test="free8 != null and free8 != ''"> or free8 = #{free8} </if>
             <if test="free9 != null and free9 != ''"> or free9 = #{free9} </if>
             <if test="graphid != null and graphid != ''"> or graphid = #{graphid} </if>
             <if test="height != null and height != ''"> or height = #{height} </if>
             <if test="invbarcode != null and invbarcode != ''"> or invbarcode = #{invbarcode} </if>
             <if test="invcode != null and invcode != ''"> or invcode = #{invcode} </if>
             <if test="invmnecode != null and invmnecode != ''"> or invmnecode = #{invmnecode} </if>
             <if test="invname != null and invname != ''"> or invname = #{invname} </if>
             <if test="invpinpai != null and invpinpai != ''"> or invpinpai = #{invpinpai} </if>
             <if test="invshortname != null and invshortname != ''"> or invshortname = #{invshortname} </if>
             <if test="invspec != null and invspec != ''"> or invspec = #{invspec} </if>
             <if test="invtype != null and invtype != ''"> or invtype = #{invtype} </if>
             <if test="iselectrans != null and iselectrans != ''"> or iselectrans = #{iselectrans} </if>
             <if test="ismngstockbygrswt != null and ismngstockbygrswt != ''"> or ismngstockbygrswt = #{ismngstockbygrswt} </if>
             <if test="isretail != null and isretail != ''"> or isretail = #{isretail} </if>
             <if test="isstorebyconvert != null and isstorebyconvert != ''"> or isstorebyconvert = #{isstorebyconvert} </if>
             <if test="laborflag != null and laborflag != ''"> or laborflag = #{laborflag} </if>
             <if test="length != null and length != ''"> or length = #{length} </if>
             <if test="memo != null and memo != ''"> or memo = #{memo} </if>
             <if test="modifier != null and modifier != ''"> or modifier = #{modifier} </if>
             <if test="modifytime != null and modifytime != ''"> or modifytime = #{modifytime} </if>
             <if test="pkAssetcategory != null and pkAssetcategory != ''"> or pk_assetcategory = #{pkAssetcategory} </if>
             <if test="pkCorp != null and pkCorp != ''"> or pk_corp = #{pkCorp} </if>
             <if test="pkInvbasdoc != null and pkInvbasdoc != ''"> or pk_invbasdoc = #{pkInvbasdoc} </if>
             <if test="pkInvcl != null and pkInvcl != ''"> or pk_invcl = #{pkInvcl} </if>
             <if test="pkMeasdoc != null and pkMeasdoc != ''"> or pk_measdoc = #{pkMeasdoc} </if>
             <if test="pkMeasdoc1 != null and pkMeasdoc1 != ''"> or pk_measdoc1 = #{pkMeasdoc1} </if>
             <if test="pkMeasdoc2 != null and pkMeasdoc2 != ''"> or pk_measdoc2 = #{pkMeasdoc2} </if>
             <if test="pkMeasdoc3 != null and pkMeasdoc3 != ''"> or pk_measdoc3 = #{pkMeasdoc3} </if>
             <if test="pkMeasdoc5 != null and pkMeasdoc5 != ''"> or pk_measdoc5 = #{pkMeasdoc5} </if>
             <if test="pkMeasdoc6 != null and pkMeasdoc6 != ''"> or pk_measdoc6 = #{pkMeasdoc6} </if>
             <if test="pkProdline != null and pkProdline != ''"> or pk_prodline = #{pkProdline} </if>
             <if test="pkTaxitems != null and pkTaxitems != ''"> or pk_taxitems = #{pkTaxitems} </if>
             <if test="sealflag != null and sealflag != ''"> or sealflag = #{sealflag} </if>
             <if test="setpartsflag != null and setpartsflag != ''"> or setpartsflag = #{setpartsflag} </if>
             <if test="shipunitnum != null and shipunitnum != ''"> or shipunitnum = #{shipunitnum} </if>
             <if test="storeunitnum != null and storeunitnum != ''"> or storeunitnum = #{storeunitnum} </if>
             <if test="ts != null and ts != ''"> or ts = #{ts} </if>
             <if test="unitvolume != null and unitvolume != ''"> or unitvolume = #{unitvolume} </if>
             <if test="unitweight != null and unitweight != ''"> or unitweight = #{unitweight} </if>
             <if test="weitunitnum != null and weitunitnum != ''"> or weitunitnum = #{weitunitnum} </if>
             <if test="width != null and width != ''"> or width = #{width} </if>
            and sts='Y'
    </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.BdInvbasdocEntity" keyProperty="pkInvbasdoc" useGeneratedKeys="true">
    insert into bd_invbasdoc(
  <trim suffix="" suffixOverrides=",">
       <if test="asset != null and asset != ''"> asset , </if>
            <if test="assistunit != null and assistunit != ''"> assistunit , </if>
            <if test="autobalancemeas != null and autobalancemeas != ''"> autobalancemeas , </if>
            <if test="billtemplet != null and billtemplet != ''"> billtemplet , </if>
            <if test="createtime != null and createtime != ''"> createtime , </if>
            <if test="creator != null and creator != ''"> creator , </if>
            <if test="def1 != null and def1 != ''"> def1 , </if>
            <if test="def10 != null and def10 != ''"> def10 , </if>
            <if test="def11 != null and def11 != ''"> def11 , </if>
            <if test="def12 != null and def12 != ''"> def12 , </if>
            <if test="def13 != null and def13 != ''"> def13 , </if>
            <if test="def14 != null and def14 != ''"> def14 , </if>
            <if test="def15 != null and def15 != ''"> def15 , </if>
            <if test="def16 != null and def16 != ''"> def16 , </if>
            <if test="def17 != null and def17 != ''"> def17 , </if>
            <if test="def18 != null and def18 != ''"> def18 , </if>
            <if test="def19 != null and def19 != ''"> def19 , </if>
            <if test="def2 != null and def2 != ''"> def2 , </if>
            <if test="def20 != null and def20 != ''"> def20 , </if>
            <if test="def3 != null and def3 != ''"> def3 , </if>
            <if test="def4 != null and def4 != ''"> def4 , </if>
            <if test="def5 != null and def5 != ''"> def5 , </if>
            <if test="def6 != null and def6 != ''"> def6 , </if>
            <if test="def7 != null and def7 != ''"> def7 , </if>
            <if test="def8 != null and def8 != ''"> def8 , </if>
            <if test="def9 != null and def9 != ''"> def9 , </if>
            <if test="discountflag != null and discountflag != ''"> discountflag , </if>
            <if test="dr != null"> dr , </if>
            <if test="faset != null and faset != ''"> faset , </if>
            <if test="forinvname != null and forinvname != ''"> forinvname , </if>
            <if test="free1 != null and free1 != ''"> free1 , </if>
            <if test="free10 != null and free10 != ''"> free10 , </if>
            <if test="free2 != null and free2 != ''"> free2 , </if>
            <if test="free3 != null and free3 != ''"> free3 , </if>
            <if test="free4 != null and free4 != ''"> free4 , </if>
            <if test="free5 != null and free5 != ''"> free5 , </if>
            <if test="free6 != null and free6 != ''"> free6 , </if>
            <if test="free7 != null and free7 != ''"> free7 , </if>
            <if test="free8 != null and free8 != ''"> free8 , </if>
            <if test="free9 != null and free9 != ''"> free9 , </if>
            <if test="graphid != null and graphid != ''"> graphid , </if>
            <if test="height != null and height != ''"> height , </if>
            <if test="invbarcode != null and invbarcode != ''"> invbarcode , </if>
            <if test="invcode != null and invcode != ''"> invcode , </if>
            <if test="invmnecode != null and invmnecode != ''"> invmnecode , </if>
            <if test="invname != null and invname != ''"> invname , </if>
            <if test="invpinpai != null and invpinpai != ''"> invpinpai , </if>
            <if test="invshortname != null and invshortname != ''"> invshortname , </if>
            <if test="invspec != null and invspec != ''"> invspec , </if>
            <if test="invtype != null and invtype != ''"> invtype , </if>
            <if test="iselectrans != null and iselectrans != ''"> iselectrans , </if>
            <if test="ismngstockbygrswt != null and ismngstockbygrswt != ''"> ismngstockbygrswt , </if>
            <if test="isretail != null and isretail != ''"> isretail , </if>
            <if test="isstorebyconvert != null and isstorebyconvert != ''"> isstorebyconvert , </if>
            <if test="laborflag != null and laborflag != ''"> laborflag , </if>
            <if test="length != null and length != ''"> length , </if>
            <if test="memo != null and memo != ''"> memo , </if>
            <if test="modifier != null and modifier != ''"> modifier , </if>
            <if test="modifytime != null and modifytime != ''"> modifytime , </if>
            <if test="pkAssetcategory != null and pkAssetcategory != ''"> pk_assetcategory , </if>
            <if test="pkCorp != null and pkCorp != ''"> pk_corp , </if>
            <if test="pkInvbasdoc != null and pkInvbasdoc != ''"> pk_invbasdoc , </if>
            <if test="pkInvcl != null and pkInvcl != ''"> pk_invcl , </if>
            <if test="pkMeasdoc != null and pkMeasdoc != ''"> pk_measdoc , </if>
            <if test="pkMeasdoc1 != null and pkMeasdoc1 != ''"> pk_measdoc1 , </if>
            <if test="pkMeasdoc2 != null and pkMeasdoc2 != ''"> pk_measdoc2 , </if>
            <if test="pkMeasdoc3 != null and pkMeasdoc3 != ''"> pk_measdoc3 , </if>
            <if test="pkMeasdoc5 != null and pkMeasdoc5 != ''"> pk_measdoc5 , </if>
            <if test="pkMeasdoc6 != null and pkMeasdoc6 != ''"> pk_measdoc6 , </if>
            <if test="pkProdline != null and pkProdline != ''"> pk_prodline , </if>
            <if test="pkTaxitems != null and pkTaxitems != ''"> pk_taxitems , </if>
            <if test="sealflag != null and sealflag != ''"> sealflag , </if>
            <if test="setpartsflag != null and setpartsflag != ''"> setpartsflag , </if>
            <if test="shipunitnum != null and shipunitnum != ''"> shipunitnum , </if>
            <if test="storeunitnum != null and storeunitnum != ''"> storeunitnum , </if>
            <if test="ts != null and ts != ''"> ts , </if>
            <if test="unitvolume != null and unitvolume != ''"> unitvolume , </if>
            <if test="unitweight != null and unitweight != ''"> unitweight , </if>
            <if test="weitunitnum != null and weitunitnum != ''"> weitunitnum , </if>
            <if test="width != null and width != ''"> width , </if>
            <if test="sorts == null ">sorts,</if>
    <if test="sts == null ">sts,</if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <if test="asset != null and asset != ''"> #{asset} ,</if>
            <if test="assistunit != null and assistunit != ''"> #{assistunit} ,</if>
            <if test="autobalancemeas != null and autobalancemeas != ''"> #{autobalancemeas} ,</if>
            <if test="billtemplet != null and billtemplet != ''"> #{billtemplet} ,</if>
            <if test="createtime != null and createtime != ''"> #{createtime} ,</if>
            <if test="creator != null and creator != ''"> #{creator} ,</if>
            <if test="def1 != null and def1 != ''"> #{def1} ,</if>
            <if test="def10 != null and def10 != ''"> #{def10} ,</if>
            <if test="def11 != null and def11 != ''"> #{def11} ,</if>
            <if test="def12 != null and def12 != ''"> #{def12} ,</if>
            <if test="def13 != null and def13 != ''"> #{def13} ,</if>
            <if test="def14 != null and def14 != ''"> #{def14} ,</if>
            <if test="def15 != null and def15 != ''"> #{def15} ,</if>
            <if test="def16 != null and def16 != ''"> #{def16} ,</if>
            <if test="def17 != null and def17 != ''"> #{def17} ,</if>
            <if test="def18 != null and def18 != ''"> #{def18} ,</if>
            <if test="def19 != null and def19 != ''"> #{def19} ,</if>
            <if test="def2 != null and def2 != ''"> #{def2} ,</if>
            <if test="def20 != null and def20 != ''"> #{def20} ,</if>
            <if test="def3 != null and def3 != ''"> #{def3} ,</if>
            <if test="def4 != null and def4 != ''"> #{def4} ,</if>
            <if test="def5 != null and def5 != ''"> #{def5} ,</if>
            <if test="def6 != null and def6 != ''"> #{def6} ,</if>
            <if test="def7 != null and def7 != ''"> #{def7} ,</if>
            <if test="def8 != null and def8 != ''"> #{def8} ,</if>
            <if test="def9 != null and def9 != ''"> #{def9} ,</if>
            <if test="discountflag != null and discountflag != ''"> #{discountflag} ,</if>
            <if test="dr != null"> #{dr} ,</if>
            <if test="faset != null and faset != ''"> #{faset} ,</if>
            <if test="forinvname != null and forinvname != ''"> #{forinvname} ,</if>
            <if test="free1 != null and free1 != ''"> #{free1} ,</if>
            <if test="free10 != null and free10 != ''"> #{free10} ,</if>
            <if test="free2 != null and free2 != ''"> #{free2} ,</if>
            <if test="free3 != null and free3 != ''"> #{free3} ,</if>
            <if test="free4 != null and free4 != ''"> #{free4} ,</if>
            <if test="free5 != null and free5 != ''"> #{free5} ,</if>
            <if test="free6 != null and free6 != ''"> #{free6} ,</if>
            <if test="free7 != null and free7 != ''"> #{free7} ,</if>
            <if test="free8 != null and free8 != ''"> #{free8} ,</if>
            <if test="free9 != null and free9 != ''"> #{free9} ,</if>
            <if test="graphid != null and graphid != ''"> #{graphid} ,</if>
            <if test="height != null and height != ''"> #{height} ,</if>
            <if test="invbarcode != null and invbarcode != ''"> #{invbarcode} ,</if>
            <if test="invcode != null and invcode != ''"> #{invcode} ,</if>
            <if test="invmnecode != null and invmnecode != ''"> #{invmnecode} ,</if>
            <if test="invname != null and invname != ''"> #{invname} ,</if>
            <if test="invpinpai != null and invpinpai != ''"> #{invpinpai} ,</if>
            <if test="invshortname != null and invshortname != ''"> #{invshortname} ,</if>
            <if test="invspec != null and invspec != ''"> #{invspec} ,</if>
            <if test="invtype != null and invtype != ''"> #{invtype} ,</if>
            <if test="iselectrans != null and iselectrans != ''"> #{iselectrans} ,</if>
            <if test="ismngstockbygrswt != null and ismngstockbygrswt != ''"> #{ismngstockbygrswt} ,</if>
            <if test="isretail != null and isretail != ''"> #{isretail} ,</if>
            <if test="isstorebyconvert != null and isstorebyconvert != ''"> #{isstorebyconvert} ,</if>
            <if test="laborflag != null and laborflag != ''"> #{laborflag} ,</if>
            <if test="length != null and length != ''"> #{length} ,</if>
            <if test="memo != null and memo != ''"> #{memo} ,</if>
            <if test="modifier != null and modifier != ''"> #{modifier} ,</if>
            <if test="modifytime != null and modifytime != ''"> #{modifytime} ,</if>
            <if test="pkAssetcategory != null and pkAssetcategory != ''"> #{pkAssetcategory} ,</if>
            <if test="pkCorp != null and pkCorp != ''"> #{pkCorp} ,</if>
            <if test="pkInvbasdoc != null and pkInvbasdoc != ''"> #{pkInvbasdoc} ,</if>
            <if test="pkInvcl != null and pkInvcl != ''"> #{pkInvcl} ,</if>
            <if test="pkMeasdoc != null and pkMeasdoc != ''"> #{pkMeasdoc} ,</if>
            <if test="pkMeasdoc1 != null and pkMeasdoc1 != ''"> #{pkMeasdoc1} ,</if>
            <if test="pkMeasdoc2 != null and pkMeasdoc2 != ''"> #{pkMeasdoc2} ,</if>
            <if test="pkMeasdoc3 != null and pkMeasdoc3 != ''"> #{pkMeasdoc3} ,</if>
            <if test="pkMeasdoc5 != null and pkMeasdoc5 != ''"> #{pkMeasdoc5} ,</if>
            <if test="pkMeasdoc6 != null and pkMeasdoc6 != ''"> #{pkMeasdoc6} ,</if>
            <if test="pkProdline != null and pkProdline != ''"> #{pkProdline} ,</if>
            <if test="pkTaxitems != null and pkTaxitems != ''"> #{pkTaxitems} ,</if>
            <if test="sealflag != null and sealflag != ''"> #{sealflag} ,</if>
            <if test="setpartsflag != null and setpartsflag != ''"> #{setpartsflag} ,</if>
            <if test="shipunitnum != null and shipunitnum != ''"> #{shipunitnum} ,</if>
            <if test="storeunitnum != null and storeunitnum != ''"> #{storeunitnum} ,</if>
            <if test="ts != null and ts != ''"> #{ts} ,</if>
            <if test="unitvolume != null and unitvolume != ''"> #{unitvolume} ,</if>
            <if test="unitweight != null and unitweight != ''"> #{unitweight} ,</if>
            <if test="weitunitnum != null and weitunitnum != ''"> #{weitunitnum} ,</if>
            <if test="width != null and width != ''"> #{width} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from bd_invbasdoc a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="pkInvbasdoc" useGeneratedKeys="true">
  insert into bd_invbasdoc(asset, assistunit, autobalancemeas, billtemplet, createtime, creator, def1, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def2, def20, def3, def4, def5, def6, def7, def8, def9, discountflag, dr, faset, forinvname, free1, free10, free2, free3, free4, free5, free6, free7, free8, free9, graphid, height, invbarcode, invcode, invmnecode, invname, invpinpai, invshortname, invspec, invtype, iselectrans, ismngstockbygrswt, isretail, isstorebyconvert, laborflag, length, memo, modifier, modifytime, pk_assetcategory, pk_corp, pk_invcl, pk_measdoc, pk_measdoc1, pk_measdoc2, pk_measdoc3, pk_measdoc5, pk_measdoc6, pk_prodline, pk_taxitems, sealflag, setpartsflag, shipunitnum, storeunitnum, ts, unitvolume, unitweight, weitunitnum, width,  sts) 
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.asset},#{entity.assistunit},#{entity.autobalancemeas},#{entity.billtemplet},#{entity.createtime},#{entity.creator},#{entity.def1},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def14},#{entity.def15},#{entity.def16},#{entity.def17},#{entity.def18},#{entity.def19},#{entity.def2},#{entity.def20},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.discountflag},#{entity.dr},#{entity.faset},#{entity.forinvname},#{entity.free1},#{entity.free10},#{entity.free2},#{entity.free3},#{entity.free4},#{entity.free5},#{entity.free6},#{entity.free7},#{entity.free8},#{entity.free9},#{entity.graphid},#{entity.height},#{entity.invbarcode},#{entity.invcode},#{entity.invmnecode},#{entity.invname},#{entity.invpinpai},#{entity.invshortname},#{entity.invspec},#{entity.invtype},#{entity.iselectrans},#{entity.ismngstockbygrswt},#{entity.isretail},#{entity.isstorebyconvert},#{entity.laborflag},#{entity.length},#{entity.memo},#{entity.modifier},#{entity.modifytime},#{entity.pkAssetcategory},#{entity.pkCorp},#{entity.pkInvcl},#{entity.pkMeasdoc},#{entity.pkMeasdoc1},#{entity.pkMeasdoc2},#{entity.pkMeasdoc3},#{entity.pkMeasdoc5},#{entity.pkMeasdoc6},#{entity.pkProdline},#{entity.pkTaxitems},#{entity.sealflag},#{entity.setpartsflag},#{entity.shipunitnum},#{entity.storeunitnum},#{entity.ts},#{entity.unitvolume},#{entity.unitweight},#{entity.weitunitnum},#{entity.width}, 'Y')
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="pkInvbasdoc" useGeneratedKeys="true">
    insert into bd_invbasdoc(asset, assistunit, autobalancemeas, billtemplet, createtime, creator, def1, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def2, def20, def3, def4, def5, def6, def7, def8, def9, discountflag, dr, faset, forinvname, free1, free10, free2, free3, free4, free5, free6, free7, free8, free9, graphid, height, invbarcode, invcode, invmnecode, invname, invpinpai, invshortname, invspec, invtype, iselectrans, ismngstockbygrswt, isretail, isstorebyconvert, laborflag, length, memo, modifier, modifytime, pk_assetcategory, pk_corp, pk_invcl, pk_measdoc, pk_measdoc1, pk_measdoc2, pk_measdoc3, pk_measdoc5, pk_measdoc6, pk_prodline, pk_taxitems, sealflag, setpartsflag, shipunitnum, storeunitnum, ts, unitvolume, unitweight, weitunitnum, width)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.asset},#{entity.assistunit},#{entity.autobalancemeas},#{entity.billtemplet},#{entity.createtime},#{entity.creator},#{entity.def1},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def14},#{entity.def15},#{entity.def16},#{entity.def17},#{entity.def18},#{entity.def19},#{entity.def2},#{entity.def20},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.discountflag},#{entity.dr},#{entity.faset},#{entity.forinvname},#{entity.free1},#{entity.free10},#{entity.free2},#{entity.free3},#{entity.free4},#{entity.free5},#{entity.free6},#{entity.free7},#{entity.free8},#{entity.free9},#{entity.graphid},#{entity.height},#{entity.invbarcode},#{entity.invcode},#{entity.invmnecode},#{entity.invname},#{entity.invpinpai},#{entity.invshortname},#{entity.invspec},#{entity.invtype},#{entity.iselectrans},#{entity.ismngstockbygrswt},#{entity.isretail},#{entity.isstorebyconvert},#{entity.laborflag},#{entity.length},#{entity.memo},#{entity.modifier},#{entity.modifytime},#{entity.pkAssetcategory},#{entity.pkCorp},#{entity.pkInvcl},#{entity.pkMeasdoc},#{entity.pkMeasdoc1},#{entity.pkMeasdoc2},#{entity.pkMeasdoc3},#{entity.pkMeasdoc5},#{entity.pkMeasdoc6},#{entity.pkProdline},#{entity.pkTaxitems},#{entity.sealflag},#{entity.setpartsflag},#{entity.shipunitnum},#{entity.storeunitnum},#{entity.ts},#{entity.unitvolume},#{entity.unitweight},#{entity.weitunitnum},#{entity.width})
    </foreach>
    on duplicate key update
    asset = values(asset),
    assistunit = values(assistunit),
    autobalancemeas = values(autobalancemeas),
    billtemplet = values(billtemplet),
    createtime = values(createtime),
    creator = values(creator),
    def1 = values(def1),
    def10 = values(def10),
    def11 = values(def11),
    def12 = values(def12),
    def13 = values(def13),
    def14 = values(def14),
    def15 = values(def15),
    def16 = values(def16),
    def17 = values(def17),
    def18 = values(def18),
    def19 = values(def19),
    def2 = values(def2),
    def20 = values(def20),
    def3 = values(def3),
    def4 = values(def4),
    def5 = values(def5),
    def6 = values(def6),
    def7 = values(def7),
    def8 = values(def8),
    def9 = values(def9),
    discountflag = values(discountflag),
    dr = values(dr),
    faset = values(faset),
    forinvname = values(forinvname),
    free1 = values(free1),
    free10 = values(free10),
    free2 = values(free2),
    free3 = values(free3),
    free4 = values(free4),
    free5 = values(free5),
    free6 = values(free6),
    free7 = values(free7),
    free8 = values(free8),
    free9 = values(free9),
    graphid = values(graphid),
    height = values(height),
    invbarcode = values(invbarcode),
    invcode = values(invcode),
    invmnecode = values(invmnecode),
    invname = values(invname),
    invpinpai = values(invpinpai),
    invshortname = values(invshortname),
    invspec = values(invspec),
    invtype = values(invtype),
    iselectrans = values(iselectrans),
    ismngstockbygrswt = values(ismngstockbygrswt),
    isretail = values(isretail),
    isstorebyconvert = values(isstorebyconvert),
    laborflag = values(laborflag),
    length = values(length),
    memo = values(memo),
    modifier = values(modifier),
    modifytime = values(modifytime),
    pk_assetcategory = values(pk_assetcategory),
    pk_corp = values(pk_corp),
    pk_invcl = values(pk_invcl),
    pk_measdoc = values(pk_measdoc),
    pk_measdoc1 = values(pk_measdoc1),
    pk_measdoc2 = values(pk_measdoc2),
    pk_measdoc3 = values(pk_measdoc3),
    pk_measdoc5 = values(pk_measdoc5),
    pk_measdoc6 = values(pk_measdoc6),
    pk_prodline = values(pk_prodline),
    pk_taxitems = values(pk_taxitems),
    sealflag = values(sealflag),
    setpartsflag = values(setpartsflag),
    shipunitnum = values(shipunitnum),
    storeunitnum = values(storeunitnum),
    ts = values(ts),
    unitvolume = values(unitvolume),
    unitweight = values(unitweight),
    weitunitnum = values(weitunitnum),
    width = values(width)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity" >
update bd_invbasdoc  set
<trim suffix="" suffixOverrides=",">
  <if test="asset != null and asset != ''"> asset = #{asset},</if>
  <if test="assistunit != null and assistunit != ''"> assistunit = #{assistunit},</if>
  <if test="autobalancemeas != null and autobalancemeas != ''"> autobalancemeas = #{autobalancemeas},</if>
  <if test="billtemplet != null and billtemplet != ''"> billtemplet = #{billtemplet},</if>
  <if test="createtime != null and createtime != ''"> createtime = #{createtime},</if>
  <if test="creator != null and creator != ''"> creator = #{creator},</if>
  <if test="def1 != null and def1 != ''"> def1 = #{def1},</if>
  <if test="def10 != null and def10 != ''"> def10 = #{def10},</if>
  <if test="def11 != null and def11 != ''"> def11 = #{def11},</if>
  <if test="def12 != null and def12 != ''"> def12 = #{def12},</if>
  <if test="def13 != null and def13 != ''"> def13 = #{def13},</if>
  <if test="def14 != null and def14 != ''"> def14 = #{def14},</if>
  <if test="def15 != null and def15 != ''"> def15 = #{def15},</if>
  <if test="def16 != null and def16 != ''"> def16 = #{def16},</if>
  <if test="def17 != null and def17 != ''"> def17 = #{def17},</if>
  <if test="def18 != null and def18 != ''"> def18 = #{def18},</if>
  <if test="def19 != null and def19 != ''"> def19 = #{def19},</if>
  <if test="def2 != null and def2 != ''"> def2 = #{def2},</if>
  <if test="def20 != null and def20 != ''"> def20 = #{def20},</if>
  <if test="def3 != null and def3 != ''"> def3 = #{def3},</if>
  <if test="def4 != null and def4 != ''"> def4 = #{def4},</if>
  <if test="def5 != null and def5 != ''"> def5 = #{def5},</if>
  <if test="def6 != null and def6 != ''"> def6 = #{def6},</if>
  <if test="def7 != null and def7 != ''"> def7 = #{def7},</if>
  <if test="def8 != null and def8 != ''"> def8 = #{def8},</if>
  <if test="def9 != null and def9 != ''"> def9 = #{def9},</if>
  <if test="discountflag != null and discountflag != ''"> discountflag = #{discountflag},</if>
  <if test="dr != null"> dr = #{dr},</if>
  <if test="faset != null and faset != ''"> faset = #{faset},</if>
  <if test="forinvname != null and forinvname != ''"> forinvname = #{forinvname},</if>
  <if test="free1 != null and free1 != ''"> free1 = #{free1},</if>
  <if test="free10 != null and free10 != ''"> free10 = #{free10},</if>
  <if test="free2 != null and free2 != ''"> free2 = #{free2},</if>
  <if test="free3 != null and free3 != ''"> free3 = #{free3},</if>
  <if test="free4 != null and free4 != ''"> free4 = #{free4},</if>
  <if test="free5 != null and free5 != ''"> free5 = #{free5},</if>
  <if test="free6 != null and free6 != ''"> free6 = #{free6},</if>
  <if test="free7 != null and free7 != ''"> free7 = #{free7},</if>
  <if test="free8 != null and free8 != ''"> free8 = #{free8},</if>
  <if test="free9 != null and free9 != ''"> free9 = #{free9},</if>
  <if test="graphid != null and graphid != ''"> graphid = #{graphid},</if>
  <if test="height != null and height != ''"> height = #{height},</if>
  <if test="invbarcode != null and invbarcode != ''"> invbarcode = #{invbarcode},</if>
  <if test="invcode != null and invcode != ''"> invcode = #{invcode},</if>
  <if test="invmnecode != null and invmnecode != ''"> invmnecode = #{invmnecode},</if>
  <if test="invname != null and invname != ''"> invname = #{invname},</if>
  <if test="invpinpai != null and invpinpai != ''"> invpinpai = #{invpinpai},</if>
  <if test="invshortname != null and invshortname != ''"> invshortname = #{invshortname},</if>
  <if test="invspec != null and invspec != ''"> invspec = #{invspec},</if>
  <if test="invtype != null and invtype != ''"> invtype = #{invtype},</if>
  <if test="iselectrans != null and iselectrans != ''"> iselectrans = #{iselectrans},</if>
  <if test="ismngstockbygrswt != null and ismngstockbygrswt != ''"> ismngstockbygrswt = #{ismngstockbygrswt},</if>
  <if test="isretail != null and isretail != ''"> isretail = #{isretail},</if>
  <if test="isstorebyconvert != null and isstorebyconvert != ''"> isstorebyconvert = #{isstorebyconvert},</if>
  <if test="laborflag != null and laborflag != ''"> laborflag = #{laborflag},</if>
  <if test="length != null and length != ''"> length = #{length},</if>
  <if test="memo != null and memo != ''"> memo = #{memo},</if>
  <if test="modifier != null and modifier != ''"> modifier = #{modifier},</if>
  <if test="modifytime != null and modifytime != ''"> modifytime = #{modifytime},</if>
  <if test="pkAssetcategory != null and pkAssetcategory != ''"> pk_assetcategory = #{pkAssetcategory},</if>
  <if test="pkCorp != null and pkCorp != ''"> pk_corp = #{pkCorp},</if>
  <if test="pkInvcl != null and pkInvcl != ''"> pk_invcl = #{pkInvcl},</if>
  <if test="pkMeasdoc != null and pkMeasdoc != ''"> pk_measdoc = #{pkMeasdoc},</if>
  <if test="pkMeasdoc1 != null and pkMeasdoc1 != ''"> pk_measdoc1 = #{pkMeasdoc1},</if>
  <if test="pkMeasdoc2 != null and pkMeasdoc2 != ''"> pk_measdoc2 = #{pkMeasdoc2},</if>
  <if test="pkMeasdoc3 != null and pkMeasdoc3 != ''"> pk_measdoc3 = #{pkMeasdoc3},</if>
  <if test="pkMeasdoc5 != null and pkMeasdoc5 != ''"> pk_measdoc5 = #{pkMeasdoc5},</if>
  <if test="pkMeasdoc6 != null and pkMeasdoc6 != ''"> pk_measdoc6 = #{pkMeasdoc6},</if>
  <if test="pkProdline != null and pkProdline != ''"> pk_prodline = #{pkProdline},</if>
  <if test="pkTaxitems != null and pkTaxitems != ''"> pk_taxitems = #{pkTaxitems},</if>
  <if test="sealflag != null and sealflag != ''"> sealflag = #{sealflag},</if>
  <if test="setpartsflag != null and setpartsflag != ''"> setpartsflag = #{setpartsflag},</if>
  <if test="shipunitnum != null and shipunitnum != ''"> shipunitnum = #{shipunitnum},</if>
  <if test="storeunitnum != null and storeunitnum != ''"> storeunitnum = #{storeunitnum},</if>
  <if test="ts != null and ts != ''"> ts = #{ts},</if>
  <if test="unitvolume != null and unitvolume != ''"> unitvolume = #{unitvolume},</if>
  <if test="unitweight != null and unitweight != ''"> unitweight = #{unitweight},</if>
  <if test="weitunitnum != null and weitunitnum != ''"> weitunitnum = #{weitunitnum},</if>
  <if test="width != null and width != ''"> width = #{width},</if>
</trim>
where pk_invbasdoc = #{pkInvbasdoc}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity" >
update bd_invbasdoc  set sts= 'N'
where pk_invbasdoc = #{pkInvbasdoc}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity" >
update bd_invbasdoc  set sts= 'N' 
 <trim prefix="where" prefixOverrides="and"> 
        <if test="asset != null and asset != ''"> and asset = #{asset} </if>
            <if test="assistunit != null and assistunit != ''"> and assistunit = #{assistunit} </if>
            <if test="autobalancemeas != null and autobalancemeas != ''"> and autobalancemeas = #{autobalancemeas} </if>
            <if test="billtemplet != null and billtemplet != ''"> and billtemplet = #{billtemplet} </if>
            <if test="createtime != null and createtime != ''"> and createtime = #{createtime} </if>
            <if test="creator != null and creator != ''"> and creator = #{creator} </if>
            <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
            <if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
            <if test="def11 != null and def11 != ''"> and def11 = #{def11} </if>
            <if test="def12 != null and def12 != ''"> and def12 = #{def12} </if>
            <if test="def13 != null and def13 != ''"> and def13 = #{def13} </if>
            <if test="def14 != null and def14 != ''"> and def14 = #{def14} </if>
            <if test="def15 != null and def15 != ''"> and def15 = #{def15} </if>
            <if test="def16 != null and def16 != ''"> and def16 = #{def16} </if>
            <if test="def17 != null and def17 != ''"> and def17 = #{def17} </if>
            <if test="def18 != null and def18 != ''"> and def18 = #{def18} </if>
            <if test="def19 != null and def19 != ''"> and def19 = #{def19} </if>
            <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
            <if test="def20 != null and def20 != ''"> and def20 = #{def20} </if>
            <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
            <if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
            <if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
            <if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
            <if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
            <if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
            <if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
            <if test="discountflag != null and discountflag != ''"> and discountflag = #{discountflag} </if>
            <if test="dr != null"> and dr = #{dr} </if>
            <if test="faset != null and faset != ''"> and faset = #{faset} </if>
            <if test="forinvname != null and forinvname != ''"> and forinvname = #{forinvname} </if>
            <if test="free1 != null and free1 != ''"> and free1 = #{free1} </if>
            <if test="free10 != null and free10 != ''"> and free10 = #{free10} </if>
            <if test="free2 != null and free2 != ''"> and free2 = #{free2} </if>
            <if test="free3 != null and free3 != ''"> and free3 = #{free3} </if>
            <if test="free4 != null and free4 != ''"> and free4 = #{free4} </if>
            <if test="free5 != null and free5 != ''"> and free5 = #{free5} </if>
            <if test="free6 != null and free6 != ''"> and free6 = #{free6} </if>
            <if test="free7 != null and free7 != ''"> and free7 = #{free7} </if>
            <if test="free8 != null and free8 != ''"> and free8 = #{free8} </if>
            <if test="free9 != null and free9 != ''"> and free9 = #{free9} </if>
            <if test="graphid != null and graphid != ''"> and graphid = #{graphid} </if>
            <if test="height != null and height != ''"> and height = #{height} </if>
            <if test="invbarcode != null and invbarcode != ''"> and invbarcode = #{invbarcode} </if>
            <if test="invcode != null and invcode != ''"> and invcode = #{invcode} </if>
            <if test="invmnecode != null and invmnecode != ''"> and invmnecode = #{invmnecode} </if>
            <if test="invname != null and invname != ''"> and invname = #{invname} </if>
            <if test="invpinpai != null and invpinpai != ''"> and invpinpai = #{invpinpai} </if>
            <if test="invshortname != null and invshortname != ''"> and invshortname = #{invshortname} </if>
            <if test="invspec != null and invspec != ''"> and invspec = #{invspec} </if>
            <if test="invtype != null and invtype != ''"> and invtype = #{invtype} </if>
            <if test="iselectrans != null and iselectrans != ''"> and iselectrans = #{iselectrans} </if>
            <if test="ismngstockbygrswt != null and ismngstockbygrswt != ''"> and ismngstockbygrswt = #{ismngstockbygrswt} </if>
            <if test="isretail != null and isretail != ''"> and isretail = #{isretail} </if>
            <if test="isstorebyconvert != null and isstorebyconvert != ''"> and isstorebyconvert = #{isstorebyconvert} </if>
            <if test="laborflag != null and laborflag != ''"> and laborflag = #{laborflag} </if>
            <if test="length != null and length != ''"> and length = #{length} </if>
            <if test="memo != null and memo != ''"> and memo = #{memo} </if>
            <if test="modifier != null and modifier != ''"> and modifier = #{modifier} </if>
            <if test="modifytime != null and modifytime != ''"> and modifytime = #{modifytime} </if>
            <if test="pkAssetcategory != null and pkAssetcategory != ''"> and pk_assetcategory = #{pkAssetcategory} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="pkInvbasdoc != null and pkInvbasdoc != ''"> and pk_invbasdoc = #{pkInvbasdoc} </if>
            <if test="pkInvcl != null and pkInvcl != ''"> and pk_invcl = #{pkInvcl} </if>
            <if test="pkMeasdoc != null and pkMeasdoc != ''"> and pk_measdoc = #{pkMeasdoc} </if>
            <if test="pkMeasdoc1 != null and pkMeasdoc1 != ''"> and pk_measdoc1 = #{pkMeasdoc1} </if>
            <if test="pkMeasdoc2 != null and pkMeasdoc2 != ''"> and pk_measdoc2 = #{pkMeasdoc2} </if>
            <if test="pkMeasdoc3 != null and pkMeasdoc3 != ''"> and pk_measdoc3 = #{pkMeasdoc3} </if>
            <if test="pkMeasdoc5 != null and pkMeasdoc5 != ''"> and pk_measdoc5 = #{pkMeasdoc5} </if>
            <if test="pkMeasdoc6 != null and pkMeasdoc6 != ''"> and pk_measdoc6 = #{pkMeasdoc6} </if>
            <if test="pkProdline != null and pkProdline != ''"> and pk_prodline = #{pkProdline} </if>
            <if test="pkTaxitems != null and pkTaxitems != ''"> and pk_taxitems = #{pkTaxitems} </if>
            <if test="sealflag != null and sealflag != ''"> and sealflag = #{sealflag} </if>
            <if test="setpartsflag != null and setpartsflag != ''"> and setpartsflag = #{setpartsflag} </if>
            <if test="shipunitnum != null and shipunitnum != ''"> and shipunitnum = #{shipunitnum} </if>
            <if test="storeunitnum != null and storeunitnum != ''"> and storeunitnum = #{storeunitnum} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
            <if test="unitvolume != null and unitvolume != ''"> and unitvolume = #{unitvolume} </if>
            <if test="unitweight != null and unitweight != ''"> and unitweight = #{unitweight} </if>
            <if test="weitunitnum != null and weitunitnum != ''"> and weitunitnum = #{weitunitnum} </if>
            <if test="width != null and width != ''"> and width = #{width} </if>
            and sts='Y'
    </trim>
</update>

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

    <!--   存货档案查询：存货管理档案关联存货档案，-->
    <select id="queryBdInvbasdocByPkInvmandoc" parameterType="com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity" resultMap="get-BdInvbasdocEntity-result">
        SELECT
            bia.*,
            bim.pk_invmandoc,
            bim.pk_corp pk_corp_man
        FROM
            bd_invmandoc bim
            LEFT JOIN bd_invbasdoc bia ON bim.pk_invbasdoc = bia.pk_invbasdoc
        WHERE
            bim.dr = 0
            AND bia.dr = 0
          <if test="pk_invmandoc!=null and pk_invmandoc!=''">
              and bim.pk_invmandoc = #{pk_invmandoc}
          </if>
          <if test="pk_corp!=null and pk_corp!=''">
              and bim.pk_corp = #{pk_corp}
          </if>
          <if test="invcodes!=null and invcodes!=''">
                and bia.invcode = #{invcode}
          </if>
    </select>

    <!--查询存货基本档案-->
    <select id="queryBdInvbasdocByInvcodes" parameterType="com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity" resultMap="get-BdInvbasdocEntity-result">
        SELECT
            bd_invbasdoc.*
        FROM
            bd_invbasdoc
        WHERE
            dr = 0
          AND invcode IN (${invcodes})
    </select>

</mapper>

