zenglf
2023-09-28 f84d9e69907cb678150eaa6393fd74cf042fcca4
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?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.jeecg.modules.quartz.mapper.SysQuartzLogMapper">
 
    <!--分页列表查询-->
    <select id="pageList" resultType="org.jeecg.modules.quartz.dto.SysQuartzLogDto">
        SELECT
            t2.job_name jobName,
            t2.job_class_name jobClassName,
            t2.cron_expression cronExpression,
            t1.params params,
            t2.description description,
            t1.exception_detail exceptionDetail,
            t1.is_success isSuccess,
            t1.execution_time executionTime,
            t1.create_time createTime
        FROM
            sys_quartz_log t1
            LEFT JOIN sys_quartz_job t2 ON t1.job_id = t2.id
        <where>
            AND t2.id = #{ sysQuartzLogVo.jobId }
            <if test="sysQuartzLogVo.isSuccess != null">
                AND t1.is_success = #{ sysQuartzLogVo.isSuccess }
            </if>
            <if test="sysQuartzLogVo.startTime != null and sysQuartzLogVo.startTime != '' and sysQuartzLogVo.endTime != null and sysQuartzLogVo.endTime != ''">
                AND t1.create_time BETWEEN #{ sysQuartzLogVo.startTime } AND #{ sysQuartzLogVo.endTime }
            </if>
            <if test="sysQuartzLogVo.jobName != null and sysQuartzLogVo.jobName != ''">
                AND t2.job_name LIKE CONCAT(CONCAT('%',#{ sysQuartzLogVo.jobName }),'%')
            </if>
            <if test="sysQuartzLogVo.description != null and sysQuartzLogVo.description != ''">
                AND t2.description LIKE CONCAT(CONCAT('%',#{ sysQuartzLogVo.description }),'%')
            </if>
        </where>
        ORDER BY t1.create_time DESC
    </select>
 
 
    <select id="list" resultType="org.jeecg.modules.quartz.dto.SysQuartzLogDto">
        SELECT
            t2.job_name jobName,
            t2.job_class_name jobClassName,
            t2.cron_expression cronExpression,
            t1.params params,
            t2.description description,
            t1.exception_detail exceptionDetail,
            t1.is_success isSuccess,
            t1.execution_time executionTime,
            t1.create_time createTime
        FROM
            sys_quartz_log t1
            LEFT JOIN sys_quartz_job t2 ON t1.job_id = t2.id
            <where>
            AND t2.id = #{ sysQuartzLogVo.jobId }
            <if test="sysQuartzLogVo.isSuccess != null">
                AND t1.is_success = #{ sysQuartzLogVo.isSuccess }
            </if>
            <if test="sysQuartzLogVo.startTime != null and sysQuartzLogVo.startTime != '' and sysQuartzLogVo.endTime != null and sysQuartzLogVo.endTime != ''">
                AND t1.create_time BETWEEN #{ sysQuartzLogVo.startTime } AND #{ sysQuartzLogVo.endTime }
            </if>
            <if test="sysQuartzLogVo.jobName != null and sysQuartzLogVo.jobName != ''">
                AND t2.job_name LIKE CONCAT(CONCAT('%',#{ sysQuartzLogVo.jobName }),'%')
            </if>
            <if test="sysQuartzLogVo.description != null and sysQuartzLogVo.description != ''">
                AND t2.description LIKE CONCAT(CONCAT('%',#{ sysQuartzLogVo.description }),'%')
            </if>
        </where>
        ORDER BY t1.create_time DESC
    </select>
</mapper>