修复磁盘NPE

This commit is contained in:
gaoyutao
2026-01-30 21:21:48 +08:00
parent f75a49474a
commit 180986ba16
3 changed files with 27 additions and 13 deletions
@@ -214,7 +214,7 @@
group by name
</select>
<select id="getDiskTotal" parameterType="InitialDiskInfo" resultMap="InitialDiskInfoResult">
select sum(t2.total) as total
select sum(IFNULL(t2.total,0)) as total
from ${tableName} t2
inner join (
select client_id, type, max(create_time) as latest_time
@@ -225,7 +225,7 @@
and t2.create_time = t1.latest_time
</select>
<select id="sumDistInfoByCondition" parameterType="InitialDiskInfo" resultMap="InitialDiskInfoResult">
select sum(used_space) used_space,create_time
select SUM(IFNULL(used_space, 0)) AS used_space,create_time
from ${tableName}
<where>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>