CREATE TABLE tsfx.dw_complain_realtime_alarm_h
(
    sdate              timestamp NULL,
    uniqueid           varchar(200) NULL,
    uniqueclearid      varchar(200) NULL,
    eventtime          varchar(50) NULL,
    canceltime         varchar(50) NULL,
    status             numeric NULL,
    projectstatus      numeric NULL,
    vendoralarmserial  varchar(200) NULL,
    alarmtitle         varchar(200) NULL,
    vendorseverity     varchar(200) NULL,
    vendoralarmtype    varchar(200) NULL,
    specificproblem    varchar(1000) NULL,
    specificproblemid  varchar(200) NULL,
    equipmentclass     varchar(200) NULL,
    equipmentname      varchar(1000) NULL,
    locateneclass      varchar(500) NULL,
    locatenename       varchar(1000) NULL,
    province           varchar(200) NULL,
    region             varchar(200) NULL,
    city               varchar(200) NULL,
    grid               varchar(200) NULL,
    area               varchar(200) NULL,
    vendor             varchar(200) NULL,
    specialty          numeric NULL,
    siteid             varchar(200) NULL,
    roomid             varchar(1000) NULL,
    towersiteno        varchar(200) NULL,
    proequipmentstatus numeric NULL,
    projectname        varchar(200) NULL,
    projectno          varchar(200) NULL,
    projectstarttime   varchar(200) NULL,
    projectendtime     varchar(200) NULL,
    worksendstatus     numeric NULL,
    workstatus         numeric NULL,
    workno             varchar(200) NULL,
    workarchivedtime   varchar(200) NULL,
    workdutydep        varchar(200) NULL,
    worksendperson     varchar(200) NULL,
    alarmlogicclass    varchar(200) NULL,
    alarmlogicsubclass varchar(200) NULL,
    standardalarmname  varchar(1000) NULL,
    alarmseverity      numeric NULL,
    standardalarmid    varchar(500) NULL,
    effectonequipment  varchar(200) NULL,
    effectonbusiness   varchar(200) NULL,
    standardflag       numeric NULL,
    networktype        numeric NULL,
    equipmentdn        varchar(500) NULL,
    locatenedn         varchar(500) NULL,
    taccode            varchar(500) NULL,
    tacid              varchar(200) NULL,
    alarmtext          text NULL
) DISTRIBUTED BY (uniqueid);

CREATE TABLE dw_complain_realtime_alarm_h ( sdate timestamp without time zone, uniqueid character varying(200), uniqueclearid character varying(200), eventtime character varying(50), canceltime character varying(50), status numeric, projectstatus numeric, vendoralarmserial character varying(200), alarmtitle character varying(200), vendorseverity character varying(200), vendoralarmtype character varying(200), specificproblem character varying(1000), specificproblemid character varying(200), equipmentclass character varying(200), equipmentname character varying(1000), locateneclass character varying(500), locatenename character varying(1000), province character varying(200), region character varying(200), city character varying(200), grid character varying(200), area character varying(200), vendor character varying(200), specialty numeric, siteid character varying(200), roomid character varying(1000), towersiteno character varying(200), proequipmentstatus numeric, projectname character varying(200), projectno character varying(200), projectstarttime character varying(200), projectendtime character varying(200), worksendstatus numeric, workstatus numeric, workno character varying(200), workarchivedtime character varying(200), workdutydep character varying(200), worksendperson character varying(200), alarmlogicclass character varying(200), alarmlogicsubclass character varying(200), standardalarmname character varying(1000), alarmseverity numeric, standardalarmid character varying(500), effectonequipment character varying(200), effectonbusiness character varying(200), standardflag numeric, networktype numeric, equipmentdn character varying(500), locatenedn character varying(500), taccode character varying(500), tacid character varying(200), alarmtext text );