<?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.yifu.cloud.plus.v1.business.mapper.salary.TBusSalaryConfigTitleResMapper">
    <resultMap id="tBusSalaryConfigTitleResMap"
               type="com.yifu.cloud.plus.v1.business.entity.salary.TBusSalaryConfigTitleRes">
        <id property="id" column="id"/>
        <result property="deptId" column="dept_id"/>
        <result property="deptName" column="dept_name"/>
        <result property="deptNo" column="dept_no"/>
        <result property="excelTitle" column="excel_title"/>
        <result property="configId" column="config_id"/>
        <result property="configName" column="config_name"/>
        <result property="createUserId" column="create_user_id"/>
        <result property="createUserName" column="create_user_name"/>
        <result property="createTime" column="create_time"/>
        <result property="saveType" column="save_type"/>
    </resultMap>
    <sql id="Base_Column_List">
             a.id,
                  a.dept_id,
                  a.dept_name,
                  a.dept_no,
                  a.excel_title,
                  a.config_id,
                  a.config_name,
                  a.create_user_id,
                  a.create_user_name,
                  a.create_time,
                  a.save_type
         </sql>
    <sql id="tBusSalaryConfigTitleRes_where">
        <if test="tBusSalaryConfigTitleRes != null">
            <if test="tBusSalaryConfigTitleRes.id != null and tBusSalaryConfigTitleRes.id.trim() != ''">
                AND a.id = #{tBusSalaryConfigTitleRes.id}
            </if>
            <if test="tBusSalaryConfigTitleRes.deptId != null and tBusSalaryConfigTitleRes.deptId.trim() != ''">
                AND a.dept_id = #{tBusSalaryConfigTitleRes.deptId}
            </if>
            <if test="tBusSalaryConfigTitleRes.deptName != null and tBusSalaryConfigTitleRes.deptName.trim() != ''">
                AND a.dept_name = #{tBusSalaryConfigTitleRes.deptName}
            </if>
            <if test="tBusSalaryConfigTitleRes.deptNo != null and tBusSalaryConfigTitleRes.deptNo.trim() != ''">
                AND a.dept_no = #{tBusSalaryConfigTitleRes.deptNo}
            </if>
            <if test="tBusSalaryConfigTitleRes.excelTitle != null and tBusSalaryConfigTitleRes.excelTitle.trim() != ''">
                AND a.excel_title = #{tBusSalaryConfigTitleRes.excelTitle}
            </if>
            <if test="tBusSalaryConfigTitleRes.configId != null and tBusSalaryConfigTitleRes.configId.trim() != ''">
                AND a.config_id = #{tBusSalaryConfigTitleRes.configId}
            </if>
            <if test="tBusSalaryConfigTitleRes.configName != null and tBusSalaryConfigTitleRes.configName.trim() != ''">
                AND a.config_name = #{tBusSalaryConfigTitleRes.configName}
            </if>
            <if test="tBusSalaryConfigTitleRes.createUserId != null and tBusSalaryConfigTitleRes.createUserId.trim() != ''">
                AND a.create_user_id = #{tBusSalaryConfigTitleRes.createUserId}
            </if>
            <if test="tBusSalaryConfigTitleRes.createUserName != null and tBusSalaryConfigTitleRes.createUserName.trim() != ''">
                AND a.create_user_name = #{tBusSalaryConfigTitleRes.createUserName}
            </if>
            <if test="tBusSalaryConfigTitleRes.createTime != null">
                AND a.create_time = #{tBusSalaryConfigTitleRes.createTime}
            </if>
            <if test="tBusSalaryConfigTitleRes.saveType != null">
                AND a.save_type = #{tBusSalaryConfigTitleRes.saveType}
            </if>
        </if>
    </sql>
    <!--tBusSalaryConfigTitleRes简单分页查询-->
    <select id="getTBusSalaryConfigTitleResPage" resultMap="tBusSalaryConfigTitleResMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_bus_salary_config_title_res a
        <where>
            1=1
            <include refid="tBusSalaryConfigTitleRes_where"/>
        </where>
    </select>
    <!--tBusSalaryConfigTitleRes简单分页查询-->
    <select id="getResListByDeptId" resultMap="tBusSalaryConfigTitleResMap">
        SELECT
            <include refid="Base_Column_List"/>
        FROM t_bus_salary_config_title_res a
        where a.dept_id = #{deptId} and a.save_type = 0
    </select>
</mapper>
