From e6084b6098821181aded0b5966bfcc3f564d6282 Mon Sep 17 00:00:00 2001 From: mrz <17966059@qq.com> Date: Sat, 17 Nov 2018 13:30:53 +0800 Subject: [PATCH] init demo 0.1 --- src/main/java/com/example/demo/DemoApplication.java | 209 +++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ src/main/java/com/example/demo/mapper/FWBAssociatedPartyMapper.java | 17 +++++++++++++++++ src/main/java/com/example/demo/model/FWBAssociatedParty.java | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/example/demo/scheduled/FWBTask.java | 289 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/example/demo/service/FWBAsssociatedPartyService.java | 9 +++++++++ src/main/java/com/example/demo/service/imp/FWBAsssociatedPartyService.java | 22 ++++++++++++++++++++++ src/main/java/com/example/demo/util/XML/XMLParse.java | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------- src/main/resources/generator/generatorConfig.xml | 2 +- src/main/resources/mapping/FWBAssociatedPartyMapper.xml | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 701 insertions(+), 232 deletions(-) create mode 100644 src/main/java/com/example/demo/mapper/FWBAssociatedPartyMapper.java create mode 100644 src/main/java/com/example/demo/model/FWBAssociatedParty.java create mode 100644 src/main/java/com/example/demo/scheduled/FWBTask.java create mode 100644 src/main/java/com/example/demo/service/FWBAsssociatedPartyService.java create mode 100644 src/main/java/com/example/demo/service/imp/FWBAsssociatedPartyService.java create mode 100644 src/main/resources/mapping/FWBAssociatedPartyMapper.xml diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index 61dcac6..a4f3e8e 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -9,220 +9,21 @@ import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; +import org.springframework.scheduling.annotation.EnableScheduling; +import java.util.Date; import java.util.List; import java.util.Map; @SpringBootApplication +@EnableScheduling @EnableEurekaClient @MapperScan("com.example.demo.mapper")//将项目中对应的mapper类的路径加进来就可以了 public class DemoApplication { public static void main(String[] args) { - Logger logger = LoggerFactory.getLogger(DemoApplication.class); + SpringApplication.run(DemoApplication.class, args); - String testMsg= "<MSG>\n" + - "\t<META>\n" + - "\t\t<SNDR>TXD</SNDR>\n" + - "\t\t<DDTM>20181109021010</DDTM>\n" + - "\t\t<TYPE>DFME</TYPE>\n" + - "\t\t<STYP>FWB</STYP>\n" + - "\t\t<SEQN>4638010</SEQN>\n" + - "\t</META>\n" + - "\t<MasterConsignment>\n" + - "\t\t<ID>479-77229622</ID>\n" + - "\t\t<TypeCode>741</TypeCode>\n" + - "\t\t<NilCarriageValueIndicator>false</NilCarriageValueIndicator>\n" + - "\t\t<DeclaredValueForCarriageAmount currencyID=\"CNY\">0</DeclaredValueForCarriageAmount>\n" + - "\t\t<NilCustomsValueIndicator>true</NilCustomsValueIndicator>\n" + - "\t\t<DeclaredValueForCustomsAmount currencyID=\"CNY\">NCV</DeclaredValueForCustomsAmount>\n" + - "\t\t<NilInsuranceValueIndicator>true</NilInsuranceValueIndicator>\n" + - "\t\t<InsuranceValueAmount currencyID=\"CNY\">XXX</InsuranceValueAmount>\n" + - "\t\t<TotalChargePrepaidIndicator>true</TotalChargePrepaidIndicator>\n" + - "\t\t<WeightTotalChargeAmount currencyID=\"CNY\">1153</WeightTotalChargeAmount>\n" + - "\t\t<ValuationTotalChargeAmount currencyID=\"CNY\">0.00</ValuationTotalChargeAmount>\n" + - "\t\t<TotalDisbursementPrepaidIndicator>true</TotalDisbursementPrepaidIndicator>\n" + - "\t\t<TotalPrepaidChargeAmount currencyID=\"CNY\">1384.00</TotalPrepaidChargeAmount>\n" + - "\t\t<TotalCollectChargeAmount currencyID=\"CNY\">0</TotalCollectChargeAmount>\n" + - "\t\t<DestinationCurrencyTotalCollectChargeAmount currencyID=\"CNY\">0</DestinationCurrencyTotalCollectChargeAmount>\n" + - "\t\t<IncludedTareGrossWeightMeasure unitCode=\"KGM\">1153.0</IncludedTareGrossWeightMeasure>\n" + - "\t\t<NetWeightMeasure/>\n" + - "\t\t<GrossVolumeMeasure unitCode=\"MTQ\">2.7</GrossVolumeMeasure>\n" + - "\t\t<TotalChargeableWeightMeasure unitCode=\"KGM\">1153.0</TotalChargeableWeightMeasure>\n" + - "\t\t<ConsignmentItemQuantity>1</ConsignmentItemQuantity>\n" + - "\t\t<TotalPieceQuantity>45</TotalPieceQuantity>\n" + - "\t\t<TotalLoadedPackageQuantity>45</TotalLoadedPackageQuantity>\n" + - "\t\t<PackageInfo>编织袋</PackageInfo>\n" + - "\t\t<FreightRateTypeCode>Q</FreightRateTypeCode>\n" + - "\t\t<ConsignorParty>\n" + - "\t\t\t<PrimaryID schemeAgencyID=\"1\">FY</PrimaryID>\n" + - "\t\t\t<Name>郑州飞鹰货运服务有限公司</Name>\n" + - "\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" + - "\t\t\t<PostalStructuredAddress>\n" + - "\t\t\t\t<StreetName>郑州</StreetName>\n" + - "\t\t\t\t<CityName>CGO</CityName>\n" + - "\t\t\t\t<CountryID>CN</CountryID>\n" + - "\t\t\t\t<SpecifiedAddressLocation/>\n" + - "\t\t\t</PostalStructuredAddress>\n" + - "\t\t\t<SpecifiedCargoAgentLocation/>\n" + - "\t\t\t<DefinedTradeContact>\n" + - "\t\t\t\t<DirectTelephoneCommunication>\n" + - "\t\t\t\t\t<CompleteNumber>13633854441</CompleteNumber>\n" + - "\t\t\t\t</DirectTelephoneCommunication>\n" + - "\t\t\t</DefinedTradeContact>\n" + - "\t\t</ConsignorParty>\n" + - "\t\t<ConsigneeParty>\n" + - "\t\t\t<PrimaryID schemeAgencyID=\"2\">SK</PrimaryID>\n" + - "\t\t\t<Name>深圳市联运通</Name>\n" + - "\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" + - "\t\t\t<PostalStructuredAddress>\n" + - "\t\t\t\t<StreetName>机场自提</StreetName>\n" + - "\t\t\t\t<CityName>SZX</CityName>\n" + - "\t\t\t\t<CountryID>CN</CountryID>\n" + - "\t\t\t\t<SpecifiedAddressLocation/>\n" + - "\t\t\t</PostalStructuredAddress>\n" + - "\t\t\t<SpecifiedCargoAgentLocation/>\n" + - "\t\t\t<DefinedTradeContact/>\n" + - "\t\t</ConsigneeParty>\n" + - "\t\t<FreightForwarderParty>\n" + - "\t\t\t<Name>80210200</Name>\n" + - "\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" + - "\t\t\t<PostalStructuredAddress>\n" + - "\t\t\t\t<CityName>CGO</CityName>\n" + - "\t\t\t\t<CountryID>CN</CountryID>\n" + - "\t\t\t\t<SpecifiedAddressLocation/>\n" + - "\t\t\t</PostalStructuredAddress>\n" + - "\t\t\t<SpecifiedCargoAgentLocation/>\n" + - "\t\t\t<DefinedTradeContact/>\n" + - "\t\t</FreightForwarderParty>\n" + - "\t\t<AssociatedParty>\n" + - "\t\t\t<PrimaryID/>\n" + - "\t\t\t<Name>CGO</Name>\n" + - "\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" + - "\t\t\t<RoleCode>AGT</RoleCode>\n" + - "\t\t\t<Role>Agent</Role>\n" + - "\t\t\t<PostalStructuredAddress>\n" + - "\t\t\t\t<CityName>CGO</CityName>\n" + - "\t\t\t\t<CountryID>CN</CountryID>\n" + - "\t\t\t\t<SpecifiedAddressLocation/>\n" + - "\t\t\t</PostalStructuredAddress>\n" + - "\t\t\t<SpecifiedCargoAgentLocation/>\n" + - "\t\t\t<DefinedTradeContact/>\n" + - "\t\t</AssociatedParty>\n" + - "\t\t<AssociatedParty>\n" + - "\t\t\t<PrimaryID/>\n" + - "\t\t\t<Name>CGOHA</Name>\n" + - "\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" + - "\t\t\t<RoleCode>GHA</RoleCode>\n" + - "\t\t\t<Role>Ground Handling Agent</Role>\n" + - "\t\t\t<PostalStructuredAddress>\n" + - "\t\t\t\t<CityName>CGO</CityName>\n" + - "\t\t\t\t<CountryID>CN</CountryID>\n" + - "\t\t\t\t<SpecifiedAddressLocation/>\n" + - "\t\t\t</PostalStructuredAddress>\n" + - "\t\t\t<SpecifiedCargoAgentLocation/>\n" + - "\t\t\t<DefinedTradeContact/>\n" + - "\t\t</AssociatedParty>\n" + - "\t\t<OriginLocation>\n" + - "\t\t\t<ID>CGO</ID>\n" + - "\t\t</OriginLocation>\n" + - "\t\t<FinalDestinationLocation>\n" + - "\t\t\t<ID>SZX</ID>\n" + - "\t\t</FinalDestinationLocation>\n" + - "\t\t<SpecifiedLogisticsTransportMovement>\n" + - "\t\t\t<StageCode>ZH9306/Nov09</StageCode>\n" + - "\t\t\t<ModeCode>4</ModeCode>\n" + - "\t\t\t<Mode>Air Transport</Mode>\n" + - "\t\t\t<ID>ZH9306</ID>\n" + - "\t\t\t<SequenceNumeric>1</SequenceNumeric>\n" + - "\t\t\t<UsedLogisticsTransportMeans/>\n" + - "\t\t\t<ArrivalEvent>\n" + - "\t\t\t\t<OccurrenceArrivalLocation>\n" + - "\t\t\t\t\t<ID>SZX</ID>\n" + - "\t\t\t\t</OccurrenceArrivalLocation>\n" + - "\t\t\t</ArrivalEvent>\n" + - "\t\t\t<DepartureEvent>\n" + - "\t\t\t\t<ScheduledOccurrenceDateTime>2018-11-09T00:00:00+08:00</ScheduledOccurrenceDateTime>\n" + - "\t\t\t\t<OccurrenceDepartureLocation>\n" + - "\t\t\t\t\t<ID>CGO</ID>\n" + - "\t\t\t\t</OccurrenceDepartureLocation>\n" + - "\t\t\t</DepartureEvent>\n" + - "\t\t</SpecifiedLogisticsTransportMovement>\n" + - "\t\t<HandlingInstructions>\n" + - "\t\t\t<Description>ELI</Description>\n" + - "\t\t\t<DescriptionCode>ELI</DescriptionCode>\n" + - "\t\t</HandlingInstructions>\n" + - "\t\t<AssociatedConsignmentCustomsProcedure/>\n" + - "\t\t<ApplicableTradeCurrencyExchange>\n" + - "\t\t\t<SourceCurrencyCode>CNY</SourceCurrencyCode>\n" + - "\t\t\t<TargetCurrencyCode>CNY</TargetCurrencyCode>\n" + - "\t\t\t<MarketID>S</MarketID>\n" + - "\t\t\t<ConversionRate>1</ConversionRate>\n" + - "\t\t</ApplicableTradeCurrencyExchange>\n" + - "\t\t<ApplicableLogisticsServiceCharge/>\n" + - "\t\t<ApplicableLogisticsAllowanceCharge>\n" + - "\t\t\t<ID>MY</ID>\n" + - "\t\t\t<Reason>燃油费</Reason>\n" + - "\t\t\t<ActualAmount currencyID=\"CNY\">231</ActualAmount>\n" + - "\t\t\t<PartyTypeCode>C</PartyTypeCode>\n" + - "\t\t</ApplicableLogisticsAllowanceCharge>\n" + - "\t\t<SignatoryCarrierAuthentication>\n" + - "\t\t\t<ActualDateTime>2018-11-09T02:07:00</ActualDateTime>\n" + - "\t\t\t<Signatory>郑天祥</Signatory>\n" + - "\t\t\t<IssueAuthenticationLocation>\n" + - "\t\t\t\t<Name>郑州</Name>\n" + - "\t\t\t</IssueAuthenticationLocation>\n" + - "\t\t</SignatoryCarrierAuthentication>\n" + - "\t\t<IncludedMasterConsignmentItem>\n" + - "\t\t\t<SequenceNumeric>1</SequenceNumeric>\n" + - "\t\t\t<TypeCode listAgencyID=\"1\">SJ</TypeCode>\n" + - "\t\t\t<GrossWeightMeasure unitCode=\"KGM\">1153.0</GrossWeightMeasure>\n" + - "\t\t\t<GrossVolumeMeasure unitCode=\"MTQ\">2.7</GrossVolumeMeasure>\n" + - "\t\t\t<PieceQuantity>45</PieceQuantity>\n" + - "\t\t\t<TareWeightMeasure unitCode=\"KGM\">1153.0</TareWeightMeasure>\n" + - "\t\t\t<NatureIdentificationTransportCargo>\n" + - "\t\t\t\t<Identification>手机(内含锂离子电池符合包装说明PI967第二部分要求)</Identification>\n" + - "\t\t\t</NatureIdentificationTransportCargo>\n" + - "\t\t\t<OriginCountry/>\n" + - "\t\t\t<AssociatedUnitLoadTransportEquipment>\n" + - "\t\t\t\t<OperatingParty/>\n" + - "\t\t\t</AssociatedUnitLoadTransportEquipment>\n" + - "\t\t\t<TransportLogisticsPackage>\n" + - "\t\t\t\t<ItemQuantity>45</ItemQuantity>\n" + - "\t\t\t\t<LinearSpatialDimension>\n" + - "\t\t\t\t\t<Description>true</Description>\n" + - "\t\t\t\t\t<WidthMeasure unitCode=\"CMT\">40</WidthMeasure>\n" + - "\t\t\t\t\t<LengthMeasure unitCode=\"CMT\">30</LengthMeasure>\n" + - "\t\t\t\t\t<HeightMeasure unitCode=\"CMT\">50</HeightMeasure>\n" + - "\t\t\t\t</LinearSpatialDimension>\n" + - "\t\t\t</TransportLogisticsPackage>\n" + - "\t\t\t<ApplicableFreightRateServiceCharge>\n" + - "\t\t\t\t<CategoryCode>Q</CategoryCode>\n" + - "\t\t\t\t<CommodityItemID>D2</CommodityItemID>\n" + - "\t\t\t\t<ChargeableWeightMeasure unitCode=\"KGM\">1153.0</ChargeableWeightMeasure>\n" + - "\t\t\t\t<AppliedRate>1</AppliedRate>\n" + - "\t\t\t\t<AppliedAmount currencyID=\"CNY\">1153</AppliedAmount>\n" + - "\t\t\t</ApplicableFreightRateServiceCharge>\n" + - "\t\t\t<SpecifiedRateCombinationPointLocation/>\n" + - "\t\t</IncludedMasterConsignmentItem>\n" + - "\t\t<ReportedStatus>\n" + - "\t\t\t<ReasonCode>FWB</ReasonCode>\n" + - "\t\t\t<EventTime>\n" + - "\t\t\t\t<OccurrenceDateTime>2018-11-09T02:07:15+08:00</OccurrenceDateTime>\n" + - "\t\t\t\t<DateTimeTypeCode>Actual</DateTimeTypeCode>\n" + - "\t\t\t</EventTime>\n" + - "\t\t\t<SpecifiedLocation>\n" + - "\t\t\t\t<ID>CGO</ID>\n" + - "\t\t\t</SpecifiedLocation>\n" + - "\t\t</ReportedStatus>\n" + - "\t</MasterConsignment>\n" + - "</MSG>"; - try { - XMLParse xmlParse = new XMLParse(testMsg, "/MSG/MasterConsignment/AssociatedParty"); - List<Map> stype_value =xmlParse.getNodeValuesFromXmlString(); - logger.info(stype_value.toString()); - }catch (Exception var7){ - System.out.print("there something wrong"); - } + } } diff --git a/src/main/java/com/example/demo/mapper/FWBAssociatedPartyMapper.java b/src/main/java/com/example/demo/mapper/FWBAssociatedPartyMapper.java new file mode 100644 index 0000000..8c20a9d --- /dev/null +++ b/src/main/java/com/example/demo/mapper/FWBAssociatedPartyMapper.java @@ -0,0 +1,17 @@ +package com.example.demo.mapper; + +import com.example.demo.model.FWBAssociatedParty; + +public interface FWBAssociatedPartyMapper { + int deleteByPrimaryKey(Integer id); + + int insert(FWBAssociatedParty record); + + int insertSelective(FWBAssociatedParty record); + + FWBAssociatedParty selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(FWBAssociatedParty record); + + int updateByPrimaryKey(FWBAssociatedParty record); +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/model/FWBAssociatedParty.java b/src/main/java/com/example/demo/model/FWBAssociatedParty.java new file mode 100644 index 0000000..a0dc1e1 --- /dev/null +++ b/src/main/java/com/example/demo/model/FWBAssociatedParty.java @@ -0,0 +1,116 @@ +package com.example.demo.model; + +import java.time.LocalDate; + + +public class FWBAssociatedParty { + private Integer id; + + private String primaryid; + + private String name; + + private String accountid; + + private String rolecode; + + private String role; + + private String cityname; + + private String countryid; + + private String awbnumber; + + private LocalDate flightdate; + + private String flightnumber; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getPrimaryid() { + return primaryid; + } + + public void setPrimaryid(String primaryid) { + this.primaryid = primaryid == null ? null : primaryid.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getAccountid() { + return accountid; + } + + public void setAccountid(String accountid) { + this.accountid = accountid == null ? null : accountid.trim(); + } + + public String getRolecode() { + return rolecode; + } + + public void setRolecode(String rolecode) { + this.rolecode = rolecode == null ? null : rolecode.trim(); + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role == null ? null : role.trim(); + } + + public String getCityname() { + return cityname; + } + + public void setCityname(String cityname) { + this.cityname = cityname == null ? null : cityname.trim(); + } + + public String getCountryid() { + return countryid; + } + + public void setCountryid(String countryid) { + this.countryid = countryid == null ? null : countryid.trim(); + } + + public String getAwbnumber() { + return awbnumber; + } + + public void setAwbnumber(String awbnumber) { + this.awbnumber = awbnumber == null ? null : awbnumber.trim(); + } + + public LocalDate getFlightdate() { + return flightdate; + } + + public void setFlightdate(LocalDate flightdate) { + this.flightdate = flightdate; + } + + public String getFlightnumber() { + return flightnumber; + } + + public void setFlightnumber(String flightnumber) { + this.flightnumber = flightnumber == null ? null : flightnumber.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/demo/scheduled/FWBTask.java b/src/main/java/com/example/demo/scheduled/FWBTask.java new file mode 100644 index 0000000..b800e6a --- /dev/null +++ b/src/main/java/com/example/demo/scheduled/FWBTask.java @@ -0,0 +1,289 @@ +package com.example.demo.scheduled; + +import com.example.demo.model.FWBAssociatedParty; +import com.example.demo.util.XML.XMLParse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +/** + * 定时任务 + */ +@Component +public class FWBTask { + private static final Logger logger = LoggerFactory.getLogger(FWBTask.class); + private static final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + @Scheduled(fixedRate = 5000) + public void scheduledDemo(){ + logger.info("scheduled - fixedRate - print time every 5 seconds:{}", format.format(new Date()) ); + String testMsg= "<MSG>\n" + + "\t<META>\n" + + "\t\t<SNDR>TXD</SNDR>\n" + + "\t\t<DDTM>20181114040536</DDTM>\n" + + "\t\t<TYPE>DFME</TYPE>\n" + + "\t\t<STYP>FWB</STYP>\n" + + "\t\t<SEQN>4643187</SEQN>\n" + + "\t</META>\n" + + "\t<MasterConsignment>\n" + + "\t\t<ID>880-83213594</ID>\n" + + "\t\t<TypeCode>741</TypeCode>\n" + + "\t\t<NilCarriageValueIndicator>false</NilCarriageValueIndicator>\n" + + "\t\t<DeclaredValueForCarriageAmount currencyID=\"CNY\">0</DeclaredValueForCarriageAmount>\n" + + "\t\t<NilCustomsValueIndicator>true</NilCustomsValueIndicator>\n" + + "\t\t<DeclaredValueForCustomsAmount currencyID=\"CNY\">NCV</DeclaredValueForCustomsAmount>\n" + + "\t\t<NilInsuranceValueIndicator>true</NilInsuranceValueIndicator>\n" + + "\t\t<InsuranceValueAmount currencyID=\"CNY\">XXX</InsuranceValueAmount>\n" + + "\t\t<TotalChargePrepaidIndicator>true</TotalChargePrepaidIndicator>\n" + + "\t\t<WeightTotalChargeAmount currencyID=\"CNY\">502</WeightTotalChargeAmount>\n" + + "\t\t<ValuationTotalChargeAmount currencyID=\"CNY\">0.00</ValuationTotalChargeAmount>\n" + + "\t\t<TotalDisbursementPrepaidIndicator>true</TotalDisbursementPrepaidIndicator>\n" + + "\t\t<TotalPrepaidChargeAmount currencyID=\"CNY\">613.60</TotalPrepaidChargeAmount>\n" + + "\t\t<TotalCollectChargeAmount currencyID=\"CNY\">0</TotalCollectChargeAmount>\n" + + "\t\t<DestinationCurrencyTotalCollectChargeAmount currencyID=\"CNY\">0</DestinationCurrencyTotalCollectChargeAmount>\n" + + "\t\t<IncludedTareGrossWeightMeasure unitCode=\"KGM\">558.0</IncludedTareGrossWeightMeasure>\n" + + "\t\t<NetWeightMeasure/>\n" + + "\t\t<GrossVolumeMeasure unitCode=\"MTQ\">4.44</GrossVolumeMeasure>\n" + + "\t\t<TotalChargeableWeightMeasure unitCode=\"KGM\">558.0</TotalChargeableWeightMeasure>\n" + + "\t\t<ConsignmentItemQuantity>1</ConsignmentItemQuantity>\n" + + "\t\t<TotalPieceQuantity>74</TotalPieceQuantity>\n" + + "\t\t<TotalLoadedPackageQuantity>74</TotalLoadedPackageQuantity>\n" + + "\t\t<PackageInfo>编织袋</PackageInfo>\n" + + "\t\t<FreightRateTypeCode>Q</FreightRateTypeCode>\n" + + "\t\t<ConsignorParty>\n" + + "\t\t\t<PrimaryID schemeAgencyID=\"1\">HNHH</PrimaryID>\n" + + "\t\t\t<Name>河南汇海物流有限公司</Name>\n" + + "\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" + + "\t\t\t<PostalStructuredAddress>\n" + + "\t\t\t\t<StreetName>郑州</StreetName>\n" + + "\t\t\t\t<CityName>CGO</CityName>\n" + + "\t\t\t\t<CountryID>CN</CountryID>\n" + + "\t\t\t\t<SpecifiedAddressLocation/>\n" + + "\t\t\t</PostalStructuredAddress>\n" + + "\t\t\t<SpecifiedCargoAgentLocation/>\n" + + "\t\t\t<DefinedTradeContact>\n" + + "\t\t\t\t<DirectTelephoneCommunication>\n" + + "\t\t\t\t\t<CompleteNumber>CGO</CompleteNumber>\n" + + "\t\t\t\t</DirectTelephoneCommunication>\n" + + "\t\t\t</DefinedTradeContact>\n" + + "\t\t</ConsignorParty>\n" + + "\t\t<ConsigneeParty>\n" + + "\t\t\t<PrimaryID schemeAgencyID=\"2\">SK</PrimaryID>\n" + + "\t\t\t<Name>海南顺丰速运有限公司</Name>\n" + + "\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" + + "\t\t\t<PostalStructuredAddress>\n" + + "\t\t\t\t<StreetName>机场自提</StreetName>\n" + + "\t\t\t\t<CityName>HAK</CityName>\n" + + "\t\t\t\t<CountryID>CN</CountryID>\n" + + "\t\t\t\t<SpecifiedAddressLocation/>\n" + + "\t\t\t</PostalStructuredAddress>\n" + + "\t\t\t<SpecifiedCargoAgentLocation/>\n" + + "\t\t\t<DefinedTradeContact/>\n" + + "\t\t</ConsigneeParty>\n" + + "\t\t<FreightForwarderParty>\n" + + "\t\t\t<Name>CGOSA</Name>\n" + + "\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" + + "\t\t\t<PostalStructuredAddress>\n" + + "\t\t\t\t<CityName>CGO</CityName>\n" + + "\t\t\t\t<CountryID>CN</CountryID>\n" + + "\t\t\t\t<SpecifiedAddressLocation/>\n" + + "\t\t\t</PostalStructuredAddress>\n" + + "\t\t\t<SpecifiedCargoAgentLocation/>\n" + + "\t\t\t<DefinedTradeContact/>\n" + + "\t\t</FreightForwarderParty>\n" + + "\t\t<AssociatedParty>\n" + + "\t\t\t<PrimaryID/>\n" + + "\t\t\t<Name>CGO</Name>\n" + + "\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" + + "\t\t\t<RoleCode>AGT</RoleCode>\n" + + "\t\t\t<Role>Agent</Role>\n" + + "\t\t\t<PostalStructuredAddress>\n" + + "\t\t\t\t<CityName>CGO</CityName>\n" + + "\t\t\t\t<CountryID>CN</CountryID>\n" + + "\t\t\t\t<SpecifiedAddressLocation/>\n" + + "\t\t\t</PostalStructuredAddress>\n" + + "\t\t\t<SpecifiedCargoAgentLocation/>\n" + + "\t\t\t<DefinedTradeContact/>\n" + + "\t\t</AssociatedParty>\n" + + "\t\t<AssociatedParty>\n" + + "\t\t\t<PrimaryID/>\n" + + "\t\t\t<Name>CGOHA</Name>\n" + + "\t\t\t<AccountID>INFOSKY:NULL</AccountID>\n" + + "\t\t\t<RoleCode>GHA</RoleCode>\n" + + "\t\t\t<Role>Ground Handling Agent</Role>\n" + + "\t\t\t<PostalStructuredAddress>\n" + + "\t\t\t\t<CityName>CGO</CityName>\n" + + "\t\t\t\t<CountryID>CN</CountryID>\n" + + "\t\t\t\t<SpecifiedAddressLocation/>\n" + + "\t\t\t</PostalStructuredAddress>\n" + + "\t\t\t<SpecifiedCargoAgentLocation/>\n" + + "\t\t\t<DefinedTradeContact/>\n" + + "\t\t</AssociatedParty>\n" + + "\t\t<OriginLocation>\n" + + "\t\t\t<ID>CGO</ID>\n" + + "\t\t</OriginLocation>\n" + + "\t\t<FinalDestinationLocation>\n" + + "\t\t\t<ID>HAK</ID>\n" + + "\t\t</FinalDestinationLocation>\n" + + "\t\t<SpecifiedLogisticsTransportMovement>\n" + + "\t\t\t<StageCode>HU7304/Nov14</StageCode>\n" + + "\t\t\t<ModeCode>4</ModeCode>\n" + + "\t\t\t<Mode>Air Transport</Mode>\n" + + "\t\t\t<ID>HU7304</ID>\n" + + "\t\t\t<SequenceNumeric>1</SequenceNumeric>\n" + + "\t\t\t<UsedLogisticsTransportMeans/>\n" + + "\t\t\t<ArrivalEvent>\n" + + "\t\t\t\t<OccurrenceArrivalLocation>\n" + + "\t\t\t\t\t<ID>HAK</ID>\n" + + "\t\t\t\t</OccurrenceArrivalLocation>\n" + + "\t\t\t</ArrivalEvent>\n" + + "\t\t\t<DepartureEvent>\n" + + "\t\t\t\t<ScheduledOccurrenceDateTime>2018-11-14T00:00:00+08:00</ScheduledOccurrenceDateTime>\n" + + "\t\t\t\t<OccurrenceDepartureLocation>\n" + + "\t\t\t\t\t<ID>CGO</ID>\n" + + "\t\t\t\t</OccurrenceDepartureLocation>\n" + + "\t\t\t</DepartureEvent>\n" + + "\t\t</SpecifiedLogisticsTransportMovement>\n" + + "\t\t<IncludedAccountingNote>\n" + + "\t\t\t<ContentCode>20010003普通</ContentCode>\n" + + "\t\t\t<Content>20010003普通</Content>\n" + + "\t\t</IncludedAccountingNote>\n" + + "\t\t<AssociatedConsignmentCustomsProcedure/>\n" + + "\t\t<ApplicableTradeCurrencyExchange>\n" + + "\t\t\t<SourceCurrencyCode>CNY</SourceCurrencyCode>\n" + + "\t\t\t<TargetCurrencyCode>CNY</TargetCurrencyCode>\n" + + "\t\t\t<MarketID>S</MarketID>\n" + + "\t\t\t<ConversionRate>1</ConversionRate>\n" + + "\t\t</ApplicableTradeCurrencyExchange>\n" + + "\t\t<ApplicableLogisticsServiceCharge/>\n" + + "\t\t<ApplicableLogisticsAllowanceCharge>\n" + + "\t\t\t<ID>MY</ID>\n" + + "\t\t\t<Reason>燃油费</Reason>\n" + + "\t\t\t<ActualAmount currencyID=\"CNY\">111.6</ActualAmount>\n" + + "\t\t\t<PartyTypeCode>C</PartyTypeCode>\n" + + "\t\t</ApplicableLogisticsAllowanceCharge>\n" + + "\t\t<SignatoryCarrierAuthentication>\n" + + "\t\t\t<ActualDateTime>2018-11-14T04:02:00</ActualDateTime>\n" + + "\t\t\t<Signatory>牛青</Signatory>\n" + + "\t\t\t<IssueAuthenticationLocation>\n" + + "\t\t\t\t<Name>郑州</Name>\n" + + "\t\t\t</IssueAuthenticationLocation>\n" + + "\t\t</SignatoryCarrierAuthentication>\n" + + "\t\t<IncludedMasterConsignmentItem>\n" + + "\t\t\t<SequenceNumeric>1</SequenceNumeric>\n" + + "\t\t\t<TypeCode listAgencyID=\"1\">PH</TypeCode>\n" + + "\t\t\t<GrossWeightMeasure unitCode=\"KGM\">558.0</GrossWeightMeasure>\n" + + "\t\t\t<GrossVolumeMeasure unitCode=\"MTQ\">4.44</GrossVolumeMeasure>\n" + + "\t\t\t<PieceQuantity>74</PieceQuantity>\n" + + "\t\t\t<TareWeightMeasure unitCode=\"KGM\">558.0</TareWeightMeasure>\n" + + "\t\t\t<NatureIdentificationTransportCargo>\n" + + "\t\t\t\t<Identification>手机机头(无电池) 电子主板 上衣 茶叶 大枣 皮带 票证 运动鞋 背包 灯座</Identification>\n" + + "\t\t\t</NatureIdentificationTransportCargo>\n" + + "\t\t\t<OriginCountry/>\n" + + "\t\t\t<AssociatedUnitLoadTransportEquipment>\n" + + "\t\t\t\t<OperatingParty/>\n" + + "\t\t\t</AssociatedUnitLoadTransportEquipment>\n" + + "\t\t\t<TransportLogisticsPackage>\n" + + "\t\t\t\t<ItemQuantity>74</ItemQuantity>\n" + + "\t\t\t\t<LinearSpatialDimension>\n" + + "\t\t\t\t\t<Description>true</Description>\n" + + "\t\t\t\t\t<WidthMeasure unitCode=\"CMT\">40</WidthMeasure>\n" + + "\t\t\t\t\t<LengthMeasure unitCode=\"CMT\">30</LengthMeasure>\n" + + "\t\t\t\t\t<HeightMeasure unitCode=\"CMT\">50</HeightMeasure>\n" + + "\t\t\t\t</LinearSpatialDimension>\n" + + "\t\t\t</TransportLogisticsPackage>\n" + + "\t\t\t<ApplicableFreightRateServiceCharge>\n" + + "\t\t\t\t<CategoryCode>Q</CategoryCode>\n" + + "\t\t\t\t<CommodityItemID>P</CommodityItemID>\n" + + "\t\t\t\t<ChargeableWeightMeasure unitCode=\"KGM\">558.0</ChargeableWeightMeasure>\n" + + "\t\t\t\t<AppliedRate>0.9</AppliedRate>\n" + + "\t\t\t\t<AppliedAmount currencyID=\"CNY\">502</AppliedAmount>\n" + + "\t\t\t</ApplicableFreightRateServiceCharge>\n" + + "\t\t\t<SpecifiedRateCombinationPointLocation/>\n" + + "\t\t</IncludedMasterConsignmentItem>\n" + + "\t\t<ReportedStatus>\n" + + "\t\t\t<ReasonCode>FWB</ReasonCode>\n" + + "\t\t\t<EventTime>\n" + + "\t\t\t\t<OccurrenceDateTime>2018-11-14T04:03:02+08:00</OccurrenceDateTime>\n" + + "\t\t\t\t<DateTimeTypeCode>Actual</DateTimeTypeCode>\n" + + "\t\t\t</EventTime>\n" + + "\t\t\t<SpecifiedLocation>\n" + + "\t\t\t\t<ID>CGO</ID>\n" + + "\t\t\t</SpecifiedLocation>\n" + + "\t\t</ReportedStatus>\n" + + "\t</MasterConsignment>\n" + + "</MSG>"; + try { + XMLParse xmlParse = new XMLParse(testMsg); + Map resoultMaps = xmlParse.getAllValuesFromXmlString(); + logger.info(resoultMaps.toString()); + FWBAssociatedParty fwbAssociatedParty = new FWBAssociatedParty(); + + fwbAssociatedParty.setAwbnumber(xmlParse.getNodeValueFromXmlString( "/MSG/MasterConsignment/ID")); + String[] flight = xmlParse.getNodeValueFromXmlString( "/MSG/MasterConsignment/SpecifiedLogisticsTransportMovement/StageCode").split("/"); + String flightDep = xmlParse.getNodeValueFromXmlString( "/MSG/MasterConsignment/SpecifiedLogisticsTransportMovement/DepartureEvent/ScheduledOccurrenceDateTime"); + String flight_No = flight[0]; //航班号 + String flight_date=flight[1]; //航班日期年月 + fwbAssociatedParty.setFlightnumber(flight_No); + + //根据离港日期取航班日期年份 + ZonedDateTime depZoneTime = ZonedDateTime.parse(flightDep); + String year = String.valueOf(depZoneTime.getYear()); + //合并航班日期和离港年份,组成完整日期格式 + flight_date = flight_date+year; + DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL); + formatter = DateTimeFormatter.ofPattern("MMMddyyyy",Locale.ENGLISH); + LocalDate date =LocalDate.parse(flight_date,formatter); + //写入对象 + fwbAssociatedParty.setFlightdate(date); + //以上关于运单的信息与航班信息已解析完成 + + //开始读取相同节点数组 + List<Map> stype_value =xmlParse.getNodeValuesFromXmlString( "/MSG/MasterConsignment/AssociatedParty"); + for (Map map :stype_value){ + fwbAssociatedParty.setPrimaryid((String) map.get("PrimaryID")); + fwbAssociatedParty.setName(map.get("Name").toString()); + fwbAssociatedParty.setAccountid(map.get("AccountID").toString()); + fwbAssociatedParty.setRolecode(map.get("RoleCode").toString()); + fwbAssociatedParty.setRole(map.get("Role").toString()); + } + + // + + logger.info(stype_value.toString()); + }catch (Exception var7){ + logger.error(var7.toString()); + } + } + + /** + "0/5 * * * * ?" 每5秒触发 + "0 0 12 * * ?" 每天中午十二点触发 + "0 15 10 ? * *" 每天早上10:15触发 + "0 15 10 * * ?" 每天早上10:15触发 + "0 15 10 * * ? *" 每天早上10:15触发 + "0 15 10 * * ? 2005" 2005年的每天早上10:15触发 + "0 * 14 * * ?" 每天从下午2点开始到2点59分每分钟一次触发 + "0 0/5 14 * * ?" 每天从下午2点开始到2:55分结束每5分钟一次触发 + "0 0/5 14,18 * * ?" 每天的下午2点至2:55和6点至6点55分两个时间段内每5分钟一次触发 + "0 0-5 14 * * ?" 每天14:00至14:05每分钟一次触发 + "0 10,44 14 ? 3 WED" 三月的每周三的14:10和14:44触发 + "0 15 10 ? * MON-FRI" 每个周一、周二、周三、周四、周五的10:15触发 + */ +// @Scheduled(cron="0/10 * * * * ?") +// public void scheduledCronDemo(){ +// logger.info("scheduled - cron - print time every 10 seconds:{}", format.format(new Date()) ); +// } +} diff --git a/src/main/java/com/example/demo/service/FWBAsssociatedPartyService.java b/src/main/java/com/example/demo/service/FWBAsssociatedPartyService.java new file mode 100644 index 0000000..2c48778 --- /dev/null +++ b/src/main/java/com/example/demo/service/FWBAsssociatedPartyService.java @@ -0,0 +1,9 @@ +package com.example.demo.service; + +import com.example.demo.model.FWBAssociatedParty; + +public interface FWBAsssociatedPartyService { + int insert(FWBAssociatedParty record); + + int insertSelective(FWBAssociatedParty record); +} diff --git a/src/main/java/com/example/demo/service/imp/FWBAsssociatedPartyService.java b/src/main/java/com/example/demo/service/imp/FWBAsssociatedPartyService.java new file mode 100644 index 0000000..81c7742 --- /dev/null +++ b/src/main/java/com/example/demo/service/imp/FWBAsssociatedPartyService.java @@ -0,0 +1,22 @@ +package com.example.demo.service.imp; + +import com.example.demo.mapper.FWBAssociatedPartyMapper; +import com.example.demo.model.FWBAssociatedParty; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("fwbAssService") +public class FWBAsssociatedPartyService implements com.example.demo.service.FWBAsssociatedPartyService { + + + @Autowired + FWBAssociatedPartyMapper fwbAssociatedPartyMapper; + + public int insert(FWBAssociatedParty record){ + return fwbAssociatedPartyMapper.insert(record); + } + + public int insertSelective(FWBAssociatedParty record){ + return fwbAssociatedPartyMapper.insertSelective(record); + } +} diff --git a/src/main/java/com/example/demo/util/XML/XMLParse.java b/src/main/java/com/example/demo/util/XML/XMLParse.java index f9a8480..b6e01c4 100644 --- a/src/main/java/com/example/demo/util/XML/XMLParse.java +++ b/src/main/java/com/example/demo/util/XML/XMLParse.java @@ -15,44 +15,87 @@ import java.io.StringReader; import java.util.*; public class XMLParse { + private static final Logger logger = LoggerFactory.getLogger(DemoApplication.class); private static String xmlString; - private static String[] nodes; private static Document document; private static SAXBuilder builder; private static Element root; private static LinkedList<SubNode> listNode; private static StringReader xmlReader; private static InputSource xmlSource; + private static List<Map> maps = new ArrayList<Map>(); + private static Map<String,Map> allElementValue = new HashMap<String, Map>(); + private static int domCount=0; private String value; + public XMLParse() { } - Logger logger = LoggerFactory.getLogger(DemoApplication.class); - /** - * - * @param xmlString xml字符窜 - * @param xmlNodePath 节点参数(例如:/root/head/type) - */ - public XMLParse(String xmlString, String xmlNodePath) { - this.xmlString = xmlString; - this.nodes = xmlNodePath.split("/"); - this.builder = new SAXBuilder(); - this.root = null; - this.listNode = new LinkedList(); - this.value = ""; - this.document =new Document(); + public XMLParse(String XmlString) { + builder = new SAXBuilder(); + root = null; + listNode = new LinkedList(); + value = ""; + document =new Document(); + xmlString = XmlString; + } + + public Map getAllValuesFromXmlString() throws Exception{ + try { + xmlReader = new StringReader(xmlString); + xmlSource = new InputSource(xmlReader); + document = builder.build(xmlSource); + root = document.getRootElement(); + getElements(root); + + }catch (Exception var17) { + var17.printStackTrace(); + throw var17; + } finally { + listNode.clear(); + document = null; + root = null; +// builder = null; + + } + return allElementValue; } + public void getElements (Element element) throws Exception{ + try { + domCount++; + List<Element> Children = element.getChildren(); + if (Children.size()>0){ + for (Element elements : Children){ + if(elements.getChildren().size()>0){ + getElements(elements); + }else {//确定是最末节点了 开始取末节点的数据 + String childName = elements.getName(); + String childValue = elements.getText(); + Map<String,String> childMap = new HashMap<String, String>(); //用map存储每个最终节点的值 + childMap.put(childName,childValue); + allElementValue.put(domCount+elements.getParentElement().getName()+"-"+childName,childMap); + } + } + } + + + }catch (Exception e){ + e.printStackTrace(); + throw e; + } + + } /** * 取一对多关系的节点下的所有子节点的属性名 和 值 * @return * @throws Exception */ - public List<Map> getNodeValuesFromXmlString() throws Exception{ - + public List<Map> getNodeValuesFromXmlString(String xmlNodePath) throws Exception{ + String[] nodes = xmlNodePath.split("/"); try { - this.xmlReader = new StringReader(this.xmlString); - this.xmlSource = new InputSource(this.xmlReader); - this.document = this.builder.build(xmlSource); + xmlReader = new StringReader(xmlString); + xmlSource = new InputSource(xmlReader); + document = builder.build(xmlSource); List<Map> maps = new ArrayList<Map>(); for(int i = 1; i < nodes.length; ++i) { SubNode snode; @@ -71,10 +114,17 @@ public class XMLParse { List<Element> elements=element.getChildren(); Map<String,String> childMap = new HashMap<String, String>(); //用map存储每个值 for (Element childElements : elements){ + if (childElements.getChildren().size()>1){ + for (Element grandChildrenEle : (List<Element>)childElements.getChildren()){ + String childName = grandChildrenEle.getName(); + String childValue = grandChildrenEle.getText(); + childMap.put(childName,childValue); + } + } String childName = childElements.getName(); String childValue = childElements.getText(); childMap.put(childName,childValue); - logger.debug(childValue); + logger.info(childValue); } maps.add(childMap); } @@ -95,7 +145,7 @@ public class XMLParse { listNode.clear(); document = null; root = null; - builder = null; +// builder = null; nodes = null; } @@ -106,11 +156,12 @@ public class XMLParse { * @return 单一节点值 * @throws Exception */ - public final String getNodeValueFromXmlString() throws Exception { + public final String getNodeValueFromXmlString(String xmlNodePath) throws Exception { + String[] nodes = xmlNodePath.split("/"); try { - this.xmlReader = new StringReader(this.xmlString); - this.xmlSource = new InputSource(this.xmlReader); - this.document = this.builder.build(xmlSource); + xmlReader = new StringReader(xmlString); + xmlSource = new InputSource(xmlReader); + document = builder.build(xmlSource); for(int i = 1; i < nodes.length; ++i) { SubNode snode; @@ -139,7 +190,7 @@ public class XMLParse { listNode.clear(); document = null; root = null; - builder = null; +// builder = null; nodes = null; } diff --git a/src/main/resources/generator/generatorConfig.xml b/src/main/resources/generator/generatorConfig.xml index fb51b27..98d8958 100644 --- a/src/main/resources/generator/generatorConfig.xml +++ b/src/main/resources/generator/generatorConfig.xml @@ -31,6 +31,6 @@ <property name="enableSubPackages" value="true"/> </javaClientGenerator> <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> - <table tableName="users" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> + <table tableName="AssociatedParty" domainObjectName="FWBAssociatedParty" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> </context> </generatorConfiguration> \ No newline at end of file diff --git a/src/main/resources/mapping/FWBAssociatedPartyMapper.xml b/src/main/resources/mapping/FWBAssociatedPartyMapper.xml new file mode 100644 index 0000000..90eb6d1 --- /dev/null +++ b/src/main/resources/mapping/FWBAssociatedPartyMapper.xml @@ -0,0 +1,164 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.example.demo.mapper.FWBAssociatedPartyMapper" > + <resultMap id="BaseResultMap" type="com.example.demo.model.FWBAssociatedParty" > + <id column="ID" property="id" jdbcType="INTEGER" /> + <result column="PrimaryID" property="primaryid" jdbcType="VARCHAR" /> + <result column="Name" property="name" jdbcType="VARCHAR" /> + <result column="AccountID" property="accountid" jdbcType="VARCHAR" /> + <result column="RoleCode" property="rolecode" jdbcType="VARCHAR" /> + <result column="Role" property="role" jdbcType="VARCHAR" /> + <result column="CityName" property="cityname" jdbcType="VARCHAR" /> + <result column="CountryID" property="countryid" jdbcType="VARCHAR" /> + <result column="AWBNumber" property="awbnumber" jdbcType="VARCHAR" /> + <result column="FlightDate" property="flightdate" jdbcType="TIMESTAMP" /> + <result column="FlightNumber" property="flightnumber" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + ID, PrimaryID, Name, AccountID, RoleCode, Role, CityName, CountryID, AWBNumber, FlightDate, + FlightNumber + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > + select + <include refid="Base_Column_List" /> + from AssociatedParty + where ID = #{id,jdbcType=INTEGER} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > + delete from AssociatedParty + where ID = #{id,jdbcType=INTEGER} + </delete> + <insert id="insert" parameterType="com.example.demo.model.FWBAssociatedParty" > + insert into AssociatedParty (ID, PrimaryID, Name, + AccountID, RoleCode, Role, + CityName, CountryID, AWBNumber, + FlightDate, FlightNumber) + values (#{id,jdbcType=INTEGER}, #{primaryid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{accountid,jdbcType=VARCHAR}, #{rolecode,jdbcType=VARCHAR}, #{role,jdbcType=VARCHAR}, + #{cityname,jdbcType=VARCHAR}, #{countryid,jdbcType=VARCHAR}, #{awbnumber,jdbcType=VARCHAR}, + #{flightdate,jdbcType=TIMESTAMP}, #{flightnumber,jdbcType=VARCHAR}) + </insert> + <insert id="insertSelective" parameterType="com.example.demo.model.FWBAssociatedParty" > + insert into AssociatedParty + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="id != null" > + ID, + </if> + <if test="primaryid != null" > + PrimaryID, + </if> + <if test="name != null" > + Name, + </if> + <if test="accountid != null" > + AccountID, + </if> + <if test="rolecode != null" > + RoleCode, + </if> + <if test="role != null" > + Role, + </if> + <if test="cityname != null" > + CityName, + </if> + <if test="countryid != null" > + CountryID, + </if> + <if test="awbnumber != null" > + AWBNumber, + </if> + <if test="flightdate != null" > + FlightDate, + </if> + <if test="flightnumber != null" > + FlightNumber, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="id != null" > + #{id,jdbcType=INTEGER}, + </if> + <if test="primaryid != null" > + #{primaryid,jdbcType=VARCHAR}, + </if> + <if test="name != null" > + #{name,jdbcType=VARCHAR}, + </if> + <if test="accountid != null" > + #{accountid,jdbcType=VARCHAR}, + </if> + <if test="rolecode != null" > + #{rolecode,jdbcType=VARCHAR}, + </if> + <if test="role != null" > + #{role,jdbcType=VARCHAR}, + </if> + <if test="cityname != null" > + #{cityname,jdbcType=VARCHAR}, + </if> + <if test="countryid != null" > + #{countryid,jdbcType=VARCHAR}, + </if> + <if test="awbnumber != null" > + #{awbnumber,jdbcType=VARCHAR}, + </if> + <if test="flightdate != null" > + #{flightdate,jdbcType=TIMESTAMP}, + </if> + <if test="flightnumber != null" > + #{flightnumber,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.example.demo.model.FWBAssociatedParty" > + update AssociatedParty + <set > + <if test="primaryid != null" > + PrimaryID = #{primaryid,jdbcType=VARCHAR}, + </if> + <if test="name != null" > + Name = #{name,jdbcType=VARCHAR}, + </if> + <if test="accountid != null" > + AccountID = #{accountid,jdbcType=VARCHAR}, + </if> + <if test="rolecode != null" > + RoleCode = #{rolecode,jdbcType=VARCHAR}, + </if> + <if test="role != null" > + Role = #{role,jdbcType=VARCHAR}, + </if> + <if test="cityname != null" > + CityName = #{cityname,jdbcType=VARCHAR}, + </if> + <if test="countryid != null" > + CountryID = #{countryid,jdbcType=VARCHAR}, + </if> + <if test="awbnumber != null" > + AWBNumber = #{awbnumber,jdbcType=VARCHAR}, + </if> + <if test="flightdate != null" > + FlightDate = #{flightdate,jdbcType=TIMESTAMP}, + </if> + <if test="flightnumber != null" > + FlightNumber = #{flightnumber,jdbcType=VARCHAR}, + </if> + </set> + where ID = #{id,jdbcType=INTEGER} + </update> + <update id="updateByPrimaryKey" parameterType="com.example.demo.model.FWBAssociatedParty" > + update AssociatedParty + set PrimaryID = #{primaryid,jdbcType=VARCHAR}, + Name = #{name,jdbcType=VARCHAR}, + AccountID = #{accountid,jdbcType=VARCHAR}, + RoleCode = #{rolecode,jdbcType=VARCHAR}, + Role = #{role,jdbcType=VARCHAR}, + CityName = #{cityname,jdbcType=VARCHAR}, + CountryID = #{countryid,jdbcType=VARCHAR}, + AWBNumber = #{awbnumber,jdbcType=VARCHAR}, + FlightDate = #{flightdate,jdbcType=TIMESTAMP}, + FlightNumber = #{flightnumber,jdbcType=VARCHAR} + where ID = #{id,jdbcType=INTEGER} + </update> +</mapper> \ No newline at end of file -- libgit2 0.24.0