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

    <resultMap id="get-BdDeptdocEntity-result" type="com.hzya.frame.plugin.lets.entity.BdDeptdocEntity" >
       <result property="addr" column="addr" jdbcType="VARCHAR"/>
           <result property="canceldate" column="canceldate" jdbcType="VARCHAR"/>
           <result property="canceled" column="canceled" jdbcType="VARCHAR"/>
           <result property="createdate" column="createdate" 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="deptattr" column="deptattr" jdbcType="VARCHAR"/>
           <result property="deptcode" column="deptcode" jdbcType="VARCHAR"/>
           <result property="deptduty" column="deptduty" jdbcType="VARCHAR"/>
           <result property="deptlevel" column="deptlevel" jdbcType="VARCHAR"/>
           <result property="deptname" column="deptname" jdbcType="VARCHAR"/>
           <result property="deptshortname" column="deptshortname" jdbcType="VARCHAR"/>
           <result property="depttype" column="depttype" jdbcType="INTEGER"/>
           <result property="dr" column="dr" jdbcType="INTEGER"/>
           <result property="hrcanceled" column="hrcanceled" jdbcType="VARCHAR"/>
           <result property="innercode" column="innercode" jdbcType="VARCHAR"/>
           <result property="isuseretail" column="isuseretail" jdbcType="VARCHAR"/>
           <result property="maxinnercode" column="maxinnercode" jdbcType="VARCHAR"/>
           <result property="memo" column="memo" jdbcType="VARCHAR"/>
           <result property="orgtype" column="orgtype" jdbcType="INTEGER"/>
           <result property="phone" column="phone" jdbcType="VARCHAR"/>
           <result property="pkCalbody" column="pk_calbody" jdbcType="VARCHAR"/>
           <result property="pkCorp" column="pk_corp" jdbcType="VARCHAR"/>
           <result property="pkDeptdoc" column="pk_deptdoc" jdbcType="VARCHAR"/>
           <result property="pkFathedept" column="pk_fathedept" jdbcType="VARCHAR"/>
           <result property="pkPsndoc" column="pk_psndoc" jdbcType="VARCHAR"/>
           <result property="pkPsndoc2" column="pk_psndoc2" jdbcType="VARCHAR"/>
           <result property="pkPsndoc3" column="pk_psndoc3" jdbcType="VARCHAR"/>
           <result property="remcode" column="remcode" jdbcType="VARCHAR"/>
           <result property="resposition" column="resposition" jdbcType="VARCHAR"/>
           <result property="showorder" column="showorder" jdbcType="INTEGER"/>
           <result property="ts" column="ts" jdbcType="VARCHAR"/>
           <result property="xtersysflag" column="xtersysflag" jdbcType="INTEGER"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "BdDeptdocEntity_Base_Column_List">
        addr
       ,canceldate 
        ,canceled 
        ,createdate 
        ,def1 
        ,def10 
        ,def11 
        ,def12 
        ,def13 
        ,def14 
        ,def15 
        ,def16 
        ,def17 
        ,def18 
        ,def19 
        ,def2 
        ,def20 
        ,def3 
        ,def4 
        ,def5 
        ,def6 
        ,def7 
        ,def8 
        ,def9 
        ,deptattr 
        ,deptcode 
        ,deptduty 
        ,deptlevel 
        ,deptname 
        ,deptshortname 
        ,depttype 
        ,dr 
        ,hrcanceled 
        ,innercode 
        ,isuseretail 
        ,maxinnercode 
        ,memo 
        ,orgtype 
        ,phone 
        ,pk_calbody 
        ,pk_corp 
        ,pk_deptdoc 
        ,pk_fathedept 
        ,pk_psndoc 
        ,pk_psndoc2 
        ,pk_psndoc3 
        ,remcode 
        ,resposition 
        ,showorder 
        ,ts 
        ,xtersysflag 
     </sql>

 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-BdDeptdocEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdDeptdocEntity">
    select
    <include refid="BdDeptdocEntity_Base_Column_List" />
    from bd_deptdoc
    <trim prefix="where" prefixOverrides="and"> 
        <if test="addr != null and addr != ''"> and addr = #{addr} </if>
            <if test="canceldate != null and canceldate != ''"> and canceldate = #{canceldate} </if>
            <if test="canceled != null and canceled != ''"> and canceled = #{canceled} </if>
            <if test="createdate != null and createdate != ''"> and createdate = #{createdate} </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="deptattr != null and deptattr != ''"> and deptattr = #{deptattr} </if>
            <if test="deptcode != null and deptcode != ''"> and deptcode = #{deptcode} </if>
            <if test="deptduty != null and deptduty != ''"> and deptduty = #{deptduty} </if>
            <if test="deptlevel != null and deptlevel != ''"> and deptlevel = #{deptlevel} </if>
            <if test="deptname != null and deptname != ''"> and deptname = #{deptname} </if>
            <if test="deptshortname != null and deptshortname != ''"> and deptshortname = #{deptshortname} </if>
            <if test="depttype != null"> and depttype = #{depttype} </if>
            <if test="dr != null"> and dr = #{dr} </if>
            <if test="hrcanceled != null and hrcanceled != ''"> and hrcanceled = #{hrcanceled} </if>
            <if test="innercode != null and innercode != ''"> and innercode = #{innercode} </if>
            <if test="isuseretail != null and isuseretail != ''"> and isuseretail = #{isuseretail} </if>
            <if test="maxinnercode != null and maxinnercode != ''"> and maxinnercode = #{maxinnercode} </if>
            <if test="memo != null and memo != ''"> and memo = #{memo} </if>
            <if test="orgtype != null"> and orgtype = #{orgtype} </if>
            <if test="phone != null and phone != ''"> and phone = #{phone} </if>
            <if test="pkCalbody != null and pkCalbody != ''"> and pk_calbody = #{pkCalbody} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> and pk_deptdoc = #{pkDeptdoc} </if>
            <if test="pkFathedept != null and pkFathedept != ''"> and pk_fathedept = #{pkFathedept} </if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> and pk_psndoc = #{pkPsndoc} </if>
            <if test="pkPsndoc2 != null and pkPsndoc2 != ''"> and pk_psndoc2 = #{pkPsndoc2} </if>
            <if test="pkPsndoc3 != null and pkPsndoc3 != ''"> and pk_psndoc3 = #{pkPsndoc3} </if>
            <if test="remcode != null and remcode != ''"> and remcode = #{remcode} </if>
            <if test="resposition != null and resposition != ''"> and resposition = #{resposition} </if>
            <if test="showorder != null"> and showorder = #{showorder} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
            <if test="xtersysflag != null"> and xtersysflag = #{xtersysflag} </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.BdDeptdocEntity">
        select  count(1)   from bd_deptdoc
    <trim prefix="where" prefixOverrides="and"> 
        <if test="addr != null and addr != ''"> and addr = #{addr} </if>
            <if test="canceldate != null and canceldate != ''"> and canceldate = #{canceldate} </if>
            <if test="canceled != null and canceled != ''"> and canceled = #{canceled} </if>
            <if test="createdate != null and createdate != ''"> and createdate = #{createdate} </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="deptattr != null and deptattr != ''"> and deptattr = #{deptattr} </if>
            <if test="deptcode != null and deptcode != ''"> and deptcode = #{deptcode} </if>
            <if test="deptduty != null and deptduty != ''"> and deptduty = #{deptduty} </if>
            <if test="deptlevel != null and deptlevel != ''"> and deptlevel = #{deptlevel} </if>
            <if test="deptname != null and deptname != ''"> and deptname = #{deptname} </if>
            <if test="deptshortname != null and deptshortname != ''"> and deptshortname = #{deptshortname} </if>
            <if test="depttype != null"> and depttype = #{depttype} </if>
            <if test="dr != null"> and dr = #{dr} </if>
            <if test="hrcanceled != null and hrcanceled != ''"> and hrcanceled = #{hrcanceled} </if>
            <if test="innercode != null and innercode != ''"> and innercode = #{innercode} </if>
            <if test="isuseretail != null and isuseretail != ''"> and isuseretail = #{isuseretail} </if>
            <if test="maxinnercode != null and maxinnercode != ''"> and maxinnercode = #{maxinnercode} </if>
            <if test="memo != null and memo != ''"> and memo = #{memo} </if>
            <if test="orgtype != null"> and orgtype = #{orgtype} </if>
            <if test="phone != null and phone != ''"> and phone = #{phone} </if>
            <if test="pkCalbody != null and pkCalbody != ''"> and pk_calbody = #{pkCalbody} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> and pk_deptdoc = #{pkDeptdoc} </if>
            <if test="pkFathedept != null and pkFathedept != ''"> and pk_fathedept = #{pkFathedept} </if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> and pk_psndoc = #{pkPsndoc} </if>
            <if test="pkPsndoc2 != null and pkPsndoc2 != ''"> and pk_psndoc2 = #{pkPsndoc2} </if>
            <if test="pkPsndoc3 != null and pkPsndoc3 != ''"> and pk_psndoc3 = #{pkPsndoc3} </if>
            <if test="remcode != null and remcode != ''"> and remcode = #{remcode} </if>
            <if test="resposition != null and resposition != ''"> and resposition = #{resposition} </if>
            <if test="showorder != null"> and showorder = #{showorder} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
            <if test="xtersysflag != null"> and xtersysflag = #{xtersysflag} </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-BdDeptdocEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdDeptdocEntity">
    select
    <include refid="BdDeptdocEntity_Base_Column_List" />
    from bd_deptdoc
    <trim prefix="where" prefixOverrides="and"> 
        <if test="addr != null and addr != ''"> and addr like concat('%',#{addr},'%') </if>
            <if test="canceldate != null and canceldate != ''"> and canceldate like concat('%',#{canceldate},'%') </if>
            <if test="canceled != null and canceled != ''"> and canceled like concat('%',#{canceled},'%') </if>
            <if test="createdate != null and createdate != ''"> and createdate like concat('%',#{createdate},'%') </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="deptattr != null and deptattr != ''"> and deptattr like concat('%',#{deptattr},'%') </if>
            <if test="deptcode != null and deptcode != ''"> and deptcode like concat('%',#{deptcode},'%') </if>
            <if test="deptduty != null and deptduty != ''"> and deptduty like concat('%',#{deptduty},'%') </if>
            <if test="deptlevel != null and deptlevel != ''"> and deptlevel like concat('%',#{deptlevel},'%') </if>
            <if test="deptname != null and deptname != ''"> and deptname like concat('%',#{deptname},'%') </if>
            <if test="deptshortname != null and deptshortname != ''"> and deptshortname like concat('%',#{deptshortname},'%') </if>
            <if test="depttype != null"> and depttype like concat('%',#{depttype},'%') </if>
            <if test="dr != null"> and dr like concat('%',#{dr},'%') </if>
            <if test="hrcanceled != null and hrcanceled != ''"> and hrcanceled like concat('%',#{hrcanceled},'%') </if>
            <if test="innercode != null and innercode != ''"> and innercode like concat('%',#{innercode},'%') </if>
            <if test="isuseretail != null and isuseretail != ''"> and isuseretail like concat('%',#{isuseretail},'%') </if>
            <if test="maxinnercode != null and maxinnercode != ''"> and maxinnercode like concat('%',#{maxinnercode},'%') </if>
            <if test="memo != null and memo != ''"> and memo like concat('%',#{memo},'%') </if>
            <if test="orgtype != null"> and orgtype like concat('%',#{orgtype},'%') </if>
            <if test="phone != null and phone != ''"> and phone like concat('%',#{phone},'%') </if>
            <if test="pkCalbody != null and pkCalbody != ''"> and pk_calbody like concat('%',#{pkCalbody},'%') </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp like concat('%',#{pkCorp},'%') </if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> and pk_deptdoc like concat('%',#{pkDeptdoc},'%') </if>
            <if test="pkFathedept != null and pkFathedept != ''"> and pk_fathedept like concat('%',#{pkFathedept},'%') </if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> and pk_psndoc like concat('%',#{pkPsndoc},'%') </if>
            <if test="pkPsndoc2 != null and pkPsndoc2 != ''"> and pk_psndoc2 like concat('%',#{pkPsndoc2},'%') </if>
            <if test="pkPsndoc3 != null and pkPsndoc3 != ''"> and pk_psndoc3 like concat('%',#{pkPsndoc3},'%') </if>
            <if test="remcode != null and remcode != ''"> and remcode like concat('%',#{remcode},'%') </if>
            <if test="resposition != null and resposition != ''"> and resposition like concat('%',#{resposition},'%') </if>
            <if test="showorder != null"> and showorder like concat('%',#{showorder},'%') </if>
            <if test="ts != null and ts != ''"> and ts like concat('%',#{ts},'%') </if>
            <if test="xtersysflag != null"> and xtersysflag like concat('%',#{xtersysflag},'%') </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="BdDeptdocentity_list_or" resultMap="get-BdDeptdocEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdDeptdocEntity">
    select
    <include refid="BdDeptdocEntity_Base_Column_List" />
    from bd_deptdoc
    <trim prefix="where" prefixOverrides="and"> 
         <if test="addr != null and addr != ''"> or addr = #{addr} </if>
             <if test="canceldate != null and canceldate != ''"> or canceldate = #{canceldate} </if>
             <if test="canceled != null and canceled != ''"> or canceled = #{canceled} </if>
             <if test="createdate != null and createdate != ''"> or createdate = #{createdate} </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="deptattr != null and deptattr != ''"> or deptattr = #{deptattr} </if>
             <if test="deptcode != null and deptcode != ''"> or deptcode = #{deptcode} </if>
             <if test="deptduty != null and deptduty != ''"> or deptduty = #{deptduty} </if>
             <if test="deptlevel != null and deptlevel != ''"> or deptlevel = #{deptlevel} </if>
             <if test="deptname != null and deptname != ''"> or deptname = #{deptname} </if>
             <if test="deptshortname != null and deptshortname != ''"> or deptshortname = #{deptshortname} </if>
             <if test="depttype != null"> or depttype = #{depttype} </if>
             <if test="dr != null"> or dr = #{dr} </if>
             <if test="hrcanceled != null and hrcanceled != ''"> or hrcanceled = #{hrcanceled} </if>
             <if test="innercode != null and innercode != ''"> or innercode = #{innercode} </if>
             <if test="isuseretail != null and isuseretail != ''"> or isuseretail = #{isuseretail} </if>
             <if test="maxinnercode != null and maxinnercode != ''"> or maxinnercode = #{maxinnercode} </if>
             <if test="memo != null and memo != ''"> or memo = #{memo} </if>
             <if test="orgtype != null"> or orgtype = #{orgtype} </if>
             <if test="phone != null and phone != ''"> or phone = #{phone} </if>
             <if test="pkCalbody != null and pkCalbody != ''"> or pk_calbody = #{pkCalbody} </if>
             <if test="pkCorp != null and pkCorp != ''"> or pk_corp = #{pkCorp} </if>
             <if test="pkDeptdoc != null and pkDeptdoc != ''"> or pk_deptdoc = #{pkDeptdoc} </if>
             <if test="pkFathedept != null and pkFathedept != ''"> or pk_fathedept = #{pkFathedept} </if>
             <if test="pkPsndoc != null and pkPsndoc != ''"> or pk_psndoc = #{pkPsndoc} </if>
             <if test="pkPsndoc2 != null and pkPsndoc2 != ''"> or pk_psndoc2 = #{pkPsndoc2} </if>
             <if test="pkPsndoc3 != null and pkPsndoc3 != ''"> or pk_psndoc3 = #{pkPsndoc3} </if>
             <if test="remcode != null and remcode != ''"> or remcode = #{remcode} </if>
             <if test="resposition != null and resposition != ''"> or resposition = #{resposition} </if>
             <if test="showorder != null"> or showorder = #{showorder} </if>
             <if test="ts != null and ts != ''"> or ts = #{ts} </if>
             <if test="xtersysflag != null"> or xtersysflag = #{xtersysflag} </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.BdDeptdocEntity" keyProperty="pkDeptdoc" useGeneratedKeys="true">
    insert into bd_deptdoc(
  <trim suffix="" suffixOverrides=",">
       <if test="addr != null and addr != ''"> addr , </if>
            <if test="canceldate != null and canceldate != ''"> canceldate , </if>
            <if test="canceled != null and canceled != ''"> canceled , </if>
            <if test="createdate != null and createdate != ''"> createdate , </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="deptattr != null and deptattr != ''"> deptattr , </if>
            <if test="deptcode != null and deptcode != ''"> deptcode , </if>
            <if test="deptduty != null and deptduty != ''"> deptduty , </if>
            <if test="deptlevel != null and deptlevel != ''"> deptlevel , </if>
            <if test="deptname != null and deptname != ''"> deptname , </if>
            <if test="deptshortname != null and deptshortname != ''"> deptshortname , </if>
            <if test="depttype != null"> depttype , </if>
            <if test="dr != null"> dr , </if>
            <if test="hrcanceled != null and hrcanceled != ''"> hrcanceled , </if>
            <if test="innercode != null and innercode != ''"> innercode , </if>
            <if test="isuseretail != null and isuseretail != ''"> isuseretail , </if>
            <if test="maxinnercode != null and maxinnercode != ''"> maxinnercode , </if>
            <if test="memo != null and memo != ''"> memo , </if>
            <if test="orgtype != null"> orgtype , </if>
            <if test="phone != null and phone != ''"> phone , </if>
            <if test="pkCalbody != null and pkCalbody != ''"> pk_calbody , </if>
            <if test="pkCorp != null and pkCorp != ''"> pk_corp , </if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> pk_deptdoc , </if>
            <if test="pkFathedept != null and pkFathedept != ''"> pk_fathedept , </if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> pk_psndoc , </if>
            <if test="pkPsndoc2 != null and pkPsndoc2 != ''"> pk_psndoc2 , </if>
            <if test="pkPsndoc3 != null and pkPsndoc3 != ''"> pk_psndoc3 , </if>
            <if test="remcode != null and remcode != ''"> remcode , </if>
            <if test="resposition != null and resposition != ''"> resposition , </if>
            <if test="showorder != null"> showorder , </if>
            <if test="ts != null and ts != ''"> ts , </if>
            <if test="xtersysflag != null"> xtersysflag , </if>
            <if test="sorts == null ">sorts,</if>
    <if test="sts == null ">sts,</if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <if test="addr != null and addr != ''"> #{addr} ,</if>
            <if test="canceldate != null and canceldate != ''"> #{canceldate} ,</if>
            <if test="canceled != null and canceled != ''"> #{canceled} ,</if>
            <if test="createdate != null and createdate != ''"> #{createdate} ,</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="deptattr != null and deptattr != ''"> #{deptattr} ,</if>
            <if test="deptcode != null and deptcode != ''"> #{deptcode} ,</if>
            <if test="deptduty != null and deptduty != ''"> #{deptduty} ,</if>
            <if test="deptlevel != null and deptlevel != ''"> #{deptlevel} ,</if>
            <if test="deptname != null and deptname != ''"> #{deptname} ,</if>
            <if test="deptshortname != null and deptshortname != ''"> #{deptshortname} ,</if>
            <if test="depttype != null"> #{depttype} ,</if>
            <if test="dr != null"> #{dr} ,</if>
            <if test="hrcanceled != null and hrcanceled != ''"> #{hrcanceled} ,</if>
            <if test="innercode != null and innercode != ''"> #{innercode} ,</if>
            <if test="isuseretail != null and isuseretail != ''"> #{isuseretail} ,</if>
            <if test="maxinnercode != null and maxinnercode != ''"> #{maxinnercode} ,</if>
            <if test="memo != null and memo != ''"> #{memo} ,</if>
            <if test="orgtype != null"> #{orgtype} ,</if>
            <if test="phone != null and phone != ''"> #{phone} ,</if>
            <if test="pkCalbody != null and pkCalbody != ''"> #{pkCalbody} ,</if>
            <if test="pkCorp != null and pkCorp != ''"> #{pkCorp} ,</if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> #{pkDeptdoc} ,</if>
            <if test="pkFathedept != null and pkFathedept != ''"> #{pkFathedept} ,</if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> #{pkPsndoc} ,</if>
            <if test="pkPsndoc2 != null and pkPsndoc2 != ''"> #{pkPsndoc2} ,</if>
            <if test="pkPsndoc3 != null and pkPsndoc3 != ''"> #{pkPsndoc3} ,</if>
            <if test="remcode != null and remcode != ''"> #{remcode} ,</if>
            <if test="resposition != null and resposition != ''"> #{resposition} ,</if>
            <if test="showorder != null"> #{showorder} ,</if>
            <if test="ts != null and ts != ''"> #{ts} ,</if>
            <if test="xtersysflag != null"> #{xtersysflag} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from bd_deptdoc a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="pkDeptdoc" useGeneratedKeys="true">
  insert into bd_deptdoc(addr, canceldate, canceled, createdate, def1, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def2, def20, def3, def4, def5, def6, def7, def8, def9, deptattr, deptcode, deptduty, deptlevel, deptname, deptshortname, depttype, dr, hrcanceled, innercode, isuseretail, maxinnercode, memo, orgtype, phone, pk_calbody, pk_corp, pk_fathedept, pk_psndoc, pk_psndoc2, pk_psndoc3, remcode, resposition, showorder, ts, xtersysflag,  sts) 
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.addr},#{entity.canceldate},#{entity.canceled},#{entity.createdate},#{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.deptattr},#{entity.deptcode},#{entity.deptduty},#{entity.deptlevel},#{entity.deptname},#{entity.deptshortname},#{entity.depttype},#{entity.dr},#{entity.hrcanceled},#{entity.innercode},#{entity.isuseretail},#{entity.maxinnercode},#{entity.memo},#{entity.orgtype},#{entity.phone},#{entity.pkCalbody},#{entity.pkCorp},#{entity.pkFathedept},#{entity.pkPsndoc},#{entity.pkPsndoc2},#{entity.pkPsndoc3},#{entity.remcode},#{entity.resposition},#{entity.showorder},#{entity.ts},#{entity.xtersysflag}, 'Y')
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="pkDeptdoc" useGeneratedKeys="true">
    insert into bd_deptdoc(addr, canceldate, canceled, createdate, def1, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def2, def20, def3, def4, def5, def6, def7, def8, def9, deptattr, deptcode, deptduty, deptlevel, deptname, deptshortname, depttype, dr, hrcanceled, innercode, isuseretail, maxinnercode, memo, orgtype, phone, pk_calbody, pk_corp, pk_fathedept, pk_psndoc, pk_psndoc2, pk_psndoc3, remcode, resposition, showorder, ts, xtersysflag)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.addr},#{entity.canceldate},#{entity.canceled},#{entity.createdate},#{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.deptattr},#{entity.deptcode},#{entity.deptduty},#{entity.deptlevel},#{entity.deptname},#{entity.deptshortname},#{entity.depttype},#{entity.dr},#{entity.hrcanceled},#{entity.innercode},#{entity.isuseretail},#{entity.maxinnercode},#{entity.memo},#{entity.orgtype},#{entity.phone},#{entity.pkCalbody},#{entity.pkCorp},#{entity.pkFathedept},#{entity.pkPsndoc},#{entity.pkPsndoc2},#{entity.pkPsndoc3},#{entity.remcode},#{entity.resposition},#{entity.showorder},#{entity.ts},#{entity.xtersysflag})
    </foreach>
    on duplicate key update
    addr = values(addr),
    canceldate = values(canceldate),
    canceled = values(canceled),
    createdate = values(createdate),
    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),
    deptattr = values(deptattr),
    deptcode = values(deptcode),
    deptduty = values(deptduty),
    deptlevel = values(deptlevel),
    deptname = values(deptname),
    deptshortname = values(deptshortname),
    depttype = values(depttype),
    dr = values(dr),
    hrcanceled = values(hrcanceled),
    innercode = values(innercode),
    isuseretail = values(isuseretail),
    maxinnercode = values(maxinnercode),
    memo = values(memo),
    orgtype = values(orgtype),
    phone = values(phone),
    pk_calbody = values(pk_calbody),
    pk_corp = values(pk_corp),
    pk_fathedept = values(pk_fathedept),
    pk_psndoc = values(pk_psndoc),
    pk_psndoc2 = values(pk_psndoc2),
    pk_psndoc3 = values(pk_psndoc3),
    remcode = values(remcode),
    resposition = values(resposition),
    showorder = values(showorder),
    ts = values(ts),
    xtersysflag = values(xtersysflag)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.BdDeptdocEntity" >
update bd_deptdoc  set
<trim suffix="" suffixOverrides=",">
  <if test="addr != null and addr != ''"> addr = #{addr},</if>
  <if test="canceldate != null and canceldate != ''"> canceldate = #{canceldate},</if>
  <if test="canceled != null and canceled != ''"> canceled = #{canceled},</if>
  <if test="createdate != null and createdate != ''"> createdate = #{createdate},</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="deptattr != null and deptattr != ''"> deptattr = #{deptattr},</if>
  <if test="deptcode != null and deptcode != ''"> deptcode = #{deptcode},</if>
  <if test="deptduty != null and deptduty != ''"> deptduty = #{deptduty},</if>
  <if test="deptlevel != null and deptlevel != ''"> deptlevel = #{deptlevel},</if>
  <if test="deptname != null and deptname != ''"> deptname = #{deptname},</if>
  <if test="deptshortname != null and deptshortname != ''"> deptshortname = #{deptshortname},</if>
  <if test="depttype != null"> depttype = #{depttype},</if>
  <if test="dr != null"> dr = #{dr},</if>
  <if test="hrcanceled != null and hrcanceled != ''"> hrcanceled = #{hrcanceled},</if>
  <if test="innercode != null and innercode != ''"> innercode = #{innercode},</if>
  <if test="isuseretail != null and isuseretail != ''"> isuseretail = #{isuseretail},</if>
  <if test="maxinnercode != null and maxinnercode != ''"> maxinnercode = #{maxinnercode},</if>
  <if test="memo != null and memo != ''"> memo = #{memo},</if>
  <if test="orgtype != null"> orgtype = #{orgtype},</if>
  <if test="phone != null and phone != ''"> phone = #{phone},</if>
  <if test="pkCalbody != null and pkCalbody != ''"> pk_calbody = #{pkCalbody},</if>
  <if test="pkCorp != null and pkCorp != ''"> pk_corp = #{pkCorp},</if>
  <if test="pkFathedept != null and pkFathedept != ''"> pk_fathedept = #{pkFathedept},</if>
  <if test="pkPsndoc != null and pkPsndoc != ''"> pk_psndoc = #{pkPsndoc},</if>
  <if test="pkPsndoc2 != null and pkPsndoc2 != ''"> pk_psndoc2 = #{pkPsndoc2},</if>
  <if test="pkPsndoc3 != null and pkPsndoc3 != ''"> pk_psndoc3 = #{pkPsndoc3},</if>
  <if test="remcode != null and remcode != ''"> remcode = #{remcode},</if>
  <if test="resposition != null and resposition != ''"> resposition = #{resposition},</if>
  <if test="showorder != null"> showorder = #{showorder},</if>
  <if test="ts != null and ts != ''"> ts = #{ts},</if>
  <if test="xtersysflag != null"> xtersysflag = #{xtersysflag},</if>
</trim>
where pk_deptdoc = #{pkDeptdoc}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.BdDeptdocEntity" >
update bd_deptdoc  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where pk_deptdoc = #{pkDeptdoc}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.BdDeptdocEntity" >
update bd_deptdoc  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 <trim prefix="where" prefixOverrides="and"> 
        <if test="addr != null and addr != ''"> and addr = #{addr} </if>
            <if test="canceldate != null and canceldate != ''"> and canceldate = #{canceldate} </if>
            <if test="canceled != null and canceled != ''"> and canceled = #{canceled} </if>
            <if test="createdate != null and createdate != ''"> and createdate = #{createdate} </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="deptattr != null and deptattr != ''"> and deptattr = #{deptattr} </if>
            <if test="deptcode != null and deptcode != ''"> and deptcode = #{deptcode} </if>
            <if test="deptduty != null and deptduty != ''"> and deptduty = #{deptduty} </if>
            <if test="deptlevel != null and deptlevel != ''"> and deptlevel = #{deptlevel} </if>
            <if test="deptname != null and deptname != ''"> and deptname = #{deptname} </if>
            <if test="deptshortname != null and deptshortname != ''"> and deptshortname = #{deptshortname} </if>
            <if test="depttype != null"> and depttype = #{depttype} </if>
            <if test="dr != null"> and dr = #{dr} </if>
            <if test="hrcanceled != null and hrcanceled != ''"> and hrcanceled = #{hrcanceled} </if>
            <if test="innercode != null and innercode != ''"> and innercode = #{innercode} </if>
            <if test="isuseretail != null and isuseretail != ''"> and isuseretail = #{isuseretail} </if>
            <if test="maxinnercode != null and maxinnercode != ''"> and maxinnercode = #{maxinnercode} </if>
            <if test="memo != null and memo != ''"> and memo = #{memo} </if>
            <if test="orgtype != null"> and orgtype = #{orgtype} </if>
            <if test="phone != null and phone != ''"> and phone = #{phone} </if>
            <if test="pkCalbody != null and pkCalbody != ''"> and pk_calbody = #{pkCalbody} </if>
            <if test="pkCorp != null and pkCorp != ''"> and pk_corp = #{pkCorp} </if>
            <if test="pkDeptdoc != null and pkDeptdoc != ''"> and pk_deptdoc = #{pkDeptdoc} </if>
            <if test="pkFathedept != null and pkFathedept != ''"> and pk_fathedept = #{pkFathedept} </if>
            <if test="pkPsndoc != null and pkPsndoc != ''"> and pk_psndoc = #{pkPsndoc} </if>
            <if test="pkPsndoc2 != null and pkPsndoc2 != ''"> and pk_psndoc2 = #{pkPsndoc2} </if>
            <if test="pkPsndoc3 != null and pkPsndoc3 != ''"> and pk_psndoc3 = #{pkPsndoc3} </if>
            <if test="remcode != null and remcode != ''"> and remcode = #{remcode} </if>
            <if test="resposition != null and resposition != ''"> and resposition = #{resposition} </if>
            <if test="showorder != null"> and showorder = #{showorder} </if>
            <if test="ts != null and ts != ''"> and ts = #{ts} </if>
            <if test="xtersysflag != null"> and xtersysflag = #{xtersysflag} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from bd_deptdoc where pk_deptdoc = #{pkDeptdoc}
</delete>

</mapper>

