fix:数据总览,空文件夹过滤

This commit is contained in:
2026-03-31 16:39:04 +08:00
parent b36770e087
commit b43a826fad

View File

@@ -25,8 +25,10 @@
<select id="listSimulationNodeFiles" resultType="com.sdm.data.model.entity.FileMetadataInfo">
SELECT DISTINCT tmp.*
FROM (
<!-- 第一个子查询:文件(必执行) -->
SELECT distinct file_metadata_info.*
SELECT file_metadata_info.*
FROM file_metadata_info
<where>
<if test="parentIds != null and parentIds.size() > 0">
@@ -36,7 +38,7 @@
</foreach>
)
</if>
and tenantId = #{tenantId}
AND tenantId = #{tenantId}
AND dataType = 2
AND isLatest = true
AND deletedAt IS NULL
@@ -45,7 +47,6 @@
<!-- 动态判断uuids 不为空且有元素时,才拼接 UNION ALL + 第二个子查询:普通文件夹和节点文件夹 -->
<if test="fileIds != null and fileIds.size() > 0">
UNION ALL
(
SELECT file_metadata_info.*
FROM file_metadata_info
<if test="filterEmptyData != null and filterEmptyData">
@@ -53,8 +54,7 @@
</if>
<where>
file_metadata_info.tenantId = #{tenantId}
and
file_metadata_info.id IN (
AND file_metadata_info.id IN (
<foreach collection="fileIds" item="fileId" separator=",">
#{fileId}
</foreach>
@@ -65,10 +65,8 @@
AND file_storage.fileId IS NOT NULL
</if>
</where>
)
</if>
<!-- 排序:无论是否联合,都对最终结果排序 -->
) tmp
ORDER BY dataType ASC, updateTime DESC
</select>
</mapper>