TbTmpInterfaceDao.java
1.34 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
package com.sitech.database.dao;
import java.util.HashMap;
import java.util.List;
import com.sitech.database.domain.TbTmpInterface;
public class TbTmpInterfaceDao extends BaseDao {
public void addTbTmpInterface(TbTmpInterface newIf){
try {
sqlmapClient.insert("addTbTmpInterface", newIf);
} catch (Exception e) {
error.error("Exception while addTbTmpInterface.", e);
}
}
public void deleteTbTmpInterface(TbTmpInterface newIf){
try {
sqlmapClient.delete("deleteTbTmpInterface", newIf);
} catch (Exception e) {
error.error("Exception while deleteTbTmpInterface.", e);
}
}
public TbTmpInterface queryTbTmpInterface(String ipAddr, String ifIndex){
try {
HashMap<String, String> param = new HashMap<String, String>();
param.put("IP_ADDR", ipAddr);
param.put("IF_INDEX", ifIndex);
List<TbTmpInterface> list = sqlmapClient.queryForList("queryTbTmpInterface", param);
if (list != null && list.size() > 0) {
return list.get(0);
}
} catch (Exception e) {
error.error("Exception while queryTbTmpInterface.", e);
}
return null;
}
public void clean() {
try {
int status = sqlmapClient.delete("deleteTbTmpInterfaceAll", null);
System.out.println(status);
} catch (Exception e) {
error.error("Exception while deleteTbTmpInterfaceAll.", e);
}
}
}