|
@@ -174,29 +174,70 @@
|
|
|
|
|
|
|
|
|
</select>
|
|
|
-
|
|
|
<update id="timedCreatTable">
|
|
|
- CREATE TABLE alarmhistory_${stationname}_${yearmonth} (
|
|
|
- `ID` decimal(65,0) NOT NULL,
|
|
|
- `ALERTTIME` datetime(6) NOT NULL,
|
|
|
- `MESSAGETYPE` char(1) NOT NULL,
|
|
|
- `SNAPID` decimal(65,0) NOT NULL,
|
|
|
- `DATAINFO` text,
|
|
|
- `ALERTTEXTLAST` varchar(50)
|
|
|
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
+ create table ALARMHISTORY_${stationname}_${yearmonth}
|
|
|
+ (
|
|
|
+ ID INTEGER not null,
|
|
|
+ ALERTTIME DATE not null,
|
|
|
+ MESSAGETYPE CHAR(1) default '1' not null,
|
|
|
+ SNAPID INTEGER not null,
|
|
|
+ DATAINFO VARCHAR2(1000),
|
|
|
+ ALERTTEXTLAST VARCHAR2(50)
|
|
|
+ )
|
|
|
+ tablespace ${tablespace}
|
|
|
+ pctfree 10
|
|
|
+ initrans 1
|
|
|
+ maxtrans 255
|
|
|
+ storage
|
|
|
+ (
|
|
|
+ initial 16K
|
|
|
+ minextents 1
|
|
|
+ maxextents unlimited
|
|
|
+ )
|
|
|
</update>
|
|
|
<update id="timedAlterTable">
|
|
|
- alter table alarmhistory_${stationname}_${yearmonth}
|
|
|
- add primary key (`id`)
|
|
|
+ alter table ALARMHISTORY_${stationname}_${yearmonth}
|
|
|
+ add constraint PK_ALARMHISTORY_${stationname}_${yearmonth} primary key (ID)
|
|
|
+ using index
|
|
|
+ tablespace ${tablespace}
|
|
|
+ pctfree 10
|
|
|
+ initrans 2
|
|
|
+ maxtrans 255
|
|
|
+ storage
|
|
|
+ (
|
|
|
+ initial 64K
|
|
|
+ minextents 1
|
|
|
+ maxextents unlimited
|
|
|
+ )
|
|
|
</update>
|
|
|
<update id="timedCreatAlerttimeIndex">
|
|
|
- create index IX_AH_${stationname}_${yearmonth}_ALARMTIME on alarmhistory_${stationname}_${yearmonth} (alerttime)
|
|
|
+ create index IX_AH_${stationname}_${yearmonth}_ALARMTIME on ALARMHISTORY_${stationname}_${yearmonth} (ALERTTIME)
|
|
|
+ tablespace ${tablespace}
|
|
|
+ pctfree 10
|
|
|
+ initrans 2
|
|
|
+ maxtrans 255
|
|
|
+ storage
|
|
|
+ (
|
|
|
+ initial 64K
|
|
|
+ minextents 1
|
|
|
+ maxextents unlimited
|
|
|
+ )
|
|
|
</update>
|
|
|
<update id="timedCreatSnapidIndex">
|
|
|
- create index IX_AH_${stationname}_${yearmonth}_SNAPID on alarmhistory_${stationname}_${yearmonth} (snapid)
|
|
|
+ create index IX_AH_${stationname}_${yearmonth}_SNAPID on ALARMHISTORY_${stationname}_${yearmonth} (SNAPID)
|
|
|
+ tablespace ${tablespace}
|
|
|
+ pctfree 10
|
|
|
+ initrans 2
|
|
|
+ maxtrans 255
|
|
|
+ storage
|
|
|
+ (
|
|
|
+ initial 64K
|
|
|
+ minextents 1
|
|
|
+ maxextents unlimited
|
|
|
+ )
|
|
|
</update>
|
|
|
<select id="isHasTable" resultType="java.lang.Integer">
|
|
|
- select count(*) from information_schema.TABLES where table_name =upper('ALARMHISTORY_${stationname}_${yearmonth}')
|
|
|
+ select count(*) from user_tables where table_name =upper('ALARMHISTORY_${stationname}_${yearmonth}')
|
|
|
</select>
|
|
|
|
|
|
|