| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?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.ruoyi.interfaces.mapper.SnailJobMapper">
- <resultMap type="com.ruoyi.interfaces.domain.Job" id="JobResult">
- <result property="id" column="id"/>
- <result property="namespaceId" column="namespace_id"/>
- <result property="groupName" column="group_name"/>
- <result property="jobName" column="job_name"/>
- <result property="argsStr" column="args_str"/>
- <result property="argsType" column="args_type"/>
- <result property="nextTriggerAt" column="next_trigger_at"/>
- <result property="jobStatus" column="job_status"/>
- <result property="taskType" column="task_type"/>
- <result property="routeKey" column="route_key"/>
- <result property="executorType" column="executor_type"/>
- <result property="executorInfo" column="executor_info"/>
- <result property="triggerType" column="trigger_type"/>
- <result property="triggerInterval" column="trigger_interval"/>
- <result property="blockStrategy" column="block_strategy"/>
- <result property="executorTimeout" column="executor_timeout"/>
- <result property="maxRetryTimes" column="max_retry_times"/>
- <result property="parallelNum" column="parallel_num"/>
- <result property="retryInterval" column="retry_interval"/>
- <result property="bucketIndex" column="bucket_index"/>
- <result property="resident" column="resident"/>
- <result property="notifyIds" column="notify_ids"/>
- <result property="ownerId" column="owner_id"/>
- <result property="labels" column="labels"/>
- <result property="description" column="description"/>
- <result property="extAttrs" column="ext_attrs"/>
- <result property="deleted" column="deleted"/>
- </resultMap>
- <sql id="selectJobVo">
- select id,
- namespace_id,
- group_name,
- job_name,
- args_str,
- args_type,
- next_trigger_at,
- job_status,
- task_type,
- route_key,
- executor_type,
- executor_info,
- trigger_type,
- trigger_interval,
- block_strategy,
- executor_timeout,
- max_retry_times,
- parallel_num,
- retry_interval,
- bucket_index,
- resident,
- notify_ids,
- owner_id,
- labels,
- description,
- ext_attrs,
- deleted
- from SNAIL_JOB.sj_job
- </sql>
- <select id="selectJobList" resultType="com.ruoyi.interfaces.domain.Job">
- <include refid="selectJobVo"></include>
- <where>
- <if test="namespaceId != null and namespaceId != ''">and namespace_id = #{namespaceId}</if>
- <if test="groupName != null and groupName != ''">and group_name = #{groupName}</if>
- <if test="jobName != null and jobName != ''">and job_name = #{jobName}</if>
- <if test="argsStr != null and argsStr != ''">and args_str = #{argsStr}</if>
- <if test="argsType != null ">and args_type = #{argsType}</if>
- <if test="nextTriggerAt != null ">and next_trigger_at = #{nextTriggerAt}</if>
- <if test="jobStatus != null ">and job_status = #{jobStatus}</if>
- <if test="taskType != null ">and task_type = #{taskType}</if>
- <if test="routeKey != null ">and route_key = #{routeKey}</if>
- <if test="executorType != null ">and executor_type = #{executorType}</if>
- <if test="executorInfo != null ">and executor_info = #{executorInfo}</if>
- </where>
- order by id
- </select>
- <select id="listOfJobLog" resultType="com.ruoyi.interfaces.domain.JobLogVo">
- SELECT
- A.*,
- B.TASK_STATUS,
- B.CREATE_DT AS EXECUTION_TIME
- FROM SJ_JOB A
- JOIN SJ_JOB_TASK B ON A.ID = B.JOB_ID
- <where>
- <if test="jobName != null and jobName != ''">and A.JOB_NAME = #{jobName}</if>
- <if test="startTime != null and startTime != ''">
- and B.CREATE_DT >= TO_DATE(TO_CHAR(startTime, 'YYYY-MM-DD'), 'YYYY-MM-DD')
- </if>
- <if test="endTime != null and endTime != ''">
- and B.CREATE_DT <= TO_DATE(TO_CHAR(endTime, 'YYYY-MM-DD'), 'YYYY-MM-DD')
- </if>
- </where>
- ORDER BY B.CREATE_DT DESC
- </select>
- <select id="listOfJobLogCount" resultType="java.lang.Long">
- SELECT
- count(*)
- FROM SJ_JOB A
- JOIN SJ_JOB_TASK B ON A.ID = B.JOB_ID
- <where>
- <if test="jobName != null and jobName != ''">and A.job_name = #{jobName}</if>
- <if test="startTime != null">
- and B.CREATE_DT >= TO_DATE(TO_CHAR(#{startTime}, 'YYYY-MM-DD'), 'YYYY-MM-DD')
- </if>
- <if test="endTime != null">
- and B.CREATE_DT <= TO_DATE(TO_CHAR(#{endTime}, 'YYYY-MM-DD'), 'YYYY-MM-DD')
- </if>
- </where>
- </select>
- </mapper>
|