fix: 修复多个 null 参数和空集合问题

1. EditReviewRepository - reviewedAt null 参数问题
   - PENDING 状态时 reviewedAt 为 null
   - 修复:null 时不在 SET 语句中包含该字段

2. KnowledgeItemApplicationService - 空 IN 子句问题
   - getKnowledgeManagementStatistics() 未检查空集合
   - 导致 WHERE id IN () MySQL 语法错误
   - 修复:添加空集合检查,提前返回零计数

验证:
- 其他 Neo4j 操作已正确处理 null 参数
- 其他 listByIds/removeByIds 调用已有保护
This commit is contained in:
2026-02-23 18:03:57 +08:00
parent e62a8369d4
commit ca37bc5a3b
2 changed files with 15 additions and 3 deletions

View File

@@ -266,6 +266,12 @@ public class KnowledgeItemApplicationService {
response.setTotalKnowledgeSets(totalSets);
List<String> accessibleSetIds = knowledgeSetRepository.listSetIdsByCriteria(baseQuery, ownerFilterUserId, excludeConfidential);
if (CollectionUtils.isEmpty(accessibleSetIds)) {
response.setTotalFiles(0L);
response.setTotalSize(0L);
response.setTotalTags(0L);
return response;
}
List<KnowledgeSet> accessibleSets = knowledgeSetRepository.listByIds(accessibleSetIds);
if (CollectionUtils.isEmpty(accessibleSets)) {
response.setTotalFiles(0L);