<?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.csp.mapper.EmployeeRegistrationLeaveLogMapper">

  <resultMap id="employeeRegistrationLeaveLogMap" type="com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistrationLeaveLog">
    <id property="id" column="id"/>
    <result property="leaveId" column="leave_id"/>
    <result property="createName" column="create_name"/>
    <result property="createTime" column="create_time"/>
    <result property="content" column="content"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.id,
                a.leave_id,
                a.create_name,
                a.create_time,
                a.content
    </sql>
    <sql id="employeeRegistrationLeaveLog_where">
        <if test="employeeRegistrationLeaveLog != null">
                    <if test="employeeRegistrationLeaveLog.id != null and employeeRegistrationLeaveLog.id.trim() != ''">
                        AND a.id = #{employeeRegistrationLeaveLog.id}
                    </if>
                    <if test="employeeRegistrationLeaveLog.leaveId != null and employeeRegistrationLeaveLog.leaveId.trim() != ''">
                        AND a.leave_id = #{employeeRegistrationLeaveLog.leaveId}
                    </if>
                    <if test="employeeRegistrationLeaveLog.createName != null and employeeRegistrationLeaveLog.createName.trim() != ''">
                        AND a.create_name = #{employeeRegistrationLeaveLog.createName}
                    </if>
                    <if test="employeeRegistrationLeaveLog.createTime != null">
                        AND a.create_time = #{employeeRegistrationLeaveLog.createTime}
                    </if>
                    <if test="employeeRegistrationLeaveLog.content != null and employeeRegistrationLeaveLog.content.trim() != ''">
                        AND a.content = #{employeeRegistrationLeaveLog.content}
                    </if>
        </if>
    </sql>
    <!--employeeRegistrationLeaveLog简单分页查询-->
    <select id="getEmployeeRegistrationLeaveLogPage" resultMap="employeeRegistrationLeaveLogMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM employee_registration_leave_log a
        <where>
            1=1
            <include refid="employeeRegistrationLeaveLog_where"/>
        </where>
        order by a.create_time desc
    </select>

    <!--employeeRegistrationLeaveLog简单分页查询-->
    <select id="getEmployeeRegistrationLeaveLogList" resultMap="employeeRegistrationLeaveLogMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM employee_registration_leave_log a
        <where>
            1=1
            <include refid="employeeRegistrationLeaveLog_where"/>
        </where>
		order by a.create_time desc
    </select>
</mapper>
