CREATE TABLE
t_rerecognitionresult_par
(
ID INT NOT NULL AUTO_INCREMENT,
StationID CHAR(42) COLLATE utf8_general_ci DEFAULT '5' NOT NULL COMMENT '定义时,采用层级关系',
PatrolDataID INT NOT NULL,
DevicePartID CHAR(42) COLLATE utf8_general_ci NOT NULL COMMENT '定义时,采用层级关系',
RecognitionType INT,
RecognitionValue FLOAT,
Unit CHAR(10),
ValueShow CHAR(100),
RecognitionTime DATETIME,
ImageType INT,
Coordinate longblob,
IsAccurate TINYINT(1) COMMENT '是否经过模式识别 - 正确识别(鲁能内部用)',
VerifyState TINYINT(1) COMMENT '人工识别是否认同机器人识别的结果(0:识别正确,1:错误)',
VerifyResult FLOAT,
VerifyIsAlarm TINYINT(1) COMMENT '识别结果 正常或异常(人工审核指定的,0或1)',
IsAlarm TINYINT(1) COMMENT '机器人自动识别的对应VerifyIsAlarm(0:正常,1:报警)',
VerifyBy CHAR(20) COLLATE utf8_general_ci COMMENT '审核人记录用户表ID(审核人)',
VerifyOn DATETIME COMMENT ' 审核时间',
IsVerified TINYINT(1) COMMENT '是否人工审核 (是否审核,0:未审核,1已审核)',
CoordinateWeb CHAR(200) COLLATE utf8_general_ci,
TaskRunHisID CHAR(50) NOT NULL,
PRIMARY KEY (ID, StationID,RecognitionTime)
)
ENGINE=innodb DEFAULT CHARSET=gb2312
PARTITION BY RANGE (to_days(RecognitionTime))
(
PARTITION p0 VALUES LESS THAN (TO_DAYS('2017-02-01')) ENGINE = innodb,
PARTITION p1 VALUES LESS THAN (TO_DAYS('2017-03-01')) ENGINE = innodb,
PARTITION p2 VALUES LESS THAN (TO_DAYS('2017-04-01')) ENGINE = innodb,
PARTITION p3 VALUES LESS THAN (TO_DAYS('2017-05-01')) ENGINE = innodb,
PARTITION p4 VALUES LESS THAN (TO_DAYS('2017-06-01')) ENGINE = innodb,
PARTITION p5 VALUES LESS THAN (TO_DAYS('2017-07-01')) ENGINE = innodb,
PARTITION p6 VALUES LESS THAN (TO_DAYS('2017-08-01')) ENGINE = innodb,
PARTITION p7 VALUES LESS THAN (TO_DAYS('2017-09-01')) ENGINE = innodb,
PARTITION p8 VALUES LESS THAN (TO_DAYS('2017-10-01')) ENGINE = innodb,
PARTITION p9 VALUES LESS THAN (TO_DAYS('2017-11-01')) ENGINE = innodb,
PARTITION p10 VALUES LESS THAN (TO_DAYS('2017-12-01')) ENGINE = innodb
)
注意:分区的字段必须是主键