From 6754df3c4faf22d426d45d1c4995c865cab686de Mon Sep 17 00:00:00 2001
From: weicd <weicd@yhzhg.cn>
Date: Mon, 20 Feb 2023 02:45:16 +0000
Subject: [PATCH] 流水相关
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java | 39 +++++++++++++++++++++++++++++++++------
1 files changed, 33 insertions(+), 6 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 065e294..47332ff 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
@@ -74,12 +74,12 @@
Double findSumConsumedWorkloadByProjectIdAndTaskId(Long projectId, Long taskId);
/**
- * 根据项目ID、任务ID查询
+ * 根据项目ID、任务ID、用户ID查询
* @param projectId
* @param taskId
* @return
*/
- List<TaskDaliy> findByProjectIdAndTaskId(Long projectId, Long taskId);
+ List<TaskDaliy> findByProjectIdAndTaskIdAndUserId(Long projectId, Long taskId, Long userId);
/**
* 根据项目ID查询任务日报信息
@@ -106,9 +106,16 @@
List<TaskDailyInterface> collectByProjectIdAndFillDateLessThanGroupByUserIdAndFillDate(Long projectId, Timestamp fillDate);
/**
+ * 根据项目ID查询任务日报信息
+ * @param projectId
+ * @return
+ */
+ @Query(value = "SELECT user_id AS userId, fill_date AS fillDate, COALESCE(SUM(consumed_hours), 0) AS consumedHours FROM task_daliy WHERE project_id = ?1 GROUP BY user_id, fill_date", nativeQuery = true)
+ List<TaskDailyInterface> collectByProjectIdGroupByUserIdAndFillDate(Long projectId);
+
+ /**
* 根据项目ID、任务ID查询
* @param projectId
- * @param taskId
* @return
*/
@Query(value = "SELECT user_id AS userId, COALESCE(SUM(consumed_hours), 0) AS consumedHours FROM task_daliy WHERE project_id = ?1 GROUP BY user_id", nativeQuery = true)
@@ -117,11 +124,10 @@
/**
* 根据项目ID、任务ID查询
* @param projectId
- * @param taskId
* @return
*/
- @Query(value = "SELECT user_id AS userId, task_id AS taskId, COALESCE(MAX(task_progress), 0) AS taskProgress FROM task_daliy WHERE project_id = ?1 AND fill_date BETWEEN ?2 AND ?3 GROUP BY user_id, task_id", nativeQuery = true)
- List<TaskDailyInterface> collectCostByProjectIdAndFillDateBetweenGroupUserAndTaskId(Long projectId, Timestamp sdate, Timestamp edate);
+ @Query(value = "SELECT user_id AS userId, task_id AS taskId, COALESCE(MAX(task_progress), 0) AS taskProgress FROM task_daliy WHERE project_id = ?1 AND fill_date <= ?2 GROUP BY user_id, task_id", nativeQuery = true)
+ List<TaskDailyInterface> collectCostByProjectIdAndFillDateLessThanGroupUserAndTaskId(Long projectId, Timestamp edate);
/**
@@ -143,4 +149,25 @@
*/
@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)
List<TaskDaliy> findAllByUserAndDate(Long userId, LocalDate startDate, LocalDate endDate);
+
+ /**
+ * 根据用户ID查询参与的项目ID
+ * @param userId
+ * @return
+ */
+ @Query(value = "SELECT DISTINCT(project_id) FROM task_user WHERE user_id = ?1", nativeQuery = true)
+ List<Long> findProjectIdByUserId(Long userId);
+
+ /**
+ * 根据项目ID删除
+ * @param projectId
+ */
+ void deleteByProjectId(Long projectId);
+
+ /**
+ * 根据项目ID查询
+ * @param projectId
+ * @return
+ */
+ List<TaskDaliy> findByProjectId(Long projectId);
}
\ No newline at end of file
--
Gitblit v1.9.3