learn 테이블 연결 소스 삭제 및 수정
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnDataGeomEntity;
|
||||
import java.util.List;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Repository
|
||||
public interface MapSheetLearnDataGeomRepository
|
||||
extends JpaRepository<MapSheetLearnDataGeomEntity, Long> {
|
||||
|
||||
/** 데이터 UID로 지오메트리 정보 조회 */
|
||||
List<MapSheetLearnDataGeomEntity> findByDataUid(Long dataUid);
|
||||
|
||||
/** 도엽 번호로 지오메트리 정보 조회 */
|
||||
List<MapSheetLearnDataGeomEntity> findByMapSheetNum(Long mapSheetNum);
|
||||
|
||||
/** 연도 범위로 지오메트리 정보 조회 */
|
||||
List<MapSheetLearnDataGeomEntity> findByBeforeYyyyAndAfterYyyy(
|
||||
Integer beforeYyyy, Integer afterYyyy);
|
||||
|
||||
/** 지오메트리 타입별 조회 */
|
||||
List<MapSheetLearnDataGeomEntity> findByGeoType(String geoType);
|
||||
|
||||
/** 데이터 UID로 기존 지오메트리 데이터 삭제 (재생성 전에 사용) */
|
||||
void deleteByDataUid(Long dataUid);
|
||||
|
||||
/** PostGIS 함수를 사용하여 geometry 데이터를 직접 삽입 ST_SetSRID(ST_GeomFromGeoJSON(...), 5186) 형식으로 저장 */
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query(
|
||||
value =
|
||||
"""
|
||||
INSERT INTO tb_map_sheet_learn_data_geom (
|
||||
geo_uid, cd_prob, class_before_name, class_before_prob,
|
||||
class_after_name, class_after_prob, map_sheet_num,
|
||||
before_yyyy, after_yyyy, area, geom, geo_type, data_uid,
|
||||
created_dttm, updated_dttm
|
||||
) VALUES (
|
||||
:geoUid, :cdProb, :classBeforeName, :classBeforeProb,
|
||||
:classAfterName, :classAfterProb, :mapSheetNum,
|
||||
:beforeYyyy, :afterYyyy, :area,
|
||||
ST_SetSRID(ST_GeomFromGeoJSON(CAST(:geometryJson AS TEXT)), 5186),
|
||||
:geoType, :dataUid, NOW(), NOW()
|
||||
) ON CONFLICT (geo_uid) DO NOTHING
|
||||
""",
|
||||
nativeQuery = true)
|
||||
void insertWithPostGISGeometry(
|
||||
@Param("geoUid") Long geoUid,
|
||||
@Param("cdProb") Double cdProb,
|
||||
@Param("classBeforeName") String classBeforeName,
|
||||
@Param("classBeforeProb") Double classBeforeProb,
|
||||
@Param("classAfterName") String classAfterName,
|
||||
@Param("classAfterProb") Double classAfterProb,
|
||||
@Param("mapSheetNum") Long mapSheetNum,
|
||||
@Param("beforeYyyy") Integer beforeYyyy,
|
||||
@Param("afterYyyy") Integer afterYyyy,
|
||||
@Param("area") Double area,
|
||||
@Param("geometryJson") String geometryJson,
|
||||
@Param("geoType") String geoType,
|
||||
@Param("dataUid") Long dataUid);
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnDataEntity;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface MapSheetLearnDataRepository extends JpaRepository<MapSheetLearnDataEntity, Long> {
|
||||
|
||||
/** 데이터 이름으로 조회 */
|
||||
Optional<MapSheetLearnDataEntity> findByDataName(String dataName);
|
||||
|
||||
/** 데이터 경로로 조회 */
|
||||
Optional<MapSheetLearnDataEntity> findByDataPath(String dataPath);
|
||||
|
||||
/** 처리 상태별 조회 */
|
||||
List<MapSheetLearnDataEntity> findByDataState(String dataState);
|
||||
|
||||
/** 데이터 타입별 조회 */
|
||||
List<MapSheetLearnDataEntity> findByDataType(String dataType);
|
||||
|
||||
/** 분석 상태별 조회 */
|
||||
List<MapSheetLearnDataEntity> findByAnalState(String analState);
|
||||
|
||||
/** 분석 상태별 개수 조회 */
|
||||
long countByAnalState(String analState);
|
||||
|
||||
/** 처리되지 않은 데이터 조회 (data_state가 'PENDING' 또는 null인 것들) */
|
||||
List<MapSheetLearnDataEntity> findByDataStateIsNullOrDataState(String dataState);
|
||||
}
|
||||
Reference in New Issue
Block a user