-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feat/develop #85
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…into feat/develop
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit 77bfed7. |
david-parkk
approved these changes
Aug 13, 2024
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)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✏️ 작업 개요
페이징 오류 해결, menuId 추가 반환, 메뉴 검색 조건 삭제
⛳ 작업 분류
🔨 작업 상세 내용
💡 생각해볼 문제