提交 | 用户 | 时间
|
0ca254
|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
A |
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.jcdm.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 |
</select> |
|
46 |
|
|
47 |
<select id="selectJobLogAll" resultMap="SysJobLogResult"> |
|
48 |
<include refid="selectJobLogVo"/> |
|
49 |
</select> |
|
50 |
|
|
51 |
<select id="selectJobLogById" parameterType="Long" resultMap="SysJobLogResult"> |
|
52 |
<include refid="selectJobLogVo"/> |
|
53 |
where job_log_id = #{jobLogId} |
|
54 |
</select> |
|
55 |
|
|
56 |
<delete id="deleteJobLogById" parameterType="Long"> |
|
57 |
delete from sys_job_log where job_log_id = #{jobLogId} |
|
58 |
</delete> |
|
59 |
|
|
60 |
<delete id="deleteJobLogByIds" parameterType="Long"> |
|
61 |
delete from sys_job_log where job_log_id in |
|
62 |
<foreach collection="array" item="jobLogId" open="(" separator="," close=")"> |
|
63 |
#{jobLogId} |
|
64 |
</foreach> |
|
65 |
</delete> |
|
66 |
|
|
67 |
<update id="cleanJobLog"> |
|
68 |
truncate table sys_job_log |
|
69 |
</update> |
|
70 |
|
|
71 |
<insert id="insertJobLog" parameterType="SysJobLog"> |
|
72 |
insert into sys_job_log( |
|
73 |
<if test="jobLogId != null and jobLogId != 0">job_log_id,</if> |
|
74 |
<if test="jobName != null and jobName != ''">job_name,</if> |
|
75 |
<if test="jobGroup != null and jobGroup != ''">job_group,</if> |
|
76 |
<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if> |
|
77 |
<if test="jobMessage != null and jobMessage != ''">job_message,</if> |
|
78 |
<if test="status != null and status != ''">status,</if> |
|
79 |
<if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if> |
|
80 |
create_time |
|
81 |
)values( |
|
82 |
<if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if> |
|
83 |
<if test="jobName != null and jobName != ''">#{jobName},</if> |
|
84 |
<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if> |
|
85 |
<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if> |
|
86 |
<if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if> |
|
87 |
<if test="status != null and status != ''">#{status},</if> |
|
88 |
<if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if> |
|
89 |
getdate() |
|
90 |
) |
|
91 |
</insert> |
|
92 |
|
|
93 |
</mapper> |