Skip to content

Commit

Permalink
Merge pull request #164 from UMC-WOWMARKET/feat/home
Browse files Browse the repository at this point in the history
[refactor] 메인페이지 승인 여부 반영 #158
  • Loading branch information
yoonsseo authored Jan 11, 2024
2 parents 0f5a887 + 112b3cf commit 6914f42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@ public interface DemandProjectRepository extends JpaRepository<DemandProject, Lo
@Query("SELECT dp FROM DemandProject dp " +
"WHERE dp.isEnd = false " +
"AND dp.startDate <= :currentDate AND dp.endDate >= :currentDate " +
"AND dp.user.univ = :userUniv")
"AND dp.user.univ = :userUniv AND dp.permission = 'APPROVED'")
Page<DemandProject> findByUserUniv(@Param("currentDate") LocalDateTime currentDate, @Param("userUniv") String userUniv, Pageable pageable);

@Query("SELECT dp FROM DemandProject dp WHERE dp.isEnd = false " +
"AND dp.startDate <= :currentDate AND dp.endDate >= :currentDate")
"AND dp.startDate <= :currentDate AND dp.endDate >= :currentDate " +
"AND dp.permission = 'APPROVED'")
Page<DemandProject> findAllNotEnd(@Param("currentDate") LocalDateTime currentDate, Pageable pageable);

@Query("SELECT dp FROM DemandProject dp " +
"WHERE dp.isEnd = false " +
"AND dp.startDate <= :currentDate AND dp.endDate >= :currentDate " +
"AND dp.projectName LIKE CONCAT('%', :search, '%') " +
"AND dp.user.univ = :userUniv")
"AND dp.user.univ = :userUniv AND dp.permission = 'APPROVED'")
Page<DemandProject> findBySearchUserUniv(@Param("currentDate") LocalDateTime currentDate, @Param("search") String search,
@Param("userUniv") String userUniv, Pageable pageable);

@Query("SELECT dp FROM DemandProject dp " +
"WHERE dp.isEnd = false " +
"AND dp.startDate <= :currentDate AND dp.endDate >= :currentDate " +
"AND dp.projectName LIKE CONCAT('%', :search, '%')")
"AND dp.projectName LIKE CONCAT('%', :search, '%') AND dp.permission = 'APPROVED'")
Page<DemandProject> findBySearch(@Param("currentDate") LocalDateTime currentDate, @Param("search") String search, Pageable pageable);

Page<DemandProject> findDemandProjectByUser_Id(Long seller_id, Pageable pageable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,27 @@ public interface ProjectRepository extends JpaRepository<Project, Long> {
@Query("SELECT p FROM Project p " +
"WHERE p.isDel = false AND p.isEnd = false " +
"AND p.startDate <= :currentDate AND p.endDate >= :currentDate " +
"AND p.user.univ = :userUniv")
"AND p.user.univ = :userUniv AND p.permission = 'APPROVED'")
Page<Project> findByUserUniv(@Param("userUniv") String userUniv, @Param("currentDate") LocalDateTime currentDate, Pageable pageable);

@Query("SELECT p FROM Project p WHERE p.isDel = false AND p.isEnd = false " +
"AND p.startDate <= :currentDate AND p.endDate >= :currentDate")
"AND p.startDate <= :currentDate AND p.endDate >= :currentDate " +
"AND p.permission = 'APPROVED'")
Page<Project> findAllNotDelNotEnd(@Param("currentDate") LocalDateTime currentDate, Pageable pageable);

@Query("SELECT p FROM Project p " +
"WHERE p.isDel = false AND p.isEnd = false " +
"AND p.startDate <= :currentDate AND p.endDate >= :currentDate " +
"AND p.projectName LIKE CONCAT('%', :search, '%') " +
"AND p.user.univ = :userUniv")
"AND p.user.univ = :userUniv AND p.permission = 'APPROVED'")
Page<Project> findBySearchUserUniv(@Param("currentDate") LocalDateTime currentDate, @Param("search") String search,
@Param("userUniv") String userUniv, Pageable pageable);

@Query("SELECT p FROM Project p " +
"WHERE p.isDel = false AND p.isEnd = false " +
"AND p.startDate <= :currentDate AND p.endDate >= :currentDate " +
"AND p.projectName LIKE CONCAT('%', :search, '%')")
"AND p.projectName LIKE CONCAT('%', :search, '%') " +
"AND p.permission = 'APPROVED'")
Page<Project> findBySearch(@Param("currentDate") LocalDateTime currentDate, @Param("search") String search, Pageable pageable);

Page<Project> findByUser_Id(Long sellerId, Pageable pageable);
Expand Down

0 comments on commit 6914f42

Please sign in to comment.