智慧保安后台管理-外网项目备份
钟日健
2026-06-01 62eb499b0c969f246d3245d1429a97da4de1ce28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?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="org.springblade.modules.leave.mapper.LeavesMapper">
 
 
    <select id="getPage" resultType="org.springblade.modules.leave.vo.LeaveVO">
 
        SELECT l.*,
               bu.real_name as applyName,
               bu1.real_name as auditName
               FROM sys_leave l
        LEFT JOIN blade_user bu ON bu.id = l.create_user
        LEFT JOIN blade_user bu1 ON bu1.id = l.audit_user
        where l.is_deleted = 0
        <if test="vo.applyName != null and vo.applyName !='' ">
            AND bu.real_name LIKE CONCAT('%', #{vo.applyName} , '%')
        </if>
        <if test="vo.auditName != null and vo.auditName !='' ">
            AND bu1.real_name LIKE CONCAT('%', #{vo.auditName} , '%')
        </if>
        <if test="vo.applyStartTime!=null and vo.applyStartTime!=''">
            and date_format(l.create_time,'%Y-%m-%d')&gt;=#{vo.applyStartTime}
        </if>
        <if test="vo.applyEndTime!=null and vo.applyEndTime!=''">
            and date_format(l.create_time,'%Y-%m-%d')&lt;=#{vo.applyEndTime}
        </if>
        <if test="vo.leaveDay != null ">
            and datediff(l.start_time,l.end_time) &lt;=#{vo.leaveDay}
        </if>
        <if test="vo.auditStatus != null and vo.auditStatus !=''">
            and l.audit_status = #{vo.auditStatus}
        </if>
        <if test="vo.createUser != null and vo.createUser != ''">
            AND l.create_user = #{vo.createUser}
        </if>
        ORDER BY l.create_time DESC
    </select>
</mapper>