parent
81b6fa6760
commit
03c6316022
5 changed files with 227 additions and 0 deletions
@ -0,0 +1,14 @@ |
|||||||
|
-- 排查方法配置表 |
||||||
|
CREATE TABLE smartpark.t_config_resolve_tips |
||||||
|
( |
||||||
|
id INT auto_increment NOT NULL, |
||||||
|
class_code varchar(64) NOT NULL COMMENT '设备类型', |
||||||
|
point_code varchar(16) NULL COMMENT '节点代码', |
||||||
|
tips varchar(512) NULL COMMENT '排查方法', |
||||||
|
short_num INT NULL COMMENT '排序', |
||||||
|
is_deleted INT default 0 COMMENT '逻辑删除', |
||||||
|
CONSTRAINT t_config_resolve_tips_pk PRIMARY KEY (id) |
||||||
|
) ENGINE = InnoDB |
||||||
|
DEFAULT CHARSET = utf8mb4 |
||||||
|
COLLATE = utf8mb4_0900_ai_ci |
||||||
|
COMMENT ='排查方法'; |
||||||
@ -0,0 +1,72 @@ |
|||||||
|
package org.springblade.modules.desk.controller; |
||||||
|
|
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
/** |
||||||
|
* 系统监控控制器 |
||||||
|
* |
||||||
|
* @author liuqingkun |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping("/monitor-business") |
||||||
|
public class BusinessMonitorController { |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据设备类型和报警节点查询排查方法 |
||||||
|
* |
||||||
|
* @param classCode |
||||||
|
* @param pointCode |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping("/getResolveTips") |
||||||
|
public R getResolveTips(@RequestParam("classCode") String classCode, @RequestParam("pointCode") String pointCode) { |
||||||
|
|
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询设备列表 |
||||||
|
* |
||||||
|
* @param classCode |
||||||
|
* @param warnStatus |
||||||
|
* @param equipCode |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping("/getEquipList") |
||||||
|
public R getEquipList(@RequestParam("classCode") String classCode, |
||||||
|
@RequestParam("warnStatus") String warnStatus, |
||||||
|
@RequestParam("equipCode") String equipCode) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询设备当前报警信息 |
||||||
|
* |
||||||
|
* @param equipCode |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping("/getWarnMsg") |
||||||
|
public R getWarnMsg(@RequestParam("equipCode") String equipCode) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询设备报警记录 |
||||||
|
* |
||||||
|
* @param equipCode |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping("/getWarnHisList") |
||||||
|
public R getWarnHisList(@RequestParam("equipCode") String equipCode) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,23 @@ |
|||||||
|
package org.springblade.modules.desk.controller; |
||||||
|
|
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
/** |
||||||
|
* 业务数据监控控制器 |
||||||
|
* |
||||||
|
* @author liuqingkun |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping("/monitor-system") |
||||||
|
public class SystemMonitorController { |
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
public R test() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,56 @@ |
|||||||
|
package org.springblade.modules.desk.mapper; |
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.MapKey; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* Mapper 接口 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
public interface MonitorMapper { |
||||||
|
|
||||||
|
/** |
||||||
|
* 前N条数据 |
||||||
|
* |
||||||
|
* @param classCode 设备类型编码 |
||||||
|
* @param pointCode 节点编码 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@MapKey("id") |
||||||
|
List<Map<String, String>> resolveTips(@Param("classCode") String classCode, @Param("pointCode") String pointCode); |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询设备列表 |
||||||
|
* |
||||||
|
* @param classCode |
||||||
|
* @param warnStatus |
||||||
|
* @param equipCode |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
List<Map<String, String>> getEquipList(@Param("classCode") String classCode, |
||||||
|
@Param("warnStatus") String warnStatus, |
||||||
|
@Param("equipCode") String equipCode); |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询设备当前报警信息 |
||||||
|
* |
||||||
|
* @param equipCode |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
List<Map<String, String>> getWarnMsg(@Param("equipCode") String equipCode); |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询设备报警记录 |
||||||
|
* |
||||||
|
* @param equipCode |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
List<Map<String, String>> getWarnHisList(@Param("equipCode") String equipCode); |
||||||
|
} |
||||||
@ -0,0 +1,62 @@ |
|||||||
|
<?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 = "org.springblade.modules.desk.mapper.MonitorMapper"> |
||||||
|
|
||||||
|
<select id = "resolveTips" resultType = "map"> |
||||||
|
select id, class_code as classCode, point_code as pointCode, tips, short_num as shortNum |
||||||
|
from t_config_resolve_tips |
||||||
|
where is_deleted = 0 |
||||||
|
<if test = "classCode != null and classCode != ''"> |
||||||
|
class_code = #{classCode} |
||||||
|
</if> |
||||||
|
<if test = "pointCode != null and pointCode != ''"> |
||||||
|
point_code = #{pointCode} |
||||||
|
</if> |
||||||
|
order by short_num asc |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id = "getEquipList" resultType = "map"> |
||||||
|
select * |
||||||
|
from t_equip e |
||||||
|
where e.is_deleted = 0 |
||||||
|
and e.class_code = #{classCode} |
||||||
|
<if test = "warnStatus != null and warnStatus != ''"> |
||||||
|
point_code = #{pointCode} |
||||||
|
</if> |
||||||
|
<if test = "equipCode != null and equipCode != ''"> |
||||||
|
code like CONCAT('%', #{equipCode}, '%') |
||||||
|
</if> |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id = "getWarnMsg" resultType = "map"> |
||||||
|
select equip_code as equipCode, |
||||||
|
equip_name as equipName, |
||||||
|
location as location, |
||||||
|
area as area, |
||||||
|
warn_type as warnType, |
||||||
|
warn_content as warnContent, |
||||||
|
warn_date as warnDate |
||||||
|
from t_data_warn |
||||||
|
where equip_code = #{equipCode} |
||||||
|
and status = 1 |
||||||
|
order by warn_date desc limit 1 |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id = "getWarnHisList" resultType = "map"> |
||||||
|
select equip_code as equipCode, |
||||||
|
equip_name as equipName, |
||||||
|
location as location, |
||||||
|
area as area, |
||||||
|
warn_type as warnType, |
||||||
|
warn_content as warnContent, |
||||||
|
warn_date as warnDate, |
||||||
|
recovery_type as recoveryType, |
||||||
|
recovery_person as recoveryPerson, |
||||||
|
recovery_date as recoveryDate, |
||||||
|
status as status |
||||||
|
from t_data_warn |
||||||
|
where equip_code = #{equipCode} |
||||||
|
and status = 1 |
||||||
|
order by warn_date desc limit 10 |
||||||
|
</select> |
||||||
|
</mapper> |
||||||
Loading…
Reference in new issue