🗃️ Ship Data 스키마 변경

This commit is contained in:
hyojin kim 2025-12-23 11:23:29 +09:00
부모 4700ec862b
커밋 bda2d812ff
2개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제

파일 보기

@ -76,8 +76,8 @@ public class ShipDetailDataWriter extends BaseWriter<ShipDetailUpdate> {
// 2. Repository에 전달
// 2-1. ShipDetailRepository (Core20 데이터)
// log.debug("Core20 데이터 저장 시작: {} 건", coreEntities.size());
// shipDetailRepository.saveAllCoreData(coreEntities);
log.debug("Core20 데이터 저장 시작: {} 건", coreEntities.size());
shipDetailRepository.saveAllCoreData(coreEntities);
//
// // 2-2. 추가적인 Array/List 데이터
// // OwnerHistory 저장

파일 보기

@ -26,7 +26,7 @@ public class ShipRepositoryImpl extends BaseJdbcRepository<ShipEntity, Long> imp
@Override
protected String getTableName() {
return "ship_data";
return "snp_data.ship_data";
}
@Override
@ -47,7 +47,7 @@ public class ShipRepositoryImpl extends BaseJdbcRepository<ShipEntity, Long> imp
@Override
protected String getInsertSql() {
return """
INSERT INTO ship_data (imo_number, core_ship_ind, dataset_version, import_date, created_at, updated_at, created_by, updated_by)
INSERT INTO snp_data.ship_data (imo_number, core_ship_ind, dataset_version, import_date, created_at, updated_at, created_by, updated_by)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
""";
}
@ -55,7 +55,7 @@ public class ShipRepositoryImpl extends BaseJdbcRepository<ShipEntity, Long> imp
@Override
protected String getUpdateSql() {
return """
UPDATE ship_data
UPDATE snp_data.ship_data
SET core_ship_ind = ?,
dataset_version = ?,
import_date = ?,
@ -100,7 +100,7 @@ public class ShipRepositoryImpl extends BaseJdbcRepository<ShipEntity, Long> imp
*/
@Override
public Optional<ShipEntity> findByImoNumber(String imoNumber) {
String sql = "SELECT * FROM ship_data WHERE imo_number = ?";
String sql = "SELECT * FROM snp_data.ship_data WHERE imo_number = ?";
return executeQueryForObject(sql, imoNumber);
}
@ -109,7 +109,7 @@ public class ShipRepositoryImpl extends BaseJdbcRepository<ShipEntity, Long> imp
*/
@Override
public boolean existsByImoNumber(String imoNumber) {
String sql = "SELECT COUNT(*) FROM ship_data WHERE imo_number = ?";
String sql = "SELECT COUNT(*) FROM snp_data.ship_data WHERE imo_number = ?";
Long count = jdbcTemplate.queryForObject(sql, Long.class, imoNumber);
return count != null && count > 0;
}