|
@@ -6,14 +6,15 @@ |
|
@@ -6,14 +6,15 @@ |
6
|
<result column="alias" property="alias" jdbcType="VARCHAR" />
|
6
|
<result column="alias" property="alias" jdbcType="VARCHAR" />
|
7
|
<result column="host_ip" property="hostIp" jdbcType="VARCHAR" />
|
7
|
<result column="host_ip" property="hostIp" jdbcType="VARCHAR" />
|
8
|
<result column="group_id" property="groupId" jdbcType="INTEGER" />
|
8
|
<result column="group_id" property="groupId" jdbcType="INTEGER" />
|
9
|
- <result column="cloud_type" property="cloudType" jdbcType="BIT" />
|
9
|
+ <result column="cloud_type" property="cloudType" jdbcType="INTEGER" />
|
|
|
10
|
+ <result column="cloud_detail_type" property="cloudDetailType" jdbcType="INTEGER" />
|
10
|
<result column="tags" property="tags" jdbcType="VARCHAR" />
|
11
|
<result column="tags" property="tags" jdbcType="VARCHAR" />
|
11
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
12
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
12
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
13
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
13
|
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
14
|
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
14
|
</resultMap>
|
15
|
</resultMap>
|
15
|
<sql id="Base_Column_List" >
|
16
|
<sql id="Base_Column_List" >
|
16
|
- id, alias, host_ip, group_id, cloud_type, tags, create_time, update_time
|
17
|
+ id, alias, host_ip, group_id, cloud_type, tags, create_time, update_time,cloud_detail_type
|
17
|
</sql>
|
18
|
</sql>
|
18
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
19
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
19
|
select
|
20
|
select
|
|
@@ -28,66 +29,12 @@ |
|
@@ -28,66 +29,12 @@ |
28
|
<insert id="insert" parameterType="com.model.HostInfo" >
|
29
|
<insert id="insert" parameterType="com.model.HostInfo" >
|
29
|
insert into host_info (id, alias, host_ip,
|
30
|
insert into host_info (id, alias, host_ip,
|
30
|
group_id, cloud_type, tags,
|
31
|
group_id, cloud_type, tags,
|
31
|
- create_time, update_time)
|
32
|
+ create_time, update_time,cloud_detail_type)
|
32
|
values (#{id,jdbcType=INTEGER}, #{alias,jdbcType=VARCHAR}, #{hostIp,jdbcType=VARCHAR},
|
33
|
values (#{id,jdbcType=INTEGER}, #{alias,jdbcType=VARCHAR}, #{hostIp,jdbcType=VARCHAR},
|
33
|
- #{groupId,jdbcType=INTEGER}, #{cloudType,jdbcType=BIT}, #{tags,jdbcType=VARCHAR},
|
|
|
34
|
- now(), now())
|
|
|
35
|
- </insert>
|
|
|
36
|
- <insert id="insertSelective" parameterType="com.model.HostInfo" >
|
|
|
37
|
- insert into host_info
|
|
|
38
|
- <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
39
|
- <if test="id != null" >
|
|
|
40
|
- id,
|
|
|
41
|
- </if>
|
|
|
42
|
- <if test="alias != null" >
|
|
|
43
|
- alias,
|
|
|
44
|
- </if>
|
|
|
45
|
- <if test="hostIp != null" >
|
|
|
46
|
- host_ip,
|
|
|
47
|
- </if>
|
|
|
48
|
- <if test="groupId != null" >
|
|
|
49
|
- group_id,
|
|
|
50
|
- </if>
|
|
|
51
|
- <if test="cloudType != null" >
|
|
|
52
|
- cloud_type,
|
|
|
53
|
- </if>
|
|
|
54
|
- <if test="tags != null" >
|
|
|
55
|
- tags,
|
|
|
56
|
- </if>
|
|
|
57
|
- <if test="createTime != null" >
|
|
|
58
|
- create_time,
|
|
|
59
|
- </if>
|
|
|
60
|
- <if test="updateTime != null" >
|
|
|
61
|
- update_time,
|
|
|
62
|
- </if>
|
|
|
63
|
- </trim>
|
|
|
64
|
- <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
65
|
- <if test="id != null" >
|
|
|
66
|
- #{id,jdbcType=INTEGER},
|
|
|
67
|
- </if>
|
|
|
68
|
- <if test="alias != null" >
|
|
|
69
|
- #{alias,jdbcType=VARCHAR},
|
|
|
70
|
- </if>
|
|
|
71
|
- <if test="hostIp != null" >
|
|
|
72
|
- #{hostIp,jdbcType=VARCHAR},
|
|
|
73
|
- </if>
|
|
|
74
|
- <if test="groupId != null" >
|
|
|
75
|
- #{groupId,jdbcType=INTEGER},
|
|
|
76
|
- </if>
|
|
|
77
|
- <if test="cloudType != null" >
|
|
|
78
|
- #{cloudType,jdbcType=BIT},
|
|
|
79
|
- </if>
|
|
|
80
|
- <if test="tags != null" >
|
|
|
81
|
- #{tags,jdbcType=VARCHAR},
|
|
|
82
|
- </if>
|
|
|
83
|
- <if test="createTime != null" >
|
|
|
84
|
- #{createTime,jdbcType=TIMESTAMP},
|
|
|
85
|
- </if>
|
|
|
86
|
- <if test="updateTime != null" >
|
|
|
87
|
- #{updateTime,jdbcType=TIMESTAMP},
|
|
|
88
|
- </if>
|
|
|
89
|
- </trim>
|
34
|
+ #{groupId,jdbcType=INTEGER}, #{cloudType,jdbcType=INTEGER}, #{tags,jdbcType=VARCHAR},
|
|
|
35
|
+ now(), now(), #{cloudDetailType,jdbcType=INTEGER})
|
90
|
</insert>
|
36
|
</insert>
|
|
|
37
|
+
|
91
|
<update id="updateByPrimaryKeySelective" parameterType="com.model.HostInfo" >
|
38
|
<update id="updateByPrimaryKeySelective" parameterType="com.model.HostInfo" >
|
92
|
update host_info
|
39
|
update host_info
|
93
|
<set >
|
40
|
<set >
|
|
@@ -101,7 +48,10 @@ |
|
@@ -101,7 +48,10 @@ |
101
|
group_id = #{groupId,jdbcType=INTEGER},
|
48
|
group_id = #{groupId,jdbcType=INTEGER},
|
102
|
</if>
|
49
|
</if>
|
103
|
<if test="cloudType != null && cloudType != 0" >
|
50
|
<if test="cloudType != null && cloudType != 0" >
|
104
|
- cloud_type = #{cloudType,jdbcType=BIT},
|
51
|
+ cloud_type = #{cloudType,jdbcType=INTEGER},
|
|
|
52
|
+ </if>
|
|
|
53
|
+ <if test="cloudDetailType != null && cloudDetailType != 0" >
|
|
|
54
|
+ cloud_detail_type = #{cloudDetailType,jdbcType=INTEGER},
|
105
|
</if>
|
55
|
</if>
|
106
|
<if test="tags != null" >
|
56
|
<if test="tags != null" >
|
107
|
tags = #{tags,jdbcType=VARCHAR},
|
57
|
tags = #{tags,jdbcType=VARCHAR},
|
|
@@ -120,7 +70,8 @@ |
|
@@ -120,7 +70,8 @@ |
120
|
set alias = #{alias,jdbcType=VARCHAR},
|
70
|
set alias = #{alias,jdbcType=VARCHAR},
|
121
|
host_ip = #{hostIp,jdbcType=VARCHAR},
|
71
|
host_ip = #{hostIp,jdbcType=VARCHAR},
|
122
|
group_id = #{groupId,jdbcType=INTEGER},
|
72
|
group_id = #{groupId,jdbcType=INTEGER},
|
123
|
- cloud_type = #{cloudType,jdbcType=BIT},
|
73
|
+ cloud_type = #{cloudType,jdbcType=INTEGER},
|
|
|
74
|
+ cloud_detail_type = #{cloudDetailType,jdbcType=INTEGER},
|
124
|
tags = #{tags,jdbcType=VARCHAR},
|
75
|
tags = #{tags,jdbcType=VARCHAR},
|
125
|
update_time = now()
|
76
|
update_time = now()
|
126
|
where id = #{id,jdbcType=INTEGER}
|
77
|
where id = #{id,jdbcType=INTEGER}
|
|
@@ -138,6 +89,9 @@ |
|
@@ -138,6 +89,9 @@ |
138
|
<if test="params.cloudType != null && params.cloudType != 0" >
|
89
|
<if test="params.cloudType != null && params.cloudType != 0" >
|
139
|
and a.cloud_type = #{params.cloudType}
|
90
|
and a.cloud_type = #{params.cloudType}
|
140
|
</if>
|
91
|
</if>
|
|
|
92
|
+ <if test="params.cloudDetailType != null && params.cloudDetailType != 0" >
|
|
|
93
|
+ and a.cloud_detail_type = #{params.cloudDetailType}
|
|
|
94
|
+ </if>
|
141
|
<if test="params.hostIp != null && params.hostIp != ''" >
|
95
|
<if test="params.hostIp != null && params.hostIp != ''" >
|
142
|
and a.host_ip like concat(#{params.hostIp},'%')
|
96
|
and a.host_ip like concat(#{params.hostIp},'%')
|
143
|
</if>
|
97
|
</if>
|
|
@@ -169,7 +123,7 @@ |
|
@@ -169,7 +123,7 @@ |
169
|
|
123
|
|
170
|
<select id="selectHostInfosByCodition" resultMap="BaseResultMap">
|
124
|
<select id="selectHostInfosByCodition" resultMap="BaseResultMap">
|
171
|
select
|
125
|
select
|
172
|
- a.id, a.alias, a.host_ip, a.group_id, a.cloud_type, a.tags, a.create_time, a.update_time,b.group_name
|
126
|
+ a.id, a.alias, a.host_ip, a.group_id, a.cloud_type,a.cloud_detail_type, a.tags, a.create_time, a.update_time,b.group_name
|
173
|
from host_info a left join host_group b on a.group_id=b.id
|
127
|
from host_info a left join host_group b on a.group_id=b.id
|
174
|
where
|
128
|
where
|
175
|
1=1
|
129
|
1=1
|
|
@@ -179,6 +133,9 @@ |
|
@@ -179,6 +133,9 @@ |
179
|
<if test="params.cloudType != null && params.cloudType != 0" >
|
133
|
<if test="params.cloudType != null && params.cloudType != 0" >
|
180
|
and a.cloud_type = #{params.cloudType}
|
134
|
and a.cloud_type = #{params.cloudType}
|
181
|
</if>
|
135
|
</if>
|
|
|
136
|
+ <if test="params.cloudDetailType != null && params.cloudDetailType != 0" >
|
|
|
137
|
+ and a.cloud_detail_type = #{params.cloudDetailType}
|
|
|
138
|
+ </if>
|
182
|
<if test="params.hostIp != null && params.hostIp != ''" >
|
139
|
<if test="params.hostIp != null && params.hostIp != ''" >
|
183
|
and a.host_ip like concat(#{params.hostIp},'%')
|
140
|
and a.host_ip like concat(#{params.hostIp},'%')
|
184
|
</if>
|
141
|
</if>
|
|
@@ -277,24 +234,15 @@ |
|
@@ -277,24 +234,15 @@ |
277
|
</foreach>
|
234
|
</foreach>
|
278
|
</select>
|
235
|
</select>
|
279
|
|
236
|
|
280
|
- <update id="updateTagByIps" >
|
|
|
281
|
- update host_info
|
|
|
282
|
- set tags = ""
|
|
|
283
|
- where host_ip in
|
|
|
284
|
- <foreach item="hostIp" index="index" collection="hostIps" open="("
|
|
|
285
|
- separator="," close=")">
|
|
|
286
|
- #{hostIp}
|
|
|
287
|
- </foreach>
|
|
|
288
|
- </update>
|
|
|
289
|
-
|
|
|
290
|
|
237
|
|
291
|
<update id="updateHostInfoByIp" parameterType="com.model.HostInfo" >
|
238
|
<update id="updateHostInfoByIp" parameterType="com.model.HostInfo" >
|
292
|
update host_info
|
239
|
update host_info
|
293
|
set alias = #{alias,jdbcType=VARCHAR},
|
240
|
set alias = #{alias,jdbcType=VARCHAR},
|
294
|
- cloud_type = #{cloudType,jdbcType=BIT},
|
241
|
+ cloud_type = #{cloudType,jdbcType=INTEGER},
|
|
|
242
|
+ cloud_detail_type = #{cloudType,jdbcType=INTEGER},
|
295
|
tags = #{tags,jdbcType=VARCHAR},
|
243
|
tags = #{tags,jdbcType=VARCHAR},
|
296
|
update_time = now()
|
244
|
update_time = now()
|
297
|
- where host_ip = #{hostIp,jdbcType=INTEGER}
|
245
|
+ where host_ip = #{hostIp,jdbcType=VARCHAR}
|
298
|
</update>
|
246
|
</update>
|
299
|
|
247
|
|
300
|
|
248
|
|