1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?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.project.monitor.job.mapper.JobLogMapper">
- <resultMap type="JobLog" id="JobLogResult">
- <id property="jobLogId" column="job_log_id" />
- <result property="jobName" column="job_name" />
- <result property="jobGroup" column="job_group" />
- <result property="methodName" column="method_name" />
- <result property="methodParams" column="method_params" />
- <result property="jobMessage" column="job_message" />
- <result property="status" column="status" />
- <result property="exceptionInfo" column="exception_info" />
- <result property="createTime" column="create_time" />
- </resultMap>
-
- <sql id="selectJobLogVo">
- select job_log_id, job_name, job_group, method_name, method_params, job_message, status, exception_info, create_time
- from sys_job_log
- </sql>
-
- <select id="selectJobLogList" parameterType="JobLog" resultMap="JobLogResult">
- <include refid="selectJobLogVo"/>
- <where>
- <if test="jobName != null and jobName != ''">
- AND job_name like concat('%', #{jobName}, '%')
- </if>
- <if test="status != null and status != ''">
- AND status = #{status}
- </if>
- <if test="methodName != null and methodName != ''">
- AND method_name like concat('%', #{methodName}, '%')
- </if>
- <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
- and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
- </if>
- <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
- and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
- </if>
- </where>
- </select>
-
- <select id="selectJobAll" resultMap="JobLogResult">
- <include refid="selectJobLogVo"/>
- </select>
-
- <select id="selectJobLogById" parameterType="Long" resultMap="JobLogResult">
- <include refid="selectJobLogVo"/>
- where job_log_id = #{jobLogId}
- </select>
-
- <delete id="deleteJobLogById" parameterType="Long">
- delete from sys_job_log where job_log_id = #{jobLogId}
- </delete>
-
- <delete id="deleteJobLogByIds" parameterType="String">
- delete from sys_job_log where job_log_id in
- <foreach collection="array" item="jobLogId" open="(" separator="," close=")">
- #{jobLogId}
- </foreach>
- </delete>
-
- <insert id="insertJobLog" parameterType="JobLog">
- 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="methodName != null and methodName != ''">method_name,</if>
- <if test="methodParams != null and methodParams != ''">method_params,</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="methodName != null and methodName != ''">#{methodName},</if>
- <if test="methodParams != null and methodParams != ''">#{methodParams},</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>
- sysdate()
- )
- </insert>
- </mapper>
|