Skip to content

Commit

Permalink
fix: modify jpql
Browse files Browse the repository at this point in the history
  • Loading branch information
aiaiaiai1 committed Jul 10, 2024
1 parent fe06286 commit ce53ed7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/gymmi/repository/WorkspaceRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ default Workspace getWorkspaceById(Long id) {
"limit 10 offset :pageNumber", nativeQuery = true)
List<Workspace> getJoinedWorkspacesByUserIdOrderBy_(Long userId, int pageNumber);

@Query("select count(*) from Workspace w where w.status = 'PREPARING' or w.status = 'IN_PROGRESS'")
@Query("select count(*) from Workspace ws join Worker w on ws.id = w.workspace.id " +
"where ws.status = 'PREPARING' or ws.status = 'IN_PROGRESS' " +
"and w.user.id = :userId")
int getCountsOfJoinedWorkspacesWhereStatusIsPreparingOrInProgress(Long userId);


Expand Down

0 comments on commit ce53ed7

Please sign in to comment.