From a4077d90d300cf50c563f44953ed84322c5d5ff2 Mon Sep 17 00:00:00 2001 From: weicd <weicd@yhzhg.cn> Date: Tue, 21 Nov 2023 03:48:54 +0000 Subject: [PATCH] 加验证 --- eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskRepository.java | 23 +++++++++++++++++++++++ 1 files changed, 23 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 7e7614d..af4ddda 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 @@ -47,4 +47,27 @@ @Query(value = "SELECT COALESCE(SUM(plan_hours), 0.0) AS planHours, COALESCE(sum(plan_workload), 0.0) as planWorkload FROM task WHERE project_id = ?1", nativeQuery = true) TaskInterface collectByProjectId(Long projectId); + + /** + * 根据项目ID删除 + * @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