DowntimeMap.xml
1.59 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
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="TB_DOWNTIME_HOST">
<typeAlias alias="downtimeBean" type="com.sitech.ismp.check.downtime.DowntimeBean" />
<select id="getDowntimeByIp" resultClass="downtimeBean" parameterClass="java.util.HashMap">
SELECT
DEVICE_ID,
DEVICE_IP,
DEVICE_ALIAS,
KBP_CLASS,
PROTOCOL,
PROTOCOL_PORT,
USER_NAME,
PASSWORD,
CREATE_DATE
FROM TB_DOWNTIME_HOST
<isNotEmpty property="DEVICE_IP">
WHERE DEVICE_IP IN #DEVICE_IP#
</isNotEmpty>
</select>
<insert id="addDowntimeHost" parameterClass="downtimeBean">
INSERT INTO TB_DOWNTIME_HOST (
DEVICE_ID,
DEVICE_IP,
DEVICE_ALIAS,
KBP_CLASS,
PROTOCOL,
PROTOCOL_PORT,
USER_NAME,
PASSWORD,
CREATE_DATE)
VALUES (
#DEVICE_ID#,
#DEVICE_IP#,
#DEVICE_ALIAS#,
#KBP_CLASS#,
#PROTOCOL#,
#PROTOCOL_PORT#,
#USER_NAME#,
#PASSWORD#,
#CREATE_DATE#);
</insert>
<delete id="deleteDowntimeHostByIp" parameterClass="java.lang.String">
DELETE FROM TB_DOWNTIME_HOST WHERE DEVICE_IP=#ip#
</delete>
<update id="updateDowntimeHostByIp" parameterClass="downtimeBean">
UPDATE TB_DOWNTIME_HOST SET
<isNotEmpty property="PROTOCOL_PORT">
PROTOCOL_PORT = #PROTOCOL_PORT#,
</isNotEmpty>
<isNotEmpty property="USER_NAME">
USER_NAME = #USER_NAME#,
</isNotEmpty>
<isNotEmpty property="PASSWORD">
PASSWORD = #PASSWORD#,
</isNotEmpty>
DEVICE_ALIAS = #DEVICE_ALIAS#
WHERE DEVICE_IP = #DEVICE_IP#
</update>
</sqlMap>