Skip to content

Commit

Permalink
Merge pull request #128 from moidot/feat/participate_add_isStartVote
Browse files Browse the repository at this point in the history
chore : 사용되지 않는 query 제거
  • Loading branch information
1000kkannoo authored May 24, 2024
2 parents 41f5160 + ef0d6e5 commit f3d7895
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
package com.moim.backend.domain.hotplace.repository;

import com.moim.backend.domain.hotplace.entity.HotPlace;
import com.moim.backend.domain.subway.response.BestPlaceInterface;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface HotPlaceRepository extends JpaRepository<HotPlace, Long>, HotPlaceCustomRepository {

@Query(value = "select name, latitude, longitude, "
+ "ST_DISTANCE_SPHERE(POINT(longitude, latitude), POINT(:middleLongitude, :middleLatitude)) AS distanceFromMiddlePoint "
+ "from hot_place "
+ "having distanceFromMiddlePoint <= :validRange "
+ "order by distanceFromMiddlePoint "
+ "limit 3 ", nativeQuery = true)
List<BestPlaceInterface> getBestHotPlaceList(
@Param("middleLatitude") double middleLatit록ude, @Param("middleLongitude") double middleLongitude, @Param("validRange") double validRange
);

}

0 comments on commit f3d7895

Please sign in to comment.