liujie
2026-04-01 4b33796be3887c81fa40fba2f55dce4489cff041
admin-server/src/main/java/com/estate/expert/admin/domain/exam/record/warning/WarningRecordRepository.java
@@ -24,6 +24,18 @@
            "order by w.updateTime desc")
    List<WarningRecord> list(Integer checkTaskId);
    @Query("select w.problem.id, count(w) from WarningRecord w " +
            "where w.deleted = false " +
            "and w.device is null " +
            "and w.problem is not null " +
            "and w.problem.id in :problemIds " +
            "and w.checkTask.project.id = :projectId " +
            "and w.checkTask.state in :taskStates " +
            "group by w.problem.id")
    List<Object[]> countSystemWarningsByProjectAndProblemIds(@Param("projectId") Integer projectId,
                                                            @Param("taskStates") List<com.estate.expert.admin.domain.exam.task.check.CheckTaskState> taskStates,
                                                            @Param("problemIds") List<Integer> problemIds);
    @Query("select w from WarningRecord w where ( :clientId is null or w.checkTask.project.client.id = :clientId) " +
            "and ( :planId is null or w.checkTask.plan.id = :planId) " +
            "and ( :taskId is null or w.checkTask.id = :taskId) " +
@@ -50,4 +62,4 @@
                             @Param("taskId") Integer taskId,
                             @Param("startDate") LocalDateTime startDate,
                             @Param("endDate") LocalDateTime endDate);
}
}