<?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="com.xmomen.module.schedule.mapper.ScheduleMapper" >

    <!--    查询计划任务    -->
    <select id="queryScheduleJobs" resultType="com.xmomen.module.schedule.controller.vo.ScheduleJobVo" parameterType="java.lang.String">
        SELECT
        ID,
        JOB_NAME,
        JOB_GROUP,
        JOB_STATUS,
        CASE
        JOB_STATUS
        WHEN 0
        THEN '运行中'
        WHEN 1
        THEN '暂停'
        WHEN 2
        THEN '已完成'
        WHEN 3
        THEN '异常'
        WHEN 4
        THEN '阻塞'
        WHEN - 1
        THEN '无'
        ELSE '错误状态码'
        END AS jobStatusDesc,
        JOB_DESCRIPTION,
        CRON_EXPRESSION,
        TRIGGER_ID
        FROM
        schedule_job where  (JOB_NAME LIKE CONCAT('%', #{keyword} , '%')) OR (JOB_DESCRIPTION LIKE CONCAT('%', #{keyword} , '%')) OR (JOB_GROUP LIKE CONCAT('%', #{keyword} , '%'))
    </select>
</mapper>