DockerMonitorServiceMapper.xml
3.1 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
<?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.DockerMonitorServiceMapper" >
<resultMap id="BaseResultMap" type="com.model.DockerMonitorServiceModel" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="servicename" property="serviceName" jdbcType="VARCHAR" />
<result column="namespace" property="namespace" jdbcType="VARCHAR" />
<result column="clusterid" property="clusterId" jdbcType="VARCHAR" />
<result column="monitor_flag" property="monitorFlag" jdbcType="VARCHAR" />
<result column="descr" property="descr" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id,servicename,namespace,clusterid,monitor_flag,descr
</sql>
<update id="updateMonitorFlagByCluster" >
update docker_monitor_service
set monitor_flag = #{monitorFlag}
where clusterid = #{clusterId}
</update>
<update id="updateMonitorFlagById" >
update docker_monitor_service
set monitor_flag = #{monitorFlag}
where id = #{id}
</update>
<select id="selectAllMonitor" resultMap="BaseResultMap">
select * from docker_monitor_service
where monitor_flag = '1'
</select>
<select id="selectCountByCodition" resultType="java.lang.Integer">
select
count(1)
from docker_monitor_service
where 1=1
<if test="params.clusterId != null && params.clusterId != ''" >
and clusterid = #{params.clusterId}
</if>
</select>
<select id="selectDockerServiceByCodition" resultMap="BaseResultMap">
select * from docker_monitor_service
where 1=1
<if test="params.clusterId != null && params.clusterId != ''" >
and clusterid = #{params.clusterId}
</if>
order by clusterid
limit #{startIndex},#{pageSize}
</select>
<select id="selectDockerServiceByClusterId" resultMap="BaseResultMap">
select * from docker_monitor_service
where clusterid = #{clusterId}
</select>
<delete id="deleteAll">
delete from docker_monitor_service
</delete>
<delete id="deleteById" parameterType="java.lang.Integer" >
delete from docker_monitor_service
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteExcludeCluster">
delete from docker_monitor_service
where clusterid not in
<foreach item="clsid" index="index" collection="includeClusterList" open="("
separator=" , " close=")">
#{clsid}
</foreach>
</delete>
<insert id="insert" parameterType="com.model.DockerMonitorServiceModel" >
insert into docker_monitor_service (servicename,namespace,clusterid,monitor_flag,descr)
values ( #{serviceName,jdbcType=VARCHAR}, #{namespace,jdbcType=VARCHAR},
#{clusterId,jdbcType=VARCHAR}, #{monitorFlag,jdbcType=VARCHAR}, #{descr,jdbcType=VARCHAR})
</insert>
</mapper>