🦖 선박제원정보 테이블 변경 core20 > ship_detail_data
This commit is contained in:
부모
b2167d4ec7
커밋
fb10e3cc39
@ -176,6 +176,125 @@ public class ShipDetailDto {
|
||||
@JsonProperty("FlagCode")
|
||||
private String flagCode;
|
||||
|
||||
|
||||
// 소유주 및 등록정보
|
||||
@JsonProperty("OfficialNumber")
|
||||
private String officialnumber;
|
||||
@JsonProperty("FishingNumber")
|
||||
private String fishingnumber;
|
||||
|
||||
// 안전 및 인증
|
||||
@JsonProperty("ClassNarrative")
|
||||
private String classnarrative;
|
||||
|
||||
// 선박 건조
|
||||
@JsonProperty("AlterationsDescriptiveNarrative")
|
||||
private String alterationsdescriptivenarrative;
|
||||
@JsonProperty("ShiptypeGroup")
|
||||
private String shiptypegroup;
|
||||
@JsonProperty("ShiptypeLevel3")
|
||||
private String shiptypelevel3;
|
||||
@JsonProperty("ShiptypeLevel4")
|
||||
private String shiptypelevel4;
|
||||
@JsonProperty("ShiptypeLevel5HullType")
|
||||
private String shiptypelevel5hulltype;
|
||||
@JsonProperty("ShiptypeLevel5SubGroup")
|
||||
private String shiptypelevel5subgroup;
|
||||
@JsonProperty("ConstructionDescriptiveNarrative")
|
||||
private String constructiondescriptivenarrative;
|
||||
@JsonProperty("DateOfBuild")
|
||||
private String dateofbuild;
|
||||
@JsonProperty("ShipbuilderFullStyle")
|
||||
private String shipbuilderfullstyle;
|
||||
@JsonProperty("YardNumber")
|
||||
private String yardnumber;
|
||||
@JsonProperty("ConsumptionSpeed1")
|
||||
private String consumptionspeed1; // Double
|
||||
@JsonProperty("ConsumptionValue1")
|
||||
private String consumptionvalue1; // Double
|
||||
@JsonProperty("ConsumptionSpeed2")
|
||||
private String consumptionspeed2; // Double
|
||||
@JsonProperty("ConsumptionValue2")
|
||||
private String consumptionvalue2; // Double
|
||||
@JsonProperty("TotalBunkerCapacity")
|
||||
private String totalbunkercapacity; // Double
|
||||
@JsonProperty("BoilerManufacturer")
|
||||
private String boilermanufacturer;
|
||||
@JsonProperty("PropellerManufacturer")
|
||||
private String propellermanufacturer;
|
||||
|
||||
// 치수 및 톤수
|
||||
@JsonProperty("LengthRegistered")
|
||||
private String lengthregistered; // Double
|
||||
@JsonProperty("BreadthExtreme")
|
||||
private String breadthextreme; // Double
|
||||
@JsonProperty("KeelToMastHeight")
|
||||
private String keeltomastheight; // Double
|
||||
@JsonProperty("Displacement")
|
||||
private String displacement; // Double
|
||||
@JsonProperty("LengthBetweenPerpendicularsLBP")
|
||||
private String lengthbetweenperpendicularslbp; // Double
|
||||
@JsonProperty("BulbousBow")
|
||||
private String bulbousbow;
|
||||
@JsonProperty("TonnesPerCentimetreImmersionTPCI")
|
||||
private String tonnespercentimetreimmersiontpci; // Double
|
||||
@JsonProperty("TonnageEffectiveDate")
|
||||
private String tonnageeffectivedate;
|
||||
@JsonProperty("FormulaDWT")
|
||||
private String formuladwt; // Double
|
||||
@JsonProperty("NetTonnage")
|
||||
private String nettonnage; // Integer
|
||||
@JsonProperty("CompensatedGrossTonnageCGT")
|
||||
private String compensatedgrosstonnagecgt; // Integer
|
||||
@JsonProperty("LightDisplacementTonnage")
|
||||
private String lightdisplacementtonnage; // Integer
|
||||
|
||||
// 화물 및 적재량
|
||||
@JsonProperty("GrainCapacity")
|
||||
private String graincapacity;
|
||||
@JsonProperty("BaleCapacity")
|
||||
private String balecapacity;
|
||||
@JsonProperty("LiquidCapacity")
|
||||
private String liquidcapacity;
|
||||
@JsonProperty("GasCapacity")
|
||||
private String gascapacity;
|
||||
@JsonProperty("TEUCapacity14THomogenous")
|
||||
private String teucapacity14thomogenous;
|
||||
@JsonProperty("InsulatedCapacity")
|
||||
private String insulatedcapacity;
|
||||
@JsonProperty("PassengerCapacity")
|
||||
private String passengercapacity;
|
||||
@JsonProperty("BollardPull")
|
||||
private String bollardpull;
|
||||
@JsonProperty("CargoCapacitiesNarrative")
|
||||
private String cargocapacitiesnarrative;
|
||||
@JsonProperty("GearDescriptiveNarrative")
|
||||
private String geardescriptivenarrative;
|
||||
@JsonProperty("HoldsDescriptiveNarrative")
|
||||
private String holdsdescriptivenarrative;
|
||||
@JsonProperty("HatchesDescriptiveNarrative")
|
||||
private String hatchesdescriptivenarrative;
|
||||
@JsonProperty("LanesDoorsRampsNarrative")
|
||||
private String lanesdoorsrampsnarrative;
|
||||
@JsonProperty("SpecialistTankerNarrative")
|
||||
private String specialisttankernarrative;
|
||||
@JsonProperty("TanksDescriptiveNarrative")
|
||||
private String tanksdescriptivenarrative;
|
||||
|
||||
// 선박 기관
|
||||
@JsonProperty("PrimeMoverDescriptiveNarrative")
|
||||
private String primemoverdescriptivenarrative;
|
||||
@JsonProperty("PrimeMoverDescriptiveOverviewNarrative")
|
||||
private String primemoverdescriptiveoverviewnarrative;
|
||||
@JsonProperty("AuxiliaryEnginesNarrative")
|
||||
private String auxiliaryenginesnarrative;
|
||||
@JsonProperty("AuxiliaryGeneratorsDescriptiveNarrative")
|
||||
private String auxiliarygeneratorsdescriptivenarrative;
|
||||
@JsonProperty("BunkersDescriptiveNarrative")
|
||||
private String bunkersdescriptivenarrative;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 소유주 이력 List
|
||||
* API: OwnerHistory
|
||||
|
||||
@ -205,4 +205,68 @@ public class ShipDetailEntity extends BaseEntity {
|
||||
private String operator;
|
||||
private String flagCode;
|
||||
|
||||
// 소유주 및 등록정보
|
||||
private String officialnumber;
|
||||
private String fishingnumber;
|
||||
|
||||
// 안전 및 인증
|
||||
private String classnarrative;
|
||||
|
||||
// 선박 건조
|
||||
private String alterationsdescriptivenarrative;
|
||||
private String shiptypegroup;
|
||||
private String shiptypelevel3;
|
||||
private String shiptypelevel4;
|
||||
private String shiptypelevel5hulltype;
|
||||
private String shiptypelevel5subgroup;
|
||||
private String constructiondescriptivenarrative;
|
||||
private String dateofbuild;
|
||||
private String shipbuilderfullstyle;
|
||||
private String yardnumber;
|
||||
private String consumptionspeed1;
|
||||
private String consumptionvalue1;
|
||||
private String consumptionspeed2;
|
||||
private String consumptionvalue2;
|
||||
private String totalbunkercapacity;
|
||||
private String boilermanufacturer;
|
||||
private String propellermanufacturer;
|
||||
|
||||
// 치수 및 톤수
|
||||
private String lengthregistered;
|
||||
private String breadthextreme;
|
||||
private String keeltomastheight;
|
||||
private String displacement;
|
||||
private String lengthbetweenperpendicularslbp;
|
||||
private String bulbousbow;
|
||||
private String tonnespercentimetreimmersiontpci;
|
||||
private String tonnageeffectivedate;
|
||||
private String formuladwt;
|
||||
private String nettonnage;
|
||||
private String compensatedgrosstonnagecgt;
|
||||
private String lightdisplacementtonnage;
|
||||
|
||||
// 화물 및 적재량
|
||||
private String graincapacity;
|
||||
private String balecapacity;
|
||||
private String liquidcapacity;
|
||||
private String gascapacity;
|
||||
private String teucapacity14thomogenous;
|
||||
private String insulatedcapacity;
|
||||
private String passengercapacity;
|
||||
private String bollardpull;
|
||||
private String cargocapacitiesnarrative;
|
||||
private String geardescriptivenarrative;
|
||||
private String holdsdescriptivenarrative;
|
||||
private String hatchesdescriptivenarrative;
|
||||
private String lanesdoorsrampsnarrative;
|
||||
private String specialisttankernarrative;
|
||||
private String tanksdescriptivenarrative;
|
||||
|
||||
// 선박 기관
|
||||
private String primemoverdescriptivenarrative;
|
||||
private String primemoverdescriptiveoverviewnarrative;
|
||||
private String auxiliaryenginesnarrative;
|
||||
private String auxiliarygeneratorsdescriptivenarrative;
|
||||
private String bunkersdescriptivenarrative;
|
||||
|
||||
}
|
||||
|
||||
@ -130,6 +130,70 @@ public class ShipDetailDataProcessor extends BaseProcessor<ShipDetailComparisonD
|
||||
.shipStatus(safeGetString(dto.getShipStatus()))
|
||||
.operator(safeGetString(dto.getOperator()))
|
||||
.flagCode(safeGetString(dto.getFlagCode()))
|
||||
// 소유주 및 등록정보 (String)
|
||||
.officialnumber(safeGetString(dto.getOfficialnumber()))
|
||||
.fishingnumber(safeGetString(dto.getFishingnumber()))
|
||||
// 안전 및 인증 (String)
|
||||
.classnarrative(safeGetString(dto.getClassnarrative()))
|
||||
// 선박 건조
|
||||
.alterationsdescriptivenarrative(safeGetString(dto.getAlterationsdescriptivenarrative()))
|
||||
.shiptypegroup(safeGetString(dto.getShiptypegroup()))
|
||||
.shiptypelevel3(safeGetString(dto.getShiptypelevel3()))
|
||||
.shiptypelevel4(safeGetString(dto.getShiptypelevel4()))
|
||||
.shiptypelevel5hulltype(safeGetString(dto.getShiptypelevel5hulltype()))
|
||||
.shiptypelevel5subgroup(safeGetString(dto.getShiptypelevel5subgroup()))
|
||||
.constructiondescriptivenarrative(safeGetString(dto.getConstructiondescriptivenarrative()))
|
||||
.dateofbuild(safeGetString(dto.getDateofbuild()))
|
||||
.shipbuilderfullstyle(safeGetString(dto.getShipbuilderfullstyle()))
|
||||
.yardnumber(safeGetString(dto.getYardnumber()))
|
||||
// 선박 건조 (Double 변환 필드)
|
||||
.consumptionspeed1(safeGetString(dto.getConsumptionspeed1()))
|
||||
.consumptionvalue1(safeGetString(dto.getConsumptionvalue1()))
|
||||
.consumptionspeed2(safeGetString(dto.getConsumptionspeed2()))
|
||||
.consumptionvalue2(safeGetString(dto.getConsumptionvalue2()))
|
||||
.totalbunkercapacity(safeGetString(dto.getTotalbunkercapacity()))
|
||||
// 선박 건조 (String)
|
||||
.boilermanufacturer(safeGetString(dto.getBoilermanufacturer()))
|
||||
.propellermanufacturer(safeGetString(dto.getPropellermanufacturer()))
|
||||
// 치수 및 톤수 (Double 변환 필드)
|
||||
.lengthregistered(safeGetString(dto.getLengthregistered()))
|
||||
.breadthextreme(safeGetString(dto.getBreadthextreme()))
|
||||
.keeltomastheight(safeGetString(dto.getKeeltomastheight()))
|
||||
.displacement(safeGetString(dto.getDisplacement()))
|
||||
.lengthbetweenperpendicularslbp(safeGetString(dto.getLengthbetweenperpendicularslbp()))
|
||||
// 치수 및 톤수 (String)
|
||||
.bulbousbow(safeGetString(dto.getBulbousbow()))
|
||||
// 치수 및 톤수 (Double 변환 필드)
|
||||
.tonnespercentimetreimmersiontpci(safeGetString(dto.getTonnespercentimetreimmersiontpci()))
|
||||
.tonnageeffectivedate(safeGetString(dto.getTonnageeffectivedate()))
|
||||
.formuladwt(safeGetString(dto.getFormuladwt()))
|
||||
// 치수 및 톤수 (Integer 변환 필드)
|
||||
.nettonnage(safeGetString(dto.getNettonnage()))
|
||||
.compensatedgrosstonnagecgt(safeGetString(dto.getCompensatedgrosstonnagecgt()))
|
||||
.lightdisplacementtonnage(safeGetString(dto.getLightdisplacementtonnage()))
|
||||
// 화물 및 적재량 (Integer 변환 필드)
|
||||
.graincapacity(safeGetString(dto.getGraincapacity()))
|
||||
.balecapacity(safeGetString(dto.getBalecapacity()))
|
||||
.liquidcapacity(safeGetString(dto.getLiquidcapacity()))
|
||||
.gascapacity(safeGetString(dto.getGascapacity()))
|
||||
.teucapacity14thomogenous(safeGetString(dto.getTeucapacity14thomogenous()))
|
||||
.insulatedcapacity(safeGetString(dto.getInsulatedcapacity()))
|
||||
.passengercapacity(safeGetString(dto.getPassengercapacity()))
|
||||
.bollardpull(safeGetString(dto.getBollardpull()))
|
||||
// 화물 및 적재량 (String)
|
||||
.cargocapacitiesnarrative(safeGetString(dto.getCargocapacitiesnarrative()))
|
||||
.geardescriptivenarrative(safeGetString(dto.getGeardescriptivenarrative()))
|
||||
.holdsdescriptivenarrative(safeGetString(dto.getHoldsdescriptivenarrative()))
|
||||
.hatchesdescriptivenarrative(safeGetString(dto.getHatchesdescriptivenarrative()))
|
||||
.lanesdoorsrampsnarrative(safeGetString(dto.getLanesdoorsrampsnarrative()))
|
||||
.specialisttankernarrative(safeGetString(dto.getSpecialisttankernarrative()))
|
||||
.tanksdescriptivenarrative(safeGetString(dto.getTanksdescriptivenarrative()))
|
||||
// 선박 기관 (String)
|
||||
.primemoverdescriptivenarrative(safeGetString(dto.getPrimemoverdescriptivenarrative()))
|
||||
.primemoverdescriptiveoverviewnarrative(safeGetString(dto.getPrimemoverdescriptiveoverviewnarrative()))
|
||||
.auxiliaryenginesnarrative(safeGetString(dto.getAuxiliaryenginesnarrative()))
|
||||
.auxiliarygeneratorsdescriptivenarrative(safeGetString(dto.getAuxiliarygeneratorsdescriptivenarrative()))
|
||||
.bunkersdescriptivenarrative(safeGetString(dto.getBunkersdescriptivenarrative()))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ public class ShipDetailUpdateDataReader extends BaseApiReader<ShipDetailComparis
|
||||
}
|
||||
|
||||
protected String getShipUpdateApiPath(){
|
||||
return "MaritimeWCF/APSShipService.svc/RESTFul/GetShipChangesByLastUpdateDateRange";
|
||||
return "/MaritimeWCF/APSShipService.svc/RESTFul/GetShipChangesByLastUpdateDateRange";
|
||||
}
|
||||
|
||||
private static final String FETCH_ALL_HASHES_QUERY =
|
||||
|
||||
@ -7,10 +7,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@ -44,16 +41,37 @@ public class ShipDetailRepositoryImpl extends BaseJdbcRepository<ShipDetailEntit
|
||||
@Override
|
||||
protected String getInsertSql() {
|
||||
return """
|
||||
INSERT INTO snp_data.core20(
|
||||
shipresultindex, vesselid, ihslrorimoshipno, maritimemobileserviceidentitymmsinumber, shipname,
|
||||
INSERT INTO snp_data.ship_detail_data(
|
||||
ihslrorimoshipno, maritimemobileserviceidentitymmsinumber, shipname,
|
||||
callsign, flagname, portofregistry, classificationsociety, shiptypelevel5,
|
||||
shiptypelevel5subtype, yearofbuild, shipbuilder, lengthoverallloa, breadthmoulded,
|
||||
"depth", draught, grosstonnage, deadweight, teu,
|
||||
mainenginetype, status, operator, flagcode, shiptypelevel2
|
||||
) VALUES (nextval('snp_data.core20_index_seq'::regclass), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
mainenginetype, shipstatus, operator, flagcode, shiptypelevel2,
|
||||
officialnumber, fishingnumber, classnarrative,
|
||||
alterationsdescriptivenarrative, shiptypegroup, shiptypelevel3, shiptypelevel4, shiptypelevel5hulltype,
|
||||
shiptypelevel5subgroup, constructiondescriptivenarrative, dateofbuild,
|
||||
shipbuilderfullstyle, yardnumber, consumptionspeed1, consumptionvalue1, consumptionspeed2,
|
||||
consumptionvalue2, totalbunkercapacity, boilermanufacturer, propellermanufacturer,
|
||||
lengthregistered, breadthextreme, keeltomastheight, displacement, lengthbetweenperpendicularslbp,
|
||||
bulbousbow, tonnespercentimetreimmersiontpci, tonnageeffectivedate, formuladwt, nettonnage,
|
||||
compensatedgrosstonnagecgt, lightdisplacementtonnage, graincapacity, balecapacity, liquidcapacity,
|
||||
gascapacity, teucapacity14thomogenous, insulatedcapacity, passengercapacity, bollardpull,
|
||||
cargocapacitiesnarrative, geardescriptivenarrative, holdsdescriptivenarrative, hatchesdescriptivenarrative,
|
||||
lanesdoorsrampsnarrative, specialisttankernarrative, tanksdescriptivenarrative,
|
||||
primemoverdescriptivenarrative, primemoverdescriptiveoverviewnarrative,
|
||||
auxiliaryenginesnarrative, auxiliarygeneratorsdescriptivenarrative, bunkersdescriptivenarrative
|
||||
) VALUES (
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?
|
||||
)
|
||||
ON CONFLICT (ihslrorimoshipno)
|
||||
DO UPDATE SET
|
||||
vesselid = EXCLUDED.vesselid,
|
||||
maritimemobileserviceidentitymmsinumber = EXCLUDED.maritimemobileserviceidentitymmsinumber,
|
||||
shipname = EXCLUDED.shipname,
|
||||
callsign = EXCLUDED.callsign,
|
||||
@ -72,19 +90,70 @@ public class ShipDetailRepositoryImpl extends BaseJdbcRepository<ShipDetailEntit
|
||||
deadweight = EXCLUDED.deadweight,
|
||||
teu = EXCLUDED.teu,
|
||||
mainenginetype = EXCLUDED.mainenginetype,
|
||||
status = EXCLUDED.status,
|
||||
shipstatus = EXCLUDED.shipstatus,
|
||||
operator = EXCLUDED.operator,
|
||||
flagcode = EXCLUDED.flagcode,
|
||||
shiptypelevel2 = EXCLUDED.shiptypelevel2
|
||||
shiptypelevel2 = EXCLUDED.shiptypelevel2,
|
||||
officialnumber = EXCLUDED.officialnumber,
|
||||
fishingnumber = EXCLUDED.fishingnumber,
|
||||
classnarrative = EXCLUDED.classnarrative,
|
||||
alterationsdescriptivenarrative = EXCLUDED.alterationsdescriptivenarrative,
|
||||
shiptypegroup = EXCLUDED.shiptypegroup,
|
||||
shiptypelevel3 = EXCLUDED.shiptypelevel3,
|
||||
shiptypelevel4 = EXCLUDED.shiptypelevel4,
|
||||
shiptypelevel5hulltype = EXCLUDED.shiptypelevel5hulltype,
|
||||
shiptypelevel5subgroup = EXCLUDED.shiptypelevel5subgroup,
|
||||
constructiondescriptivenarrative = EXCLUDED.constructiondescriptivenarrative,
|
||||
dateofbuild = EXCLUDED.dateofbuild,
|
||||
shipbuilderfullstyle = EXCLUDED.shipbuilderfullstyle,
|
||||
yardnumber = EXCLUDED.yardnumber,
|
||||
consumptionspeed1 = EXCLUDED.consumptionspeed1,
|
||||
consumptionvalue1 = EXCLUDED.consumptionvalue1,
|
||||
consumptionspeed2 = EXCLUDED.consumptionspeed2,
|
||||
consumptionvalue2 = EXCLUDED.consumptionvalue2,
|
||||
totalbunkercapacity = EXCLUDED.totalbunkercapacity,
|
||||
boilermanufacturer = EXCLUDED.boilermanufacturer,
|
||||
propellermanufacturer = EXCLUDED.propellermanufacturer,
|
||||
lengthregistered = EXCLUDED.lengthregistered,
|
||||
breadthextreme = EXCLUDED.breadthextreme,
|
||||
keeltomastheight = EXCLUDED.keeltomastheight,
|
||||
displacement = EXCLUDED.displacement,
|
||||
lengthbetweenperpendicularslbp = EXCLUDED.lengthbetweenperpendicularslbp,
|
||||
bulbousbow = EXCLUDED.bulbousbow,
|
||||
tonnespercentimetreimmersiontpci = EXCLUDED.tonnespercentimetreimmersiontpci,
|
||||
tonnageeffectivedate = EXCLUDED.tonnageeffectivedate,
|
||||
formuladwt = EXCLUDED.formuladwt,
|
||||
nettonnage = EXCLUDED.nettonnage,
|
||||
compensatedgrosstonnagecgt = EXCLUDED.compensatedgrosstonnagecgt,
|
||||
lightdisplacementtonnage = EXCLUDED.lightdisplacementtonnage,
|
||||
graincapacity = EXCLUDED.graincapacity,
|
||||
balecapacity = EXCLUDED.balecapacity,
|
||||
liquidcapacity = EXCLUDED.liquidcapacity,
|
||||
gascapacity = EXCLUDED.gascapacity,
|
||||
teucapacity14thomogenous = EXCLUDED.teucapacity14thomogenous,
|
||||
insulatedcapacity = EXCLUDED.insulatedcapacity,
|
||||
passengercapacity = EXCLUDED.passengercapacity,
|
||||
bollardpull = EXCLUDED.bollardpull,
|
||||
cargocapacitiesnarrative = EXCLUDED.cargocapacitiesnarrative,
|
||||
geardescriptivenarrative = EXCLUDED.geardescriptivenarrative,
|
||||
holdsdescriptivenarrative = EXCLUDED.holdsdescriptivenarrative,
|
||||
hatchesdescriptivenarrative = EXCLUDED.hatchesdescriptivenarrative,
|
||||
lanesdoorsrampsnarrative = EXCLUDED.lanesdoorsrampsnarrative,
|
||||
specialisttankernarrative = EXCLUDED.specialisttankernarrative,
|
||||
tanksdescriptivenarrative = EXCLUDED.tanksdescriptivenarrative,
|
||||
primemoverdescriptivenarrative = EXCLUDED.primemoverdescriptivenarrative,
|
||||
primemoverdescriptiveoverviewnarrative = EXCLUDED.primemoverdescriptiveoverviewnarrative,
|
||||
auxiliaryenginesnarrative = EXCLUDED.auxiliaryenginesnarrative,
|
||||
auxiliarygeneratorsdescriptivenarrative = EXCLUDED.auxiliarygeneratorsdescriptivenarrative,
|
||||
bunkersdescriptivenarrative = EXCLUDED.bunkersdescriptivenarrative
|
||||
""";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getUpdateSql() {
|
||||
return """
|
||||
UPDATE snp_data.core20
|
||||
SET vesselid = ?,
|
||||
maritimemobileserviceidentitymmsinumber = ?,
|
||||
UPDATE snp_data.ship_detail_data
|
||||
SET maritimemobileserviceidentitymmsinumber = ?,
|
||||
shipname = ?,
|
||||
callsign = ?,
|
||||
flagname = ?,
|
||||
@ -102,11 +171,63 @@ public class ShipDetailRepositoryImpl extends BaseJdbcRepository<ShipDetailEntit
|
||||
deadweight = ?,
|
||||
teu = ?,
|
||||
mainenginetype = ?,
|
||||
batch_flag = 'N'::character varying,
|
||||
status = ?,
|
||||
shipstatus = ?,
|
||||
operator = ?,
|
||||
flagcode = ?,
|
||||
shiptypelevel2 = ?
|
||||
shiptypelevel2 = ?,
|
||||
officialnumber = ?,
|
||||
fishingnumber = ?,
|
||||
classnarrative = ?,
|
||||
alterationsdescriptivenarrative = ?,
|
||||
shiptypegroup = ?,
|
||||
shiptypelevel3 = ?,
|
||||
shiptypelevel4 = ?,
|
||||
shiptypelevel5hulltype = ?,
|
||||
shiptypelevel5subgroup = ?,
|
||||
constructiondescriptivenarrative = ?,
|
||||
dateofbuild = ?,
|
||||
shipbuilderfullstyle = ?,
|
||||
yardnumber = ?,
|
||||
consumptionspeed1 = ?,
|
||||
consumptionvalue1 = ?,
|
||||
consumptionspeed2 = ?,
|
||||
consumptionvalue2 = ?,
|
||||
totalbunkercapacity = ?,
|
||||
boilermanufacturer = ?,
|
||||
propellermanufacturer = ?,
|
||||
lengthregistered = ?,
|
||||
breadthextreme = ?,
|
||||
keeltomastheight = ?,
|
||||
displacement = ?,
|
||||
lengthbetweenperpendicularslbp = ?,
|
||||
bulbousbow = ?,
|
||||
tonnespercentimetreimmersiontpci = ?,
|
||||
tonnageeffectivedate = ?,
|
||||
formuladwt = ?,
|
||||
nettonnage = ?,
|
||||
compensatedgrosstonnagecgt = ?,
|
||||
lightdisplacementtonnage = ?,
|
||||
graincapacity = ?,
|
||||
balecapacity = ?,
|
||||
liquidcapacity = ?,
|
||||
gascapacity = ?,
|
||||
teucapacity14thomogenous = ?,
|
||||
insulatedcapacity = ?,
|
||||
passengercapacity = ?,
|
||||
bollardpull = ?,
|
||||
cargocapacitiesnarrative = ?,
|
||||
geardescriptivenarrative = ?,
|
||||
holdsdescriptivenarrative = ?,
|
||||
hatchesdescriptivenarrative = ?,
|
||||
lanesdoorsrampsnarrative = ?,
|
||||
specialisttankernarrative = ?,
|
||||
tanksdescriptivenarrative = ?,
|
||||
primemoverdescriptivenarrative = ?,
|
||||
primemoverdescriptiveoverviewnarrative = ?,
|
||||
auxiliaryenginesnarrative = ?,
|
||||
auxiliarygeneratorsdescriptivenarrative = ?,
|
||||
bunkersdescriptivenarrative = ?,
|
||||
batch_flag = 'N'::character varying
|
||||
WHERE ihslrorimoshipno = ?
|
||||
""";
|
||||
}
|
||||
@ -114,7 +235,6 @@ public class ShipDetailRepositoryImpl extends BaseJdbcRepository<ShipDetailEntit
|
||||
@Override
|
||||
protected void setInsertParameters(PreparedStatement ps, ShipDetailEntity entity) throws Exception {
|
||||
int idx = 1;
|
||||
ps.setString(idx++, entity.getIhslrorimoshipno()); //vesselId
|
||||
ps.setString(idx++, entity.getIhslrorimoshipno());
|
||||
ps.setString(idx++, entity.getMaritimeMobileServiceIdentityMmsiNumber());
|
||||
ps.setString(idx++, entity.getShipName());
|
||||
@ -138,6 +258,86 @@ public class ShipDetailRepositoryImpl extends BaseJdbcRepository<ShipDetailEntit
|
||||
ps.setString(idx++, entity.getOperator());
|
||||
ps.setString(idx++, entity.getFlagCode());
|
||||
ps.setString(idx++, entity.getShipTypeLevel2());
|
||||
// 1. 소유주 및 등록정보 (VARCHAR)
|
||||
ps.setString(idx++, entity.getOfficialnumber());
|
||||
ps.setString(idx++, entity.getFishingnumber());
|
||||
|
||||
// 2. 안전 및 인증 (VARCHAR)
|
||||
ps.setString(idx++, entity.getClassnarrative());
|
||||
|
||||
// 3. 선박 건조 (VARCHAR 및 숫자형)
|
||||
ps.setString(idx++, entity.getAlterationsdescriptivenarrative());
|
||||
ps.setString(idx++, entity.getShiptypegroup());
|
||||
ps.setString(idx++, entity.getShiptypelevel3());
|
||||
ps.setString(idx++, entity.getShiptypelevel4());
|
||||
ps.setString(idx++, entity.getShiptypelevel5hulltype());
|
||||
ps.setString(idx++, entity.getShiptypelevel5subgroup());
|
||||
ps.setString(idx++, entity.getConstructiondescriptivenarrative());
|
||||
ps.setString(idx++, entity.getDateofbuild());
|
||||
ps.setString(idx++, entity.getShipbuilderfullstyle());
|
||||
ps.setString(idx++, entity.getYardnumber());
|
||||
|
||||
// 숫자형 필드 (SqlUtils의 setDoubleOrNull을 사용하며, String을 Double로 파싱 시도)
|
||||
setDoubleOrNull(ps, idx++, entity.getConsumptionspeed1());
|
||||
setDoubleOrNull(ps, idx++, entity.getConsumptionvalue1());
|
||||
setDoubleOrNull(ps, idx++, entity.getConsumptionspeed2());
|
||||
setDoubleOrNull(ps, idx++, entity.getConsumptionvalue2());
|
||||
setDoubleOrNull(ps, idx++, entity.getTotalbunkercapacity());
|
||||
|
||||
ps.setString(idx++, entity.getBoilermanufacturer());
|
||||
ps.setString(idx++, entity.getPropellermanufacturer());
|
||||
|
||||
// 4. 치수 및 톤수 (VARCHAR 및 숫자형)
|
||||
// 숫자형 필드
|
||||
setDoubleOrNull(ps, idx++, entity.getLengthregistered());
|
||||
setDoubleOrNull(ps, idx++, entity.getBreadthextreme());
|
||||
setDoubleOrNull(ps, idx++, entity.getKeeltomastheight());
|
||||
setDoubleOrNull(ps, idx++, entity.getDisplacement());
|
||||
setDoubleOrNull(ps, idx++, entity.getLengthbetweenperpendicularslbp());
|
||||
|
||||
// VARCHAR
|
||||
ps.setString(idx++, entity.getBulbousbow());
|
||||
|
||||
// 숫자형 필드
|
||||
setDoubleOrNull(ps, idx++, entity.getTonnespercentimetreimmersiontpci());
|
||||
|
||||
// VARCHAR
|
||||
ps.setString(idx++, entity.getTonnageeffectivedate());
|
||||
|
||||
// 숫자형 필드
|
||||
setDoubleOrNull(ps, idx++, entity.getFormuladwt());
|
||||
|
||||
// 정수형 필드 (SqlUtils의 setIntegerOrNull을 사용하며, String을 Integer로 파싱 시도)
|
||||
setIntegerOrNull(ps, idx++, entity.getNettonnage());
|
||||
setIntegerOrNull(ps, idx++, entity.getCompensatedgrosstonnagecgt());
|
||||
setIntegerOrNull(ps, idx++, entity.getLightdisplacementtonnage());
|
||||
|
||||
// 5. 화물 및 적재량 (정수형 및 VARCHAR)
|
||||
// 정수형 필드
|
||||
setIntegerOrNull(ps, idx++, entity.getGraincapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getBalecapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getLiquidcapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getGascapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getTeucapacity14thomogenous());
|
||||
setIntegerOrNull(ps, idx++, entity.getInsulatedcapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getPassengercapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getBollardpull());
|
||||
|
||||
// VARCHAR
|
||||
ps.setString(idx++, entity.getCargocapacitiesnarrative());
|
||||
ps.setString(idx++, entity.getGeardescriptivenarrative());
|
||||
ps.setString(idx++, entity.getHoldsdescriptivenarrative());
|
||||
ps.setString(idx++, entity.getHatchesdescriptivenarrative());
|
||||
ps.setString(idx++, entity.getLanesdoorsrampsnarrative());
|
||||
ps.setString(idx++, entity.getSpecialisttankernarrative());
|
||||
ps.setString(idx++, entity.getTanksdescriptivenarrative());
|
||||
|
||||
// 6. 선박 기관 (VARCHAR)
|
||||
ps.setString(idx++, entity.getPrimemoverdescriptivenarrative());
|
||||
ps.setString(idx++, entity.getPrimemoverdescriptiveoverviewnarrative());
|
||||
ps.setString(idx++, entity.getAuxiliaryenginesnarrative());
|
||||
ps.setString(idx++, entity.getAuxiliarygeneratorsdescriptivenarrative());
|
||||
ps.setString(idx++, entity.getBunkersdescriptivenarrative());
|
||||
|
||||
// 감사 필드
|
||||
// ps.setTimestamp(idx++, entity.getCreatedAt() != null ?
|
||||
@ -155,6 +355,24 @@ public class ShipDetailRepositoryImpl extends BaseJdbcRepository<ShipDetailEntit
|
||||
ps.setNull(index, java.sql.Types.DOUBLE);
|
||||
}
|
||||
}
|
||||
public static void setDoubleOrNull(PreparedStatement ps, int index, String value) throws Exception {
|
||||
// 1. null 또는 빈 문자열 체크
|
||||
if (value == null || value.trim().isEmpty()) {
|
||||
ps.setNull(index, Types.DOUBLE);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// 2. String을 Double로 변환
|
||||
double parsedValue = Double.parseDouble(value.trim());
|
||||
ps.setDouble(index, parsedValue);
|
||||
} catch (NumberFormatException e) {
|
||||
// 3. 파싱 오류 발생 시 SQL NULL 처리
|
||||
// 경고 로그를 남기고 NULL을 설정하는 것이 안전합니다.
|
||||
// System.err.println("Warning: Invalid double format for index " + index + ". Value: '" + value + "'. Setting NULL.");
|
||||
ps.setNull(index, Types.DOUBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void setIntegerOrNull(PreparedStatement ps, int index, String value) throws Exception {
|
||||
if (value == null || value.trim().isEmpty()) {
|
||||
@ -174,7 +392,6 @@ public class ShipDetailRepositoryImpl extends BaseJdbcRepository<ShipDetailEntit
|
||||
@Override
|
||||
protected void setUpdateParameters(PreparedStatement ps, ShipDetailEntity entity) throws Exception {
|
||||
int idx = 1;
|
||||
ps.setString(idx++, entity.getVesselId());
|
||||
ps.setString(idx++, entity.getMaritimeMobileServiceIdentityMmsiNumber());
|
||||
ps.setString(idx++, entity.getShipName());
|
||||
ps.setString(idx++, entity.getCallSign());
|
||||
@ -197,6 +414,76 @@ public class ShipDetailRepositoryImpl extends BaseJdbcRepository<ShipDetailEntit
|
||||
ps.setString(idx++, entity.getOperator());
|
||||
ps.setString(idx++, entity.getFlagCode());
|
||||
ps.setString(idx++, entity.getShipTypeLevel2());
|
||||
// 1. 소유주 및 등록정보 (VARCHAR)
|
||||
ps.setString(idx++, entity.getOfficialnumber());
|
||||
ps.setString(idx++, entity.getFishingnumber());
|
||||
// 2. 안전 및 인증 (VARCHAR)
|
||||
ps.setString(idx++, entity.getClassnarrative());
|
||||
// 3. 선박 건조 (VARCHAR 및 숫자형)
|
||||
ps.setString(idx++, entity.getAlterationsdescriptivenarrative());
|
||||
ps.setString(idx++, entity.getShiptypegroup());
|
||||
ps.setString(idx++, entity.getShiptypelevel3());
|
||||
ps.setString(idx++, entity.getShiptypelevel4());
|
||||
ps.setString(idx++, entity.getShiptypelevel5hulltype());
|
||||
ps.setString(idx++, entity.getShiptypelevel5subgroup());
|
||||
ps.setString(idx++, entity.getConstructiondescriptivenarrative());
|
||||
ps.setString(idx++, entity.getDateofbuild());
|
||||
ps.setString(idx++, entity.getShipbuilderfullstyle());
|
||||
ps.setString(idx++, entity.getYardnumber());
|
||||
// 숫자형 필드 (SqlUtils의 setDoubleOrNull을 사용하며, String을 Double로 파싱 시도)
|
||||
setDoubleOrNull(ps, idx++, entity.getConsumptionspeed1());
|
||||
setDoubleOrNull(ps, idx++, entity.getConsumptionvalue1());
|
||||
setDoubleOrNull(ps, idx++, entity.getConsumptionspeed2());
|
||||
setDoubleOrNull(ps, idx++, entity.getConsumptionvalue2());
|
||||
setDoubleOrNull(ps, idx++, entity.getTotalbunkercapacity());
|
||||
ps.setString(idx++, entity.getBoilermanufacturer());
|
||||
ps.setString(idx++, entity.getPropellermanufacturer());
|
||||
// 4. 치수 및 톤수 (VARCHAR 및 숫자형)
|
||||
// 숫자형 필드
|
||||
setDoubleOrNull(ps, idx++, entity.getLengthregistered());
|
||||
setDoubleOrNull(ps, idx++, entity.getBreadthextreme());
|
||||
setDoubleOrNull(ps, idx++, entity.getKeeltomastheight());
|
||||
setDoubleOrNull(ps, idx++, entity.getDisplacement());
|
||||
setDoubleOrNull(ps, idx++, entity.getLengthbetweenperpendicularslbp());
|
||||
// VARCHAR
|
||||
ps.setString(idx++, entity.getBulbousbow());
|
||||
// 숫자형 필드
|
||||
setDoubleOrNull(ps, idx++, entity.getTonnespercentimetreimmersiontpci());
|
||||
// VARCHAR
|
||||
ps.setString(idx++, entity.getTonnageeffectivedate());
|
||||
// 숫자형 필드
|
||||
setDoubleOrNull(ps, idx++, entity.getFormuladwt());
|
||||
// 정수형 필드 (SqlUtils의 setIntegerOrNull을 사용하며, String을 Integer로 파싱 시도)
|
||||
setIntegerOrNull(ps, idx++, entity.getNettonnage());
|
||||
setIntegerOrNull(ps, idx++, entity.getCompensatedgrosstonnagecgt());
|
||||
setIntegerOrNull(ps, idx++, entity.getLightdisplacementtonnage());
|
||||
// 5. 화물 및 적재량 (정수형 및 VARCHAR)
|
||||
// 정수형 필드
|
||||
setIntegerOrNull(ps, idx++, entity.getGraincapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getBalecapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getLiquidcapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getGascapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getTeucapacity14thomogenous());
|
||||
setIntegerOrNull(ps, idx++, entity.getInsulatedcapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getPassengercapacity());
|
||||
setIntegerOrNull(ps, idx++, entity.getBollardpull());
|
||||
|
||||
// VARCHAR
|
||||
ps.setString(idx++, entity.getCargocapacitiesnarrative());
|
||||
ps.setString(idx++, entity.getGeardescriptivenarrative());
|
||||
ps.setString(idx++, entity.getHoldsdescriptivenarrative());
|
||||
ps.setString(idx++, entity.getHatchesdescriptivenarrative());
|
||||
ps.setString(idx++, entity.getLanesdoorsrampsnarrative());
|
||||
ps.setString(idx++, entity.getSpecialisttankernarrative());
|
||||
ps.setString(idx++, entity.getTanksdescriptivenarrative());
|
||||
|
||||
// 6. 선박 기관 (VARCHAR)
|
||||
ps.setString(idx++, entity.getPrimemoverdescriptivenarrative());
|
||||
ps.setString(idx++, entity.getPrimemoverdescriptiveoverviewnarrative());
|
||||
ps.setString(idx++, entity.getAuxiliaryenginesnarrative());
|
||||
ps.setString(idx++, entity.getAuxiliarygeneratorsdescriptivenarrative());
|
||||
ps.setString(idx++, entity.getBunkersdescriptivenarrative());
|
||||
|
||||
ps.setString(idx++, entity.getIhslrorimoshipno());
|
||||
}
|
||||
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user