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

  <resultMap id="tSalaryEmpModLogMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmpModLog">
    <id property="id" column="id"/>
    <result property="content" column="content"/>
    <result property="type" column="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"/>
    <result property="idNum" column="id_num"/>
    <result property="parentId" column="parent_id"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.id,
                a.content,
                a.type,
                a.CREATE_BY,
                a.CREATE_NAME,
                a.CREATE_TIME,
                a.UPDATE_BY,
                a.UPDATE_TIME,
                a.id_num,
                a.parent_id
    </sql>
    <sql id="tSalaryEmpModLog_where">
        <if test="tSalaryEmpModLog != null">
                    <if test="tSalaryEmpModLog.id != null and tSalaryEmpModLog.id.trim() != ''">
                        AND a.id = #{tSalaryEmpModLog.id}
                    </if>
                    <if test="tSalaryEmpModLog.content != null and tSalaryEmpModLog.content.trim() != ''">
                        AND a.content like concat('%',#{tSalaryEmpModLog.content},'%')
                    </if>
                    <if test="tSalaryEmpModLog.type != null and tSalaryEmpModLog.type.trim() != ''">
                        AND a.type = #{tSalaryEmpModLog.type}
                    </if>
                    <if test="tSalaryEmpModLog.createBy != null and tSalaryEmpModLog.createBy.trim() != ''">
                        AND a.CREATE_BY = #{tSalaryEmpModLog.createBy}
                    </if>
                    <if test="tSalaryEmpModLog.createName != null and tSalaryEmpModLog.createName.trim() != ''">
                        AND a.CREATE_NAME = #{tSalaryEmpModLog.createName}
                    </if>
					<if test="tSalaryEmpModLog.createTimeStart != null">
						AND a.CREATE_TIME <![CDATA[ >= ]]> #{tSalaryEmpModLog.createTimeStart}
					</if>
					<if test="tSalaryEmpModLog.createTimeEnd != null">
						AND a.CREATE_TIME <![CDATA[ <= ]]> #{tSalaryEmpModLog.createTimeEnd}
					</if>
                    <if test="tSalaryEmpModLog.updateBy != null and tSalaryEmpModLog.updateBy.trim() != ''">
                        AND a.UPDATE_BY = #{tSalaryEmpModLog.updateBy}
                    </if>
                    <if test="tSalaryEmpModLog.updateTime != null">
                        AND a.UPDATE_TIME = #{tSalaryEmpModLog.updateTime}
                    </if>
                    <if test="tSalaryEmpModLog.idNum != null and tSalaryEmpModLog.idNum.trim() != ''">
                        AND a.id_num = #{tSalaryEmpModLog.idNum}
                    </if>
                    <if test="tSalaryEmpModLog.parentId != null and tSalaryEmpModLog.parentId.trim() != ''">
                        AND a.parent_id = #{tSalaryEmpModLog.parentId}
                    </if>
        </if>
    </sql>
    <!--tSalaryEmpModLog简单分页查询-->
    <select id="getTSalaryEmpModLogPage" resultMap="tSalaryEmpModLogMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_salary_emp_mod_log a
        <where>
            1=1
            <include refid="tSalaryEmpModLog_where"/>
        </where>
    </select>
</mapper>
