quartz-task-config-mapper.xml
1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?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.cjs.cms.dao.pub.QuartzTaskConfigDao">
<sql id="quartz_task_config_field">
id, class_name, active_id, task_type, start_date, sched_type, cron, interval_ms, times, status, remark, create_at
</sql>
<insert id="insert" parameterType="QuartzTaskConfigInfo" useGeneratedKeys="true" keyProperty="id">
insert into quartz_task_config(class_name, active_id, task_type, start_date, sched_type, cron, interval_ms, times, status, remark, create_at)
values(#{className}, #{activeId}, #{taskType}, #{startDate}, #{schedType}, #{cron}, #{intervalMs}, #{times}, #{status}, #{remark}, CURRENT_TIMESTAMP)
</insert>
<select id="queryTasks" resultType="QuartzTaskConfigInfo">
select <include refid="quartz_task_config_field" />
from quartz_task_config
where status = '0'
</select>
<select id="queryTaskById" parameterType="int" resultType="QuartzTaskConfigInfo">
select <include refid="quartz_task_config_field" />
from quartz_task_config
where id = #{id}
</select>
<select id="queryTaskByCondition" parameterType="map" resultType="QuartzTaskConfigInfo">
select <include refid="quartz_task_config_field" />
from quartz_task_config
where task_type = #{taskType} and active_id = #{activeId} and status = '0' and remark = #{remark}
</select>
<update id="updateStartDate" parameterType="QuartzTaskConfigInfo">
update quartz_task_config set start_date = #{startDate}
where id = #{id}
</update>
</mapper>