xiaohuo 9 months ago
commit 707a703e89
  1. 2
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquInterface.java
  2. 2
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquRouting.java
  3. 5
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquVeneer.java
  4. 2
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquBaseQueryDto.java
  5. 1
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquMonitorHomeDto.java
  6. 14
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorLastDto.java
  7. 9
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorListDto.java
  8. 80
      ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquBaseMapper.xml
  9. 2
      ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml

@ -17,7 +17,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @date 2025-08-20 * @date 2025-08-20
*/ */
@Data @Data
public class EquInterface extends BaseEntity public class EquInterface
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

@ -14,7 +14,7 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2025-08-15 * @date 2025-08-15
*/ */
@Data @Data
public class EquRouting extends BaseEntity public class EquRouting
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

@ -14,7 +14,7 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2025-08-15 * @date 2025-08-15
*/ */
@Data @Data
public class EquVeneer extends BaseEntity public class EquVeneer
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -34,8 +34,7 @@ public class EquVeneer extends BaseEntity
@Excel(name = "采集id") @Excel(name = "采集id")
private String equGatherId; private String equGatherId;
@Excel(name = "采集+预警同一批标志")
private String batchId;
public void setId(String id) public void setId(String id)
{ {

@ -19,6 +19,8 @@ public class EquBaseQueryDto implements Serializable {
/** 设备类型 (equ_type, varchar) */ /** 设备类型 (equ_type, varchar) */
private String equTypeId; private String equTypeId;
/** 设备类型 (equ_type, varchar) */ /** 设备类型 (equ_type, varchar) */
private String equTypeId;
/** 设备类型 (equ_type, varchar) */
private String equType; private String equType;
/** 设备名称 (name, varchar) */ /** 设备名称 (name, varchar) */
private String name; private String name;

@ -10,6 +10,7 @@ import java.util.Date;
@Data @Data
public class EquMonitorHomeDto { public class EquMonitorHomeDto {
private String id; private String id;
private String equNumber; //设备编号
private String name; // 设备名称 private String name; // 设备名称
private String location; // 设备位置 private String location; // 设备位置
private Float cpuUtilization; // CPU 使用率 private Float cpuUtilization; // CPU 使用率

@ -18,7 +18,8 @@ public class MonitorLastDto {
private String temperature; private String temperature;
// equ_base 表 // equ_base 表
private Long id; private String id;
private String equNumber;
private String name; private String name;
private String version; private String version;
private String deviceLevel; private String deviceLevel;
@ -26,19 +27,24 @@ public class MonitorLastDto {
private String location; private String location;
private Date installDate; private Date installDate;
private String inCharge; private String inCharge;
private int failureFrequency; private String status;
private int warranty; private int warranty;
private String equImage; private String equImage;
// equ_type // equ_type
private String equType; private String equTypeId;
private String equTypeName;
// equ_manu // equ_manu
private String manufacture; private String equManuId;
private String equManuName;
private String ContactBy; private String ContactBy;
private String ContactWay; private String ContactWay;
// equ_supplier // equ_supplier
private String supplierId; private String supplierId;
private String supplierName;
private int AlertCount;
private String unhandledAlertCount; private String unhandledAlertCount;
} }

@ -12,19 +12,22 @@ public class MonitorListDto {
private String id; private String id;
private String name; private String name;
private String ip; private String ip;
private String equType; private String equTypeId;
private String manufacture; private String equTypeName;
private String equManuId;
private String equManuName;
private String version; private String version;
private String deviceLevel; private String deviceLevel;
private String location; private String location;
private String status; private String status;
private int failureFrequency;
// 监控指标 // 监控指标
private Float cpuUtilization; private Float cpuUtilization;
private String health; private String health;
private int fanSpeed; private int fanSpeed;
private String contWorkPeriod; private String contWorkPeriod;
private int AlertCount;;
private int unhandledAlertCount; private int unhandledAlertCount;
} }

@ -57,6 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="cpuUtilization" column="cpu_utilization"/> <result property="cpuUtilization" column="cpu_utilization"/>
<result property="memoryUtilization" column="memory_utilization"/> <result property="memoryUtilization" column="memory_utilization"/>
<result property="health" column="health"/> <result property="health" column="health"/>
<result property="equImage" column="equ_image" />
<result property="equNumber" column="equ_number" />
<result property="contWorkPeriod" column="cont_work_period"/> <result property="contWorkPeriod" column="cont_work_period"/>
<association property="manufactureVO" columnPrefix="equ_manu_" autoMapping="true" /> <association property="manufactureVO" columnPrefix="equ_manu_" autoMapping="true" />
<association property="equTypeVO" columnPrefix="equ_type_" autoMapping="true" /> <association property="equTypeVO" columnPrefix="equ_type_" autoMapping="true" />
@ -179,48 +181,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) tmp ON eg.equ_id = tmp.equ_id AND eg.gather_time = tmp.max_time ) tmp ON eg.equ_id = tmp.equ_id AND eg.gather_time = tmp.max_time
) g ON b.id = g.equ_id ) g ON b.id = g.equ_id
<where> <where>
<if test="name != null and name != ''">
AND b.name LIKE CONCAT('%', #{name}, '%')
</if>
<if test="location != null and location != ''">
AND b.location LIKE CONCAT('%', #{location}, '%')
</if>
<if test="minTime != null"> <if test="minTime != null">
AND b.create_date &gt;= #{minTime} AND b.create_date &gt;= #{minTime}
</if> </if>
<if test="maxTime != null"> <if test="maxTime != null">
AND b.create_date &lt;= #{maxTime} AND b.create_date &lt;= #{maxTime}
</if> </if>
<if test="status != null">
AND b.status = #{status}
</if>
</where> </where>
</select> </select>
<select id="selectEquMonitorListPaged" resultType="MonitorListDto"> <select id="selectEquMonitorListPaged" resultType="MonitorListDto">
SELECT SELECT
t.id, c.id,
t.name, c.name,
t.ip, c.ip,
t.equType, c.equTypeId,
t.manufacture, c.equTypeName,
t.version, c.equManuId,
t.deviceLevel, c.equManuName,
t.location, c.version,
t.status, c.deviceLevel,
t.cpuUtilization, c.location,
t.health, c.status,
t.fanSpeed, c.cpuUtilization,
t.contWorkPeriod, c.health,
t.failureFrequency, c.fanSpeed,
t.unhandledAlertCount c.contWorkPeriod,
c.unhandledAlertCount,
c.AlertCount
FROM ( FROM (
SELECT SELECT
b.id, b.id,
b.name, b.name,
b.ip, b.ip,
t.name AS equType, b.equ_type AS equTypeId,
m.name AS manufacture, t.name AS equTypeName,
b.manufacture AS equManuId,
m.name AS equManuName,
b.version, b.version,
b.device_level AS deviceLevel, b.device_level AS deviceLevel,
b.location, b.location,
@ -229,22 +226,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
g.health, g.health,
g.fan_speed AS fanSpeed, g.fan_speed AS fanSpeed,
g.cont_work_period AS contWorkPeriod, g.cont_work_period AS contWorkPeriod,
b.failure_frequency AS failureFrequency,
(SELECT COUNT(1) (SELECT COUNT(1)
FROM alert_message a FROM alert_message a
WHERE a.equ_id = b.id AND a.status = 'HANDLED') AS unhandledAlertCount, WHERE a.equ_id = b.id AND a.status = 'UNHANDLED') AS unhandledAlertCount,
(SELECT COUNT(1)
FROM alert_message a
WHERE a.equ_id = b.id ) AS AlertCount,
ROW_NUMBER() OVER (PARTITION BY b.id ORDER BY g.gather_time DESC) AS rn ROW_NUMBER() OVER (PARTITION BY b.id ORDER BY g.gather_time DESC) AS rn
FROM equ_base b FROM equ_base b
LEFT JOIN equ_type t ON b.equ_type = t.id LEFT JOIN equ_type t ON b.equ_type = t.id
LEFT JOIN equ_manu m ON b.manufacture = m.id LEFT JOIN equ_manu m ON b.manufacture = m.id
LEFT JOIN equ_gather g ON b.id = g.equ_id LEFT JOIN equ_gather g ON b.id = g.equ_id
) t ) c
WHERE t.rn = 1 WHERE c.rn = 1
ORDER BY t.id ORDER BY c.id
</select> </select>
<select id="selectLatestEquMonitorList" resultType="com.alops.system.domain.dto.EquMonitorHomeDto"> <select id="selectLatestEquMonitorList" resultType="com.alops.system.domain.dto.EquMonitorHomeDto">
SELECT SELECT
t.id,
t.equNumber,
t.name, t.name,
t.location, t.location,
t.cpuUtilization, t.cpuUtilization,
@ -256,6 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM ( FROM (
SELECT SELECT
b.id, b.id,
b.equ_number as equNumber,
b.name, b.name,
b.location, b.location,
g.cpu_utilization AS cpuUtilization, g.cpu_utilization AS cpuUtilization,
@ -278,14 +280,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
g.cont_work_period AS contWorkPeriod, g.cont_work_period AS contWorkPeriod,
b.equ_image AS equImage, b.equ_image AS equImage,
b.id, b.id,
b.equ_number as equNumber,
b.name, b.name,
b.version, b.version,
b.device_level AS deviceLevel, b.device_level AS deviceLevel,
t.name as equType, b.equ_type as equTypeId,
t.name as equTypeName,
b.status, b.status,
m.name as manufacture, b.manufacture as equManuId,
s.name as supplierId, m.name as equManuName,
b.supplier_id as supplierId,
s.name as supplierName,
s.contact_by AS ContactBy, s.contact_by AS ContactBy,
s.contact_way AS ContactWay, s.contact_way AS ContactWay,
b.warranty, b.warranty,
@ -295,11 +301,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
b.install_date AS installDate, b.install_date AS installDate,
b.in_charge AS inCharge, b.in_charge AS inCharge,
b.failure_frequency AS failureFrequency, (SELECT COUNT(1)
FROM alert_message a
WHERE a.equ_id = b.id ) AS AlertCount,
-- 新增列:统计未处理告警数量 -- 新增列:统计未处理告警数量
(SELECT COUNT(1) (SELECT COUNT(1)
FROM alert_message a FROM alert_message a
WHERE a.equ_id = b.id AND a.status = 'HANDLED') AS unhandledAlertCount, WHERE a.equ_id = b.id AND a.status = 'UNHANDLED') AS unhandledAlertCount,
g.fan_speed AS fanSpeed, g.fan_speed AS fanSpeed,
g.cpu_utilization AS cpuUtilization, g.cpu_utilization AS cpuUtilization,

@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<sql id="selectEquVlanVoJoinGather"> <sql id="selectEquVlanVoJoinGather">
select vl.id, g.equ_id, equ_gather_id, main_id, ip_address, subnet_mask, create_time, update_by, vlan_id from equ_vlan vl LEFT JOIN equ_gather g ON vl.equ_gather_id = g.id select vl.id, g.equ_id as equId, equ_gather_id, main_id, ip_address, subnet_mask, create_time, update_by, vlan_id from equ_vlan vl LEFT JOIN equ_gather g ON vl.equ_gather_id = g.id
</sql> </sql>
<select id="selectEquVlanList" parameterType="EquVlan" resultMap="EquVlanResult"> <select id="selectEquVlanList" parameterType="EquVlan" resultMap="EquVlanResult">

Loading…
Cancel
Save