Commit 622ec023 authored by Dimitrios Chalepakis's avatar Dimitrios Chalepakis
Browse files

Merge branch 'DEVELOP' of...

Merge branch 'DEVELOP' of ssh://git.eclipse.org:29418/openk-usermodules/org.eclipse.openk-usermodules.gridFailureInformation.backend into SI-63-Datenbanktabelle-um-Maps-Attribute-erweitern

+ sql script angepasst. Richtige Werte für longitude und latitude eingefügt und für history data
parents 164c148f 1fd91638
/*
*******************************************************************************
* Copyright (c) 2019 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************
*/
package org.eclipse.openk.gridfailureinformation.controller;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.log4j.Log4j2;
import org.eclipse.openk.gridfailureinformation.service.HistFailureInformationService;
import org.eclipse.openk.gridfailureinformation.viewmodel.FailureInformationDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
@Log4j2
@RestController
@RequestMapping("/hist-grid-failure-informations")
public class HistFailureInformationController {
@Value("${gridFailureInformation.maxListSize}")
int maxListSize;
@Autowired
private HistFailureInformationService histfailureInformationService;
@GetMapping("/{uuid}/versions")
@ApiOperation(value = "Anzeigen aller Versionen einer Störungsinformation")
@ApiResponses(value = { @ApiResponse(code = 200, message = "Erfolgreich durchgeführt"),
@ApiResponse(code = 404, message = "Störungsinformationen wurden nicht gefunden")})
@ResponseStatus(HttpStatus.OK)
public List<FailureInformationDto> getHistFailureInformationVersions(@PathVariable UUID uuid) {
return histfailureInformationService.getFailureInformationVersionsByUuid(uuid);
}
@GetMapping("/{uuid}/versions/{versionNumber}")
@ApiOperation(value = "Anzeigen einer bestimmten Version einer Störungsinformation")
@ApiResponses(value = { @ApiResponse(code = 200, message = "Erfolgreich durchgeführt"),
@ApiResponse(code = 404, message = "Störungsinformation wurden nicht gefunden")})
@ResponseStatus(HttpStatus.OK)
public FailureInformationDto readVersion(
@PathVariable UUID uuid,
@PathVariable Long versionNumber) {
return histfailureInformationService.getFailureInformationVersion(uuid, versionNumber);
}
}
/*
*******************************************************************************
* Copyright (c) 2019 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************
*/
package org.eclipse.openk.gridfailureinformation.mapper;
import org.eclipse.openk.gridfailureinformation.model.HtblFailureInformation;
import org.eclipse.openk.gridfailureinformation.viewmodel.FailureInformationDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface HistFailureInformationMapper {
@Mappings({
@Mapping(source = "refFailureClassification.uuid", target = "failureClassificationId"),
@Mapping(source = "refFailureClassification.classification", target = "failureClassification"),
@Mapping(source = "refFailureType.uuid", target = "failureTypeId"),
@Mapping(source = "refFailureType.type", target = "failureType"),
@Mapping(source = "refStatusIntern.uuid", target = "statusInternId"),
@Mapping(source = "refStatusIntern.status", target = "statusIntern"),
@Mapping(source = "refStatusExtern.uuid", target = "statusExternId"),
@Mapping(source = "refStatusExtern.status", target = "statusExtern"),
@Mapping(source = "refBranch.uuid", target = "branchId"),
@Mapping(source = "refBranch.name", target = "branch"),
@Mapping(source = "refBranch.colorCode", target = "branchColorCode")
})
FailureInformationDto toFailureInformationDto(HtblFailureInformation htblFailureInformation);
@Mappings({
@Mapping(target = "refFailureClassification.uuid", source = "failureClassificationId"),
@Mapping(target = "refFailureClassification.classification", source = "failureClassification"),
@Mapping(target = "refFailureType.uuid", source = "failureTypeId"),
@Mapping(target = "refFailureType.type", source = "failureType"),
@Mapping(target = "refStatusIntern.uuid", source = "statusInternId"),
@Mapping(target = "refStatusIntern.status", source = "statusIntern"),
@Mapping(target = "refStatusExtern.uuid", source = "statusExternId"),
@Mapping(target = "refStatusExtern.status", source = "statusExtern"),
@Mapping(target = "refBranch.uuid", source = "branchId"),
@Mapping(target = "refBranch.name", source = "branch"),
@Mapping(target = "refBranch.colorCode", source = "branchColorCode")
})
HtblFailureInformation toHtblFailureInformation(FailureInformationDto failureInformationDto);
}
/*
*******************************************************************************
* Copyright (c) 2019 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************
*/
package org.eclipse.openk.gridfailureinformation.model;
import lombok.Data;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.util.Date;
import java.util.UUID;
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
public class HtblFailureInformation {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "htbl_failure_information_id_seq")
@SequenceGenerator(name = "htbl_failure_information_id_seq", sequenceName = "htbl_failure_information_id_seq", allocationSize = 1)
@Column(name = "hid", updatable = false)
private Long hid;
private Long haction;
private Date hdate;
private String huser;
private Long id;
private UUID uuid;
private Long versionNumber;
private String responsibility;
private String internExtern;
private String voltageLevel;
private String pressureLevel;
private Date failureBegin;
private Date failureEndPlanned;
private Date failureEndResupplied;
private String probableReason;
private String internalRemark;
private String postcode;
private String city;
private String district;
private String street;
private String housenumber;
private String stationDescription;
private String stationCoords;
private String radius;
@CreatedDate
@Column(name = "create_date")
private Date createDate;
@CreatedBy
@Column(name = "create_user")
private String createUser;
@LastModifiedDate
@Column(name = "mod_date")
private Date modDate;
@LastModifiedBy
@Column(name = "mod_user")
private String modUser;
@ManyToOne
@JoinColumn( name = "fk_ref_failure_classification")
private RefFailureClassification refFailureClassification;
@ManyToOne
@JoinColumn( name = "fk_ref_failure_type")
private RefFailureType refFailureType;
@ManyToOne
@JoinColumn( name = "fk_ref_status_intern")
private RefStatus refStatusIntern;
@ManyToOne
@JoinColumn( name = "fk_ref_status_extern")
private RefStatus refStatusExtern;
@ManyToOne
@JoinColumn( name = "fk_ref_branch")
private RefBranch refBranch;
}
......@@ -36,6 +36,7 @@ public class TblFailureInformation {
@Column(name = "id", updatable = false)
private Long id;
private UUID uuid;
private Long versionNumber;
private String responsibility;
private String internExtern;
private String voltageLevel;
......
/*
*******************************************************************************
* Copyright (c) 2019 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************
*/
package org.eclipse.openk.gridfailureinformation.repository;
import org.eclipse.openk.gridfailureinformation.model.HtblFailureInformation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
@Repository
public interface HistFailureInformationRepository extends JpaRepository<HtblFailureInformation, Long > {
List<HtblFailureInformation> findByUuid(UUID uuid);
Optional<HtblFailureInformation> findByUuidAndVersionNumber(UUID uuid, Long versionNumber);
Long countByUuid(UUID uuid);
}
......@@ -17,6 +17,7 @@ package org.eclipse.openk.gridfailureinformation.service;
import org.eclipse.openk.gridfailureinformation.exceptions.NotFoundException;
import org.eclipse.openk.gridfailureinformation.mapper.FailureInformationMapper;
import org.eclipse.openk.gridfailureinformation.model.HtblFailureInformation;
import org.eclipse.openk.gridfailureinformation.model.TblFailureInformation;
import org.eclipse.openk.gridfailureinformation.repository.*;
import org.eclipse.openk.gridfailureinformation.viewmodel.FailureInformationDto;
......@@ -35,6 +36,9 @@ public class FailureInformationService {
@Autowired
private FailureInformationRepository failureInformationRepository;
@Autowired
private HistFailureInformationRepository histFailureInformationRepository;
@Autowired
private FailureInformationMapper failureInformationMapper;
......@@ -63,11 +67,13 @@ public class FailureInformationService {
public FailureInformationDto insertFailureInfo(FailureInformationDto failureInfoDto){
TblFailureInformation tblFailureInformationToSave = failureInformationMapper.toTblFailureInformation(failureInfoDto);
tblFailureInformationToSave.setUuid(UUID.randomUUID());
tblFailureInformationToSave.setVersionNumber(1L);
setFromGridFailureInformationDto(tblFailureInformationToSave, failureInfoDto);
return failureInformationMapper.toFailureInformationDto(failureInformationRepository.save(tblFailureInformationToSave));
}
@Transactional
public FailureInformationDto updateFailureInfo(FailureInformationDto failureInfoDto) {
TblFailureInformation tblFailureInformation = failureInformationRepository.findByUuid(failureInfoDto.getUuid())
......@@ -77,6 +83,11 @@ public class FailureInformationService {
tblFailureInformationToSave.setId(tblFailureInformation.getId());
setFromGridFailureInformationDto(tblFailureInformationToSave, failureInfoDto);
// Holen der nächsten Versionsnummer mit Hilfe der History-Tabelle
Long countVersions = histFailureInformationRepository.countByUuid(failureInfoDto.getUuid());
tblFailureInformationToSave.setVersionNumber(countVersions + 1);
TblFailureInformation savedFailureInformation = failureInformationRepository.save(tblFailureInformationToSave);
return failureInformationMapper.toFailureInformationDto(savedFailureInformation);
}
......
/*
*******************************************************************************
* Copyright (c) 2019 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************
*/
package org.eclipse.openk.gridfailureinformation.service;
import org.eclipse.openk.gridfailureinformation.exceptions.NotFoundException;
import org.eclipse.openk.gridfailureinformation.mapper.HistFailureInformationMapper;
import org.eclipse.openk.gridfailureinformation.model.HtblFailureInformation;
import org.eclipse.openk.gridfailureinformation.repository.*;
import org.eclipse.openk.gridfailureinformation.viewmodel.FailureInformationDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
@Service
public class HistFailureInformationService {
@Autowired
private HistFailureInformationRepository histFailureInformationRepository;
@Autowired
private HistFailureInformationMapper histFailureInformationMapper;
@Autowired
private BranchRepository branchRepository;
@Autowired
private FailureClassificationRepository failureClassificationRepository;
@Autowired
private FailureTypeRepository failureTypeRepository;
@Autowired
private StatusRepository statusRepository;
public List<FailureInformationDto> getFailureInformationVersionsByUuid(UUID uuid ) {
List<HtblFailureInformation> htblFailureInformationList = histFailureInformationRepository.findByUuid(uuid);
return htblFailureInformationList.stream().map(histFailureInformationMapper::toFailureInformationDto).collect(Collectors.toList());
}
public FailureInformationDto getFailureInformationVersion(UUID uuid, Long versionNumber ) {
HtblFailureInformation htblFailureInformation = histFailureInformationRepository.findByUuidAndVersionNumber(uuid, versionNumber)
.orElseThrow(NotFoundException::new);
return histFailureInformationMapper.toFailureInformationDto(htblFailureInformation);
}
}
......@@ -27,6 +27,7 @@ import java.util.UUID;
public class FailureInformationDto implements Serializable {
@JsonProperty("id")
private UUID uuid;
private Long versionNumber;
private String responsibility;
private String internExtern;
private String voltageLevel;
......
......@@ -189,6 +189,7 @@ CREATE TABLE public.TBL_FAILURE_INFORMATION
(
ID integer NOT NULL DEFAULT nextval('TBL_FAILURE_INFORMATION_ID_SEQ'::regclass),
UUID uuid NOT NULL,
VERSION_NUMBER integer NOT NULL,
FK_REF_FAILURE_CLASSIFICATION integer,
FK_REF_FAILURE_TYPE integer,
RESPONSIBILITY character varying(255),
......@@ -211,12 +212,11 @@ CREATE TABLE public.TBL_FAILURE_INFORMATION
STATION_DESCRIPTION character varying(255),
STATION_COORDS character varying(255),
RADIUS character varying(100),
LONGITUDE numeric(9,6),
LATITUDE numeric(9,6),
CREATE_DATE timestamp without time zone NOT NULL,
CREATE_USER character varying(100) NOT NULL,
MOD_DATE timestamp without time zone NOT NULL,
CREATE_USER character varying(100),
CREATE_DATE timestamp without time zone,
MOD_USER character varying(100),
MOD_DATE timestamp without time zone,
CONSTRAINT TBL_FAILURE_INFORMATION_PKEY PRIMARY KEY (id)
);
......@@ -224,10 +224,209 @@ ALTER TABLE public.TBL_FAILURE_INFORMATION
OWNER TO GFI_SERVICE;
GRANT ALL ON TABLE public.TBL_FAILURE_INFORMATION TO GFI_SERVICE;
INSERT INTO public.tbl_failure_information(UUID, FK_REF_FAILURE_CLASSIFICATION, FK_REF_FAILURE_TYPE, RESPONSIBILITY, INTERN_EXTERN, FK_REF_STATUS_INTERN, FK_REF_STATUS_EXTERN, FK_REF_BRANCH, VOLTAGE_LEVEL, PRESSURE_LEVEL, FAILURE_BEGIN, FAILURE_END_PLANNED, FAILURE_END_RESUPPLIED, PROBABLE_REASON, INTERNAL_REMARK, POSTCODE, CITY, DISTRICT, STREET, HOUSENUMBER, STATION_DESCRIPTION, STATION_COORDS, RADIUS, LONGITUDE, LATITUDE, CREATE_DATE, CREATE_USER, MOD_DATE, MOD_USER)
VALUES ('6432a9c9-0384-44af-9bb8-34f2878d7b49', 1, 1, 'Rolf Rudis', 'I', 1, 1, 1, 'NS', null, '2021-01-19 00:00:00', '2021-01-22 00:00:00', '2021-01-22 12:00:00', 'Stromausfall durch Bagger', 'Der Bagger grub zu tief', '77654', 'Buddelbrugg', 'Westbezirk', 'Hauptstraße', '5a', 'Trafo 1', '124,2323', '2km', 9.247952, 48.955700, '2020-01-22 15:32:15', 'schmidth', '2020-01-24 08:02:44', 'meyers');
INSERT INTO public.tbl_failure_information(UUID, VERSION_NUMBER, FK_REF_FAILURE_CLASSIFICATION, FK_REF_FAILURE_TYPE, RESPONSIBILITY, INTERN_EXTERN, FK_REF_STATUS_INTERN, FK_REF_STATUS_EXTERN, FK_REF_BRANCH, VOLTAGE_LEVEL, PRESSURE_LEVEL, FAILURE_BEGIN, FAILURE_END_PLANNED, FAILURE_END_RESUPPLIED, PROBABLE_REASON, INTERNAL_REMARK, POSTCODE, CITY, DISTRICT, STREET, HOUSENUMBER, STATION_DESCRIPTION, STATION_COORDS, RADIUS, CREATE_DATE, CREATE_USER, MOD_DATE, MOD_USER)
VALUES ('6432a9c9-0384-44af-9bb8-34f2878d7b49',1, 1, 1, 'Rolf Rudis', 'I', 1, 1, 1, 'NS', null, '2021-01-19 00:00:00', '2021-01-22 00:00:00', '2021-01-22 12:00:00', 'Stromausfall durch Bagger', 'Der Bagger grub zu tief', '77654', 'Buddelbrugg', 'Westbezirk', 'Hauptstraße', '5a', 'Trafo 1', '124,2323', '2km', '2020-01-22 15:32:15', 'schmidth', '2020-01-24 08:02:44', 'meyers');
INSERT INTO public.tbl_failure_information(UUID, VERSION_NUMBER, FK_REF_FAILURE_CLASSIFICATION, FK_REF_FAILURE_TYPE, RESPONSIBILITY, INTERN_EXTERN, FK_REF_STATUS_INTERN, FK_REF_STATUS_EXTERN, FK_REF_BRANCH, VOLTAGE_LEVEL, PRESSURE_LEVEL, FAILURE_BEGIN, FAILURE_END_PLANNED, FAILURE_END_RESUPPLIED, PROBABLE_REASON, INTERNAL_REMARK, POSTCODE, CITY, DISTRICT, STREET, HOUSENUMBER, STATION_DESCRIPTION, STATION_COORDS, RADIUS, CREATE_DATE, CREATE_USER, MOD_DATE, MOD_USER)
VALUES ('37aef635-d0d4-4c47-ac25-c0d16c29e35c', 1,3, 2, 'Bernd Britzel', 'E', 2, 2, 3, null, 'HD', '2021-05-19 00:00:00', '2021-05-22 00:00:00', '2021-05-22 12:00:00', 'Leck in Gasleitung', 'HD betroffen', '77344', 'Hitzingen', null, 'Ostring', '104', 'ertf', '124,2323', '6km', '2020-02-03 15:15:15', 'schulzek', '2020-02-24 20:08:41', 'muellert');
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
-- HISTORY-TABLES
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
-- PUBLIC.HTBL_FAILURE_INFORMATION Automatic generanted History Table DDL --
-- <GENERATED CODE!>
DROP TABLE IF EXISTS PUBLIC.HTBL_FAILURE_INFORMATION;
DROP SEQUENCE IF EXISTS PUBLIC.HTBL_FAILURE_INFORMATION_ID_SEQ;
CREATE SEQUENCE PUBLIC.HTBL_FAILURE_INFORMATION_ID_SEQ
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE PUBLIC.HTBL_FAILURE_INFORMATION_ID_SEQ
OWNER TO gfi_service;
CREATE TABLE PUBLIC.HTBL_FAILURE_INFORMATION
(
HID integer NOT NULL DEFAULT nextval('HTBL_FAILURE_INFORMATION_ID_SEQ'::regclass),
HACTION integer NOT NULL,
HDATE timestamp without time zone NOT NULL,
HUSER character varying(100),
ID integer,
UUID uuid,
VERSION_NUMBER integer,
FK_REF_FAILURE_CLASSIFICATION integer,
FK_REF_FAILURE_TYPE integer,
RESPONSIBILITY character varying (255),
INTERN_EXTERN character varying (1),
FK_REF_STATUS_INTERN integer,
FK_REF_STATUS_EXTERN integer,
FK_REF_BRANCH integer,
VOLTAGE_LEVEL character varying (2),
PRESSURE_LEVEL character varying (2),
FAILURE_BEGIN timestamp without time zone,
FAILURE_END_PLANNED timestamp without time zone,
FAILURE_END_RESUPPLIED timestamp without time zone,
PROBABLE_REASON character varying (1024),
INTERNAL_REMARK character varying (1024),
POSTCODE character varying (30),
CITY character varying (255),
DISTRICT character varying (255),
STREET character varying (255),
HOUSENUMBER character varying (30),
STATION_DESCRIPTION character varying (255),
STATION_COORDS character varying (255),
RADIUS character varying (100),
CREATE_USER character varying(100),
CREATE_DATE timestamp without time zone,
MOD_USER character varying(100),
MOD_DATE timestamp without time zone,
CONSTRAINT HTBL_FAILURE_INFORMATION_PKEY PRIMARY KEY (HID)
)
WITH (
OIDS=FALSE
);
ALTER TABLE PUBLIC.HTBL_FAILURE_INFORMATION
OWNER TO gfi_service;
GRANT ALL ON TABLE PUBLIC.HTBL_FAILURE_INFORMATION TO gfi_service;
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
-- TRIGGER
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
-- PUBLIC.TBL_FAILURE_INFORMATION INSERT TRIGGER --
-- <GENERATED CODE!>
CREATE OR REPLACE FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_INSERT_TRG()
RETURNS trigger AS
$BODY$
BEGIN
INSERT INTO HTBL_FAILURE_INFORMATION (
ID,UUID,VERSION_NUMBER,FK_REF_FAILURE_CLASSIFICATION,FK_REF_FAILURE_TYPE,RESPONSIBILITY,INTERN_EXTERN,FK_REF_STATUS_INTERN,FK_REF_STATUS_EXTERN,FK_REF_BRANCH,VOLTAGE_LEVEL,PRESSURE_LEVEL,FAILURE_BEGIN,FAILURE_END_PLANNED,FAILURE_END_RESUPPLIED,PROBABLE_REASON,INTERNAL_REMARK,POSTCODE,CITY,DISTRICT,STREET,HOUSENUMBER,STATION_DESCRIPTION,STATION_COORDS,RADIUS,CREATE_DATE,CREATE_USER,MOD_DATE,MOD_USER,
HACTION,
HDATE,
HUSER
)
VALUES (
NEW.ID,NEW.UUID,NEW.VERSION_NUMBER,NEW.FK_REF_FAILURE_CLASSIFICATION,NEW.FK_REF_FAILURE_TYPE,NEW.RESPONSIBILITY,NEW.INTERN_EXTERN,NEW.FK_REF_STATUS_INTERN,NEW.FK_REF_STATUS_EXTERN,NEW.FK_REF_BRANCH,NEW.VOLTAGE_LEVEL,NEW.PRESSURE_LEVEL,NEW.FAILURE_BEGIN,NEW.FAILURE_END_PLANNED,NEW.FAILURE_END_RESUPPLIED,NEW.PROBABLE_REASON,NEW.INTERNAL_REMARK,NEW.POSTCODE,NEW.CITY,NEW.DISTRICT,NEW.STREET,NEW.HOUSENUMBER,NEW.STATION_DESCRIPTION,NEW.STATION_COORDS,NEW.RADIUS,NEW.CREATE_DATE,NEW.CREATE_USER,NEW.MOD_DATE,NEW.MOD_USER,
1,
current_timestamp,
NEW.CREATE_USER );
RETURN NEW;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_INSERT_TRG()
OWNER TO gfi_service;
DROP TRIGGER IF EXISTS TBL_FAILURE_INFORMATION_INSERT_TRG ON PUBLIC.TBL_FAILURE_INFORMATION;
CREATE TRIGGER TBL_FAILURE_INFORMATION_INSERT_TRG
BEFORE INSERT
ON PUBLIC.TBL_FAILURE_INFORMATION