处理磁盘健康数据
This commit is contained in:
@@ -63,7 +63,7 @@ public class AllDiskName extends BaseEntity
|
||||
private String type;
|
||||
/** 表名 */
|
||||
private String tableName;
|
||||
/** 健康状态 0 不健康,1健康 */
|
||||
private Long healthStatus;
|
||||
/** 健康信息 */
|
||||
private String healthInfo;
|
||||
|
||||
}
|
||||
|
||||
@@ -87,6 +87,8 @@ public class InitialDiskInfo extends BaseEntity
|
||||
private String unit;
|
||||
/** 健康状态 0-不健康 1-健康) */
|
||||
private Long healthStatus;
|
||||
/** 健康分数 */
|
||||
private Integer healthScore;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -153,7 +153,11 @@
|
||||
TRUNCATE(IFNULL(b.read_speed,0)/(1024*1024), 0) as readSpeed,
|
||||
b.type,
|
||||
TRUNCATE(IFNULL(b.used_space,0)/(1024 * 1024 * 1024), 0) as usedSpace,
|
||||
b.health_status as healthStatus
|
||||
CASE
|
||||
WHEN b.health_score IS NOT NULL THEN b.health_score
|
||||
WHEN b.health_status = 1 THEN '健康'
|
||||
WHEN b.health_status = 0 THEN '不健康' ELSE null
|
||||
END AS healthInfo
|
||||
FROM all_disk_name a
|
||||
LEFT JOIN (
|
||||
SELECT client_id, name, MAX(create_time) as max_create_time
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<result property="type" column="type" />
|
||||
<result property="usedSpace" column="used_space" />
|
||||
<result property="healthStatus" column="health_status" />
|
||||
<result property="healthScore" column="health_score" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@@ -43,7 +44,7 @@
|
||||
</select>
|
||||
<select id="selectInitialDiskInfoListByCondition" parameterType="InitialDiskInfo" resultMap="InitialDiskInfoResult">
|
||||
select id, client_id, name, serial, total, write_speed, read_speed, write_times, read_times, write_bytes,
|
||||
read_bytes, type, used_space,health_status, create_by, update_by, create_time, update_time
|
||||
read_bytes, type, used_space,health_status, health_score, create_by, update_by, create_time, update_time
|
||||
from ${tableName}
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
@@ -156,6 +157,7 @@
|
||||
type,
|
||||
used_space,
|
||||
health_status,
|
||||
health_score,
|
||||
create_by,
|
||||
update_by,
|
||||
create_time,
|
||||
@@ -178,6 +180,7 @@
|
||||
#{item.type},
|
||||
#{item.usedSpace},
|
||||
#{item.healthStatus},
|
||||
#{item.healthScore},
|
||||
#{item.createBy},
|
||||
#{item.updateBy},
|
||||
<choose>
|
||||
@@ -202,7 +205,7 @@
|
||||
|
||||
<select id="getDistDetailsMsgByClientId" parameterType="InitialDiskInfo" resultMap="InitialDiskInfoResult">
|
||||
select id, client_id, name, serial, total, write_speed, read_speed, write_times, read_times, write_bytes,
|
||||
read_bytes, type, used_space,health_status, create_by, update_by, create_time, update_time
|
||||
read_bytes, type, used_space,health_status, health_score, create_by, update_by, create_time, update_time
|
||||
from ${tableName}
|
||||
where client_id = #{clientId} and `name`= #{name}
|
||||
order by create_time desc
|
||||
|
||||
Reference in New Issue
Block a user