RedisMonitorMapper.xml
6.07 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?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.RedisMonitorMapper" >
<resultMap id="BaseResultMap" type="com.model.RedisMonitor" >
<id column="id" property="id" jdbcType="BIGINT" />
<result column="node_from" property="nodeFrom" jdbcType="VARCHAR" />
<result column="node_to" property="nodeTo" jdbcType="VARCHAR" />
<result column="level" property="level" jdbcType="TINYINT" />
<result column="param_monitor" property="paramMonitor" jdbcType="VARCHAR" />
<result column="is_failed" property="isFailed" jdbcType="TINYINT" />
<result column="is_slave" property="isSlave" jdbcType="TINYINT" />
<result column="redis_type" property="redisType" jdbcType="TINYINT" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, node_from, node_to, level, param_monitor, is_failed, is_slave, redis_type, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from redis_monitor
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from redis_monitor
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.model.RedisMonitor" >
insert into redis_monitor (id, node_from, node_to,
level, param_monitor, is_failed,
is_slave, redis_type, create_time,
update_time)
values (#{id,jdbcType=BIGINT}, #{nodeFrom,jdbcType=VARCHAR}, #{nodeTo,jdbcType=VARCHAR},
#{level,jdbcType=TINYINT}, #{paramMonitor,jdbcType=VARCHAR}, #{isFailed,jdbcType=TINYINT},
#{isSlave,jdbcType=TINYINT}, #{redisType,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.model.RedisMonitor" >
insert into redis_monitor
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="nodeFrom != null" >
node_from,
</if>
<if test="nodeTo != null" >
node_to,
</if>
<if test="level != null" >
level,
</if>
<if test="paramMonitor != null" >
param_monitor,
</if>
<if test="isFailed != null" >
is_failed,
</if>
<if test="isSlave != null" >
is_slave,
</if>
<if test="redisType != null" >
redis_type,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=BIGINT},
</if>
<if test="nodeFrom != null" >
#{nodeFrom,jdbcType=VARCHAR},
</if>
<if test="nodeTo != null" >
#{nodeTo,jdbcType=VARCHAR},
</if>
<if test="level != null" >
#{level,jdbcType=TINYINT},
</if>
<if test="paramMonitor != null" >
#{paramMonitor,jdbcType=VARCHAR},
</if>
<if test="isFailed != null" >
#{isFailed,jdbcType=TINYINT},
</if>
<if test="isSlave != null" >
#{isSlave,jdbcType=TINYINT},
</if>
<if test="redisType != null" >
#{redisType,jdbcType=TINYINT},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.model.RedisMonitor" >
update redis_monitor
<set >
<if test="nodeFrom != null" >
node_from = #{nodeFrom,jdbcType=VARCHAR},
</if>
<if test="nodeTo != null" >
node_to = #{nodeTo,jdbcType=VARCHAR},
</if>
<if test="level != null" >
level = #{level,jdbcType=TINYINT},
</if>
<if test="paramMonitor != null" >
param_monitor = #{paramMonitor,jdbcType=VARCHAR},
</if>
<if test="isFailed != null" >
is_failed = #{isFailed,jdbcType=TINYINT},
</if>
<if test="isSlave != null" >
is_slave = #{isSlave,jdbcType=TINYINT},
</if>
<if test="redisType != null" >
redis_type = #{redisType,jdbcType=TINYINT},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.model.RedisMonitor" >
update redis_monitor
set node_from = #{nodeFrom,jdbcType=VARCHAR},
node_to = #{nodeTo,jdbcType=VARCHAR},
level = #{level,jdbcType=TINYINT},
param_monitor = #{paramMonitor,jdbcType=VARCHAR},
is_failed = #{isFailed,jdbcType=TINYINT},
is_slave = #{isSlave,jdbcType=TINYINT},
redis_type = #{redisType,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<delete id="deleteAllRedisMonitor">
delete from redis_monitor
</delete>
<insert id="bachInsertRedisMonitor" parameterType="com.model.RedisMonitor">
insert into redis_monitor
(node_from, node_to,level,is_failed,is_slave,redis_type,param_monitor)
values
<foreach collection="list" item="item" index="index"
separator=",">
(#{item.nodeFrom},#{item.nodeTo},#{item.level},#{item.isFailed},#{item.isSlave},#{item.redisType},#{item.paramMonitor})
</foreach>
</insert>
<select id="selectAllRedisMonitors" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from redis_monitor order by redis_type ,level
</select>
</mapper>