2024-02-29 12:41:52 +08:00
|
|
|
<?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.quartz.mapper.SysJobLogMapper">
|
|
|
|
|
|
|
|
<resultMap type="SysJobLog" id="SysJobLogResult">
|
|
|
|
<id property="jobLogId" column="job_log_id" />
|
|
|
|
<result property="jobName" column="job_name" />
|
|
|
|
<result property="jobGroup" column="job_group" />
|
|
|
|
<result property="invokeTarget" column="invoke_target" />
|
|
|
|
<result property="jobMessage" column="job_message" />
|
|
|
|
<result property="status" column="status" />
|
|
|
|
<result property="exceptionInfo" column="exception_info" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
</resultMap>
|
2024-03-13 09:55:47 +08:00
|
|
|
|
2024-02-29 12:41:52 +08:00
|
|
|
<sql id="selectJobLogVo">
|
2024-03-13 09:55:47 +08:00
|
|
|
select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time
|
2024-02-29 12:41:52 +08:00
|
|
|
from sys_job_log
|
|
|
|
</sql>
|
2024-03-13 09:55:47 +08:00
|
|
|
|
2024-02-29 12:41:52 +08:00
|
|
|
<select id="selectJobLogList" parameterType="SysJobLog" resultMap="SysJobLogResult">
|
|
|
|
<include refid="selectJobLogVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="jobName != null and jobName != ''">
|
|
|
|
AND job_name like concat('%', #{jobName}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="jobGroup != null and jobGroup != ''">
|
|
|
|
AND job_group = #{jobGroup}
|
|
|
|
</if>
|
|
|
|
<if test="status != null and status != ''">
|
|
|
|
AND status = #{status}
|
|
|
|
</if>
|
|
|
|
<if test="invokeTarget != null and invokeTarget != ''">
|
|
|
|
AND invoke_target like concat('%', #{invokeTarget}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
|
|
<!-- and <![CDATA[ create_time >= convert(datetime, #{params.beginTime}, 20)]]>-->
|
|
|
|
and datediff(d, create_time, #{params.beginTime}) <![CDATA[<=]]> 0
|
|
|
|
</if>
|
|
|
|
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
|
<!-- and <![CDATA[ create_time <= convert(datetime, #{params.endTime}, 20)]]>-->
|
|
|
|
and datediff(d, create_time, #{params.endTime}) <![CDATA[>=]]> 0
|
|
|
|
</if>
|
|
|
|
</where>
|
2024-03-13 09:55:47 +08:00
|
|
|
order by create_time desc
|
2024-02-29 12:41:52 +08:00
|
|
|
</select>
|
2024-03-13 09:55:47 +08:00
|
|
|
|
2024-02-29 12:41:52 +08:00
|
|
|
<select id="selectJobLogAll" resultMap="SysJobLogResult">
|
|
|
|
<include refid="selectJobLogVo"/>
|
|
|
|
</select>
|
2024-03-13 09:55:47 +08:00
|
|
|
|
2024-02-29 12:41:52 +08:00
|
|
|
<select id="selectJobLogById" parameterType="Long" resultMap="SysJobLogResult">
|
|
|
|
<include refid="selectJobLogVo"/>
|
|
|
|
where job_log_id = #{jobLogId}
|
|
|
|
</select>
|
2024-03-13 09:55:47 +08:00
|
|
|
|
2024-02-29 12:41:52 +08:00
|
|
|
<delete id="deleteJobLogById" parameterType="Long">
|
|
|
|
delete from sys_job_log where job_log_id = #{jobLogId}
|
|
|
|
</delete>
|
2024-03-13 09:55:47 +08:00
|
|
|
|
2024-02-29 12:41:52 +08:00
|
|
|
<delete id="deleteJobLogByIds" parameterType="Long">
|
|
|
|
delete from sys_job_log where job_log_id in
|
|
|
|
<foreach collection="array" item="jobLogId" open="(" separator="," close=")">
|
|
|
|
#{jobLogId}
|
2024-03-13 09:55:47 +08:00
|
|
|
</foreach>
|
2024-02-29 12:41:52 +08:00
|
|
|
</delete>
|
2024-03-13 09:55:47 +08:00
|
|
|
|
2024-02-29 12:41:52 +08:00
|
|
|
<update id="cleanJobLog">
|
|
|
|
truncate table sys_job_log
|
|
|
|
</update>
|
2024-03-13 09:55:47 +08:00
|
|
|
|
2024-02-29 12:41:52 +08:00
|
|
|
<insert id="insertJobLog" parameterType="SysJobLog">
|
|
|
|
insert into sys_job_log(
|
|
|
|
<if test="jobLogId != null and jobLogId != 0">job_log_id,</if>
|
|
|
|
<if test="jobName != null and jobName != ''">job_name,</if>
|
|
|
|
<if test="jobGroup != null and jobGroup != ''">job_group,</if>
|
|
|
|
<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
|
|
|
|
<if test="jobMessage != null and jobMessage != ''">job_message,</if>
|
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
|
|
<if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
|
|
|
|
create_time
|
|
|
|
)values(
|
|
|
|
<if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if>
|
|
|
|
<if test="jobName != null and jobName != ''">#{jobName},</if>
|
|
|
|
<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
|
|
|
|
<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
|
|
|
|
<if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
|
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
|
<if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
|
|
|
|
getdate()
|
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
|
2024-03-13 09:55:47 +08:00
|
|
|
</mapper>
|