智慧保安后台管理-外网项目备份
guoshilong
2023-12-14 a068c51b248e44490d979985b6d27fe022e0a527
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
<?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.post.mapper.CheckRecordMapper">
 
    <!--自定义分页查询-->
    <select id="getPage" resultType="org.springblade.modules.post.vo.CheckRecordVO">
        SELECT scr.*,
               spf.name as postName,
               spf.type as postType,
 
               spf.duty_time as dutyTime,
               spf.layoff_time as layoffTime,
 
               bu.real_name as userName FROM sys_check_record scr
        LEFT JOIN sys_post_filing spf ON spf.id = scr.post_id
        LEFT JOIN blade_user bu ON bu.id = scr.create_user
        WHERE scr.is_deleted = 0
        <if test="vo.postType != null and vo.postType !='' ">
            AND spf.type = #{vo.postType}
        </if>
        <if test="vo.checkTime != null and vo.checkTime !='' ">
            AND   date_format(scr.check_time,'%Y-%m-%d') = date_format(#{vo.checkTime},'%Y-%m-%d')
        </if>
        ORDER BY scr.check_time DESC
 
    </select>
</mapper>