-- Version:		2025.7.31  14:52:27
Drop Table T_EQP_HISTORY@

Create Table T_EQP_HISTORY(
RuleBTime		TIMESTAMP		NOT NULL,
EqpId		VARCHAR(20)		NOT NULL,
RuleId		VARCHAR(40)		NOT NULL,
RuleGroup		VARCHAR(20)		NOT NULL,
RuleLevel		VARCHAR(40),
RuleName		VARCHAR(100),
Result		VARCHAR(1000),
DealResult		DECIMAL(5),
DealContent		VARCHAR(1000),
RuleETime		TIMESTAMP,
CONSTRAINT pk_T_EQP_HISTORY PRIMARY KEY (RuleBTime, EqpId, RuleId, RuleGroup)
)
IN TB8KUSREMS INDEX IN TB8KIDXEMS@
Alter Table T_EQP_HISTORY ALTER COLUMN DealResult SET WITH Default 0@

COMMENT ON Table T_EQP_HISTORY IS '设备报警履历(已经处理）'@

COMMENT ON T_EQP_HISTORY (RuleBTime IS '报警开始时间')@
COMMENT ON T_EQP_HISTORY (EqpId IS '设备编号')@
COMMENT ON T_EQP_HISTORY (RuleId IS '报警id')@
COMMENT ON T_EQP_HISTORY (RuleGroup IS '报警分组')@
COMMENT ON T_EQP_HISTORY (RuleLevel IS '报警等级')@
COMMENT ON T_EQP_HISTORY (RuleName IS '报警名称')@
COMMENT ON T_EQP_HISTORY (Result IS '报警结果')@
COMMENT ON T_EQP_HISTORY (DealResult IS '是否处理 0:没处理 1:已经处理 -1:误报警')@
COMMENT ON T_EQP_HISTORY (DealContent IS '处理内容')@
COMMENT ON T_EQP_HISTORY (RuleETime IS '报警结束')@

