Jiarenxiang | 25a45b7 | 2025-03-13 16:09:13 +0800 | [diff] [blame^] | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | <mapper namespace="com.ruoyi.quartz.mapper.SysJobLogMapper"> |
| 6 | |
| 7 | <resultMap type="SysJobLog" id="SysJobLogResult"> |
| 8 | <id property="jobLogId" column="job_log_id" /> |
| 9 | <result property="jobName" column="job_name" /> |
| 10 | <result property="jobGroup" column="job_group" /> |
| 11 | <result property="invokeTarget" column="invoke_target" /> |
| 12 | <result property="jobMessage" column="job_message" /> |
| 13 | <result property="status" column="status" /> |
| 14 | <result property="exceptionInfo" column="exception_info" /> |
| 15 | <result property="createTime" column="create_time" /> |
| 16 | </resultMap> |
| 17 | |
| 18 | <sql id="selectJobLogVo"> |
| 19 | select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time |
| 20 | from sys_job_log |
| 21 | </sql> |
| 22 | |
| 23 | <select id="selectJobLogList" parameterType="SysJobLog" resultMap="SysJobLogResult"> |
| 24 | <include refid="selectJobLogVo"/> |
| 25 | <where> |
| 26 | <if test="jobName != null and jobName != ''"> |
| 27 | AND job_name like concat('%', #{jobName}, '%') |
| 28 | </if> |
| 29 | <if test="jobGroup != null and jobGroup != ''"> |
| 30 | AND job_group = #{jobGroup} |
| 31 | </if> |
| 32 | <if test="status != null and status != ''"> |
| 33 | AND status = #{status} |
| 34 | </if> |
| 35 | <if test="invokeTarget != null and invokeTarget != ''"> |
| 36 | AND invoke_target like concat('%', #{invokeTarget}, '%') |
| 37 | </if> |
| 38 | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| 39 | and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') |
| 40 | </if> |
| 41 | <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |
| 42 | and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') |
| 43 | </if> |
| 44 | </where> |
| 45 | order by create_time desc |
| 46 | </select> |
| 47 | |
| 48 | <select id="selectJobLogAll" resultMap="SysJobLogResult"> |
| 49 | <include refid="selectJobLogVo"/> |
| 50 | </select> |
| 51 | |
| 52 | <select id="selectJobLogById" parameterType="Long" resultMap="SysJobLogResult"> |
| 53 | <include refid="selectJobLogVo"/> |
| 54 | where job_log_id = #{jobLogId} |
| 55 | </select> |
| 56 | |
| 57 | <delete id="deleteJobLogById" parameterType="Long"> |
| 58 | delete from sys_job_log where job_log_id = #{jobLogId} |
| 59 | </delete> |
| 60 | |
| 61 | <delete id="deleteJobLogByIds" parameterType="Long"> |
| 62 | delete from sys_job_log where job_log_id in |
| 63 | <foreach collection="array" item="jobLogId" open="(" separator="," close=")"> |
| 64 | #{jobLogId} |
| 65 | </foreach> |
| 66 | </delete> |
| 67 | |
| 68 | <update id="cleanJobLog"> |
| 69 | truncate table sys_job_log |
| 70 | </update> |
| 71 | |
| 72 | <insert id="insertJobLog" parameterType="SysJobLog"> |
| 73 | insert into sys_job_log( |
| 74 | <if test="jobLogId != null and jobLogId != 0">job_log_id,</if> |
| 75 | <if test="jobName != null and jobName != ''">job_name,</if> |
| 76 | <if test="jobGroup != null and jobGroup != ''">job_group,</if> |
| 77 | <if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if> |
| 78 | <if test="jobMessage != null and jobMessage != ''">job_message,</if> |
| 79 | <if test="status != null and status != ''">status,</if> |
| 80 | <if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if> |
| 81 | create_time |
| 82 | )values( |
| 83 | <if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if> |
| 84 | <if test="jobName != null and jobName != ''">#{jobName},</if> |
| 85 | <if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if> |
| 86 | <if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if> |
| 87 | <if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if> |
| 88 | <if test="status != null and status != ''">#{status},</if> |
| 89 | <if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if> |
| 90 | sysdate() |
| 91 | ) |
| 92 | </insert> |
| 93 | |
| 94 | </mapper> |