| | |
| | | |
| | | import me.zhengjie.modules.task.domain.TaskDaliy; |
| | | import me.zhengjie.modules.task.domain.TaskDaliyCollectInterface; |
| | | import me.zhengjie.modules.task.domain.TaskDaliyCostGroupByUserInterface; |
| | | |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | |
| | | TaskDaliy findNextByProjectIdAndTaskIdAndAndUserId(Long projectId, Long taskId, Long userId, Timestamp 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) |
| | | @Query(value = "SELECT COALESCE(avg(task_progress), 0.0) as taskProgress, COALESCE(sum(consumed_workload), 0.0) as consumedWorkload, COALESCE(sum(consumed_hours), 0.0) as consumedHours FROM task_daliy WHERE task_id = ?1 AND create_time < ?2", nativeQuery = true) |
| | | TaskDaliyCollectInterface collectTaskDaliyUntilDate(Long taskId, Date belongDate); |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | List<TaskDaliy> findByProjectIdAndTaskId(Long projectId, Long taskId); |
| | | |
| | | /** |
| | | * 根据项目ID查询任务日报信息 |
| | | * @param projectId |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT * FROM task_daliy WHERE project_id = ?1 ORDER BY user_id, fill_date ASC", nativeQuery = true) |
| | | List<TaskDaliy> findByProjectId(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) |
| | | List<TaskDaliyCostGroupByUserInterface> collectCostByProjectIdGroupUser(Long projectId); |
| | | } |