diff --git a/src/main/java/com/ssafy/tott/housegeo/data/cond/HouseGeoFilterCond.java b/src/main/java/com/ssafy/tott/housegeo/data/cond/HouseGeoFilterCond.java new file mode 100644 index 0000000..28d32fe --- /dev/null +++ b/src/main/java/com/ssafy/tott/housegeo/data/cond/HouseGeoFilterCond.java @@ -0,0 +1,20 @@ +package com.ssafy.tott.housegeo.data.cond; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.List; + +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +public class HouseGeoFilterCond { + private String district; + private String legalDong; + private int minPrice; + private int maxPrice; + private int minArea; + private int maxArea; + private List type; + private int buildingYear; +} diff --git a/src/main/java/com/ssafy/tott/housegeo/domain/HouseGeoRepository.java b/src/main/java/com/ssafy/tott/housegeo/domain/HouseGeoRepository.java index ca0589f..3a60b59 100644 --- a/src/main/java/com/ssafy/tott/housegeo/domain/HouseGeoRepository.java +++ b/src/main/java/com/ssafy/tott/housegeo/domain/HouseGeoRepository.java @@ -1,9 +1,10 @@ package com.ssafy.tott.housegeo.domain; +import com.ssafy.tott.housegeo.domain.query.HouseGeoRepositoryCustom; import org.springframework.data.jpa.repository.JpaRepository; import java.util.Optional; -public interface HouseGeoRepository extends JpaRepository { +public interface HouseGeoRepository extends JpaRepository, HouseGeoRepositoryCustom { Optional findByMainNumberAndSubNumber(int mainNumber, int subNumber); } diff --git a/src/main/java/com/ssafy/tott/housegeo/domain/query/HouseGeoRepositoryCustom.java b/src/main/java/com/ssafy/tott/housegeo/domain/query/HouseGeoRepositoryCustom.java new file mode 100644 index 0000000..526f577 --- /dev/null +++ b/src/main/java/com/ssafy/tott/housegeo/domain/query/HouseGeoRepositoryCustom.java @@ -0,0 +1,10 @@ +package com.ssafy.tott.housegeo.domain.query; + +import com.ssafy.tott.housegeo.data.cond.HouseGeoFilterCond; +import com.ssafy.tott.housegeo.domain.HouseGeo; + +import java.util.List; + +public interface HouseGeoRepositoryCustom { + List findByFilterCond(HouseGeoFilterCond cond); +} diff --git a/src/main/java/com/ssafy/tott/housegeo/domain/query/HouseGeoRepositoryImpl.java b/src/main/java/com/ssafy/tott/housegeo/domain/query/HouseGeoRepositoryImpl.java new file mode 100644 index 0000000..bfd439c --- /dev/null +++ b/src/main/java/com/ssafy/tott/housegeo/domain/query/HouseGeoRepositoryImpl.java @@ -0,0 +1,21 @@ +package com.ssafy.tott.housegeo.domain.query; + +import com.querydsl.jpa.impl.JPAQueryFactory; +import com.ssafy.tott.housegeo.data.cond.HouseGeoFilterCond; +import com.ssafy.tott.housegeo.domain.HouseGeo; + +import javax.persistence.EntityManager; +import java.util.List; + +public class HouseGeoRepositoryImpl implements HouseGeoRepositoryCustom { + private final JPAQueryFactory query; + + public HouseGeoRepositoryImpl(EntityManager em) { + this.query = new JPAQueryFactory(em); + } + + @Override + public List findByFilterCond(HouseGeoFilterCond cond) { + return null; + } +}