From 85d7d8d3444dd931190603349cd4d961a9fd9114 Mon Sep 17 00:00:00 2001
From: YH-zlh <zhaolh@yhzhg.cn>
Date: Wed, 06 Sep 2023 03:21:48 +0000
Subject: [PATCH] 新工资管理
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 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 b4a513d..584799a 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查询任务日报信息
@@ -216,4 +225,11 @@
* @return
*/
List<TaskDaliy> findByProjectId(Long projectId);
+
+ /**
+ * 根据项目ID查询
+ * @param projectId
+ * @return
+ */
+ List<TaskDaliy> findByProjectIdAndTaskId(Long projectId, Long id);
}
\ No newline at end of file
--
Gitblit v1.9.3