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

    <resultMap id="get-BdJobmngfilEntity-result" type="com.hzya.frame.plugin.lets.entity.BdJobmngfilEntity" >
       <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="dr" column="dr" jdbcType="INTEGER"/>
           <result property="memo" column="memo" jdbcType="VARCHAR"/>
           <result property="pkCorp" column="pk_corp" jdbcType="VARCHAR"/>
           <result property="pkCustdoc" column="pk_custdoc" jdbcType="VARCHAR"/>
           <result property="pkDeptdoc" column="pk_deptdoc" jdbcType="VARCHAR"/>
           <result property="pkJobbasfil" column="pk_jobbasfil" jdbcType="VARCHAR"/>
           <result property="pkJobmngfil" column="pk_jobmngfil" jdbcType="VARCHAR"/>
           <result property="pkPsndoc" column="pk_psndoc" jdbcType="VARCHAR"/>
           <result property="pkVendoc" column="pk_vendoc" jdbcType="VARCHAR"/>
           <result property="pubflag" column="pubflag" jdbcType="VARCHAR"/>
           <result property="remcode" column="remcode" jdbcType="VARCHAR"/>
           <result property="sealflag" column="sealflag" jdbcType="VARCHAR"/>
           <result property="ts" column="ts" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "BdJobmngfilEntity_Base_Column_List">
        def1
       ,def10 
        ,def11 
        ,def12 
        ,def13 
        ,def14 
        ,def15 
        ,def16 
        ,def17 
        ,def18 
        ,def19 
        ,def2 
        ,def20 
        ,def3 
        ,def4 
        ,def5 
        ,def6 
        ,def7 
        ,def8 
        ,def9 
        ,dr 
        ,memo 
        ,pk_corp 
        ,pk_custdoc 
        ,pk_deptdoc 
        ,pk_jobbasfil 
        ,pk_jobmngfil 
        ,pk_psndoc 
        ,pk_vendoc 
        ,pubflag 
        ,remcode 
        ,sealflag 
        ,ts 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-BdJobmngfilEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdJobmngfilEntity">
    select
    <include refid="BdJobmngfilEntity_Base_Column_List" />
    from bd_jobmngfil
    <trim prefix="where" prefixOverrides="and"> 
        <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="dr != null"> and dr = #{dr} </if>
            <if test="memo != null and memo != ''"> and memo = #{memo} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="pkCustdoc != null and pkCustdoc != ''"> and pk_custdoc = #{pkCustdoc} </if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> and pk_deptdoc = #{pkDeptdoc} </if>
            <if test="pkJobbasfil != null and pkJobbasfil != ''"> and pk_jobbasfil = #{pkJobbasfil} </if>
            <if test="pkJobmngfil != null and pkJobmngfil != ''"> and pk_jobmngfil = #{pkJobmngfil} </if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> and pk_psndoc = #{pkPsndoc} </if>
            <if test="pkVendoc != null and pkVendoc != ''"> and pk_vendoc = #{pkVendoc} </if>
            <if test="pubflag != null and pubflag != ''"> and pubflag = #{pubflag} </if>
            <if test="remcode != null and remcode != ''"> and remcode = #{remcode} </if>
            <if test="sealflag != null and sealflag != ''"> and sealflag = #{sealflag} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
    </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.BdJobmngfilEntity">
        select  count(1)   from bd_jobmngfil
    <trim prefix="where" prefixOverrides="and"> 
        <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="dr != null"> and dr = #{dr} </if>
            <if test="memo != null and memo != ''"> and memo = #{memo} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="pkCustdoc != null and pkCustdoc != ''"> and pk_custdoc = #{pkCustdoc} </if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> and pk_deptdoc = #{pkDeptdoc} </if>
            <if test="pkJobbasfil != null and pkJobbasfil != ''"> and pk_jobbasfil = #{pkJobbasfil} </if>
            <if test="pkJobmngfil != null and pkJobmngfil != ''"> and pk_jobmngfil = #{pkJobmngfil} </if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> and pk_psndoc = #{pkPsndoc} </if>
            <if test="pkVendoc != null and pkVendoc != ''"> and pk_vendoc = #{pkVendoc} </if>
            <if test="pubflag != null and pubflag != ''"> and pubflag = #{pubflag} </if>
            <if test="remcode != null and remcode != ''"> and remcode = #{remcode} </if>
            <if test="sealflag != null and sealflag != ''"> and sealflag = #{sealflag} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
    </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-BdJobmngfilEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdJobmngfilEntity">
    select
    <include refid="BdJobmngfilEntity_Base_Column_List" />
    from bd_jobmngfil
    <trim prefix="where" prefixOverrides="and"> 
        <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="dr != null"> and dr like concat('%',#{dr},'%') </if>
            <if test="memo != null and memo != ''"> and memo like concat('%',#{memo},'%') </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp like concat('%',#{pkCorp},'%') </if>
            <if test="pkCustdoc != null and pkCustdoc != ''"> and pk_custdoc like concat('%',#{pkCustdoc},'%') </if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> and pk_deptdoc like concat('%',#{pkDeptdoc},'%') </if>
            <if test="pkJobbasfil != null and pkJobbasfil != ''"> and pk_jobbasfil like concat('%',#{pkJobbasfil},'%') </if>
            <if test="pkJobmngfil != null and pkJobmngfil != ''"> and pk_jobmngfil like concat('%',#{pkJobmngfil},'%') </if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> and pk_psndoc like concat('%',#{pkPsndoc},'%') </if>
            <if test="pkVendoc != null and pkVendoc != ''"> and pk_vendoc like concat('%',#{pkVendoc},'%') </if>
            <if test="pubflag != null and pubflag != ''"> and pubflag like concat('%',#{pubflag},'%') </if>
            <if test="remcode != null and remcode != ''"> and remcode like concat('%',#{remcode},'%') </if>
            <if test="sealflag != null and sealflag != ''"> and sealflag like concat('%',#{sealflag},'%') </if>
            <if test="ts != null and ts != ''"> and ts like concat('%',#{ts},'%') </if>
    </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="BdJobmngfilentity_list_or" resultMap="get-BdJobmngfilEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdJobmngfilEntity">
    select
    <include refid="BdJobmngfilEntity_Base_Column_List" />
    from bd_jobmngfil
    <trim prefix="where" prefixOverrides="and"> 
         <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="dr != null"> or dr = #{dr} </if>
             <if test="memo != null and memo != ''"> or memo = #{memo} </if>
             <if test="pkCorp != null and pkCorp != ''"> or pk_corp = #{pkCorp} </if>
             <if test="pkCustdoc != null and pkCustdoc != ''"> or pk_custdoc = #{pkCustdoc} </if>
             <if test="pkDeptdoc != null and pkDeptdoc != ''"> or pk_deptdoc = #{pkDeptdoc} </if>
             <if test="pkJobbasfil != null and pkJobbasfil != ''"> or pk_jobbasfil = #{pkJobbasfil} </if>
             <if test="pkJobmngfil != null and pkJobmngfil != ''"> or pk_jobmngfil = #{pkJobmngfil} </if>
             <if test="pkPsndoc != null and pkPsndoc != ''"> or pk_psndoc = #{pkPsndoc} </if>
             <if test="pkVendoc != null and pkVendoc != ''"> or pk_vendoc = #{pkVendoc} </if>
             <if test="pubflag != null and pubflag != ''"> or pubflag = #{pubflag} </if>
             <if test="remcode != null and remcode != ''"> or remcode = #{remcode} </if>
             <if test="sealflag != null and sealflag != ''"> or sealflag = #{sealflag} </if>
             <if test="ts != null and ts != ''"> or ts = #{ts} </if>
    </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.BdJobmngfilEntity" keyProperty="pkJobmngfil" useGeneratedKeys="true">
    insert into bd_jobmngfil(
  <trim suffix="" suffixOverrides=",">
       <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="dr != null"> dr , </if>
            <if test="memo != null and memo != ''"> memo , </if>
            <if test="pkCorp != null and pkCorp != ''"> pk_corp , </if>
            <if test="pkCustdoc != null and pkCustdoc != ''"> pk_custdoc , </if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> pk_deptdoc , </if>
            <if test="pkJobbasfil != null and pkJobbasfil != ''"> pk_jobbasfil , </if>
            <if test="pkJobmngfil != null and pkJobmngfil != ''"> pk_jobmngfil , </if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> pk_psndoc , </if>
            <if test="pkVendoc != null and pkVendoc != ''"> pk_vendoc , </if>
            <if test="pubflag != null and pubflag != ''"> pubflag , </if>
            <if test="remcode != null and remcode != ''"> remcode , </if>
            <if test="sealflag != null and sealflag != ''"> sealflag , </if>
            <if test="ts != null and ts != ''"> ts , </if>
            <if test="sorts == null ">sorts,</if>
    <if test="sts == null ">sts,</if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <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="dr != null"> #{dr} ,</if>
            <if test="memo != null and memo != ''"> #{memo} ,</if>
            <if test="pkCorp != null and pkCorp != ''"> #{pkCorp} ,</if>
            <if test="pkCustdoc != null and pkCustdoc != ''"> #{pkCustdoc} ,</if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> #{pkDeptdoc} ,</if>
            <if test="pkJobbasfil != null and pkJobbasfil != ''"> #{pkJobbasfil} ,</if>
            <if test="pkJobmngfil != null and pkJobmngfil != ''"> #{pkJobmngfil} ,</if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> #{pkPsndoc} ,</if>
            <if test="pkVendoc != null and pkVendoc != ''"> #{pkVendoc} ,</if>
            <if test="pubflag != null and pubflag != ''"> #{pubflag} ,</if>
            <if test="remcode != null and remcode != ''"> #{remcode} ,</if>
            <if test="sealflag != null and sealflag != ''"> #{sealflag} ,</if>
            <if test="ts != null and ts != ''"> #{ts} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from bd_jobmngfil a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="pkJobmngfil" useGeneratedKeys="true">
  insert into bd_jobmngfil(def1, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def2, def20, def3, def4, def5, def6, def7, def8, def9, dr, memo, pk_corp, pk_custdoc, pk_deptdoc, pk_jobbasfil, pk_psndoc, pk_vendoc, pubflag, remcode, sealflag, ts,  sts) 
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{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.dr},#{entity.memo},#{entity.pkCorp},#{entity.pkCustdoc},#{entity.pkDeptdoc},#{entity.pkJobbasfil},#{entity.pkPsndoc},#{entity.pkVendoc},#{entity.pubflag},#{entity.remcode},#{entity.sealflag},#{entity.ts}, 'Y')
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="pkJobmngfil" useGeneratedKeys="true">
    insert into bd_jobmngfil(def1, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def2, def20, def3, def4, def5, def6, def7, def8, def9, dr, memo, pk_corp, pk_custdoc, pk_deptdoc, pk_jobbasfil, pk_psndoc, pk_vendoc, pubflag, remcode, sealflag, ts)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{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.dr},#{entity.memo},#{entity.pkCorp},#{entity.pkCustdoc},#{entity.pkDeptdoc},#{entity.pkJobbasfil},#{entity.pkPsndoc},#{entity.pkVendoc},#{entity.pubflag},#{entity.remcode},#{entity.sealflag},#{entity.ts})
    </foreach>
    on duplicate key update
    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),
    dr = values(dr),
    memo = values(memo),
    pk_corp = values(pk_corp),
    pk_custdoc = values(pk_custdoc),
    pk_deptdoc = values(pk_deptdoc),
    pk_jobbasfil = values(pk_jobbasfil),
    pk_psndoc = values(pk_psndoc),
    pk_vendoc = values(pk_vendoc),
    pubflag = values(pubflag),
    remcode = values(remcode),
    sealflag = values(sealflag),
    ts = values(ts)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.BdJobmngfilEntity" >
update bd_jobmngfil  set
<trim suffix="" suffixOverrides=",">
  <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="dr != null"> dr = #{dr},</if>
  <if test="memo != null and memo != ''"> memo = #{memo},</if>
  <if test="pkCorp != null and pkCorp != ''"> pk_corp = #{pkCorp},</if>
  <if test="pkCustdoc != null and pkCustdoc != ''"> pk_custdoc = #{pkCustdoc},</if>
  <if test="pkDeptdoc != null and pkDeptdoc != ''"> pk_deptdoc = #{pkDeptdoc},</if>
  <if test="pkJobbasfil != null and pkJobbasfil != ''"> pk_jobbasfil = #{pkJobbasfil},</if>
  <if test="pkPsndoc != null and pkPsndoc != ''"> pk_psndoc = #{pkPsndoc},</if>
  <if test="pkVendoc != null and pkVendoc != ''"> pk_vendoc = #{pkVendoc},</if>
  <if test="pubflag != null and pubflag != ''"> pubflag = #{pubflag},</if>
  <if test="remcode != null and remcode != ''"> remcode = #{remcode},</if>
  <if test="sealflag != null and sealflag != ''"> sealflag = #{sealflag},</if>
  <if test="ts != null and ts != ''"> ts = #{ts},</if>
</trim>
where pk_jobmngfil = #{pkJobmngfil}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.BdJobmngfilEntity" >
update bd_jobmngfil  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where pk_jobmngfil = #{pkJobmngfil}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.BdJobmngfilEntity" >
update bd_jobmngfil  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 <trim prefix="where" prefixOverrides="and"> 
        <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="dr != null"> and dr = #{dr} </if>
            <if test="memo != null and memo != ''"> and memo = #{memo} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="pkCustdoc != null and pkCustdoc != ''"> and pk_custdoc = #{pkCustdoc} </if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> and pk_deptdoc = #{pkDeptdoc} </if>
            <if test="pkJobbasfil != null and pkJobbasfil != ''"> and pk_jobbasfil = #{pkJobbasfil} </if>
            <if test="pkJobmngfil != null and pkJobmngfil != ''"> and pk_jobmngfil = #{pkJobmngfil} </if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> and pk_psndoc = #{pkPsndoc} </if>
            <if test="pkVendoc != null and pkVendoc != ''"> and pk_vendoc = #{pkVendoc} </if>
            <if test="pubflag != null and pubflag != ''"> and pubflag = #{pubflag} </if>
            <if test="remcode != null and remcode != ''"> and remcode = #{remcode} </if>
            <if test="sealflag != null and sealflag != ''"> and sealflag = #{sealflag} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from bd_jobmngfil where pk_jobmngfil = #{pkJobmngfil}
</delete>

</mapper>

