From 4d730af0447c686133130d0116a0fa3dd82c2dca Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Tue, 10 Nov 2026 01:41:03 +0000
Subject: [PATCH] Merge branch 'wcd-2411-update' into wcd
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java | 43 ++++++++++++++++++++++++++++++++++---------
1 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java
index 1d7ea44..90875f3 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java
@@ -15,17 +15,18 @@
*/
package me.zhengjie.modules.task.repository;
-import me.zhengjie.modules.task.domain.TaskDailyInterface;
-import me.zhengjie.modules.task.domain.TaskDaliy;
+import java.sql.Timestamp;
+import java.time.LocalDate;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
-import java.sql.Timestamp;
-import java.time.LocalDate;
-import java.util.List;
-import java.util.Map;
+import me.zhengjie.modules.task.domain.TaskDailyInterface;
+import me.zhengjie.modules.task.domain.TaskDaliy;
/**
* @website https://eladmin.vip
@@ -40,7 +41,7 @@
* @return
*/
@Query(value = "SELECT * FROM task_daliy WHERE project_id = ?1 AND task_id = ?2 AND user_id = ?3 AND fill_date < ?4 ORDER BY fill_date DESC LIMIT 1", nativeQuery = true)
- TaskDaliy findPreviousByProjectIdAndTaskIdAndAndUserId(Long projectId, Long taskId, Long userId, Timestamp fillDate);
+ TaskDaliy findPreviousByProjectIdAndTaskIdAndAndUserId(Long projectId, Long taskId, Long userId, Date fillDate);
/**
* 根据项目ID、任务ID、用户ID查询填报日期后最近的任务日报信息
@@ -48,7 +49,7 @@
* @return
*/
@Query(value = "SELECT * FROM task_daliy WHERE project_id = ?1 AND task_id = ?2 AND user_id = ?3 AND fill_date > ?4 ORDER BY fill_date ASC LIMIT 1", nativeQuery = true)
- TaskDaliy findNextByProjectIdAndTaskIdAndAndUserId(Long projectId, Long taskId, Long userId, Timestamp fillDate);
+ TaskDaliy findNextByProjectIdAndTaskIdAndAndUserId(Long projectId, Long taskId, Long userId, Date fillDate);
// @Query(value = "SELECT avg(task_progress) as taskProgress, COALESCE(sum(consumed_workload), 0.0) as consumedWorkload, sum(consumed_hours) as consumedHours FROM task_daliy WHERE task_id = ?1 AND create_time < ?2", nativeQuery = true)
@@ -96,6 +97,14 @@
* @return
*/
List<TaskDaliy> findByProjectIdAndTaskIdAndUserId(Long projectId, Long taskId, Long userId);
+
+ /**
+ * 根据项目ID、任务ID、用户ID查询
+ * @param projectId
+ * @param taskId
+ * @return
+ */
+ List<TaskDaliy> findByProjectIdAndTaskIdAndUserIdOrderByFillDateDesc(Long projectId, Long taskId, Long userId);
/**
* 根据项目ID查询任务日报信息
@@ -193,7 +202,7 @@
* @param endDate
* @return
*/
- @Query(value = "SELECT id,project_id,task_id,user_id,fill_date,consumed_workload,task_progress,settlement_status,SUM( consumed_hours ) AS consumed_hours,remarks,create_by,create_time,update_by,update_time from task_daliy where user_id = ?1 and fill_date <= ?3 and fill_date >= ?2 group by fill_date", nativeQuery = true)
+ @Query(value = "SELECT id,project_id,task_id,task_inner_id,user_id,fill_date,consumed_workload,task_progress,settlement_status,SUM( consumed_hours ) AS consumed_hours,remarks,create_by,create_time,update_by,update_time from task_daliy where user_id = ?1 and fill_date <= ?3 and fill_date >= ?2 group by fill_date", nativeQuery = true)
List<TaskDaliy> findAllByUserAndDate(Long userId, LocalDate startDate, LocalDate endDate); // TODO
/**
@@ -216,4 +225,20 @@
* @return
*/
List<TaskDaliy> findByProjectId(Long projectId);
+
+ /**
+ * 根据项目ID查询
+ * @param projectId
+ * @return
+ */
+ List<TaskDaliy> findByProjectIdAndTaskId(Long projectId, Long id);
+
+
+ @Query(value = "select DISTINCT user_id from task_daliy where task_id = ?1",nativeQuery = true)
+ List<Long> findByTaskId(Long taskId);
+
+ List<TaskDaliy> findByTaskIdAndUserId(Long taskId, Long userId);
+
+ @Query(value = "select COALESCE(SUM(td.consumed_hours), 0) AS consumedHours, project_id as projectId, user_id as userId from task_daliy where fill_date <= ?2 and fill_date >= ?1 group by project_id, user_id order by user_id",nativeQuery = true)
+ List<Map> calcTotalConsumedHours(LocalDate startDate, LocalDate endDate);
}
\ No newline at end of file
--
Gitblit v1.9.3