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

    <resultMap id="get-BdBomEntity-result" type="com.hzya.frame.plugin.lets.entity.BdBomEntity" >
       <result property="bblx" column="BBLX" jdbcType="VARCHAR"/>
           <result property="bomlx" column="BOMLX" jdbcType="VARCHAR"/>
           <result property="clf" column="CLF" jdbcType="VARCHAR"/>
           <result property="creat" column="CREAT" jdbcType="VARCHAR"/>
           <result property="dr" column="DR" jdbcType="VARCHAR"/>
           <result property="fsl" column="FSL" jdbcType="VARCHAR"/>
           <result property="fslsx" column="FSLSX" jdbcType="VARCHAR"/>
           <result property="fslxx" column="FSLXX" jdbcType="VARCHAR"/>
           <result property="gcbm" column="GCBM" jdbcType="VARCHAR"/>
           <result property="gdfsl" column="GDFSL" jdbcType="VARCHAR"/>
           <result property="gdsl" column="GDSL" jdbcType="VARCHAR"/>
           <result property="hsl" column="HSL" jdbcType="VARCHAR"/>
           <result property="jldwid" column="JLDWID" jdbcType="VARCHAR"/>
           <result property="memo" column="MEMO" jdbcType="VARCHAR"/>
           <result property="mver" column="MVER" jdbcType="VARCHAR"/>
           <result property="pkBomid" column="PK_BOMID" jdbcType="VARCHAR"/>
           <result property="pkCorp" column="PK_CORP" jdbcType="VARCHAR"/>
           <result property="pkProduce" column="PK_PRODUCE" jdbcType="VARCHAR"/>
           <result property="rgf" column="RGF" jdbcType="VARCHAR"/>
           <result property="sfmr" column="SFMR" jdbcType="VARCHAR"/>
           <result property="sftpmr" column="SFTPMR" jdbcType="VARCHAR"/>
           <result property="sl" column="SL" jdbcType="VARCHAR"/>
           <result property="slsx" column="SLSX" jdbcType="VARCHAR"/>
           <result property="slxx" column="SLXX" jdbcType="VARCHAR"/>
           <result property="ts" column="TS" jdbcType="VARCHAR"/>
           <result property="version" column="VERSION" jdbcType="VARCHAR"/>
           <result property="wlbmid" column="WLBMID" jdbcType="VARCHAR"/>
           <result property="zdy1" column="ZDY1" jdbcType="VARCHAR"/>
           <result property="zdy10" column="ZDY10" jdbcType="VARCHAR"/>
           <result property="zdy11" column="ZDY11" jdbcType="VARCHAR"/>
           <result property="zdy12" column="ZDY12" jdbcType="VARCHAR"/>
           <result property="zdy13" column="ZDY13" jdbcType="VARCHAR"/>
           <result property="zdy14" column="ZDY14" jdbcType="VARCHAR"/>
           <result property="zdy15" column="ZDY15" jdbcType="VARCHAR"/>
           <result property="zdy16" column="ZDY16" jdbcType="VARCHAR"/>
           <result property="zdy17" column="ZDY17" jdbcType="VARCHAR"/>
           <result property="zdy18" column="ZDY18" jdbcType="VARCHAR"/>
           <result property="zdy19" column="ZDY19" jdbcType="VARCHAR"/>
           <result property="zdy2" column="ZDY2" jdbcType="VARCHAR"/>
           <result property="zdy20" column="ZDY20" jdbcType="VARCHAR"/>
           <result property="zdy3" column="ZDY3" jdbcType="VARCHAR"/>
           <result property="zdy4" column="ZDY4" jdbcType="VARCHAR"/>
           <result property="zdy5" column="ZDY5" jdbcType="VARCHAR"/>
           <result property="zdy6" column="ZDY6" jdbcType="VARCHAR"/>
           <result property="zdy7" column="ZDY7" jdbcType="VARCHAR"/>
           <result property="zdy8" column="ZDY8" jdbcType="VARCHAR"/>
           <result property="zdy9" column="ZDY9" jdbcType="VARCHAR"/>
           <result property="zt" column="ZT" jdbcType="VARCHAR"/>
           <result property="zyx1" column="ZYX1" jdbcType="VARCHAR"/>
           <result property="zyx2" column="ZYX2" jdbcType="VARCHAR"/>
           <result property="zyx3" column="ZYX3" jdbcType="VARCHAR"/>
           <result property="zyx4" column="ZYX4" jdbcType="VARCHAR"/>
           <result property="zyx5" column="ZYX5" jdbcType="VARCHAR"/>
           <result property="zzf" column="ZZF" jdbcType="VARCHAR"/>
           <result property="bomtypeFrom" column="BOMTYPE_FROM" jdbcType="VARCHAR"/>
           <result property="cjrq" column="CJRQ" jdbcType="VARCHAR"/>
           <result property="cjsj" column="CJSJ" jdbcType="VARCHAR"/>
           <result property="createtype" column="CREATETYPE" jdbcType="VARCHAR"/>
           <result property="gcbmFrom" column="GCBM_FROM" jdbcType="VARCHAR"/>
           <result property="modifiedtime" column="MODIFIEDTIME" jdbcType="VARCHAR"/>
           <result property="modifier" column="MODIFIER" jdbcType="VARCHAR"/>
           <result property="pkBomidFrom" column="PK_BOMID_FROM" jdbcType="VARCHAR"/>
           <result property="pkCorpFrom" column="PK_CORP_FROM" jdbcType="VARCHAR"/>
           <result property="qrrid" column="QRRID" jdbcType="VARCHAR"/>
           <result property="qrrq" column="QRRQ" jdbcType="VARCHAR"/>
           <result property="qrsj" column="QRSJ" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "BdBomEntity_Base_Column_List">
        BBLX
       ,BOMLX 
        ,CLF 
        ,CREAT 
        ,DR 
        ,FSL 
        ,FSLSX 
        ,FSLXX 
        ,GCBM 
        ,GDFSL 
        ,GDSL 
        ,HSL 
        ,JLDWID 
        ,MEMO 
        ,MVER 
        ,PK_BOMID 
        ,PK_CORP 
        ,PK_PRODUCE 
        ,RGF 
        ,SFMR 
        ,SFTPMR 
        ,SL 
        ,SLSX 
        ,SLXX 
        ,TS 
        ,VERSION 
        ,WLBMID 
        ,ZDY1 
        ,ZDY10 
        ,ZDY11 
        ,ZDY12 
        ,ZDY13 
        ,ZDY14 
        ,ZDY15 
        ,ZDY16 
        ,ZDY17 
        ,ZDY18 
        ,ZDY19 
        ,ZDY2 
        ,ZDY20 
        ,ZDY3 
        ,ZDY4 
        ,ZDY5 
        ,ZDY6 
        ,ZDY7 
        ,ZDY8 
        ,ZDY9 
        ,ZT 
        ,ZYX1 
        ,ZYX2 
        ,ZYX3 
        ,ZYX4 
        ,ZYX5 
        ,ZZF 
        ,BOMTYPE_FROM 
        ,CJRQ 
        ,CJSJ 
        ,CREATETYPE 
        ,GCBM_FROM 
        ,MODIFIEDTIME 
        ,MODIFIER 
        ,PK_BOMID_FROM 
        ,PK_CORP_FROM 
        ,QRRID 
        ,QRRQ 
        ,QRSJ 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-BdBomEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity">
    select
    <include refid="BdBomEntity_Base_Column_List" />
    from BD_BOM
    <trim prefix="where" prefixOverrides="and"> 
        <if test="bblx != null and bblx != ''"> and BBLX = #{bblx} </if>
            <if test="bomlx != null and bomlx != ''"> and BOMLX = #{bomlx} </if>
            <if test="clf != null and clf != ''"> and CLF = #{clf} </if>
            <if test="creat != null and creat != ''"> and CREAT = #{creat} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="fsl != null and fsl != ''"> and FSL = #{fsl} </if>
            <if test="fslsx != null and fslsx != ''"> and FSLSX = #{fslsx} </if>
            <if test="fslxx != null and fslxx != ''"> and FSLXX = #{fslxx} </if>
            <if test="gcbm != null and gcbm != ''"> and GCBM = #{gcbm} </if>
            <if test="gdfsl != null and gdfsl != ''"> and GDFSL = #{gdfsl} </if>
            <if test="gdsl != null and gdsl != ''"> and GDSL = #{gdsl} </if>
            <if test="hsl != null and hsl != ''"> and HSL = #{hsl} </if>
            <if test="jldwid != null and jldwid != ''"> and JLDWID = #{jldwid} </if>
            <if test="memo != null and memo != ''"> and MEMO = #{memo} </if>
            <if test="mver != null and mver != ''"> and MVER = #{mver} </if>
            <if test="pkBomid != null and pkBomid != ''"> and PK_BOMID = #{pkBomid} </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
            <if test="pkProduce != null and pkProduce != ''"> and PK_PRODUCE = #{pkProduce} </if>
            <if test="rgf != null and rgf != ''"> and RGF = #{rgf} </if>
            <if test="sfmr != null and sfmr != ''"> and SFMR = #{sfmr} </if>
            <if test="sftpmr != null and sftpmr != ''"> and SFTPMR = #{sftpmr} </if>
            <if test="sl != null and sl != ''"> and SL = #{sl} </if>
            <if test="slsx != null and slsx != ''"> and SLSX = #{slsx} </if>
            <if test="slxx != null and slxx != ''"> and SLXX = #{slxx} </if>
            <if test="ts != null and ts != ''"> and TS = #{ts} </if>
            <if test="version != null and version != ''"> and VERSION = #{version} </if>
            <if test="wlbmid != null and wlbmid != ''"> and WLBMID = #{wlbmid} </if>
            <if test="zdy1 != null and zdy1 != ''"> and ZDY1 = #{zdy1} </if>
            <if test="zdy10 != null and zdy10 != ''"> and ZDY10 = #{zdy10} </if>
            <if test="zdy11 != null and zdy11 != ''"> and ZDY11 = #{zdy11} </if>
            <if test="zdy12 != null and zdy12 != ''"> and ZDY12 = #{zdy12} </if>
            <if test="zdy13 != null and zdy13 != ''"> and ZDY13 = #{zdy13} </if>
            <if test="zdy14 != null and zdy14 != ''"> and ZDY14 = #{zdy14} </if>
            <if test="zdy15 != null and zdy15 != ''"> and ZDY15 = #{zdy15} </if>
            <if test="zdy16 != null and zdy16 != ''"> and ZDY16 = #{zdy16} </if>
            <if test="zdy17 != null and zdy17 != ''"> and ZDY17 = #{zdy17} </if>
            <if test="zdy18 != null and zdy18 != ''"> and ZDY18 = #{zdy18} </if>
            <if test="zdy19 != null and zdy19 != ''"> and ZDY19 = #{zdy19} </if>
            <if test="zdy2 != null and zdy2 != ''"> and ZDY2 = #{zdy2} </if>
            <if test="zdy20 != null and zdy20 != ''"> and ZDY20 = #{zdy20} </if>
            <if test="zdy3 != null and zdy3 != ''"> and ZDY3 = #{zdy3} </if>
            <if test="zdy4 != null and zdy4 != ''"> and ZDY4 = #{zdy4} </if>
            <if test="zdy5 != null and zdy5 != ''"> and ZDY5 = #{zdy5} </if>
            <if test="zdy6 != null and zdy6 != ''"> and ZDY6 = #{zdy6} </if>
            <if test="zdy7 != null and zdy7 != ''"> and ZDY7 = #{zdy7} </if>
            <if test="zdy8 != null and zdy8 != ''"> and ZDY8 = #{zdy8} </if>
            <if test="zdy9 != null and zdy9 != ''"> and ZDY9 = #{zdy9} </if>
            <if test="zt != null and zt != ''"> and ZT = #{zt} </if>
            <if test="zyx1 != null and zyx1 != ''"> and ZYX1 = #{zyx1} </if>
            <if test="zyx2 != null and zyx2 != ''"> and ZYX2 = #{zyx2} </if>
            <if test="zyx3 != null and zyx3 != ''"> and ZYX3 = #{zyx3} </if>
            <if test="zyx4 != null and zyx4 != ''"> and ZYX4 = #{zyx4} </if>
            <if test="zyx5 != null and zyx5 != ''"> and ZYX5 = #{zyx5} </if>
            <if test="zzf != null and zzf != ''"> and ZZF = #{zzf} </if>
            <if test="bomtypeFrom != null and bomtypeFrom != ''"> and BOMTYPE_FROM = #{bomtypeFrom} </if>
            <if test="cjrq != null and cjrq != ''"> and CJRQ = #{cjrq} </if>
            <if test="cjsj != null and cjsj != ''"> and CJSJ = #{cjsj} </if>
            <if test="createtype != null and createtype != ''"> and CREATETYPE = #{createtype} </if>
            <if test="gcbmFrom != null and gcbmFrom != ''"> and GCBM_FROM = #{gcbmFrom} </if>
            <if test="modifiedtime != null and modifiedtime != ''"> and MODIFIEDTIME = #{modifiedtime} </if>
            <if test="modifier != null and modifier != ''"> and MODIFIER = #{modifier} </if>
            <if test="pkBomidFrom != null and pkBomidFrom != ''"> and PK_BOMID_FROM = #{pkBomidFrom} </if>
            <if test="pkCorpFrom != null and pkCorpFrom != ''"> and PK_CORP_FROM = #{pkCorpFrom} </if>
            <if test="qrrid != null and qrrid != ''"> and QRRID = #{qrrid} </if>
            <if test="qrrq != null and qrrq != ''"> and QRRQ = #{qrrq} </if>
            <if test="qrsj != null and qrsj != ''"> and QRSJ = #{qrsj} </if>
--             and sts='Y'
    </trim>
<!--    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>-->
<!--    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>-->
</select>
    
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity">
        select  count(1)   from BD_BOM
    <trim prefix="where" prefixOverrides="and"> 
        <if test="bblx != null and bblx != ''"> and BBLX = #{bblx} </if>
            <if test="bomlx != null and bomlx != ''"> and BOMLX = #{bomlx} </if>
            <if test="clf != null and clf != ''"> and CLF = #{clf} </if>
            <if test="creat != null and creat != ''"> and CREAT = #{creat} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="fsl != null and fsl != ''"> and FSL = #{fsl} </if>
            <if test="fslsx != null and fslsx != ''"> and FSLSX = #{fslsx} </if>
            <if test="fslxx != null and fslxx != ''"> and FSLXX = #{fslxx} </if>
            <if test="gcbm != null and gcbm != ''"> and GCBM = #{gcbm} </if>
            <if test="gdfsl != null and gdfsl != ''"> and GDFSL = #{gdfsl} </if>
            <if test="gdsl != null and gdsl != ''"> and GDSL = #{gdsl} </if>
            <if test="hsl != null and hsl != ''"> and HSL = #{hsl} </if>
            <if test="jldwid != null and jldwid != ''"> and JLDWID = #{jldwid} </if>
            <if test="memo != null and memo != ''"> and MEMO = #{memo} </if>
            <if test="mver != null and mver != ''"> and MVER = #{mver} </if>
            <if test="pkBomid != null and pkBomid != ''"> and PK_BOMID = #{pkBomid} </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
            <if test="pkProduce != null and pkProduce != ''"> and PK_PRODUCE = #{pkProduce} </if>
            <if test="rgf != null and rgf != ''"> and RGF = #{rgf} </if>
            <if test="sfmr != null and sfmr != ''"> and SFMR = #{sfmr} </if>
            <if test="sftpmr != null and sftpmr != ''"> and SFTPMR = #{sftpmr} </if>
            <if test="sl != null and sl != ''"> and SL = #{sl} </if>
            <if test="slsx != null and slsx != ''"> and SLSX = #{slsx} </if>
            <if test="slxx != null and slxx != ''"> and SLXX = #{slxx} </if>
            <if test="ts != null and ts != ''"> and TS = #{ts} </if>
            <if test="version != null and version != ''"> and VERSION = #{version} </if>
            <if test="wlbmid != null and wlbmid != ''"> and WLBMID = #{wlbmid} </if>
            <if test="zdy1 != null and zdy1 != ''"> and ZDY1 = #{zdy1} </if>
            <if test="zdy10 != null and zdy10 != ''"> and ZDY10 = #{zdy10} </if>
            <if test="zdy11 != null and zdy11 != ''"> and ZDY11 = #{zdy11} </if>
            <if test="zdy12 != null and zdy12 != ''"> and ZDY12 = #{zdy12} </if>
            <if test="zdy13 != null and zdy13 != ''"> and ZDY13 = #{zdy13} </if>
            <if test="zdy14 != null and zdy14 != ''"> and ZDY14 = #{zdy14} </if>
            <if test="zdy15 != null and zdy15 != ''"> and ZDY15 = #{zdy15} </if>
            <if test="zdy16 != null and zdy16 != ''"> and ZDY16 = #{zdy16} </if>
            <if test="zdy17 != null and zdy17 != ''"> and ZDY17 = #{zdy17} </if>
            <if test="zdy18 != null and zdy18 != ''"> and ZDY18 = #{zdy18} </if>
            <if test="zdy19 != null and zdy19 != ''"> and ZDY19 = #{zdy19} </if>
            <if test="zdy2 != null and zdy2 != ''"> and ZDY2 = #{zdy2} </if>
            <if test="zdy20 != null and zdy20 != ''"> and ZDY20 = #{zdy20} </if>
            <if test="zdy3 != null and zdy3 != ''"> and ZDY3 = #{zdy3} </if>
            <if test="zdy4 != null and zdy4 != ''"> and ZDY4 = #{zdy4} </if>
            <if test="zdy5 != null and zdy5 != ''"> and ZDY5 = #{zdy5} </if>
            <if test="zdy6 != null and zdy6 != ''"> and ZDY6 = #{zdy6} </if>
            <if test="zdy7 != null and zdy7 != ''"> and ZDY7 = #{zdy7} </if>
            <if test="zdy8 != null and zdy8 != ''"> and ZDY8 = #{zdy8} </if>
            <if test="zdy9 != null and zdy9 != ''"> and ZDY9 = #{zdy9} </if>
            <if test="zt != null and zt != ''"> and ZT = #{zt} </if>
            <if test="zyx1 != null and zyx1 != ''"> and ZYX1 = #{zyx1} </if>
            <if test="zyx2 != null and zyx2 != ''"> and ZYX2 = #{zyx2} </if>
            <if test="zyx3 != null and zyx3 != ''"> and ZYX3 = #{zyx3} </if>
            <if test="zyx4 != null and zyx4 != ''"> and ZYX4 = #{zyx4} </if>
            <if test="zyx5 != null and zyx5 != ''"> and ZYX5 = #{zyx5} </if>
            <if test="zzf != null and zzf != ''"> and ZZF = #{zzf} </if>
            <if test="bomtypeFrom != null and bomtypeFrom != ''"> and BOMTYPE_FROM = #{bomtypeFrom} </if>
            <if test="cjrq != null and cjrq != ''"> and CJRQ = #{cjrq} </if>
            <if test="cjsj != null and cjsj != ''"> and CJSJ = #{cjsj} </if>
            <if test="createtype != null and createtype != ''"> and CREATETYPE = #{createtype} </if>
            <if test="gcbmFrom != null and gcbmFrom != ''"> and GCBM_FROM = #{gcbmFrom} </if>
            <if test="modifiedtime != null and modifiedtime != ''"> and MODIFIEDTIME = #{modifiedtime} </if>
            <if test="modifier != null and modifier != ''"> and MODIFIER = #{modifier} </if>
            <if test="pkBomidFrom != null and pkBomidFrom != ''"> and PK_BOMID_FROM = #{pkBomidFrom} </if>
            <if test="pkCorpFrom != null and pkCorpFrom != ''"> and PK_CORP_FROM = #{pkCorpFrom} </if>
            <if test="qrrid != null and qrrid != ''"> and QRRID = #{qrrid} </if>
            <if test="qrrq != null and qrrq != ''"> and QRRQ = #{qrrq} </if>
            <if test="qrsj != null and qrsj != ''"> and QRSJ = #{qrsj} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
    </select>

    <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-BdBomEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity">
    select
    <include refid="BdBomEntity_Base_Column_List" />
    from BD_BOM
    <trim prefix="where" prefixOverrides="and"> 
        <if test="bblx != null and bblx != ''"> and BBLX like concat('%',#{bblx},'%') </if>
            <if test="bomlx != null and bomlx != ''"> and BOMLX like concat('%',#{bomlx},'%') </if>
            <if test="clf != null and clf != ''"> and CLF like concat('%',#{clf},'%') </if>
            <if test="creat != null and creat != ''"> and CREAT like concat('%',#{creat},'%') </if>
            <if test="dr != null and dr != ''"> and DR like concat('%',#{dr},'%') </if>
            <if test="fsl != null and fsl != ''"> and FSL like concat('%',#{fsl},'%') </if>
            <if test="fslsx != null and fslsx != ''"> and FSLSX like concat('%',#{fslsx},'%') </if>
            <if test="fslxx != null and fslxx != ''"> and FSLXX like concat('%',#{fslxx},'%') </if>
            <if test="gcbm != null and gcbm != ''"> and GCBM like concat('%',#{gcbm},'%') </if>
            <if test="gdfsl != null and gdfsl != ''"> and GDFSL like concat('%',#{gdfsl},'%') </if>
            <if test="gdsl != null and gdsl != ''"> and GDSL like concat('%',#{gdsl},'%') </if>
            <if test="hsl != null and hsl != ''"> and HSL like concat('%',#{hsl},'%') </if>
            <if test="jldwid != null and jldwid != ''"> and JLDWID like concat('%',#{jldwid},'%') </if>
            <if test="memo != null and memo != ''"> and MEMO like concat('%',#{memo},'%') </if>
            <if test="mver != null and mver != ''"> and MVER like concat('%',#{mver},'%') </if>
            <if test="pkBomid != null and pkBomid != ''"> and PK_BOMID like concat('%',#{pkBomid},'%') </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP like concat('%',#{pkCorp},'%') </if>
            <if test="pkProduce != null and pkProduce != ''"> and PK_PRODUCE like concat('%',#{pkProduce},'%') </if>
            <if test="rgf != null and rgf != ''"> and RGF like concat('%',#{rgf},'%') </if>
            <if test="sfmr != null and sfmr != ''"> and SFMR like concat('%',#{sfmr},'%') </if>
            <if test="sftpmr != null and sftpmr != ''"> and SFTPMR like concat('%',#{sftpmr},'%') </if>
            <if test="sl != null and sl != ''"> and SL like concat('%',#{sl},'%') </if>
            <if test="slsx != null and slsx != ''"> and SLSX like concat('%',#{slsx},'%') </if>
            <if test="slxx != null and slxx != ''"> and SLXX like concat('%',#{slxx},'%') </if>
            <if test="ts != null and ts != ''"> and TS like concat('%',#{ts},'%') </if>
            <if test="version != null and version != ''"> and VERSION like concat('%',#{version},'%') </if>
            <if test="wlbmid != null and wlbmid != ''"> and WLBMID like concat('%',#{wlbmid},'%') </if>
            <if test="zdy1 != null and zdy1 != ''"> and ZDY1 like concat('%',#{zdy1},'%') </if>
            <if test="zdy10 != null and zdy10 != ''"> and ZDY10 like concat('%',#{zdy10},'%') </if>
            <if test="zdy11 != null and zdy11 != ''"> and ZDY11 like concat('%',#{zdy11},'%') </if>
            <if test="zdy12 != null and zdy12 != ''"> and ZDY12 like concat('%',#{zdy12},'%') </if>
            <if test="zdy13 != null and zdy13 != ''"> and ZDY13 like concat('%',#{zdy13},'%') </if>
            <if test="zdy14 != null and zdy14 != ''"> and ZDY14 like concat('%',#{zdy14},'%') </if>
            <if test="zdy15 != null and zdy15 != ''"> and ZDY15 like concat('%',#{zdy15},'%') </if>
            <if test="zdy16 != null and zdy16 != ''"> and ZDY16 like concat('%',#{zdy16},'%') </if>
            <if test="zdy17 != null and zdy17 != ''"> and ZDY17 like concat('%',#{zdy17},'%') </if>
            <if test="zdy18 != null and zdy18 != ''"> and ZDY18 like concat('%',#{zdy18},'%') </if>
            <if test="zdy19 != null and zdy19 != ''"> and ZDY19 like concat('%',#{zdy19},'%') </if>
            <if test="zdy2 != null and zdy2 != ''"> and ZDY2 like concat('%',#{zdy2},'%') </if>
            <if test="zdy20 != null and zdy20 != ''"> and ZDY20 like concat('%',#{zdy20},'%') </if>
            <if test="zdy3 != null and zdy3 != ''"> and ZDY3 like concat('%',#{zdy3},'%') </if>
            <if test="zdy4 != null and zdy4 != ''"> and ZDY4 like concat('%',#{zdy4},'%') </if>
            <if test="zdy5 != null and zdy5 != ''"> and ZDY5 like concat('%',#{zdy5},'%') </if>
            <if test="zdy6 != null and zdy6 != ''"> and ZDY6 like concat('%',#{zdy6},'%') </if>
            <if test="zdy7 != null and zdy7 != ''"> and ZDY7 like concat('%',#{zdy7},'%') </if>
            <if test="zdy8 != null and zdy8 != ''"> and ZDY8 like concat('%',#{zdy8},'%') </if>
            <if test="zdy9 != null and zdy9 != ''"> and ZDY9 like concat('%',#{zdy9},'%') </if>
            <if test="zt != null and zt != ''"> and ZT like concat('%',#{zt},'%') </if>
            <if test="zyx1 != null and zyx1 != ''"> and ZYX1 like concat('%',#{zyx1},'%') </if>
            <if test="zyx2 != null and zyx2 != ''"> and ZYX2 like concat('%',#{zyx2},'%') </if>
            <if test="zyx3 != null and zyx3 != ''"> and ZYX3 like concat('%',#{zyx3},'%') </if>
            <if test="zyx4 != null and zyx4 != ''"> and ZYX4 like concat('%',#{zyx4},'%') </if>
            <if test="zyx5 != null and zyx5 != ''"> and ZYX5 like concat('%',#{zyx5},'%') </if>
            <if test="zzf != null and zzf != ''"> and ZZF like concat('%',#{zzf},'%') </if>
            <if test="bomtypeFrom != null and bomtypeFrom != ''"> and BOMTYPE_FROM like concat('%',#{bomtypeFrom},'%') </if>
            <if test="cjrq != null and cjrq != ''"> and CJRQ like concat('%',#{cjrq},'%') </if>
            <if test="cjsj != null and cjsj != ''"> and CJSJ like concat('%',#{cjsj},'%') </if>
            <if test="createtype != null and createtype != ''"> and CREATETYPE like concat('%',#{createtype},'%') </if>
            <if test="gcbmFrom != null and gcbmFrom != ''"> and GCBM_FROM like concat('%',#{gcbmFrom},'%') </if>
            <if test="modifiedtime != null and modifiedtime != ''"> and MODIFIEDTIME like concat('%',#{modifiedtime},'%') </if>
            <if test="modifier != null and modifier != ''"> and MODIFIER like concat('%',#{modifier},'%') </if>
            <if test="pkBomidFrom != null and pkBomidFrom != ''"> and PK_BOMID_FROM like concat('%',#{pkBomidFrom},'%') </if>
            <if test="pkCorpFrom != null and pkCorpFrom != ''"> and PK_CORP_FROM like concat('%',#{pkCorpFrom},'%') </if>
            <if test="qrrid != null and qrrid != ''"> and QRRID like concat('%',#{qrrid},'%') </if>
            <if test="qrrq != null and qrrq != ''"> and QRRQ like concat('%',#{qrrq},'%') </if>
            <if test="qrsj != null and qrsj != ''"> and QRSJ like concat('%',#{qrsj},'%') </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>

<!-- 查询列表 字段采用or格式 -->
<select id="BdBomentity_list_or" resultMap="get-BdBomEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity">
    select
    <include refid="BdBomEntity_Base_Column_List" />
    from BD_BOM
    <trim prefix="where" prefixOverrides="and"> 
         <if test="bblx != null and bblx != ''"> or BBLX = #{bblx} </if>
             <if test="bomlx != null and bomlx != ''"> or BOMLX = #{bomlx} </if>
             <if test="clf != null and clf != ''"> or CLF = #{clf} </if>
             <if test="creat != null and creat != ''"> or CREAT = #{creat} </if>
             <if test="dr != null and dr != ''"> or DR = #{dr} </if>
             <if test="fsl != null and fsl != ''"> or FSL = #{fsl} </if>
             <if test="fslsx != null and fslsx != ''"> or FSLSX = #{fslsx} </if>
             <if test="fslxx != null and fslxx != ''"> or FSLXX = #{fslxx} </if>
             <if test="gcbm != null and gcbm != ''"> or GCBM = #{gcbm} </if>
             <if test="gdfsl != null and gdfsl != ''"> or GDFSL = #{gdfsl} </if>
             <if test="gdsl != null and gdsl != ''"> or GDSL = #{gdsl} </if>
             <if test="hsl != null and hsl != ''"> or HSL = #{hsl} </if>
             <if test="jldwid != null and jldwid != ''"> or JLDWID = #{jldwid} </if>
             <if test="memo != null and memo != ''"> or MEMO = #{memo} </if>
             <if test="mver != null and mver != ''"> or MVER = #{mver} </if>
             <if test="pkBomid != null and pkBomid != ''"> or PK_BOMID = #{pkBomid} </if>
             <if test="pkCorp != null and pkCorp != ''"> or PK_CORP = #{pkCorp} </if>
             <if test="pkProduce != null and pkProduce != ''"> or PK_PRODUCE = #{pkProduce} </if>
             <if test="rgf != null and rgf != ''"> or RGF = #{rgf} </if>
             <if test="sfmr != null and sfmr != ''"> or SFMR = #{sfmr} </if>
             <if test="sftpmr != null and sftpmr != ''"> or SFTPMR = #{sftpmr} </if>
             <if test="sl != null and sl != ''"> or SL = #{sl} </if>
             <if test="slsx != null and slsx != ''"> or SLSX = #{slsx} </if>
             <if test="slxx != null and slxx != ''"> or SLXX = #{slxx} </if>
             <if test="ts != null and ts != ''"> or TS = #{ts} </if>
             <if test="version != null and version != ''"> or VERSION = #{version} </if>
             <if test="wlbmid != null and wlbmid != ''"> or WLBMID = #{wlbmid} </if>
             <if test="zdy1 != null and zdy1 != ''"> or ZDY1 = #{zdy1} </if>
             <if test="zdy10 != null and zdy10 != ''"> or ZDY10 = #{zdy10} </if>
             <if test="zdy11 != null and zdy11 != ''"> or ZDY11 = #{zdy11} </if>
             <if test="zdy12 != null and zdy12 != ''"> or ZDY12 = #{zdy12} </if>
             <if test="zdy13 != null and zdy13 != ''"> or ZDY13 = #{zdy13} </if>
             <if test="zdy14 != null and zdy14 != ''"> or ZDY14 = #{zdy14} </if>
             <if test="zdy15 != null and zdy15 != ''"> or ZDY15 = #{zdy15} </if>
             <if test="zdy16 != null and zdy16 != ''"> or ZDY16 = #{zdy16} </if>
             <if test="zdy17 != null and zdy17 != ''"> or ZDY17 = #{zdy17} </if>
             <if test="zdy18 != null and zdy18 != ''"> or ZDY18 = #{zdy18} </if>
             <if test="zdy19 != null and zdy19 != ''"> or ZDY19 = #{zdy19} </if>
             <if test="zdy2 != null and zdy2 != ''"> or ZDY2 = #{zdy2} </if>
             <if test="zdy20 != null and zdy20 != ''"> or ZDY20 = #{zdy20} </if>
             <if test="zdy3 != null and zdy3 != ''"> or ZDY3 = #{zdy3} </if>
             <if test="zdy4 != null and zdy4 != ''"> or ZDY4 = #{zdy4} </if>
             <if test="zdy5 != null and zdy5 != ''"> or ZDY5 = #{zdy5} </if>
             <if test="zdy6 != null and zdy6 != ''"> or ZDY6 = #{zdy6} </if>
             <if test="zdy7 != null and zdy7 != ''"> or ZDY7 = #{zdy7} </if>
             <if test="zdy8 != null and zdy8 != ''"> or ZDY8 = #{zdy8} </if>
             <if test="zdy9 != null and zdy9 != ''"> or ZDY9 = #{zdy9} </if>
             <if test="zt != null and zt != ''"> or ZT = #{zt} </if>
             <if test="zyx1 != null and zyx1 != ''"> or ZYX1 = #{zyx1} </if>
             <if test="zyx2 != null and zyx2 != ''"> or ZYX2 = #{zyx2} </if>
             <if test="zyx3 != null and zyx3 != ''"> or ZYX3 = #{zyx3} </if>
             <if test="zyx4 != null and zyx4 != ''"> or ZYX4 = #{zyx4} </if>
             <if test="zyx5 != null and zyx5 != ''"> or ZYX5 = #{zyx5} </if>
             <if test="zzf != null and zzf != ''"> or ZZF = #{zzf} </if>
             <if test="bomtypeFrom != null and bomtypeFrom != ''"> or BOMTYPE_FROM = #{bomtypeFrom} </if>
             <if test="cjrq != null and cjrq != ''"> or CJRQ = #{cjrq} </if>
             <if test="cjsj != null and cjsj != ''"> or CJSJ = #{cjsj} </if>
             <if test="createtype != null and createtype != ''"> or CREATETYPE = #{createtype} </if>
             <if test="gcbmFrom != null and gcbmFrom != ''"> or GCBM_FROM = #{gcbmFrom} </if>
             <if test="modifiedtime != null and modifiedtime != ''"> or MODIFIEDTIME = #{modifiedtime} </if>
             <if test="modifier != null and modifier != ''"> or MODIFIER = #{modifier} </if>
             <if test="pkBomidFrom != null and pkBomidFrom != ''"> or PK_BOMID_FROM = #{pkBomidFrom} </if>
             <if test="pkCorpFrom != null and pkCorpFrom != ''"> or PK_CORP_FROM = #{pkCorpFrom} </if>
             <if test="qrrid != null and qrrid != ''"> or QRRID = #{qrrid} </if>
             <if test="qrrq != null and qrrq != ''"> or QRRQ = #{qrrq} </if>
             <if test="qrsj != null and qrsj != ''"> or QRSJ = #{qrsj} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString()  "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>

<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity" keyProperty="pkBomid" useGeneratedKeys="true">
    insert into BD_BOM(
  <trim suffix="" suffixOverrides=",">
       <if test="bblx != null and bblx != ''"> BBLX , </if>
            <if test="bomlx != null and bomlx != ''"> BOMLX , </if>
            <if test="clf != null and clf != ''"> CLF , </if>
            <if test="creat != null and creat != ''"> CREAT , </if>
            <if test="dr != null and dr != ''"> DR , </if>
            <if test="fsl != null and fsl != ''"> FSL , </if>
            <if test="fslsx != null and fslsx != ''"> FSLSX , </if>
            <if test="fslxx != null and fslxx != ''"> FSLXX , </if>
            <if test="gcbm != null and gcbm != ''"> GCBM , </if>
            <if test="gdfsl != null and gdfsl != ''"> GDFSL , </if>
            <if test="gdsl != null and gdsl != ''"> GDSL , </if>
            <if test="hsl != null and hsl != ''"> HSL , </if>
            <if test="jldwid != null and jldwid != ''"> JLDWID , </if>
            <if test="memo != null and memo != ''"> MEMO , </if>
            <if test="mver != null and mver != ''"> MVER , </if>
            <if test="pkBomid != null and pkBomid != ''"> PK_BOMID , </if>
            <if test="pkCorp != null and pkCorp != ''"> PK_CORP , </if>
            <if test="pkProduce != null and pkProduce != ''"> PK_PRODUCE , </if>
            <if test="rgf != null and rgf != ''"> RGF , </if>
            <if test="sfmr != null and sfmr != ''"> SFMR , </if>
            <if test="sftpmr != null and sftpmr != ''"> SFTPMR , </if>
            <if test="sl != null and sl != ''"> SL , </if>
            <if test="slsx != null and slsx != ''"> SLSX , </if>
            <if test="slxx != null and slxx != ''"> SLXX , </if>
            <if test="ts != null and ts != ''"> TS , </if>
            <if test="version != null and version != ''"> VERSION , </if>
            <if test="wlbmid != null and wlbmid != ''"> WLBMID , </if>
            <if test="zdy1 != null and zdy1 != ''"> ZDY1 , </if>
            <if test="zdy10 != null and zdy10 != ''"> ZDY10 , </if>
            <if test="zdy11 != null and zdy11 != ''"> ZDY11 , </if>
            <if test="zdy12 != null and zdy12 != ''"> ZDY12 , </if>
            <if test="zdy13 != null and zdy13 != ''"> ZDY13 , </if>
            <if test="zdy14 != null and zdy14 != ''"> ZDY14 , </if>
            <if test="zdy15 != null and zdy15 != ''"> ZDY15 , </if>
            <if test="zdy16 != null and zdy16 != ''"> ZDY16 , </if>
            <if test="zdy17 != null and zdy17 != ''"> ZDY17 , </if>
            <if test="zdy18 != null and zdy18 != ''"> ZDY18 , </if>
            <if test="zdy19 != null and zdy19 != ''"> ZDY19 , </if>
            <if test="zdy2 != null and zdy2 != ''"> ZDY2 , </if>
            <if test="zdy20 != null and zdy20 != ''"> ZDY20 , </if>
            <if test="zdy3 != null and zdy3 != ''"> ZDY3 , </if>
            <if test="zdy4 != null and zdy4 != ''"> ZDY4 , </if>
            <if test="zdy5 != null and zdy5 != ''"> ZDY5 , </if>
            <if test="zdy6 != null and zdy6 != ''"> ZDY6 , </if>
            <if test="zdy7 != null and zdy7 != ''"> ZDY7 , </if>
            <if test="zdy8 != null and zdy8 != ''"> ZDY8 , </if>
            <if test="zdy9 != null and zdy9 != ''"> ZDY9 , </if>
            <if test="zt != null and zt != ''"> ZT , </if>
            <if test="zyx1 != null and zyx1 != ''"> ZYX1 , </if>
            <if test="zyx2 != null and zyx2 != ''"> ZYX2 , </if>
            <if test="zyx3 != null and zyx3 != ''"> ZYX3 , </if>
            <if test="zyx4 != null and zyx4 != ''"> ZYX4 , </if>
            <if test="zyx5 != null and zyx5 != ''"> ZYX5 , </if>
            <if test="zzf != null and zzf != ''"> ZZF , </if>
            <if test="bomtypeFrom != null and bomtypeFrom != ''"> BOMTYPE_FROM , </if>
            <if test="cjrq != null and cjrq != ''"> CJRQ , </if>
            <if test="cjsj != null and cjsj != ''"> CJSJ , </if>
            <if test="createtype != null and createtype != ''"> CREATETYPE , </if>
            <if test="gcbmFrom != null and gcbmFrom != ''"> GCBM_FROM , </if>
            <if test="modifiedtime != null and modifiedtime != ''"> MODIFIEDTIME , </if>
            <if test="modifier != null and modifier != ''"> MODIFIER , </if>
            <if test="pkBomidFrom != null and pkBomidFrom != ''"> PK_BOMID_FROM , </if>
            <if test="pkCorpFrom != null and pkCorpFrom != ''"> PK_CORP_FROM , </if>
            <if test="qrrid != null and qrrid != ''"> QRRID , </if>
            <if test="qrrq != null and qrrq != ''"> QRRQ , </if>
            <if test="qrsj != null and qrsj != ''"> QRSJ , </if>
            <if test="sorts == null ">sorts,</if>
    <if test="sts == null ">sts,</if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <if test="bblx != null and bblx != ''"> #{bblx} ,</if>
            <if test="bomlx != null and bomlx != ''"> #{bomlx} ,</if>
            <if test="clf != null and clf != ''"> #{clf} ,</if>
            <if test="creat != null and creat != ''"> #{creat} ,</if>
            <if test="dr != null and dr != ''"> #{dr} ,</if>
            <if test="fsl != null and fsl != ''"> #{fsl} ,</if>
            <if test="fslsx != null and fslsx != ''"> #{fslsx} ,</if>
            <if test="fslxx != null and fslxx != ''"> #{fslxx} ,</if>
            <if test="gcbm != null and gcbm != ''"> #{gcbm} ,</if>
            <if test="gdfsl != null and gdfsl != ''"> #{gdfsl} ,</if>
            <if test="gdsl != null and gdsl != ''"> #{gdsl} ,</if>
            <if test="hsl != null and hsl != ''"> #{hsl} ,</if>
            <if test="jldwid != null and jldwid != ''"> #{jldwid} ,</if>
            <if test="memo != null and memo != ''"> #{memo} ,</if>
            <if test="mver != null and mver != ''"> #{mver} ,</if>
            <if test="pkBomid != null and pkBomid != ''"> #{pkBomid} ,</if>
            <if test="pkCorp != null and pkCorp != ''"> #{pkCorp} ,</if>
            <if test="pkProduce != null and pkProduce != ''"> #{pkProduce} ,</if>
            <if test="rgf != null and rgf != ''"> #{rgf} ,</if>
            <if test="sfmr != null and sfmr != ''"> #{sfmr} ,</if>
            <if test="sftpmr != null and sftpmr != ''"> #{sftpmr} ,</if>
            <if test="sl != null and sl != ''"> #{sl} ,</if>
            <if test="slsx != null and slsx != ''"> #{slsx} ,</if>
            <if test="slxx != null and slxx != ''"> #{slxx} ,</if>
            <if test="ts != null and ts != ''"> #{ts} ,</if>
            <if test="version != null and version != ''"> #{version} ,</if>
            <if test="wlbmid != null and wlbmid != ''"> #{wlbmid} ,</if>
            <if test="zdy1 != null and zdy1 != ''"> #{zdy1} ,</if>
            <if test="zdy10 != null and zdy10 != ''"> #{zdy10} ,</if>
            <if test="zdy11 != null and zdy11 != ''"> #{zdy11} ,</if>
            <if test="zdy12 != null and zdy12 != ''"> #{zdy12} ,</if>
            <if test="zdy13 != null and zdy13 != ''"> #{zdy13} ,</if>
            <if test="zdy14 != null and zdy14 != ''"> #{zdy14} ,</if>
            <if test="zdy15 != null and zdy15 != ''"> #{zdy15} ,</if>
            <if test="zdy16 != null and zdy16 != ''"> #{zdy16} ,</if>
            <if test="zdy17 != null and zdy17 != ''"> #{zdy17} ,</if>
            <if test="zdy18 != null and zdy18 != ''"> #{zdy18} ,</if>
            <if test="zdy19 != null and zdy19 != ''"> #{zdy19} ,</if>
            <if test="zdy2 != null and zdy2 != ''"> #{zdy2} ,</if>
            <if test="zdy20 != null and zdy20 != ''"> #{zdy20} ,</if>
            <if test="zdy3 != null and zdy3 != ''"> #{zdy3} ,</if>
            <if test="zdy4 != null and zdy4 != ''"> #{zdy4} ,</if>
            <if test="zdy5 != null and zdy5 != ''"> #{zdy5} ,</if>
            <if test="zdy6 != null and zdy6 != ''"> #{zdy6} ,</if>
            <if test="zdy7 != null and zdy7 != ''"> #{zdy7} ,</if>
            <if test="zdy8 != null and zdy8 != ''"> #{zdy8} ,</if>
            <if test="zdy9 != null and zdy9 != ''"> #{zdy9} ,</if>
            <if test="zt != null and zt != ''"> #{zt} ,</if>
            <if test="zyx1 != null and zyx1 != ''"> #{zyx1} ,</if>
            <if test="zyx2 != null and zyx2 != ''"> #{zyx2} ,</if>
            <if test="zyx3 != null and zyx3 != ''"> #{zyx3} ,</if>
            <if test="zyx4 != null and zyx4 != ''"> #{zyx4} ,</if>
            <if test="zyx5 != null and zyx5 != ''"> #{zyx5} ,</if>
            <if test="zzf != null and zzf != ''"> #{zzf} ,</if>
            <if test="bomtypeFrom != null and bomtypeFrom != ''"> #{bomtypeFrom} ,</if>
            <if test="cjrq != null and cjrq != ''"> #{cjrq} ,</if>
            <if test="cjsj != null and cjsj != ''"> #{cjsj} ,</if>
            <if test="createtype != null and createtype != ''"> #{createtype} ,</if>
            <if test="gcbmFrom != null and gcbmFrom != ''"> #{gcbmFrom} ,</if>
            <if test="modifiedtime != null and modifiedtime != ''"> #{modifiedtime} ,</if>
            <if test="modifier != null and modifier != ''"> #{modifier} ,</if>
            <if test="pkBomidFrom != null and pkBomidFrom != ''"> #{pkBomidFrom} ,</if>
            <if test="pkCorpFrom != null and pkCorpFrom != ''"> #{pkCorpFrom} ,</if>
            <if test="qrrid != null and qrrid != ''"> #{qrrid} ,</if>
            <if test="qrrq != null and qrrq != ''"> #{qrrq} ,</if>
            <if test="qrsj != null and qrsj != ''"> #{qrsj} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from BD_BOM a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="pkBomid" useGeneratedKeys="true">
  insert into BD_BOM(BBLX, BOMLX, CLF, CREAT, DR, FSL, FSLSX, FSLXX, GCBM, GDFSL, GDSL, HSL, JLDWID, MEMO, MVER, PK_CORP, PK_PRODUCE, RGF, SFMR, SFTPMR, SL, SLSX, SLXX, TS, VERSION, WLBMID, ZDY1, ZDY10, ZDY11, ZDY12, ZDY13, ZDY14, ZDY15, ZDY16, ZDY17, ZDY18, ZDY19, ZDY2, ZDY20, ZDY3, ZDY4, ZDY5, ZDY6, ZDY7, ZDY8, ZDY9, ZT, ZYX1, ZYX2, ZYX3, ZYX4, ZYX5, ZZF, BOMTYPE_FROM, CJRQ, CJSJ, CREATETYPE, GCBM_FROM, MODIFIEDTIME, MODIFIER, PK_BOMID_FROM, PK_CORP_FROM, QRRID, QRRQ, QRSJ,  sts) 
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.bblx},#{entity.bomlx},#{entity.clf},#{entity.creat},#{entity.dr},#{entity.fsl},#{entity.fslsx},#{entity.fslxx},#{entity.gcbm},#{entity.gdfsl},#{entity.gdsl},#{entity.hsl},#{entity.jldwid},#{entity.memo},#{entity.mver},#{entity.pkCorp},#{entity.pkProduce},#{entity.rgf},#{entity.sfmr},#{entity.sftpmr},#{entity.sl},#{entity.slsx},#{entity.slxx},#{entity.ts},#{entity.version},#{entity.wlbmid},#{entity.zdy1},#{entity.zdy10},#{entity.zdy11},#{entity.zdy12},#{entity.zdy13},#{entity.zdy14},#{entity.zdy15},#{entity.zdy16},#{entity.zdy17},#{entity.zdy18},#{entity.zdy19},#{entity.zdy2},#{entity.zdy20},#{entity.zdy3},#{entity.zdy4},#{entity.zdy5},#{entity.zdy6},#{entity.zdy7},#{entity.zdy8},#{entity.zdy9},#{entity.zt},#{entity.zyx1},#{entity.zyx2},#{entity.zyx3},#{entity.zyx4},#{entity.zyx5},#{entity.zzf},#{entity.bomtypeFrom},#{entity.cjrq},#{entity.cjsj},#{entity.createtype},#{entity.gcbmFrom},#{entity.modifiedtime},#{entity.modifier},#{entity.pkBomidFrom},#{entity.pkCorpFrom},#{entity.qrrid},#{entity.qrrq},#{entity.qrsj}, 'Y')
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="pkBomid" useGeneratedKeys="true">
    insert into BD_BOM(BBLX, BOMLX, CLF, CREAT, DR, FSL, FSLSX, FSLXX, GCBM, GDFSL, GDSL, HSL, JLDWID, MEMO, MVER, PK_CORP, PK_PRODUCE, RGF, SFMR, SFTPMR, SL, SLSX, SLXX, TS, VERSION, WLBMID, ZDY1, ZDY10, ZDY11, ZDY12, ZDY13, ZDY14, ZDY15, ZDY16, ZDY17, ZDY18, ZDY19, ZDY2, ZDY20, ZDY3, ZDY4, ZDY5, ZDY6, ZDY7, ZDY8, ZDY9, ZT, ZYX1, ZYX2, ZYX3, ZYX4, ZYX5, ZZF, BOMTYPE_FROM, CJRQ, CJSJ, CREATETYPE, GCBM_FROM, MODIFIEDTIME, MODIFIER, PK_BOMID_FROM, PK_CORP_FROM, QRRID, QRRQ, QRSJ)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.bblx},#{entity.bomlx},#{entity.clf},#{entity.creat},#{entity.dr},#{entity.fsl},#{entity.fslsx},#{entity.fslxx},#{entity.gcbm},#{entity.gdfsl},#{entity.gdsl},#{entity.hsl},#{entity.jldwid},#{entity.memo},#{entity.mver},#{entity.pkCorp},#{entity.pkProduce},#{entity.rgf},#{entity.sfmr},#{entity.sftpmr},#{entity.sl},#{entity.slsx},#{entity.slxx},#{entity.ts},#{entity.version},#{entity.wlbmid},#{entity.zdy1},#{entity.zdy10},#{entity.zdy11},#{entity.zdy12},#{entity.zdy13},#{entity.zdy14},#{entity.zdy15},#{entity.zdy16},#{entity.zdy17},#{entity.zdy18},#{entity.zdy19},#{entity.zdy2},#{entity.zdy20},#{entity.zdy3},#{entity.zdy4},#{entity.zdy5},#{entity.zdy6},#{entity.zdy7},#{entity.zdy8},#{entity.zdy9},#{entity.zt},#{entity.zyx1},#{entity.zyx2},#{entity.zyx3},#{entity.zyx4},#{entity.zyx5},#{entity.zzf},#{entity.bomtypeFrom},#{entity.cjrq},#{entity.cjsj},#{entity.createtype},#{entity.gcbmFrom},#{entity.modifiedtime},#{entity.modifier},#{entity.pkBomidFrom},#{entity.pkCorpFrom},#{entity.qrrid},#{entity.qrrq},#{entity.qrsj})
    </foreach>
    on duplicate key update
    BBLX = values(BBLX),
    BOMLX = values(BOMLX),
    CLF = values(CLF),
    CREAT = values(CREAT),
    DR = values(DR),
    FSL = values(FSL),
    FSLSX = values(FSLSX),
    FSLXX = values(FSLXX),
    GCBM = values(GCBM),
    GDFSL = values(GDFSL),
    GDSL = values(GDSL),
    HSL = values(HSL),
    JLDWID = values(JLDWID),
    MEMO = values(MEMO),
    MVER = values(MVER),
    PK_CORP = values(PK_CORP),
    PK_PRODUCE = values(PK_PRODUCE),
    RGF = values(RGF),
    SFMR = values(SFMR),
    SFTPMR = values(SFTPMR),
    SL = values(SL),
    SLSX = values(SLSX),
    SLXX = values(SLXX),
    TS = values(TS),
    VERSION = values(VERSION),
    WLBMID = values(WLBMID),
    ZDY1 = values(ZDY1),
    ZDY10 = values(ZDY10),
    ZDY11 = values(ZDY11),
    ZDY12 = values(ZDY12),
    ZDY13 = values(ZDY13),
    ZDY14 = values(ZDY14),
    ZDY15 = values(ZDY15),
    ZDY16 = values(ZDY16),
    ZDY17 = values(ZDY17),
    ZDY18 = values(ZDY18),
    ZDY19 = values(ZDY19),
    ZDY2 = values(ZDY2),
    ZDY20 = values(ZDY20),
    ZDY3 = values(ZDY3),
    ZDY4 = values(ZDY4),
    ZDY5 = values(ZDY5),
    ZDY6 = values(ZDY6),
    ZDY7 = values(ZDY7),
    ZDY8 = values(ZDY8),
    ZDY9 = values(ZDY9),
    ZT = values(ZT),
    ZYX1 = values(ZYX1),
    ZYX2 = values(ZYX2),
    ZYX3 = values(ZYX3),
    ZYX4 = values(ZYX4),
    ZYX5 = values(ZYX5),
    ZZF = values(ZZF),
    BOMTYPE_FROM = values(BOMTYPE_FROM),
    CJRQ = values(CJRQ),
    CJSJ = values(CJSJ),
    CREATETYPE = values(CREATETYPE),
    GCBM_FROM = values(GCBM_FROM),
    MODIFIEDTIME = values(MODIFIEDTIME),
    MODIFIER = values(MODIFIER),
    PK_BOMID_FROM = values(PK_BOMID_FROM),
    PK_CORP_FROM = values(PK_CORP_FROM),
    QRRID = values(QRRID),
    QRRQ = values(QRRQ),
    QRSJ = values(QRSJ)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity" >
update BD_BOM  set
<trim suffix="" suffixOverrides=",">
  <if test="bblx != null and bblx != ''"> BBLX = #{bblx},</if>
  <if test="bomlx != null and bomlx != ''"> BOMLX = #{bomlx},</if>
  <if test="clf != null and clf != ''"> CLF = #{clf},</if>
  <if test="creat != null and creat != ''"> CREAT = #{creat},</if>
  <if test="dr != null and dr != ''"> DR = #{dr},</if>
  <if test="fsl != null and fsl != ''"> FSL = #{fsl},</if>
  <if test="fslsx != null and fslsx != ''"> FSLSX = #{fslsx},</if>
  <if test="fslxx != null and fslxx != ''"> FSLXX = #{fslxx},</if>
  <if test="gcbm != null and gcbm != ''"> GCBM = #{gcbm},</if>
  <if test="gdfsl != null and gdfsl != ''"> GDFSL = #{gdfsl},</if>
  <if test="gdsl != null and gdsl != ''"> GDSL = #{gdsl},</if>
  <if test="hsl != null and hsl != ''"> HSL = #{hsl},</if>
  <if test="jldwid != null and jldwid != ''"> JLDWID = #{jldwid},</if>
  <if test="memo != null and memo != ''"> MEMO = #{memo},</if>
  <if test="mver != null and mver != ''"> MVER = #{mver},</if>
  <if test="pkCorp != null and pkCorp != ''"> PK_CORP = #{pkCorp},</if>
  <if test="pkProduce != null and pkProduce != ''"> PK_PRODUCE = #{pkProduce},</if>
  <if test="rgf != null and rgf != ''"> RGF = #{rgf},</if>
  <if test="sfmr != null and sfmr != ''"> SFMR = #{sfmr},</if>
  <if test="sftpmr != null and sftpmr != ''"> SFTPMR = #{sftpmr},</if>
  <if test="sl != null and sl != ''"> SL = #{sl},</if>
  <if test="slsx != null and slsx != ''"> SLSX = #{slsx},</if>
  <if test="slxx != null and slxx != ''"> SLXX = #{slxx},</if>
  <if test="ts != null and ts != ''"> TS = #{ts},</if>
  <if test="version != null and version != ''"> VERSION = #{version},</if>
  <if test="wlbmid != null and wlbmid != ''"> WLBMID = #{wlbmid},</if>
  <if test="zdy1 != null and zdy1 != ''"> ZDY1 = #{zdy1},</if>
  <if test="zdy10 != null and zdy10 != ''"> ZDY10 = #{zdy10},</if>
  <if test="zdy11 != null and zdy11 != ''"> ZDY11 = #{zdy11},</if>
  <if test="zdy12 != null and zdy12 != ''"> ZDY12 = #{zdy12},</if>
  <if test="zdy13 != null and zdy13 != ''"> ZDY13 = #{zdy13},</if>
  <if test="zdy14 != null and zdy14 != ''"> ZDY14 = #{zdy14},</if>
  <if test="zdy15 != null and zdy15 != ''"> ZDY15 = #{zdy15},</if>
  <if test="zdy16 != null and zdy16 != ''"> ZDY16 = #{zdy16},</if>
  <if test="zdy17 != null and zdy17 != ''"> ZDY17 = #{zdy17},</if>
  <if test="zdy18 != null and zdy18 != ''"> ZDY18 = #{zdy18},</if>
  <if test="zdy19 != null and zdy19 != ''"> ZDY19 = #{zdy19},</if>
  <if test="zdy2 != null and zdy2 != ''"> ZDY2 = #{zdy2},</if>
  <if test="zdy20 != null and zdy20 != ''"> ZDY20 = #{zdy20},</if>
  <if test="zdy3 != null and zdy3 != ''"> ZDY3 = #{zdy3},</if>
  <if test="zdy4 != null and zdy4 != ''"> ZDY4 = #{zdy4},</if>
  <if test="zdy5 != null and zdy5 != ''"> ZDY5 = #{zdy5},</if>
  <if test="zdy6 != null and zdy6 != ''"> ZDY6 = #{zdy6},</if>
  <if test="zdy7 != null and zdy7 != ''"> ZDY7 = #{zdy7},</if>
  <if test="zdy8 != null and zdy8 != ''"> ZDY8 = #{zdy8},</if>
  <if test="zdy9 != null and zdy9 != ''"> ZDY9 = #{zdy9},</if>
  <if test="zt != null and zt != ''"> ZT = #{zt},</if>
  <if test="zyx1 != null and zyx1 != ''"> ZYX1 = #{zyx1},</if>
  <if test="zyx2 != null and zyx2 != ''"> ZYX2 = #{zyx2},</if>
  <if test="zyx3 != null and zyx3 != ''"> ZYX3 = #{zyx3},</if>
  <if test="zyx4 != null and zyx4 != ''"> ZYX4 = #{zyx4},</if>
  <if test="zyx5 != null and zyx5 != ''"> ZYX5 = #{zyx5},</if>
  <if test="zzf != null and zzf != ''"> ZZF = #{zzf},</if>
  <if test="bomtypeFrom != null and bomtypeFrom != ''"> BOMTYPE_FROM = #{bomtypeFrom},</if>
  <if test="cjrq != null and cjrq != ''"> CJRQ = #{cjrq},</if>
  <if test="cjsj != null and cjsj != ''"> CJSJ = #{cjsj},</if>
  <if test="createtype != null and createtype != ''"> CREATETYPE = #{createtype},</if>
  <if test="gcbmFrom != null and gcbmFrom != ''"> GCBM_FROM = #{gcbmFrom},</if>
  <if test="modifiedtime != null and modifiedtime != ''"> MODIFIEDTIME = #{modifiedtime},</if>
  <if test="modifier != null and modifier != ''"> MODIFIER = #{modifier},</if>
  <if test="pkBomidFrom != null and pkBomidFrom != ''"> PK_BOMID_FROM = #{pkBomidFrom},</if>
  <if test="pkCorpFrom != null and pkCorpFrom != ''"> PK_CORP_FROM = #{pkCorpFrom},</if>
  <if test="qrrid != null and qrrid != ''"> QRRID = #{qrrid},</if>
  <if test="qrrq != null and qrrq != ''"> QRRQ = #{qrrq},</if>
  <if test="qrsj != null and qrsj != ''"> QRSJ = #{qrsj},</if>
</trim>
where PK_BOMID = #{pkBomid}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity" >
update BD_BOM  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where PK_BOMID = #{pkBomid}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.BdBomEntity" >
update BD_BOM  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 <trim prefix="where" prefixOverrides="and"> 
        <if test="bblx != null and bblx != ''"> and BBLX = #{bblx} </if>
            <if test="bomlx != null and bomlx != ''"> and BOMLX = #{bomlx} </if>
            <if test="clf != null and clf != ''"> and CLF = #{clf} </if>
            <if test="creat != null and creat != ''"> and CREAT = #{creat} </if>
            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
            <if test="fsl != null and fsl != ''"> and FSL = #{fsl} </if>
            <if test="fslsx != null and fslsx != ''"> and FSLSX = #{fslsx} </if>
            <if test="fslxx != null and fslxx != ''"> and FSLXX = #{fslxx} </if>
            <if test="gcbm != null and gcbm != ''"> and GCBM = #{gcbm} </if>
            <if test="gdfsl != null and gdfsl != ''"> and GDFSL = #{gdfsl} </if>
            <if test="gdsl != null and gdsl != ''"> and GDSL = #{gdsl} </if>
            <if test="hsl != null and hsl != ''"> and HSL = #{hsl} </if>
            <if test="jldwid != null and jldwid != ''"> and JLDWID = #{jldwid} </if>
            <if test="memo != null and memo != ''"> and MEMO = #{memo} </if>
            <if test="mver != null and mver != ''"> and MVER = #{mver} </if>
            <if test="pkBomid != null and pkBomid != ''"> and PK_BOMID = #{pkBomid} </if>
            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
            <if test="pkProduce != null and pkProduce != ''"> and PK_PRODUCE = #{pkProduce} </if>
            <if test="rgf != null and rgf != ''"> and RGF = #{rgf} </if>
            <if test="sfmr != null and sfmr != ''"> and SFMR = #{sfmr} </if>
            <if test="sftpmr != null and sftpmr != ''"> and SFTPMR = #{sftpmr} </if>
            <if test="sl != null and sl != ''"> and SL = #{sl} </if>
            <if test="slsx != null and slsx != ''"> and SLSX = #{slsx} </if>
            <if test="slxx != null and slxx != ''"> and SLXX = #{slxx} </if>
            <if test="ts != null and ts != ''"> and TS = #{ts} </if>
            <if test="version != null and version != ''"> and VERSION = #{version} </if>
            <if test="wlbmid != null and wlbmid != ''"> and WLBMID = #{wlbmid} </if>
            <if test="zdy1 != null and zdy1 != ''"> and ZDY1 = #{zdy1} </if>
            <if test="zdy10 != null and zdy10 != ''"> and ZDY10 = #{zdy10} </if>
            <if test="zdy11 != null and zdy11 != ''"> and ZDY11 = #{zdy11} </if>
            <if test="zdy12 != null and zdy12 != ''"> and ZDY12 = #{zdy12} </if>
            <if test="zdy13 != null and zdy13 != ''"> and ZDY13 = #{zdy13} </if>
            <if test="zdy14 != null and zdy14 != ''"> and ZDY14 = #{zdy14} </if>
            <if test="zdy15 != null and zdy15 != ''"> and ZDY15 = #{zdy15} </if>
            <if test="zdy16 != null and zdy16 != ''"> and ZDY16 = #{zdy16} </if>
            <if test="zdy17 != null and zdy17 != ''"> and ZDY17 = #{zdy17} </if>
            <if test="zdy18 != null and zdy18 != ''"> and ZDY18 = #{zdy18} </if>
            <if test="zdy19 != null and zdy19 != ''"> and ZDY19 = #{zdy19} </if>
            <if test="zdy2 != null and zdy2 != ''"> and ZDY2 = #{zdy2} </if>
            <if test="zdy20 != null and zdy20 != ''"> and ZDY20 = #{zdy20} </if>
            <if test="zdy3 != null and zdy3 != ''"> and ZDY3 = #{zdy3} </if>
            <if test="zdy4 != null and zdy4 != ''"> and ZDY4 = #{zdy4} </if>
            <if test="zdy5 != null and zdy5 != ''"> and ZDY5 = #{zdy5} </if>
            <if test="zdy6 != null and zdy6 != ''"> and ZDY6 = #{zdy6} </if>
            <if test="zdy7 != null and zdy7 != ''"> and ZDY7 = #{zdy7} </if>
            <if test="zdy8 != null and zdy8 != ''"> and ZDY8 = #{zdy8} </if>
            <if test="zdy9 != null and zdy9 != ''"> and ZDY9 = #{zdy9} </if>
            <if test="zt != null and zt != ''"> and ZT = #{zt} </if>
            <if test="zyx1 != null and zyx1 != ''"> and ZYX1 = #{zyx1} </if>
            <if test="zyx2 != null and zyx2 != ''"> and ZYX2 = #{zyx2} </if>
            <if test="zyx3 != null and zyx3 != ''"> and ZYX3 = #{zyx3} </if>
            <if test="zyx4 != null and zyx4 != ''"> and ZYX4 = #{zyx4} </if>
            <if test="zyx5 != null and zyx5 != ''"> and ZYX5 = #{zyx5} </if>
            <if test="zzf != null and zzf != ''"> and ZZF = #{zzf} </if>
            <if test="bomtypeFrom != null and bomtypeFrom != ''"> and BOMTYPE_FROM = #{bomtypeFrom} </if>
            <if test="cjrq != null and cjrq != ''"> and CJRQ = #{cjrq} </if>
            <if test="cjsj != null and cjsj != ''"> and CJSJ = #{cjsj} </if>
            <if test="createtype != null and createtype != ''"> and CREATETYPE = #{createtype} </if>
            <if test="gcbmFrom != null and gcbmFrom != ''"> and GCBM_FROM = #{gcbmFrom} </if>
            <if test="modifiedtime != null and modifiedtime != ''"> and MODIFIEDTIME = #{modifiedtime} </if>
            <if test="modifier != null and modifier != ''"> and MODIFIER = #{modifier} </if>
            <if test="pkBomidFrom != null and pkBomidFrom != ''"> and PK_BOMID_FROM = #{pkBomidFrom} </if>
            <if test="pkCorpFrom != null and pkCorpFrom != ''"> and PK_CORP_FROM = #{pkCorpFrom} </if>
            <if test="qrrid != null and qrrid != ''"> and QRRID = #{qrrid} </if>
            <if test="qrrq != null and qrrq != ''"> and QRRQ = #{qrrq} </if>
            <if test="qrsj != null and qrsj != ''"> and QRSJ = #{qrsj} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from BD_BOM where PK_BOMID = #{pkBomid}
</delete>

    <select id="queryBomVersion" parameterType="com.hzya.frame.plugin.lets.entity.BdBomEntity" resultMap="get-BdBomEntity-result">
        SELECT
            a.zt,
            a.cjsj,
            a.cjrq,
            a.qrrid,
            a.qrrq,
            a.qrsj,
            su2.user_name shrmc,
            a.modifier,
            a.modifiedtime,
            a.pk_corp,
            gcbm,
            pk_bomid,
            wlbmid,
            version,
            bblx,
            sfmr,
            sl,
            jldwid,
            rgf,
            clf,
            zzf,
            mver,
            bomlx,
            a.memo,
            zdy1,
            zdy2,
            zdy3,
            zdy4,
            zdy5,
            zdy6,
            zdy7,
            zdy8,
            zdy9,
            zdy10,
            zdy11,
            zdy12,
            zdy13,
            zdy14,
            zdy15,
            zdy16,
            zdy17,
            zdy18,
            zdy19,
            zdy20,
            b.invcode,
            b.invname,
            b.invspec,
            b.invtype,
            b.graphid,
            c.measname,
            pk_produce,
            a.ts,
            a.slsx,
            a.slxx,
            a.gdsl,
            a.sftpmr,
            a.fsl,
            a.fslxx,
            a.fslsx,
            a.gdfsl,
            a.hsl,
            d.pk_measdoc zjldwid,
            d.measname zjldwmc,
            a.creat,
            su.user_name,
            a.zyx1,
            a.zyx2,
            a.zyx3,
            a.zyx4,
            a.zyx5,
            pk_corp_from,
            gcbm_from,
            pk_bomid_from,
            bomtype_from,
            createtype
        FROM
            bd_bom a
                INNER JOIN bd_invbasdoc b ON a.wlbmid = b.pk_invbasdoc
                INNER JOIN bd_measdoc d ON b.pk_measdoc = d.pk_measdoc LEFT outer
                    JOIN bd_measdoc c ON a.jldwid = c.pk_measdoc LEFT outer
                    JOIN sm_user su ON a.creat = su.user_code LEFT outer
                    JOIN sm_user su2 ON a.qrrid = su2.cuserid
        WHERE
            a.dr = 0
          AND wlbmid = #{wlbmid}
          AND gcbm = #{gcbm}
        ORDER BY
            version desc
    </select>

</mapper>

