赵士淞
2023-02-01 dc0407022ca3242e9b4e9c734aca77153dbe228c
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskRepository.java
@@ -16,11 +16,12 @@
package me.zhengjie.modules.task.repository;
import me.zhengjie.modules.task.domain.Task;
import me.zhengjie.modules.task.domain.TaskInterface;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.Date;
import java.util.List;
/**
@@ -44,6 +45,6 @@
     */
   List<Task> findByProjectId(Long id);
   @Query(value = "SELECT * FROM task WHERE project_id = ?1 AND create_time < ?2", nativeQuery = true)
   List<Task> findByProjectIdUntilDate(Long projectId, Date belongDate);
   @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);
}