<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~
  ~      Copyright (c) 2018-2025, lengleng All rights reserved.
  ~
  ~  Redistribution and use in source and binary forms, with or without
  ~  modification, are permitted provided that the following conditions are met:
  ~
  ~ Redistributions of source code must retain the above copyright notice,
  ~  this list of conditions and the following disclaimer.
  ~  Redistributions in binary form must reproduce the above copyright
  ~  notice, this list of conditions and the following disclaimer in the
  ~  documentation and/or other materials provided with the distribution.
  ~  Neither the name of the yifu4cloud.com developer nor the names of its
  ~  contributors may be used to endorse or promote products derived from
  ~  this software without specific prior written permission.
  ~  Author: lengleng (wangiegie@gmail.com)
  ~
  -->

<!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.yifu.salary.mapper.MTitleConfigMapper">

  <resultMap id="mTitleConfigMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.MTitleConfig">
    <id property="id" column="id"/>
    <result property="settleId" column="settle_id"/>
    <result property="settleName" column="settle_name"/>
    <result property="settleNo" column="settle_no"/>
    <result property="excelTitle" column="excel_title"/>
    <result property="configId" column="config_id"/>
    <result property="configName" column="config_name"/>
    <result property="saveType" column="save_type"/>
	  <result property="createBy" column="CREATE_BY"/>
	  <result property="createName" column="CREATE_NAME"/>
	  <result property="createTime" column="CREATE_TIME"/>
	  <result property="updateBy" column="UPDATE_BY"/>
	  <result property="updateTime" column="UPDATE_TIME"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.id,
                a.settle_id,
                a.settle_name,
                a.settle_no,
                a.excel_title,
                a.config_id,
                a.config_name,
                a.save_type,
				a.CREATE_BY,
				a.CREATE_NAME,
				a.CREATE_TIME,
				a.UPDATE_BY,
				a.UPDATE_TIME
    </sql>
    <sql id="mTitleConfig_where">
        <if test="mTitleConfig != null">
                    <if test="mTitleConfig.id != null and mTitleConfig.id.trim() != ''">
                        AND a.id = #{mTitleConfig.id}
                    </if>
                    <if test="mTitleConfig.settleId != null and mTitleConfig.settleId.trim() != ''">
                        AND a.settle_id = #{mTitleConfig.settleId}
                    </if>
                    <if test="mTitleConfig.settleName != null and mTitleConfig.settleName.trim() != ''">
                        AND a.settle_name = #{mTitleConfig.settleName}
                    </if>
                    <if test="mTitleConfig.settleNo != null and mTitleConfig.settleNo.trim() != ''">
                        AND a.settle_no = #{mTitleConfig.settleNo}
                    </if>
                    <if test="mTitleConfig.excelTitle != null and mTitleConfig.excelTitle.trim() != ''">
                        AND a.excel_title = #{mTitleConfig.excelTitle}
                    </if>
                    <if test="mTitleConfig.configId != null and mTitleConfig.configId.trim() != ''">
                        AND a.config_id = #{mTitleConfig.configId}
                    </if>
                    <if test="mTitleConfig.configName != null and mTitleConfig.configName.trim() != ''">
                        AND a.config_name = #{mTitleConfig.configName}
                    </if>
                    <if test="mTitleConfig.createTime != null">
                        AND a.create_time = #{mTitleConfig.createTime}
                    </if>
                    <if test="mTitleConfig.saveType != null">
                        AND a.save_type = #{mTitleConfig.saveType}
                    </if>
        </if>
    </sql>
    <!--mTitleConfig简单分页查询-->
    <select id="getMTitleConfigPage" resultMap="mTitleConfigMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM m_title_config a
        <where>
            1=1
            <include refid="mTitleConfig_where"/>
        </where>
    </select>
</mapper>
