TaskSheduleMapper.xml
4.42 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?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.monitor.mysql.mapper.TaskSheduleMapper">
<resultMap id="BaseResultMap" type="com.model.TaskModel">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="alarm_interval" property="interval" jdbcType="INTEGER"/>
<result column="relax_start_time" property="relaxStartTime" jdbcType="INTEGER"/>
<result column="relax_end_time" property="relaxEndTime" jdbcType="INTEGER"/>
<result column="time_flag" property="timeFlag" jdbcType="INTEGER"/>
<result column="alarm_type" property="alarmType" jdbcType="INTEGER"/>
<result column="alarm_num_flag" property="alarmNumFlag" jdbcType="INTEGER"/>
<result column="is_run" property="isRun" jdbcType="INTEGER"/>
<result column="is_on" property="isOn" jdbcType="INTEGER"/>
<result column="continuous_alarm_times" property="alarmTimes" jdbcType="INTEGER"/>
<result column="fields" property="fields" jdbcType="VARCHAR"/>
<result column="tags" property="tags" jdbcType="VARCHAR"/>
<result column="influxdbs" property="influxdbs" jdbcType="VARCHAR"/>
<result column="influx_sql" property="influxSql" jdbcType="VARCHAR"/>
<result column="mobile" property="mobile" jdbcType="VARCHAR"/>
<result column="sms" property="sms" jdbcType="VARCHAR"/>
<result column="type" property="type" jdbcType="VARCHAR"/>
<result column="inf_database" property="database" jdbcType="VARCHAR"/>
<result column="description" property="description" jdbcType="VARCHAR"/>
<result column="last_time" property="lastTime"/>
</resultMap>
<select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
*
from task_shedule
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
*
from task_shedule
</select>
<select id="selectByPage" resultMap="BaseResultMap">
select
*
from task_shedule
order by id
limit #{startIndex},#{pageSize}
</select>
<select id="selectCount" resultType="java.lang.Integer">
select
count(1)
from task_shedule
</select>
<delete id="deleteById" parameterType="java.lang.Integer">
delete from task_shedule
where id = #{id,jdbcType=INTEGER}
</delete>
<update id="updateByid" parameterType="com.model.TaskModel">
update task_shedule
set alarm_interval = #{interval,jdbcType=INTEGER},
relax_start_time = #{relaxStartTime,jdbcType=INTEGER},
time_flag = #{timeFlag,jdbcType=INTEGER},
relax_end_time = #{relaxEndTime,jdbcType=INTEGER},
alarm_type = #{alarmType,jdbcType=INTEGER},
alarm_num_flag = #{alarmNumFlag,jdbcType=INTEGER},
is_on = #{isOn,jdbcType=INTEGER},
fields = #{fields,jdbcType=VARCHAR},
tags = #{tags,jdbcType=VARCHAR},
influxdbs = #{influxdbs,jdbcType=VARCHAR},
influx_sql = #{influxSql,jdbcType=VARCHAR},
mobile = #{mobile,jdbcType=VARCHAR},
sms = #{sms,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
inf_database = #{database,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="insert" parameterType="com.model.TaskModel">
insert into task_shedule
(alarm_interval,
relax_start_time,
time_flag,
relax_end_time,
alarm_num_flag,
alarm_type,
is_on,
fields,
tags,
influxdbs,
influx_sql,
mobile,
sms,
type ,
inf_database,
description)
values
(#{interval,jdbcType=INTEGER},
#{relaxStartTime,jdbcType=INTEGER},
#{timeFlag,jdbcType=INTEGER},
#{relaxEndTime,jdbcType=INTEGER},
#{alarmNumFlag,jdbcType=INTEGER},
#{alarmType,jdbcType=INTEGER},
#{isOn,jdbcType=INTEGER},
#{fields,jdbcType=VARCHAR},
#{tags,jdbcType=VARCHAR},
#{influxdbs,jdbcType=VARCHAR},
#{influxSql,jdbcType=VARCHAR},
#{mobile,jdbcType=VARCHAR},
#{sms,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR},
#{database,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}
)
</insert>
<update id="updateLastTime" parameterType="java.lang.Integer">
update task_shedule
set last_time = now()
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>