-- 排查方法配置表
CREATE TABLE smartpark.t_config_resolve_tips
(
    id         INT auto_increment NOT NULL,
    class_code varchar(64)        NOT NULL COMMENT '设备类型',
    point_code varchar(16)        NULL COMMENT '节点代码',
    tips       varchar(512)       NULL COMMENT '排查方法',
    short_num  INT                NULL COMMENT '排序',
    is_deleted INT default 0 COMMENT '逻辑删除',
    CONSTRAINT t_config_resolve_tips_pk PRIMARY KEY (id)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci
    COMMENT ='排查方法';

-- 电表配置
ALTER TABLE t_config_electric
    ADD value_type_code varchar(32) NULL COMMENT '数据类型编码';
ALTER TABLE t_config_electric
    ADD value_type_name varchar(32) NULL COMMENT '数据类型说明';

UPDATE t_config_electric ce
SET ce.value_type_code = 'EPI',
    ce.value_type_name = '正向有功电能'
WHERE ce.value_type = 1
  AND ce.class_code = '0100';

UPDATE t_config_electric ce
SET ce.value_type_code = 'STA',
    ce.value_type_name = '通讯状态'
WHERE ce.value_type = 2
  AND ce.class_code = '0100';
