From 9453662f6719ddb0d57b603b54f6d5fcfde6fea0 Mon Sep 17 00:00:00 2001 From: agapple Date: Tue, 20 Aug 2013 15:43:54 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20issue=203=20#3=20,=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?init=20sql=E5=92=8Csqlmap=E4=B8=AD=E7=9A=84=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sqlmap/sqlmap-mapping-delayStat.xml | 26 ++++---- .../sqlmap/sqlmap-mapping-sample.xml | 55 ---------------- .../sqlmap/sqlmap-mapping-throughputStat.xml | 8 +-- .../resources/sql/otter-manager-schema.sql | 66 +++++++------------ 4 files changed, 39 insertions(+), 116 deletions(-) delete mode 100644 manager/biz/src/main/resources/sqlmap/sqlmap-mapping-sample.xml diff --git a/manager/biz/src/main/resources/sqlmap/sqlmap-mapping-delayStat.xml b/manager/biz/src/main/resources/sqlmap/sqlmap-mapping-delayStat.xml index 4d930a9f..650139ab 100644 --- a/manager/biz/src/main/resources/sqlmap/sqlmap-mapping-delayStat.xml +++ b/manager/biz/src/main/resources/sqlmap/sqlmap-mapping-delayStat.xml @@ -20,12 +20,12 @@ - - - + + + - + ID,DELAY_TIME,DELAY_NUMBER,PIPELINE_ID,GMT_CREATE,GMT_MODIFIED @@ -97,21 +97,21 @@ - select - - from Xxx where ID = #value# - - - - - - - - insert into XXX - (NAME, , ,GMT_CREATE, GMT_MODIFIED) - values - (#name#,,, ,now(),now()) - - select last_insert_id() - - - - - - \ No newline at end of file diff --git a/manager/biz/src/main/resources/sqlmap/sqlmap-mapping-throughputStat.xml b/manager/biz/src/main/resources/sqlmap/sqlmap-mapping-throughputStat.xml index d9ae08b7..ab46fc2a 100644 --- a/manager/biz/src/main/resources/sqlmap/sqlmap-mapping-throughputStat.xml +++ b/manager/biz/src/main/resources/sqlmap/sqlmap-mapping-throughputStat.xml @@ -114,13 +114,13 @@ \ No newline at end of file diff --git a/manager/deployer/src/main/resources/sql/otter-manager-schema.sql b/manager/deployer/src/main/resources/sql/otter-manager-schema.sql index 56f26de5..dd409c7a 100644 --- a/manager/deployer/src/main/resources/sql/otter-manager-schema.sql +++ b/manager/deployer/src/main/resources/sql/otter-manager-schema.sql @@ -2,7 +2,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `otter` /*!40100 DEFAULT CHARACTER SET USE `otter`; -CREATE TABLE `alarm_rule` ( +CREATE TABLE `ALARM_RULE` ( `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `MONITOR_NAME` varchar(1024) DEFAULT NULL, `RECEIVER_KEY` varchar(1024) DEFAULT NULL, @@ -16,7 +16,7 @@ CREATE TABLE `alarm_rule` ( PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `autokeeper_cluster` ( +CREATE TABLE `AUTOKEEPER_CLUSTER` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `CLUSTER_NAME` varchar(200) NOT NULL, `SERVER_LIST` varchar(1024) NOT NULL, @@ -26,7 +26,7 @@ CREATE TABLE `autokeeper_cluster` ( PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `canal` ( +CREATE TABLE `CANAL` ( `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `NAME` varchar(200) DEFAULT NULL, `DESCRIPTION` varchar(200) DEFAULT NULL, @@ -37,7 +37,7 @@ CREATE TABLE `canal` ( UNIQUE KEY `CANALUNIQUE` (`NAME`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `channel` ( +CREATE TABLE `CHANNEL` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `NAME` varchar(200) NOT NULL, `DESCRIPTION` varchar(200) DEFAULT NULL, @@ -48,7 +48,7 @@ CREATE TABLE `channel` ( UNIQUE KEY `CHANNELUNIQUE` (`NAME`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `column_pair` ( +CREATE TABLE `COLUMN_PAIR` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `SOURCE_COLUMN` varchar(200) DEFAULT NULL, `TARGET_COLUMN` varchar(200) DEFAULT NULL, @@ -59,7 +59,7 @@ CREATE TABLE `column_pair` ( KEY `idx_DATA_MEDIA_PAIR_ID` (`DATA_MEDIA_PAIR_ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `column_pair_group` ( +CREATE TABLE `COLUMN_PAIR_GROUP` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `DATA_MEDIA_PAIR_ID` bigint(20) NOT NULL, `COLUMN_PAIR_CONTENT` text DEFAULT NULL, @@ -69,29 +69,7 @@ CREATE TABLE `column_pair_group` ( KEY `idx_DATA_MEDIA_PAIR_ID` (`DATA_MEDIA_PAIR_ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `conflict_detail_stat` ( - `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `PIPELINE_ID` bigint(20) DEFAULT NULL, - `PAIR_ID` bigint(20) DEFAULT NULL, - `COLUMN_NAME` varchar(200) DEFAULT NULL, - `CONFLICT_TYPE` varchar(200) DEFAULT NULL, - `DESCRIPTION` varchar(2000) DEFAULT NULL, - `GMT_CREATE` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `GMT_MODIFIED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`ID`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - -CREATE TABLE `conflict_stat` ( - `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `PIPELINE_ID` bigint(20) DEFAULT NULL, - `PAIR_ID` bigint(20) DEFAULT NULL, - `COUNT` bigint(20) DEFAULT NULL, - `GMT_CREATE` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `GMT_MODIFIED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`ID`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - -CREATE TABLE `data_media` ( +CREATE TABLE `DATA_MEDIA` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `NAME` varchar(200) NOT NULL, `NAMESPACE` varchar(200) NOT NULL, @@ -103,7 +81,7 @@ CREATE TABLE `data_media` ( UNIQUE KEY `DATAMEDIAUNIQUE` (`NAME`,`NAMESPACE`,`DATA_MEDIA_SOURCE_ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `data_media_pair` ( +CREATE TABLE `DATA_MEDIA_PAIR` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `PULLWEIGHT` bigint(20) DEFAULT NULL, `PUSHWEIGHT` bigint(20) DEFAULT NULL, @@ -119,7 +97,7 @@ CREATE TABLE `data_media_pair` ( KEY `idx_PipelineID` (`PIPELINE_ID`,`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `data_media_source` ( +CREATE TABLE `DATA_MEDIA_SOURCE` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `NAME` varchar(200) NOT NULL, `TYPE` varchar(20) NOT NULL, @@ -130,7 +108,7 @@ CREATE TABLE `data_media_source` ( UNIQUE KEY `DATAMEDIASOURCEUNIQUE` (`NAME`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `delay_stat` ( +CREATE TABLE `DELAY_STAT` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `DELAY_TIME` int(21) NOT NULL, `DELAY_NUMBER` bigint(20) NOT NULL, @@ -143,7 +121,7 @@ CREATE TABLE `delay_stat` ( KEY `idx_GmtCreate_id` (`GMT_CREATE`,`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `log_record` ( +CREATE TABLE `LOG_RECORD` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `NID` varchar(200) DEFAULT NULL, `CHANNEL_ID` varchar(200) NOT NULL, @@ -157,7 +135,7 @@ CREATE TABLE `log_record` ( KEY `logRecord_pipelineId` (`PIPELINE_ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `node` ( +CREATE TABLE `NODE` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `NAME` varchar(200) NOT NULL, `IP` varchar(32) NOT NULL, @@ -170,7 +148,7 @@ CREATE TABLE `node` ( UNIQUE KEY `NODEUNIQUE` (`NAME`,`IP`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `pipeline` ( +CREATE TABLE `PIPELINE` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `NAME` varchar(200) NOT NULL, `DESCRIPTION` varchar(200) DEFAULT NULL, @@ -183,7 +161,7 @@ CREATE TABLE `pipeline` ( KEY `idx_ChannelID` (`CHANNEL_ID`,`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `pipeline_node_relation` ( +CREATE TABLE `PIPELINE_NODE_RELATION` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `NODE_ID` bigint(20) NOT NULL, `PIPELINE_ID` bigint(20) NOT NULL, @@ -194,7 +172,7 @@ CREATE TABLE `pipeline_node_relation` ( KEY `idx_PipelineID` (`PIPELINE_ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `system_parameter` ( +CREATE TABLE `SYSTEM_PARAMETER` ( `ID` bigint(20) unsigned NOT NULL, `VALUE` varchar(1000) DEFAULT NULL, `GMT_CREATE` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -202,7 +180,7 @@ CREATE TABLE `system_parameter` ( PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `table_history_stat` ( +CREATE TABLE `TABLE_HISTORY_STAT` ( `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `FILE_SIZE` bigint(20) DEFAULT NULL, `FILE_COUNT` bigint(20) DEFAULT NULL, @@ -220,7 +198,7 @@ CREATE TABLE `table_history_stat` ( KEY `idx_GmtCreate_id` (`GMT_CREATE`,`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `table_stat` ( +CREATE TABLE `TABLE_STAT` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `FILE_SIZE` bigint(20) NOT NULL, `FILE_COUNT` bigint(20) NOT NULL, @@ -235,7 +213,7 @@ CREATE TABLE `table_stat` ( KEY `idx_PipelineID_DataMediaPairID` (`PIPELINE_ID`,`DATA_MEDIA_PAIR_ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `throughput_stat` ( +CREATE TABLE `THROUGHPUT_STAT` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `TYPE` varchar(20) NOT NULL, `NUMBER` bigint(20) NOT NULL, @@ -251,7 +229,7 @@ CREATE TABLE `throughput_stat` ( KEY `idx_GmtCreate_id` (`GMT_CREATE`,`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `user` ( +CREATE TABLE `USER` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(20) NOT NULL, `PASSWORD` varchar(20) NOT NULL, @@ -264,7 +242,7 @@ CREATE TABLE `user` ( UNIQUE KEY `USERUNIQUE` (`USERNAME`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -CREATE TABLE `data_matrix` ( +CREATE TABLE `DATA_MATRIX` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `GROUP_KEY` varchar(200) DEFAULT NULL, `MASTER` varchar(200) DEFAULT NULL, @@ -277,5 +255,5 @@ CREATE TABLE `data_matrix` ( ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 -insert into user(ID,USERNAME,PASSWORD,AUTHORIZETYPE,DEPARTMENT,REALNAME,GMT_CREATE,GMT_MODIFIED) values(null,'admin','801fc357a5a74743894a','ADMIN','admin','admin',now(),now()); -insert into user(ID,USERNAME,PASSWORD,AUTHORIZETYPE,DEPARTMENT,REALNAME,GMT_CREATE,GMT_MODIFIED) values(null,'guest','471e02a154a2121dc577','OPERATOR','guest','guest',now(),now()); \ No newline at end of file +insert into USER(ID,USERNAME,PASSWORD,AUTHORIZETYPE,DEPARTMENT,REALNAME,GMT_CREATE,GMT_MODIFIED) values(null,'admin','801fc357a5a74743894a','ADMIN','admin','admin',now(),now()); +insert into USER(ID,USERNAME,PASSWORD,AUTHORIZETYPE,DEPARTMENT,REALNAME,GMT_CREATE,GMT_MODIFIED) values(null,'guest','471e02a154a2121dc577','OPERATOR','guest','guest',now(),now()); \ No newline at end of file