Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/develop #85

Merged
merged 9 commits into from
Aug 14, 2024
Merged

Feat/develop #85

merged 9 commits into from
Aug 14, 2024

Conversation

csh-scl
Copy link
Contributor

@csh-scl csh-scl commented Aug 13, 2024

✏️ 작업 개요

페이징 오류 해결, menuId 추가 반환, 메뉴 검색 조건 삭제

⛳ 작업 분류

  • 페이징 오류 해결
  • Get /menu menuId 추가 반환
  • 메뉴 검색 파라미터 삭제

🔨 작업 상세 내용

  1. 페이징 오류 해결, menuId 추가 반환, 메뉴 검색 조건 삭제 하였습니다.

💡 생각해볼 문제

  • 생각해볼 내용을 적습니다

Copy link

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 77bfed7.

Comment on lines +61 to +73
@Query("SELECT m FROM Menu m WHERE m.id IN (" +
"SELECT MIN(m2.id) FROM Menu m2 " +
"JOIN m2.place p " +
"LEFT JOIN m2.images mi " +
"JOIN m2.tags mt " +
"JOIN mt.tag t " +
"WHERE m.user.id = :userId " +
"AND (:title IS NULL OR m.title LIKE %:title%) " +
"AND (:menuFolderId IS NULL OR m.menuList.id = :menuFolderId) " +
"AND (:minPrice IS NULL OR m.price >= :minPrice) " + // 최소 가격 조건
"AND (:maxPrice IS NULL OR m.price <= :maxPrice) " + // 최대 가격 조건
"AND (:tags IS NULL OR t.name IN :tags) " + // 태그 조건
"GROUP BY m.id " +
"HAVING (:tagCount IS NULL OR COUNT(DISTINCT t.name) = :tagCount) " + // tagCount가 null인 경우 조건 무시
"ORDER BY m.groupId ASC")
// groupId를 기준으로 오름차순 정렬
Page<Menu> findingMenusByCriteria2(@Param("title") String title,
@Param("tags") String[] tags, // 태그 배열
@Param("tagCount") Integer tagCount, // 태그 개수
"WHERE m2.user.id = :userId " +
// "AND (:title IS NULL OR m2.title LIKE %:title%) " +
"AND (:tags IS NULL OR (t.name IN :tags AND SIZE(m2.tags) = :tagCount)) " + // 태그 배열 조건
"AND (:menuFolderId IS NULL OR m2.menuList.id = :menuFolderId) " +
"AND (:minPrice IS NULL OR m2.price >= :minPrice) " + // 최소 가격 조건
"AND (:maxPrice IS NULL OR m2.price <= :maxPrice) " + // 최대 가격 조건
"GROUP BY m2.groupId)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙇‍♂️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

@david-parkk david-parkk merged commit 9ed5c6a into main Aug 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants