<?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')>=#{vo.applyStartTime}
|
</if>
|
<if test="vo.applyEndTime!=null and vo.applyEndTime!=''">
|
and date_format(l.create_time,'%Y-%m-%d')<=#{vo.applyEndTime}
|
</if>
|
<if test="vo.leaveDay != null ">
|
and datediff(l.start_time,l.end_time) <=#{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>
|