-- xydl_230221.busi_cable_current_result definition


CREATE TABLE `busi_cable_current_result` (
  `id` varchar(32) NOT NULL COMMENT '主键ID',
  `mea_temp` decimal(8,2) DEFAULT NULL COMMENT '电缆光纤测温温度',
  `ambient_temp` decimal(8,2) DEFAULT NULL COMMENT '电缆环境温度',
  `rated_voltage` decimal(10,0) NOT NULL COMMENT '电缆通过的额定电压',
  `external_diameter_cc` decimal(8,4) NOT NULL COMMENT '电缆线芯外径',
  `external_diameter_ci` decimal(8,4) DEFAULT NULL COMMENT '电缆绝缘层外径',
  `diameter` decimal(4,1) DEFAULT NULL COMMENT '电缆铜芯导体直径',
  `insulation_thick` decimal(4,1) DEFAULT NULL COMMENT '导体和金属间绝缘厚度',
  `cables_Number` decimal(4,0) DEFAULT NULL COMMENT '电缆根数',
  `conductivity` decimal(8,5) DEFAULT NULL COMMENT '铜导体常温电导率ρ',
  `resistance_temp_coefficient` decimal(8,6) DEFAULT NULL COMMENT '线芯的电阻温度系数',
  `dielectric_loss_factor` decimal(7,4) DEFAULT NULL COMMENT '介质损耗因数',
  `dielectric_constant` decimal(4,1) DEFAULT NULL COMMENT '绝缘材料的介电常数',
  `external_diameter_dc` decimal(7,1) DEFAULT NULL COMMENT '电缆外径(Dc)',
  `pumping_duration` decimal(7,2) DEFAULT NULL COMMENT '抽水时长',
  `electric_power_duration` decimal(7,4) DEFAULT NULL COMMENT '发电时长',
  `flag` varchar(2) DEFAULT '0' COMMENT '发电/抽水 0--发电  1--抽水',
  `t2` decimal(7,4) DEFAULT NULL COMMENT '介质损耗因数',
  `t3` decimal(7,4) DEFAULT NULL COMMENT '介质损耗因数',
  `pumping_current` decimal(10,4) DEFAULT NULL COMMENT '抽水电流',
  `electric_power_current` decimal(10,4) DEFAULT NULL COMMENT '发电电流',
  `temp_diff` decimal(8,2) DEFAULT NULL COMMENT 'Δθ',
  `r` decimal(10,8) DEFAULT NULL COMMENT '交流电阻R',
  `wd` decimal(10,4) DEFAULT NULL COMMENT '一根导体和金属套之间单位长度的热阻T1',
  `t1` decimal(7,4) DEFAULT NULL COMMENT '导体绝缘单位长度的介质损耗Wd',
  `t4` decimal(7,4) DEFAULT NULL COMMENT '电缆表面和周围媒质之间单位长度热阻T4',
  `λ1` decimal(10,7) DEFAULT NULL COMMENT '护套损耗与线芯损耗之比λ1',
  `λ2` decimal(10,7) DEFAULT NULL COMMENT '铠装损耗与线芯损耗之比λ2',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `cc` decimal(10,7) DEFAULT NULL COMMENT 'CC',
  `type` varchar(2) DEFAULT '1' COMMENT 'type: 1.手动 2.自动 */',
  `name` varchar(100) DEFAULT NULL COMMENT '电缆设备名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='电缆载流能力';
-- 避雷器模板值
INSERT INTO xydl_230221.busi_param_templet (id,weight_level,name,description,pname,value,ab_value_flag,a_value,b_value,calculated_value,warning_value,model,param_type,unit,create_time,create_user,sort_num) VALUES
	 ('110','1','bileiqi','避雷器检测','',1.00000,'0',0.00000,0.00000,'1',NULL,NULL,'blq',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',1),
	 ('111','2','jydz','绝缘电阻','bileiqi',0.20705,'1',2500.00000,3500.00000,'94',NULL,'1','blq',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',2),
	 ('112','2','xldl','泄漏电流','bileiqi',0.18722,'1',5.00000,80.00000,'85',NULL,'2','blq',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',3),
	 ('113','2','zxdl','阻性电流','bileiqi',0.13216,'1',2.00000,50.00000,'60',NULL,'2','blq',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',4),
	 ('114','2','rxdl','容性电流','bileiqi',0.13216,'1',2.00000,50.00000,'60',NULL,'2','blq',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',5),
	 ('115','2','ljcs','雷击次数','bileiqi',0.15419,'1',1.00000,10.00000,'70',NULL,'2','blq',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',6),
	 ('116','2','hjwd','环境温度','bileiqi',0.18722,'1',10.00000,25.00000,'85',NULL,'2','blq',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',7);

ALTER TABLE busi_offline_arrester_brand ADD transport_time DATETIME NULL COMMENT '设备投运时间';
ALTER TABLE busi_offline_arrester_brand ADD insulation_resistance DECIMAL(10,3) NULL COMMENT '绝缘电阻（MΩ)）';


-- xydl_230221.arrester_assessment_result definition

CREATE TABLE `arrester_assessment_result` (
  `id` varchar(32) NOT NULL,
  `site_id` varchar(32) DEFAULT NULL COMMENT '站点id',
  `main_tree_id` varchar(32) DEFAULT NULL COMMENT '站点设备树ID',
  `assess_time` datetime NOT NULL COMMENT '评测时间',
  `safety_factor` varchar(32) DEFAULT NULL COMMENT '计算安全系数',
  `operation_time` varchar(100) DEFAULT NULL COMMENT '投运时间',
  `health_level` varchar(100) DEFAULT NULL COMMENT '计算健康指数',
  `future_failure_rate` varchar(32) DEFAULT NULL COMMENT '未来故障率',
  `type` varchar(10) DEFAULT NULL COMMENT '评估类型：1.手动 2.自动',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='避雷器健康评测结果';





-- xydl_230221.busi_param_arrester definition

CREATE TABLE `busi_param_arrester` (
  `id` varchar(64) NOT NULL,
  `site_id` varchar(32) DEFAULT NULL COMMENT '站点Id,busi_site的Id',
  `main_equipment_id` varchar(32) DEFAULT NULL COMMENT '主设备ID',
  `weight_level` varchar(10) DEFAULT NULL COMMENT '1：第一级分项权重   2：第二级   3：第三级',
  `name` varchar(255) DEFAULT NULL COMMENT '计算指标的名称',
  `pname` varchar(255) DEFAULT NULL COMMENT '上级计算指标名称',
  `description` varchar(100) DEFAULT NULL COMMENT '描述',
  `value` decimal(50,5) DEFAULT NULL COMMENT '权重值',
  `ab_value_flag` varchar(2) DEFAULT NULL COMMENT '是否显示AB值:0——否；1——是',
  `a_value` decimal(50,5) DEFAULT NULL COMMENT 'a值',
  `b_value` decimal(50,5) DEFAULT NULL COMMENT 'b值',
  `warning_value` varchar(50) DEFAULT NULL COMMENT '注意值',
  `model` varchar(10) DEFAULT NULL COMMENT '评分模型：1：升   2:降',
  `unit` varchar(50) DEFAULT NULL COMMENT '单位',
  `is_attend` varchar(10) DEFAULT NULL COMMENT '是否参与评测:   0:不参与   1：参与',
  `create_time` datetime DEFAULT NULL,
  `create_user` varchar(32) DEFAULT NULL,
  `sort_num` int(11) DEFAULT NULL COMMENT '排序',
  `calculated_value` varchar(50) DEFAULT '' COMMENT '被计算的权重值',
  `scope` varchar(100) DEFAULT NULL COMMENT '范围值',
  `number` int(20) NOT NULL DEFAULT '0' COMMENT '第几次保存的参数',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='避雷器的权重系数维护表';

-- xydl_230221.busi_param_arrester definition

CREATE TABLE `busi_param_appendix` (
  `id` varchar(64) NOT NULL,
  `site_id` varchar(32) DEFAULT NULL COMMENT '站点Id,busi_site的Id',
  `main_equipment_id` varchar(32) DEFAULT NULL COMMENT '主设备ID',
  `weight_level` varchar(10) DEFAULT NULL COMMENT '1：第一级分项权重   2：第二级   3：第三级',
  `name` varchar(255) DEFAULT NULL COMMENT '计算指标的名称',
  `pname` varchar(255) DEFAULT NULL COMMENT '上级计算指标名称',
  `description` varchar(100) DEFAULT NULL COMMENT '描述',
  `value` decimal(50,5) DEFAULT NULL COMMENT '权重值',
  `ab_value_flag` varchar(2) DEFAULT NULL COMMENT '是否显示AB值:0——否；1——是',
  `a_value` decimal(50,5) DEFAULT NULL COMMENT 'a值',
  `b_value` decimal(50,5) DEFAULT NULL COMMENT 'b值',
  `warning_value` varchar(50) DEFAULT NULL COMMENT '注意值',
  `model` varchar(10) DEFAULT NULL COMMENT '评分模型：1：升   2:降',
  `unit` varchar(50) DEFAULT NULL COMMENT '单位',
  `is_attend` varchar(10) DEFAULT NULL COMMENT '是否参与评测:   0:不参与   1：参与',
  `create_time` datetime DEFAULT NULL,
  `create_user` varchar(32) DEFAULT NULL,
  `sort_num` int(11) DEFAULT NULL COMMENT '排序',
  `calculated_value` varchar(50) DEFAULT '' COMMENT '被计算的权重值',
  `scope` varchar(100) DEFAULT NULL COMMENT '范围值',
  `number` int(20) NOT NULL DEFAULT '0' COMMENT '第几次保存的参数',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='附件的权重系数维护表';


-- xydl_230221.appendix_assessment_result definition

CREATE TABLE `appendix_assessment_result` (
  `id` varchar(32) NOT NULL,
  `site_id` varchar(32) DEFAULT NULL COMMENT '站点id',
  `main_tree_id` varchar(32) DEFAULT NULL COMMENT '站点设备树ID',
  `assess_time` datetime NOT NULL COMMENT '评测时间',
  `safety_factor` varchar(32) DEFAULT NULL COMMENT '计算安全系数',
  `operation_time` varchar(100) DEFAULT NULL COMMENT '投运时间',
  `health_level` varchar(100) DEFAULT NULL COMMENT '计算健康指数',
  `future_failure_rate` varchar(32) DEFAULT NULL COMMENT '未来故障率',
  `type` varchar(10) DEFAULT NULL COMMENT '评估类型：1.手动 2.自动',
    `soure_type` varchar(10) DEFAULT NULL COMMENT '数据类型：0-附件  1-变压器高压套管 2-变压器器身 3-变压器冷却系统 4-分接开关 5-非电量保护装置',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='附件器健康评测结果';


INSERT INTO busi_param_templet (id,weight_level,name,description,pname,value,ab_value_flag,a_value,b_value,calculated_value,warning_value,model,param_type,unit,create_time,create_user,sort_num) VALUES
	 ('200','1','fujian','附件评测打分',NULL,1.00000,'0',0.00000,0.00000,'0',NULL,NULL,'fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',1),
	 ('201','2','taoguan','套管评测','fujian',0.20000,'0',0.00000,0.00000,'80',NULL,NULL,'fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',2),
	 ('202','2','qishen','变压器器身','fujian',0.20000,'0',0.00000,0.00000,'80',NULL,NULL,'fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',3),
	 ('203','2','lengque','变压器冷却系统','fujian',0.20000,'0',0.00000,0.00000,'80',NULL,NULL,'fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',4),
	 ('204','2','feijiekaiguan','分接开关','fujian',0.20000,'0',0.00000,0.00000,'80',NULL,NULL,'fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',5),
	 ('206','2','baohuzhuangzhi','非电量保护装置','fujian',0.20000,'0',0.00000,0.00000,'80',NULL,NULL,'fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',6),
	 ('207','3','jueyuandianzu','末屏绝缘电阻（MΩ）','taoguan',0.00000,'1',1000.00000,2000.00000,'0',NULL,'1','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',7),
	 ('208','3','quandianliu','全电流','taoguan',0.00000,'1',5.00000,150.00000,'0',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',8),
	 ('209','3','rxdl','容性电流','taoguan',0.00000,'1',1.50000,85.00000,'0',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',9),
	 ('210','3','zxdl','阻性电流','taoguan',0.00000,'1',1.50000,85.00000,'0',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',10);
INSERT INTO busi_param_templet (id,weight_level,name,description,pname,value,ab_value_flag,a_value,b_value,calculated_value,warning_value,model,param_type,unit,create_time,create_user,sort_num) VALUES
	 ('211','3','hwwd','红外温度℃','taoguan',0.00000,'1',30.00000,60.00000,'0',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',11),
	 ('212','3','tgjszx','套管介损在线监测','taoguan',0.00000,'1',0.00000,0.60000,'0',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',12),
	 ('213','3','wpjs','末屏介损','taoguan',0.00000,'1',0.00000,1.00000,'0',NULL,'','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',13),
	 ('214','3','wpjydr','末屏绝缘电容（pF）','taoguan',0.00000,'1',0.00000,0.00000,'0',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',14),
	 ('215','3','tgjslx','套管介损例行试验','taoguan',0.19093,'1',0.00000,1.00000,'80',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',15),
	 ('216','3','tgh2','套管H2（μL/L）','taoguan',0.05967,'1',150.00000,500.00000,'25',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',16),
	 ('217','3','tgch4','套管CH4（μL/L）','taoguan',0.05967,'1',60.00000,100.00000,'25',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',17),
	 ('218','3','tgc2h2','套管C2H2（μL/L）','taoguan',0.08353,'1',0.20000,2.00000,'35',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',18),
	 ('219','3','ywxj','油位下降%','qishen',0.42105,'1',2.00000,10.00000,'80',NULL,'1','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',19),
	 ('220','3','lycs','漏油次数','qishen',0.10526,'1',5.00000,10.00000,'20',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',20);
INSERT INTO busi_param_templet (id,weight_level,name,description,pname,value,ab_value_flag,a_value,b_value,calculated_value,warning_value,model,param_type,unit,create_time,create_user,sort_num) VALUES
	 ('221','3','byqzs','变压器噪声（dB)','qishen',0.47369,'1',75.00000,100.00000,'90',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',21),
	 ('222','3','sw','水温','lengque',0.32000,'1',15.00000,25.00000,'80',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',22),
	 ('223','3','sy','水压','lengque',0.28000,'1',0.20000,0.50000,'70',NULL,'1','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',23),
	 ('224','3','hjwd','环境温度','lengque',0.32000,'1',10.00000,28.00000,'80',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',24),
	 ('225','3','fjshjxcs','风机损坏检修次数','lengque',0.08000,'1',5.00000,20.00000,'20',NULL,'2','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',25),
	 ('226','3','yjcdybhl','油击穿电压变化率','feijiekaiguan',0.50000,'1',5.00000,15.00000,'80',NULL,'1','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',26),
	 ('227','3','cdjgywwt','传动机构有无问题','feijiekaiguan',0.50000,'0',NULL,NULL,'80',NULL,'','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',27),
	 ('228','3','jdqdz','继电器动作','baohuzhuangzhi',0.50000,'0',NULL,NULL,'80',NULL,'','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',28),
	 ('229','3','ylsgfdz','压力释放阀动作','baohuzhuangzhi',0.50000,'0',NULL,NULL,'80',NULL,'','fujian',NULL,'2023-03-31 13:29:31','f52b1f9329cb4cd68d2fc660d9c2aac5',29);


/*20230423 leo 新增电缆-红外、电缆-电缆环流*/
ALTER TABLE `site_upload_cycle` ADD `dlhw` enum('10','20','30','40','60','') DEFAULT NULL COMMENT '电缆红外(10、20、30、40、60，单位分钟)';

ALTER TABLE `site_upload_cycle` ADD `dldlhl` enum('10','20','30','40','60','') DEFAULT NULL COMMENT '电缆电缆环流(10、20、30、40、60，单位分钟)';

/*20230424 leo 新增type字段*/
ALTER TABLE `equipment_temperature_cache` ADD `type` varchar(4) DEFAULT NULL COMMENT '设备类型:01:变压器 02:gis 03:电缆 04:避雷器 05:开关柜 06:发电机 07:电缆';

/* 20230424 新增发电机装置上传周期*/
ALTER TABLE `site_upload_cycle` ADD `fdjzz` enum('30','60','90','120','180','') DEFAULT NULL COMMENT '发电机装置(30、60、90 、120、180，单位分钟)';
/* 修改点表配置单位字段容量 */
ALTER TABLE iec_points_conf MODIFY COLUMN unit varchar(3) DEFAULT NULL COMMENT '0: 无效，站点单位, stype=1时为空；\r\n1:kV(千伏) 2:V(伏) 3:kA(千安) 4:A(安) 5:mA(毫安) 6:℃(度) 7:Pa(帕) 8:KPa(千帕) 9:MPa(兆帕) 10:pF(皮法) \r\n11:pC(皮库仑) 12:dB(分贝) 13:μL(微升) 14:mL(毫升) 15:L(升) 16:m/s(米/秒) 17:rpm&r/min(转/分钟)';
ALTER TABLE iec_points_conf MODIFY COLUMN sysunit varchar(3) DEFAULT NULL COMMENT '0: 无效，暂留未用，指运行评测表中的字段值单位，系统定义单位,参见字段unit的定义' ;

/* 20230425 统计表新增创建时间*/
ALTER TABLE `generator_ampl_monitoring_statistics` ADD `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间';
ALTER TABLE `generator_pressure_monitoring_statistics` ADD `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间';

/* 20230426 一次接线图文件存储表*/
CREATE TABLE `wiring_diagram` (
  `id` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件路径id',
  `file_name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '文件名称',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `file_size` bigint(20) DEFAULT NULL COMMENT '文件大小',
  `file_type` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '文件类型',
  `deleted` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT '0' COMMENT '删除标识',
  `file_path` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '浏览器访问路径',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `index_file_type` (`file_type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='一次接线图文件存储表';


/* 20230426 一次接线图文件存储表*/

CREATE TABLE `sys_file_diagram` (
  `id` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件路径id',
  `business_id` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '业务id',
  `type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '类型 0:次接线图 1：模型',
  `file_name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '文件名称',
  `count` int(11) DEFAULT NULL COMMENT '上传次数',
  `file_path` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '文件路径',
  `suffix_name` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '后缀名称',
  `date` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '上传日期(YYYYMMDD)',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `file_size` bigint(20) DEFAULT NULL COMMENT '文件大小',
  `file_type` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '文件类型',
  `deleted` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '删除标识',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `index_file_type` (`file_type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='一次接线图文件存储表';

/* 修改模型 */

ALTER TABLE `sys_model` ADD `file_path` varchar(500) DEFAULT NULL COMMENT '文件路径 ',
ALTER TABLE `sys_model` ADD `deleted` varchar(500) DEFAULT '0' COMMENT '删除标识',
/* 修改sftp连接配置参数 */
ALTER TABLE `x_sftp_connect_config` ADD `http_port` int(11) DEFAULT NULL COMMENT '预览端口',
/* 修改存储各大设备在线,异常,总数表 */
ALTER TABLE `busi_equipment_sensor_cache` ADD `normal_ids` text DEFAULT NULL COMMENT 'normal_ids',
ALTER TABLE `busi_equipment_sensor_cache` ADD `fault_ids` text DEFAULT NULL COMMENT 'fault_ids',

/* 20230427修改模型 */
ALTER TABLE sys_model ADD model_params text NULL COMMENT '模板参数';

/* 20230505新增发电机局放统计表 */
CREATE TABLE `busi_generator_pd_statistics` (
  `id` varchar(32) NOT NULL,
  `site_id` varchar(32) DEFAULT NULL COMMENT '站点Id',
  `sensor_id` char(17) DEFAULT NULL COMMENT 'sensor编码',
  `main_tree_id` varchar(32) DEFAULT NULL COMMENT '站点设备树ID',
  `sub_tree_id` varchar(32) DEFAULT NULL COMMENT '外挂设备树ID',
  `d_time` date NOT NULL COMMENT '统计时间',
  `count` int(11) DEFAULT NULL COMMENT '放电次数',
  `electric_quantity` varchar(20) DEFAULT NULL COMMENT '放电量',
  `crateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='发电机局部放电统计';

/*新增mV单位*/
INSERT INTO sys_dictionnaire_detail (id,pid,dname,dcode,deleted) VALUES
	 ('190169d26c6b41c1b4234056fd388660','6ce5be28479b452792bb30d8500cdbab','mV','0001','0');
INSERT INTO xydl_230221.sys_dictionnaire_detail (id,pid,dname,dcode,deleted) VALUES
	 ('b1482437a67548849af4b41d8343ad41','6ce5be28479b452792bb30d8500cdbab','无','9999','0');

ALTER TABLE iec_points_conf MODIFY COLUMN unit varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '0: 无效，站点单位, stype=1时为空；
1:kV(千伏) 2:V(伏) 3:kA(千安) 4:A(安) 5:mA(毫安) 6:℃(度) 7:Pa(帕) 8:KPa(千帕) 9:MPa(兆帕) 10:pF(皮法)
11:pC(皮库仑) 12:dB(分贝) 13:μL(微升) 14:mL(毫升) 15:L(升) 16:m/s(米/秒) 17:rpm&r/min(转/分钟)';
ALTER TABLE iec_points_conf MODIFY COLUMN sysunit varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '0: 无效，暂留未用，指运行评测表中的字段值单位，系统定义单位,参见字段unit的定义';
