From 26bd928e012649913e16292462438c7bd86fb5fa Mon Sep 17 00:00:00 2001 From: e2guana Date: Sun, 14 Dec 2025 22:16:49 +0900 Subject: [PATCH 1/2] =?UTF-8?q?itemrepository=20=EC=BF=BC=EB=A6=AC?= =?UTF-8?q?=EB=AC=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../item/repository/ItemRepository.java | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/salemale/domain/item/repository/ItemRepository.java b/src/main/java/com/salemale/domain/item/repository/ItemRepository.java index 4d851a6..62693b3 100644 --- a/src/main/java/com/salemale/domain/item/repository/ItemRepository.java +++ b/src/main/java/com/salemale/domain/item/repository/ItemRepository.java @@ -60,12 +60,12 @@ List findByEndTimeBeforeAndItemStatus( WHERE i.item_type = 'AUCTION' AND i.item_status = CAST(:status AS varchar) AND ( - :me IS NULL OR i.seller NOT IN ( - SELECT bl.blocked - FROM BlockList bl - WHERE bl.blocker.id = :me + :me IS NULL OR i.seller_id NOT IN ( + SELECT bl.blocked_user_id + FROM block_list bl + WHERE bl.blocker_id = :me ) - ) + ) AND ( 6371 * acos( LEAST(1, GREATEST(-1, @@ -84,11 +84,11 @@ SELECT count(1) WHERE i.item_type = 'AUCTION' AND i.item_status = CAST(:status AS varchar) AND ( - :me IS NULL OR i.seller NOT IN ( - SELECT bl.blocked - FROM BlockList bl - WHERE bl.blocker.id = :me - ) + :me IS NULL OR i.seller_id NOT IN ( + SELECT bl.blocked_user_id + FROM block_list bl + WHERE bl.blocker_id = :me + ) ) AND ( 6371 * acos( @@ -118,12 +118,12 @@ Page findNearbyItems( WHERE i.itemType = com.salemale.global.common.enums.ItemType.AUCTION AND i.itemStatus = :status AND ( - :me IS NULL OR i.seller NOT IN ( - SELECT bl.blocked - FROM BlockList bl - WHERE bl.blocker.id = :me - ) - ) + :me IS NULL OR i.seller_id NOT IN ( + SELECT bl.blocked_user_id + FROM block_list bl + WHERE bl.blocker_id = :me + ) + ) AND ( LOWER(i.title) LIKE LOWER(CONCAT('%', :keyword, '%')) OR LOWER(i.name) LIKE LOWER(CONCAT('%', :keyword, '%')) @@ -148,12 +148,12 @@ Page searchItemsByKeyword( WHERE i.itemType = com.salemale.global.common.enums.ItemType.AUCTION AND i.itemStatus = :status AND ( - :me IS NULL OR i.seller NOT IN ( - SELECT bl.blocked - FROM BlockList bl - WHERE bl.blocker.id = :me - ) - ) + :me IS NULL OR i.seller_id NOT IN ( + SELECT bl.blocked_user_id + FROM block_list bl + WHERE bl.blocker_id = :me + ) + ) AND ( LOWER(i.title) LIKE LOWER(CONCAT('%', :keyword, '%')) OR LOWER(i.name) LIKE LOWER(CONCAT('%', :keyword, '%')) @@ -191,12 +191,12 @@ Page searchItemsByKeywordWithFilters( WHERE i.itemType = com.salemale.global.common.enums.ItemType.AUCTION AND i.itemStatus = :status AND ( - :me IS NULL OR i.seller NOT IN ( - SELECT bl.blocked - FROM BlockList bl - WHERE bl.blocker.id = :me + :me IS NULL OR i.seller_id NOT IN ( + SELECT bl.blocked_user_id + FROM block_list bl + WHERE bl.blocker_id = :me ) - ) + ) AND (:categories IS NULL OR i.category IN :categories) AND (:minPrice IS NULL OR i.currentPrice >= :minPrice) AND (:maxPrice IS NULL OR i.currentPrice <= :maxPrice) @@ -228,12 +228,12 @@ Page searchItemsByFiltersOnly( WHERE i.item_type = 'AUCTION' AND i.item_status = CAST(:status AS varchar) AND ( - :me IS NULL OR i.seller NOT IN ( - SELECT bl.blocked - FROM BlockList bl - WHERE bl.blocker.id = :me - ) - ) + :me IS NULL OR i.seller_id NOT IN ( + SELECT bl.blocked_user_id + FROM block_list bl + WHERE bl.blocker_id = :me + ) + ) AND ( LOWER(i.title) LIKE LOWER(CONCAT('%', :keyword, '%')) OR LOWER(i.name) LIKE LOWER(CONCAT('%', :keyword, '%')) @@ -256,12 +256,12 @@ SELECT count(1) WHERE i.item_type = 'AUCTION' AND i.item_status = CAST(:status AS varchar) AND ( - :me IS NULL OR i.seller NOT IN ( - SELECT bl.blocked - FROM BlockList bl - WHERE bl.blocker.id = :me + :me IS NULL OR i.seller_id NOT IN ( + SELECT bl.blocked_user_id + FROM block_list bl + WHERE bl.blocker_id = :me ) - ) + g) AND ( LOWER(i.title) LIKE LOWER(CONCAT('%', :keyword, '%')) OR LOWER(i.name) LIKE LOWER(CONCAT('%', :keyword, '%')) From e96460331d8a0c190e570242d665239bb76e499d Mon Sep 17 00:00:00 2001 From: e2guana <165550477+e2guana@users.noreply.github.com> Date: Sun, 14 Dec 2025 22:24:00 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/salemale/domain/item/repository/ItemRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/salemale/domain/item/repository/ItemRepository.java b/src/main/java/com/salemale/domain/item/repository/ItemRepository.java index 62693b3..0c96778 100644 --- a/src/main/java/com/salemale/domain/item/repository/ItemRepository.java +++ b/src/main/java/com/salemale/domain/item/repository/ItemRepository.java @@ -261,7 +261,7 @@ SELECT count(1) FROM block_list bl WHERE bl.blocker_id = :me ) - g) + ) AND ( LOWER(i.title) LIKE LOWER(CONCAT('%', :keyword, '%')) OR LOWER(i.name) LIKE LOWER(CONCAT('%', :keyword, '%')) @@ -317,4 +317,4 @@ List findByEndTimeBetweenAndItemStatus( LocalDateTime end, ItemStatus status ); -} \ No newline at end of file +}