summaryrefslogtreecommitdiff
path: root/src/main/resources/mapper
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/mapper')
-rw-r--r--src/main/resources/mapper/AlertRuleDao.xml19
-rw-r--r--src/main/resources/mapper/ConfEventDao.xml9
-rw-r--r--src/main/resources/mapper/EndpointDao.xml39
-rw-r--r--src/main/resources/mapper/PromserverDao.xml27
-rw-r--r--src/main/resources/mapper/SysConfigDao.xml16
5 files changed, 110 insertions, 0 deletions
diff --git a/src/main/resources/mapper/AlertRuleDao.xml b/src/main/resources/mapper/AlertRuleDao.xml
new file mode 100644
index 0000000..8f1e028
--- /dev/null
+++ b/src/main/resources/mapper/AlertRuleDao.xml
@@ -0,0 +1,19 @@
+<?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.nis.dao.AlertRuleDao">
+ <resultMap type="com.nis.entity.AlertRule" id="alertRule">
+ <result property="id" column="id"/>
+ <result property="alertName" column="alert_name"/>
+ <result property="expr" column="expr"/>
+ <result property="last" column="last"/>
+ <result property="severity" column="severity"/>
+ <result property="summary" column="summary"/>
+ <result property="description" column="description"/>
+ <result property="receiver" column="receiver"/>
+ </resultMap>
+
+ <select id="selectList" resultMap="alertRule">
+ select * from alert_rule
+ </select>
+
+</mapper> \ No newline at end of file
diff --git a/src/main/resources/mapper/ConfEventDao.xml b/src/main/resources/mapper/ConfEventDao.xml
new file mode 100644
index 0000000..c36a444
--- /dev/null
+++ b/src/main/resources/mapper/ConfEventDao.xml
@@ -0,0 +1,9 @@
+<?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.nis.dao.ConfEventDao">
+
+ <select id="selectList" resultType="com.nis.entity.ConfEvent">
+ select * from conf_event
+ </select>
+
+</mapper> \ No newline at end of file
diff --git a/src/main/resources/mapper/EndpointDao.xml b/src/main/resources/mapper/EndpointDao.xml
new file mode 100644
index 0000000..fcd868f
--- /dev/null
+++ b/src/main/resources/mapper/EndpointDao.xml
@@ -0,0 +1,39 @@
+<?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.nis.dao.EndpointDao">
+ <resultMap type="com.nis.entity.Endpoint" id="endpoint">
+ <result property="id" column="id"/>
+ <result property="moduleId" column="module_id"/>
+ <result property="assetId" column="asset_id"/>
+ <result property="host" column="host"/>
+ <result property="port" column="port"/>
+ <result property="param" column="param"/>
+ <result property="path" column="path"/>
+
+ <association columnPrefix="m_" property="module" javaType="com.nis.entity.Module">
+ <id column="module_id" property="id"/>
+ <result column="name" property="name"/>
+ <result column="remark" property="remark"/>
+ <result column="project_id" property="projectId"/>
+ <result column="port" property="port"/>
+ <result column="param" property="param"/>
+ <result column="path" property="path"/>
+ </association>
+ </resultMap>
+
+ <select id="selectExporterInfos" resultMap="endpoint">
+ select e.*,
+ m.id AS m_module_id,
+ m.project_id AS m_project_id,
+ m.name AS m_name,
+ m.port AS m_port,
+ m.param AS m_param,
+ m.path AS m_path,
+ m.remark AS m_remark
+ from
+ endpoint e left join asset a on e.asset_id=a.id
+ left join module m on e.module_id = m.id
+ where a.idc_id=#{idcId}
+ </select>
+
+</mapper> \ No newline at end of file
diff --git a/src/main/resources/mapper/PromserverDao.xml b/src/main/resources/mapper/PromserverDao.xml
new file mode 100644
index 0000000..3fcb02a
--- /dev/null
+++ b/src/main/resources/mapper/PromserverDao.xml
@@ -0,0 +1,27 @@
+<?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.nis.dao.PromserverDao">
+ <resultMap type="com.nis.entity.Promserver" id="promserver">
+ <result property="id" column="id"/>
+ <result property="idcId" column="idc_id"/>
+ <result property="host" column="host"/>
+ <result property="relabel" column="relabel"/>
+ <result property="type" column="type"/>
+ </resultMap>
+
+ <select id="selectList" resultMap="promserver">
+ select * from prom_server
+ </select>
+
+ <select id="selectRoleByIp" resultMap="promserver">
+ select * from prom_server where host=#{ip}
+ </select>
+
+ <select id="selectSubInfo" resultMap="promserver">
+ select * from prom_server where idc_id=#{promserver.idcId} and type=#{promserver.type} order by id asc
+ </select>
+
+ <select id="selectSubInfosByType" resultMap="promserver">
+ select * from prom_server where type=#{type}
+ </select>
+</mapper> \ No newline at end of file
diff --git a/src/main/resources/mapper/SysConfigDao.xml b/src/main/resources/mapper/SysConfigDao.xml
new file mode 100644
index 0000000..4b92e6b
--- /dev/null
+++ b/src/main/resources/mapper/SysConfigDao.xml
@@ -0,0 +1,16 @@
+<?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.nis.dao.SysConfigDao">
+ <resultMap type="com.nis.entity.SysConfig" id="sysConfig">
+ <result property="id" column="id"/>
+ <result property="paramKey" column="param_key"/>
+ <result property="paramValue" column="param_value"/>
+ <result property="status" column="status"/>
+ <result property="remark" column="remark"/>
+ </resultMap>
+
+ <select id="selectList" resultMap="sysConfig">
+ select * from sys_config where status=1
+ </select>
+
+</mapper> \ No newline at end of file