From c5dfc09145e4e10f99dbf388a4a1433b5c2973e5 Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Tue, 10 Nov 2026 01:40:38 +0000
Subject: [PATCH] 适应高版本Nodejs对应修改(二)
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskRepository.java | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskRepository.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskRepository.java
index ec7df1f..39d229b 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskRepository.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskRepository.java
@@ -53,4 +53,22 @@
* @param projectId
*/
void deleteByProjectId(Long projectId);
+
+ /**
+ * 根据项目ID查询分组工时
+ * @param projectId
+ * @return
+ */
+ @Query(value = "SELECT t.id AS taskId, t.plan_hours AS planHours, p.id AS projectId, p.project_distinguish AS projectDistinguish FROM task t LEFT JOIN project p ON t.project_id = p.id WHERE t.project_id IN (?1)", nativeQuery = true)
+ List<TaskInterface> findSubgroupWorkingHoursByProjectId(List<Long> projectId);
+
+
+ /**
+ * 根据项目ID查询总工时
+ * @param projectId
+ * @return
+ */
+ @Query(value = "SELECT COALESCE(SUM(plan_hours), 0.0) FROM task WHERE project_id IN (?1)", nativeQuery = true)
+ Double sumWorkingHoursByProjectId(List<Long> projectId);
+
}
\ No newline at end of file
--
Gitblit v1.9.3