<?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.grpU8.dictAcctSubj.dao.impl.DictAcctSubjDaoImpl">

    <resultMap id="get-DictAcctSubjEntity-result" type="com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntity" >
           <result property="acct_year" column="acct_year" jdbcType="VARCHAR"/>
           <result property="acct_subj_code" column="acct_subj_code" jdbcType="VARCHAR"/>
           <result property="acct_subj_name" column="acct_subj_name" jdbcType="VARCHAR"/>
           <result property="supper_code" column="supper_code" jdbcType="VARCHAR"/>
           <result property="subj_level" column="subj_level" jdbcType="VARCHAR"/>
           <result property="is_last" column="is_last" jdbcType="VARCHAR"/>
           <result property="subj_type_code" column="subj_type_code" jdbcType="VARCHAR"/>
           <result property="subj_type_name" column="subj_type_name" jdbcType="VARCHAR"/>
           <result property="direction" column="direction" jdbcType="VARCHAR"/>
           <result property="is_cash" column="is_cash" jdbcType="VARCHAR"/>
           <result property="subj_nature_code" column="subj_nature_code" jdbcType="VARCHAR"/>
           <result property="is_check" column="is_check" jdbcType="VARCHAR"/>
           <result property="is_stop" column="is_stop" jdbcType="VARCHAR"/>
           <result property="budg_subj_code" column="budg_subj_code" jdbcType="VARCHAR"/>
           <result property="budg_subj_name" column="budg_subj_name" jdbcType="VARCHAR"/>
           <result property="check_type_name1" column="check_type_name1" jdbcType="VARCHAR"/>
           <result property="check_type_name2" column="check_type_name2" jdbcType="VARCHAR"/>
           <result property="check_type_name3" column="check_type_name3" jdbcType="VARCHAR"/>
           <result property="check_type_name4" column="check_type_name4" jdbcType="VARCHAR"/>
           <result property="check_type_name5" column="check_type_name5" jdbcType="VARCHAR"/>
           <result property="check_type_name6" column="check_type_name6" jdbcType="VARCHAR"/>
           <result property="check_type_name7" column="check_type_name7" jdbcType="VARCHAR"/>
           <result property="check_type_name8" column="check_type_name8" jdbcType="VARCHAR"/>
           <result property="org_code" column="org_code" jdbcType="VARCHAR"/>
           <result property="org_name" column="org_name" jdbcType="VARCHAR"/>
           <result property="branch_code" column="branch_code" jdbcType="VARCHAR"/>
           <result property="branch_name" column="branch_name" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "DictAcctSubjEntity_Base_Column_List">
        acct_year
        ,acct_subj_code 
        ,acct_subj_name 
        ,supper_code 
        ,subj_level 
        ,is_last 
        ,subj_type_code 
        ,subj_type_name 
        ,direction 
        ,is_cash 
        ,subj_nature_code 
        ,is_check 
        ,is_stop 
        ,budg_subj_code 
        ,budg_subj_name 
        ,check_type_name1 
        ,check_type_name2 
        ,check_type_name3 
        ,check_type_name4 
        ,check_type_name5 
        ,check_type_name6 
        ,check_type_name7 
        ,check_type_name8 
        ,org_code 
        ,org_name 
        ,branch_code 
        ,branch_name 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-DictAcctSubjEntity-result" parameterType = "com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntity">
    select
    <include refid="DictAcctSubjEntity_Base_Column_List" />
    from dict_acct_subj
    <trim prefix="where" prefixOverrides="and"> 
            <if test="acct_year != null and acct_year != ''"> and acct_year = #{acct_year} </if>
            <if test="acct_subj_code != null and acct_subj_code != ''"> and acct_subj_code = #{acct_subj_code} </if>
            <if test="acct_subj_name != null and acct_subj_name != ''"> and acct_subj_name = #{acct_subj_name} </if>
            <if test="supper_code != null and supper_code != ''"> and supper_code = #{supper_code} </if>
            <if test="subj_level != null and subj_level != ''"> and subj_level = #{subj_level} </if>
            <if test="is_last != null and is_last != ''"> and is_last = #{is_last} </if>
            <if test="subj_type_code != null and subj_type_code != ''"> and subj_type_code = #{subj_type_code} </if>
            <if test="subj_type_name != null and subj_type_name != ''"> and subj_type_name = #{subj_type_name} </if>
            <if test="direction != null and direction != ''"> and direction = #{direction} </if>
            <if test="is_cash != null and is_cash != ''"> and is_cash = #{is_cash} </if>
            <if test="subj_nature_code != null and subj_nature_code != ''"> and subj_nature_code = #{subj_nature_code} </if>
            <if test="is_check != null and is_check != ''"> and is_check = #{is_check} </if>
            <if test="is_stop != null and is_stop != ''"> and is_stop = #{is_stop} </if>
            <if test="budg_subj_code != null and budg_subj_code != ''"> and budg_subj_code = #{budg_subj_code} </if>
            <if test="budg_subj_name != null and budg_subj_name != ''"> and budg_subj_name = #{budg_subj_name} </if>
            <if test="check_type_name1 != null and check_type_name1 != ''"> and check_type_name1 = #{check_type_name1} </if>
            <if test="check_type_name2 != null and check_type_name2 != ''"> and check_type_name2 = #{check_type_name2} </if>
            <if test="check_type_name3 != null and check_type_name3 != ''"> and check_type_name3 = #{check_type_name3} </if>
            <if test="check_type_name4 != null and check_type_name4 != ''"> and check_type_name4 = #{check_type_name4} </if>
            <if test="check_type_name5 != null and check_type_name5 != ''"> and check_type_name5 = #{check_type_name5} </if>
            <if test="check_type_name6 != null and check_type_name6 != ''"> and check_type_name6 = #{check_type_name6} </if>
            <if test="check_type_name7 != null and check_type_name7 != ''"> and check_type_name7 = #{check_type_name7} </if>
            <if test="check_type_name8 != null and check_type_name8 != ''"> and check_type_name8 = #{check_type_name8} </if>
            <if test="org_code != null and org_code != ''"> and org_code = #{org_code} </if>
            <if test="org_name != null and org_name != ''"> and org_name = #{org_name} </if>
            <if test="branch_code != null and branch_code != ''"> and branch_code = #{branch_code} </if>
            <if test="branch_name != null and branch_name != ''"> and branch_name = #{branch_name} </if>
    </trim>
</select>
    
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntity">
        select  count(1)   from dict_acct_subj
    <trim prefix="where" prefixOverrides="and"> 
            <if test="acct_year != null and acct_year != ''"> and acct_year = #{acct_year} </if>
            <if test="acct_subj_code != null and acct_subj_code != ''"> and acct_subj_code = #{acct_subj_code} </if>
            <if test="acct_subj_name != null and acct_subj_name != ''"> and acct_subj_name = #{acct_subj_name} </if>
            <if test="supper_code != null and supper_code != ''"> and supper_code = #{supper_code} </if>
            <if test="subj_level != null and subj_level != ''"> and subj_level = #{subj_level} </if>
            <if test="is_last != null and is_last != ''"> and is_last = #{is_last} </if>
            <if test="subj_type_code != null and subj_type_code != ''"> and subj_type_code = #{subj_type_code} </if>
            <if test="subj_type_name != null and subj_type_name != ''"> and subj_type_name = #{subj_type_name} </if>
            <if test="direction != null and direction != ''"> and direction = #{direction} </if>
            <if test="is_cash != null and is_cash != ''"> and is_cash = #{is_cash} </if>
            <if test="subj_nature_code != null and subj_nature_code != ''"> and subj_nature_code = #{subj_nature_code} </if>
            <if test="is_check != null and is_check != ''"> and is_check = #{is_check} </if>
            <if test="is_stop != null and is_stop != ''"> and is_stop = #{is_stop} </if>
            <if test="budg_subj_code != null and budg_subj_code != ''"> and budg_subj_code = #{budg_subj_code} </if>
            <if test="budg_subj_name != null and budg_subj_name != ''"> and budg_subj_name = #{budg_subj_name} </if>
            <if test="check_type_name1 != null and check_type_name1 != ''"> and check_type_name1 = #{check_type_name1} </if>
            <if test="check_type_name2 != null and check_type_name2 != ''"> and check_type_name2 = #{check_type_name2} </if>
            <if test="check_type_name3 != null and check_type_name3 != ''"> and check_type_name3 = #{check_type_name3} </if>
            <if test="check_type_name4 != null and check_type_name4 != ''"> and check_type_name4 = #{check_type_name4} </if>
            <if test="check_type_name5 != null and check_type_name5 != ''"> and check_type_name5 = #{check_type_name5} </if>
            <if test="check_type_name6 != null and check_type_name6 != ''"> and check_type_name6 = #{check_type_name6} </if>
            <if test="check_type_name7 != null and check_type_name7 != ''"> and check_type_name7 = #{check_type_name7} </if>
            <if test="check_type_name8 != null and check_type_name8 != ''"> and check_type_name8 = #{check_type_name8} </if>
            <if test="org_code != null and org_code != ''"> and org_code = #{org_code} </if>
            <if test="org_name != null and org_name != ''"> and org_name = #{org_name} </if>
            <if test="branch_code != null and branch_code != ''"> and branch_code = #{branch_code} </if>
            <if test="branch_name != null and branch_name != ''"> and branch_name = #{branch_name} </if>
    </trim>
    </select>

    <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-DictAcctSubjEntity-result" parameterType = "com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntity">
    select
    <include refid="DictAcctSubjEntity_Base_Column_List" />
    from dict_acct_subj
    <trim prefix="where" prefixOverrides="and"> 
            <if test="acct_year != null and acct_year != ''"> and acct_year like concat('%',#{acct_year},'%') </if>
            <if test="acct_subj_code != null and acct_subj_code != ''"> and acct_subj_code like concat('%',#{acct_subj_code},'%') </if>
            <if test="acct_subj_name != null and acct_subj_name != ''"> and acct_subj_name like concat('%',#{acct_subj_name},'%') </if>
            <if test="supper_code != null and supper_code != ''"> and supper_code like concat('%',#{supper_code},'%') </if>
            <if test="subj_level != null and subj_level != ''"> and subj_level like concat('%',#{subj_level},'%') </if>
            <if test="is_last != null and is_last != ''"> and is_last like concat('%',#{is_last},'%') </if>
            <if test="subj_type_code != null and subj_type_code != ''"> and subj_type_code like concat('%',#{subj_type_code},'%') </if>
            <if test="subj_type_name != null and subj_type_name != ''"> and subj_type_name like concat('%',#{subj_type_name},'%') </if>
            <if test="direction != null and direction != ''"> and direction like concat('%',#{direction},'%') </if>
            <if test="is_cash != null and is_cash != ''"> and is_cash like concat('%',#{is_cash},'%') </if>
            <if test="subj_nature_code != null and subj_nature_code != ''"> and subj_nature_code like concat('%',#{subj_nature_code},'%') </if>
            <if test="is_check != null and is_check != ''"> and is_check like concat('%',#{is_check},'%') </if>
            <if test="is_stop != null and is_stop != ''"> and is_stop like concat('%',#{is_stop},'%') </if>
            <if test="budg_subj_code != null and budg_subj_code != ''"> and budg_subj_code like concat('%',#{budg_subj_code},'%') </if>
            <if test="budg_subj_name != null and budg_subj_name != ''"> and budg_subj_name like concat('%',#{budg_subj_name},'%') </if>
            <if test="check_type_name1 != null and check_type_name1 != ''"> and check_type_name1 like concat('%',#{check_type_name1},'%') </if>
            <if test="check_type_name2 != null and check_type_name2 != ''"> and check_type_name2 like concat('%',#{check_type_name2},'%') </if>
            <if test="check_type_name3 != null and check_type_name3 != ''"> and check_type_name3 like concat('%',#{check_type_name3},'%') </if>
            <if test="check_type_name4 != null and check_type_name4 != ''"> and check_type_name4 like concat('%',#{check_type_name4},'%') </if>
            <if test="check_type_name5 != null and check_type_name5 != ''"> and check_type_name5 like concat('%',#{check_type_name5},'%') </if>
            <if test="check_type_name6 != null and check_type_name6 != ''"> and check_type_name6 like concat('%',#{check_type_name6},'%') </if>
            <if test="check_type_name7 != null and check_type_name7 != ''"> and check_type_name7 like concat('%',#{check_type_name7},'%') </if>
            <if test="check_type_name8 != null and check_type_name8 != ''"> and check_type_name8 like concat('%',#{check_type_name8},'%') </if>
            <if test="org_code != null and org_code != ''"> and org_code like concat('%',#{org_code},'%') </if>
            <if test="org_name != null and org_name != ''"> and org_name like concat('%',#{org_name},'%') </if>
            <if test="branch_code != null and branch_code != ''"> and branch_code like concat('%',#{branch_code},'%') </if>
            <if test="branch_name != null and branch_name != ''"> and branch_name like concat('%',#{branch_name},'%') </if>
    </trim>
</select>

<!-- 查询列表 字段采用or格式 -->
<select id="DictAcctSubjentity_list_or" resultMap="get-DictAcctSubjEntity-result" parameterType = "com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntity">
    select
    <include refid="DictAcctSubjEntity_Base_Column_List" />
    from dict_acct_subj
    <trim prefix="where" prefixOverrides="and"> 
             <if test="acct_year != null and acct_year != ''"> or acct_year = #{acct_year} </if>
             <if test="acct_subj_code != null and acct_subj_code != ''"> or acct_subj_code = #{acct_subj_code} </if>
             <if test="acct_subj_name != null and acct_subj_name != ''"> or acct_subj_name = #{acct_subj_name} </if>
             <if test="supper_code != null and supper_code != ''"> or supper_code = #{supper_code} </if>
             <if test="subj_level != null and subj_level != ''"> or subj_level = #{subj_level} </if>
             <if test="is_last != null and is_last != ''"> or is_last = #{is_last} </if>
             <if test="subj_type_code != null and subj_type_code != ''"> or subj_type_code = #{subj_type_code} </if>
             <if test="subj_type_name != null and subj_type_name != ''"> or subj_type_name = #{subj_type_name} </if>
             <if test="direction != null and direction != ''"> or direction = #{direction} </if>
             <if test="is_cash != null and is_cash != ''"> or is_cash = #{is_cash} </if>
             <if test="subj_nature_code != null and subj_nature_code != ''"> or subj_nature_code = #{subj_nature_code} </if>
             <if test="is_check != null and is_check != ''"> or is_check = #{is_check} </if>
             <if test="is_stop != null and is_stop != ''"> or is_stop = #{is_stop} </if>
             <if test="budg_subj_code != null and budg_subj_code != ''"> or budg_subj_code = #{budg_subj_code} </if>
             <if test="budg_subj_name != null and budg_subj_name != ''"> or budg_subj_name = #{budg_subj_name} </if>
             <if test="check_type_name1 != null and check_type_name1 != ''"> or check_type_name1 = #{check_type_name1} </if>
             <if test="check_type_name2 != null and check_type_name2 != ''"> or check_type_name2 = #{check_type_name2} </if>
             <if test="check_type_name3 != null and check_type_name3 != ''"> or check_type_name3 = #{check_type_name3} </if>
             <if test="check_type_name4 != null and check_type_name4 != ''"> or check_type_name4 = #{check_type_name4} </if>
             <if test="check_type_name5 != null and check_type_name5 != ''"> or check_type_name5 = #{check_type_name5} </if>
             <if test="check_type_name6 != null and check_type_name6 != ''"> or check_type_name6 = #{check_type_name6} </if>
             <if test="check_type_name7 != null and check_type_name7 != ''"> or check_type_name7 = #{check_type_name7} </if>
             <if test="check_type_name8 != null and check_type_name8 != ''"> or check_type_name8 = #{check_type_name8} </if>
             <if test="org_code != null and org_code != ''"> or org_code = #{org_code} </if>
             <if test="org_name != null and org_name != ''"> or org_name = #{org_name} </if>
             <if test="branch_code != null and branch_code != ''"> or branch_code = #{branch_code} </if>
             <if test="branch_name != null and branch_name != ''"> or branch_name = #{branch_name} </if>
    </trim>
</select>
    <resultMap id="get-DictAcctSubjEntityVo-result" type="com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntityVo" >
        <result property="acct_year" column="acct_year" jdbcType="VARCHAR"/>
        <result property="acct_subj_code" column="acct_subj_code" jdbcType="VARCHAR"/>
        <result property="acct_subj_name" column="acct_subj_name" jdbcType="VARCHAR"/>
        <result property="supper_code" column="supper_code" jdbcType="VARCHAR"/>
        <result property="subj_level" column="subj_level" jdbcType="VARCHAR"/>
        <result property="is_last" column="is_last" jdbcType="VARCHAR"/>
        <result property="subj_type_code" column="subj_type_code" jdbcType="VARCHAR"/>
        <result property="subj_type_name" column="subj_type_name" jdbcType="VARCHAR"/>
        <result property="direction" column="direction" jdbcType="VARCHAR"/>
        <result property="is_cash" column="is_cash" jdbcType="VARCHAR"/>
        <result property="subj_nature_code" column="subj_nature_code" jdbcType="VARCHAR"/>
        <result property="is_check" column="is_check" jdbcType="VARCHAR"/>
        <result property="is_stop" column="is_stop" jdbcType="VARCHAR"/>
        <result property="budg_subj_code" column="budg_subj_code" jdbcType="VARCHAR"/>
        <result property="budg_subj_name" column="budg_subj_name" jdbcType="VARCHAR"/>
        <result property="check_type_name1" column="check_type_name1" jdbcType="VARCHAR"/>
        <result property="check_type_name2" column="check_type_name2" jdbcType="VARCHAR"/>
        <result property="check_type_name3" column="check_type_name3" jdbcType="VARCHAR"/>
        <result property="check_type_name4" column="check_type_name4" jdbcType="VARCHAR"/>
        <result property="check_type_name5" column="check_type_name5" jdbcType="VARCHAR"/>
        <result property="check_type_name6" column="check_type_name6" jdbcType="VARCHAR"/>
        <result property="check_type_name7" column="check_type_name7" jdbcType="VARCHAR"/>
        <result property="check_type_name8" column="check_type_name8" jdbcType="VARCHAR"/>
        <result property="org_code" column="org_code" jdbcType="VARCHAR"/>
        <result property="org_name" column="org_name" jdbcType="VARCHAR"/>
        <result property="branch_code" column="branch_code" jdbcType="VARCHAR"/>
        <result property="branch_name" column="branch_name" jdbcType="VARCHAR"/>
    </resultMap>
    <!-- 分页查询列表 采用like格式 -->
    <select id="queryData" resultMap="get-DictAcctSubjEntityVo-result" parameterType = "com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntity">
        select
        <include refid="DictAcctSubjEntity_Base_Column_List" />
        from dict_acct_subj
        <trim prefix="where" prefixOverrides="and">
            <if test="acct_year != null and acct_year != ''"> and acct_year like '%${acct_year}%' </if>
            <if test="acct_subj_code != null and acct_subj_code != ''"> and acct_subj_code like '%${acct_subj_code}%' </if>
            <if test="acct_subj_name != null and acct_subj_name != ''"> and acct_subj_name like '%${acct_subj_name}%' </if>
            <if test="supper_code != null and supper_code != ''"> and supper_code like '%${supper_code}%' </if>
            <if test="subj_level != null and subj_level != ''"> and subj_level like '%${subj_level}%' </if>
            <if test="is_last != null and is_last != ''"> and is_last like '%${is_last}%' </if>
            <if test="subj_type_code != null and subj_type_code != ''"> and subj_type_code like '%${subj_type_code}%' </if>
            <if test="subj_type_name != null and subj_type_name != ''"> and subj_type_name like '%${subj_type_name}%' </if>
            <if test="direction != null and direction != ''"> and direction like '%${direction}%' </if>
            <if test="is_cash != null and is_cash != ''"> and is_cash like '%${is_cash}%' </if>
            <if test="subj_nature_code != null and subj_nature_code != ''"> and subj_nature_code like '%${subj_nature_code}%' </if>
            <if test="is_check != null and is_check != ''"> and is_check like '%${is_check}%' </if>
            <if test="is_stop != null and is_stop != ''"> and is_stop like '%${is_stop}%' </if>
            <if test="budg_subj_code != null and budg_subj_code != ''"> and budg_subj_code like '%${budg_subj_code}%' </if>
            <if test="budg_subj_name != null and budg_subj_name != ''"> and budg_subj_name like '%${budg_subj_name}%' </if>
            <if test="check_type_name1 != null and check_type_name1 != ''"> and check_type_name1 like '%${check_type_name1}%' </if>
            <if test="check_type_name2 != null and check_type_name2 != ''"> and check_type_name2 like '%${check_type_name2}%' </if>
            <if test="check_type_name3 != null and check_type_name3 != ''"> and check_type_name3 like '%${check_type_name3}%' </if>
            <if test="check_type_name4 != null and check_type_name4 != ''"> and check_type_name4 like '%${check_type_name4}%' </if>
            <if test="check_type_name5 != null and check_type_name5 != ''"> and check_type_name5 like '%${check_type_name5}%' </if>
            <if test="check_type_name6 != null and check_type_name6 != ''"> and check_type_name6 like '%${check_type_name6}%' </if>
            <if test="check_type_name7 != null and check_type_name7 != ''"> and check_type_name7 like '%${check_type_name7}%' </if>
            <if test="check_type_name8 != null and check_type_name8 != ''"> and check_type_name8 like '%${check_type_name8}%' </if>
            <if test="org_code != null and org_code != ''"> and org_code like '%${org_code}%' </if>
            <if test="org_name != null and org_name != ''"> and org_name like '%${org_name}%' </if>
            <if test="branch_code != null and branch_code != ''"> and branch_code like '%${branch_code}%' </if>
            <if test="branch_name != null and branch_name != ''"> and branch_name like '%${branch_name}%' </if>
        </trim>
    </select>
</mapper>

