yaozc2021
2025-04-25 c19eda1fb09764cfa1ae134bda39efd9507784aa
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java
@@ -232,4 +232,13 @@
     * @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);
}