提交 | 用户 | 时间
|
e7c126
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
H |
2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
3 |
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
4 |
<mapper namespace="com.xxl.job.admin.dao.XxlJobRegistryDao"> |
|
5 |
|
|
6 |
<resultMap id="XxlJobRegistry" type="com.xxl.job.admin.core.model.XxlJobRegistry" > |
|
7 |
<result column="id" property="id" /> |
|
8 |
<result column="registry_group" property="registryGroup" /> |
|
9 |
<result column="registry_key" property="registryKey" /> |
|
10 |
<result column="registry_value" property="registryValue" /> |
|
11 |
<result column="update_time" property="updateTime" /> |
|
12 |
</resultMap> |
|
13 |
|
|
14 |
<sql id="Base_Column_List"> |
|
15 |
t.id, |
|
16 |
t.registry_group, |
|
17 |
t.registry_key, |
|
18 |
t.registry_value, |
|
19 |
t.update_time |
|
20 |
</sql> |
|
21 |
|
|
22 |
<select id="findDead" parameterType="java.util.HashMap" resultType="java.lang.Integer" > |
|
23 |
SELECT t.id |
|
24 |
FROM xxl_job_registry AS t |
|
25 |
WHERE t.update_time <![CDATA[ < ]]> DATE_ADD(#{nowTime},INTERVAL -#{timeout} SECOND) |
|
26 |
</select> |
|
27 |
|
|
28 |
<delete id="removeDead" parameterType="java.lang.Integer" > |
|
29 |
DELETE FROM xxl_job_registry |
|
30 |
WHERE id in |
|
31 |
<foreach collection="ids" item="item" open="(" close=")" separator="," > |
|
32 |
#{item} |
|
33 |
</foreach> |
|
34 |
</delete> |
|
35 |
|
|
36 |
<select id="findAll" parameterType="java.util.HashMap" resultMap="XxlJobRegistry"> |
|
37 |
SELECT <include refid="Base_Column_List" /> |
|
38 |
FROM xxl_job_registry AS t |
|
39 |
WHERE t.update_time <![CDATA[ > ]]> DATE_ADD(#{nowTime},INTERVAL -#{timeout} SECOND) |
|
40 |
</select> |
|
41 |
|
|
42 |
<update id="registryUpdate" > |
|
43 |
UPDATE xxl_job_registry |
|
44 |
SET `update_time` = #{updateTime} |
|
45 |
WHERE `registry_group` = #{registryGroup} |
|
46 |
AND `registry_key` = #{registryKey} |
|
47 |
AND `registry_value` = #{registryValue} |
|
48 |
</update> |
|
49 |
|
|
50 |
<insert id="registrySave" > |
|
51 |
INSERT INTO xxl_job_registry( `registry_group` , `registry_key` , `registry_value`, `update_time`) |
|
52 |
VALUES( #{registryGroup} , #{registryKey} , #{registryValue}, #{updateTime}) |
|
53 |
</insert> |
|
54 |
|
|
55 |
<delete id="registryDelete" > |
|
56 |
DELETE FROM xxl_job_registry |
|
57 |
WHERE registry_group = #{registryGroup} |
|
58 |
AND registry_key = #{registryKey} |
|
59 |
AND registry_value = #{registryValue} |
|
60 |
</delete> |
|
61 |
|
|
62 |
</mapper> |