| | |
| | | package me.zhengjie.modules.project.repository; |
| | | |
| | | import me.zhengjie.modules.project.domain.ProjectProgress; |
| | | |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | | import org.springframework.data.jpa.repository.Query; |
| | | |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | |
| | | * @return |
| | | */ |
| | | List<ProjectProgress> findByBelongYearAndBelongWeekAndProjectIdIn(Integer belongYear, Integer belongWeek, List<Long> projectIds); |
| | | |
| | | @Query(value = "SELECT * FROM project_progress WHERE project_id = ?1 ORDER BY belong_year, belong_week DESC LIMIT 2", nativeQuery = true) |
| | | List<ProjectProgress> findLastWeekReport(Long projectId); |
| | | |
| | | Optional<ProjectProgress> findByBelongYearAndBelongWeekAndProjectId(int year, int weeks, Long projectId); |
| | | |
| | | |
| | | @Query(value = "SELECT distinct belong_year FROM project_progress", nativeQuery = true) |
| | | List<Integer> findAllBelongYear(); |
| | | |
| | | @Query(value = "SELECT distinct belong_week FROM project_progress WHERE belong_year = ?1", nativeQuery = true) |
| | | List<Integer> findAllBelongWeekByBelongYear(Integer year); |
| | | } |