SET NAMES utf8mb4;

-- ----------------------------
-- 1、部门表
-- ----------------------------
drop table if exists sys_dept;
create table sys_dept (
  dept_id           bigint(20)      not null auto_increment    comment '部门id',
  parent_id         bigint(20)      default 0                  comment '父部门id',
  ancestors         varchar(50)     default ''                 comment '祖级列表',
  dept_name         varchar(30)     default ''                 comment '部门名称',
  order_num         int(4)          default 0                  comment '显示顺序',
  leader            varchar(20)     default null               comment '负责人',
  phone             varchar(11)     default null               comment '联系电话',
  email             varchar(50)     default null               comment '邮箱',
  status            char(1)         default '0'                comment '部门状态（0正常 1停用）',
  del_flag          char(1)         default '0'                comment '删除标志（0代表存在 2代表删除）',
  create_by         varchar(64)     default ''                 comment '创建者',
  create_time 	    datetime                                   comment '创建时间',
  update_by         varchar(64)     default ''                 comment '更新者',
  update_time       datetime                                   comment '更新时间',
  primary key (dept_id)
) engine=innodb auto_increment=200 comment = '部门表';

-- ----------------------------
-- 初始化-部门表数据
-- ----------------------------
insert into sys_dept values(100,  0,   '0',          '创新实验室',   0, '华设集团', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(101,  100, '0,100',      '常泰服务区（北）', 1, '华设集团', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(102,  100, '0,100',      '常泰服务区（南）', 2, '华设集团', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(103,  101, '0,100,101',  '北区监控组',   3, '华设集团', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(104,  101, '0,100,101',  '北区运维组',   4, '华设集团', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(105,  101, '0,100,101',  '北区机电组',   5, '华设集团', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(106,  102, '0,100,102',  '南区监控组',   6, '华设集团', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(107,  102, '0,100,102',  '南区机电组',   7, '华设集团', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
insert into sys_dept values(108,  102, '0,100,102',  '南区运维组',   8, '华设集团', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);



-- ----------------------------
-- 2、用户信息表
-- ----------------------------
drop table if exists sys_user;
create table sys_user (
  user_id           bigint(20)      not null auto_increment    comment '用户ID',
  dept_id           bigint(20)      default null               comment '部门ID',
  user_name         varchar(30)     not null                   comment '用户账号',
  nick_name         varchar(30)     not null                   comment '用户昵称',
  user_type         varchar(2)      default '00'               comment '用户类型（00系统用户）',
  email             varchar(50)     default ''                 comment '用户邮箱',
  phonenumber       varchar(11)     default ''                 comment '手机号码',
  sex               char(1)         default '0'                comment '用户性别（0男 1女 2未知）',
  avatar            varchar(100)    default ''                 comment '头像地址',
  password          varchar(100)    default ''                 comment '密码',
  status            char(1)         default '0'                comment '帐号状态（0正常 1停用）',
  del_flag          char(1)         default '0'                comment '删除标志（0代表存在 2代表删除）',
  login_ip          varchar(128)    default ''                 comment '最后登录IP',
  login_date        datetime                                   comment '最后登录时间',
  create_by         varchar(64)     default ''                 comment '创建者',
  create_time       datetime                                   comment '创建时间',
  update_by         varchar(64)     default ''                 comment '更新者',
  update_time       datetime                                   comment '更新时间',
  remark            varchar(500)    default null               comment '备注',
  primary key (user_id)
) engine=innodb auto_increment=100 comment = '用户信息表';

-- ----------------------------
-- 初始化-用户信息表数据
-- ----------------------------
insert into sys_user values(1,  103, 'admin', '管理员', '00', 'changtai@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '管理员');

-- ----------------------------
-- 3、岗位信息表
-- ----------------------------
drop table if exists sys_post;
create table sys_post
(
  post_id       bigint(20)      not null auto_increment    comment '岗位ID',
  post_code     varchar(64)     not null                   comment '岗位编码',
  post_name     varchar(50)     not null                   comment '岗位名称',
  post_sort     int(4)          not null                   comment '显示顺序',
  status        char(1)         not null                   comment '状态（0正常 1停用）',
  create_by     varchar(64)     default ''                 comment '创建者',
  create_time   datetime                                   comment '创建时间',
  update_by     varchar(64)     default ''			       comment '更新者',
  update_time   datetime                                   comment '更新时间',
  remark        varchar(500)    default null               comment '备注',
  primary key (post_id)
) engine=innodb comment = '岗位信息表';

-- ----------------------------
-- 初始化-岗位信息表数据
-- ----------------------------
insert into sys_post values(1, 'ceo',  '总管理',    1, '0', 'admin', sysdate(), '', null, '');
insert into sys_post values(2, 'se',   '运营经理',  2, '0', 'admin', sysdate(), '', null, '');
insert into sys_post values(3, 'worker',  '机修岗',  3, '0', 'admin', sysdate(), '', null, '');
insert into sys_post values(4, 'user', '普通员工',  4, '0', 'admin', sysdate(), '', null, '');


-- ----------------------------
-- 4、角色信息表
-- ----------------------------
drop table if exists sys_role;
create table sys_role (
  role_id              bigint(20)      not null auto_increment    comment '角色ID',
  role_name            varchar(30)     not null                   comment '角色名称',
  role_key             varchar(100)    not null                   comment '角色权限字符串',
  role_sort            int(4)          not null                   comment '显示顺序',
  data_scope           char(1)         default '1'                comment '数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）',
  menu_check_strictly  tinyint(1)      default 1                  comment '菜单树选择项是否关联显示',
  dept_check_strictly  tinyint(1)      default 1                  comment '部门树选择项是否关联显示',
  status               char(1)         not null                   comment '角色状态（0正常 1停用）',
  del_flag             char(1)         default '0'                comment '删除标志（0代表存在 2代表删除）',
  create_by            varchar(64)     default ''                 comment '创建者',
  create_time          datetime                                   comment '创建时间',
  update_by            varchar(64)     default ''                 comment '更新者',
  update_time          datetime                                   comment '更新时间',
  remark               varchar(500)    default null               comment '备注',
  primary key (role_id)
) engine=innodb auto_increment=100 comment = '角色信息表';

-- ----------------------------
-- 初始化-角色信息表数据
-- ----------------------------
insert into sys_role values('1', '超级管理员',  'admin',  1, 1, 1, 1, '0', '0', 'admin', sysdate(), '', null, '超级管理员');
insert into sys_role values('2', '普通角色',    'common', 2, 2, 1, 1, '0', '0', 'admin', sysdate(), '', null, '普通角色');


-- ----------------------------
-- 5、菜单权限表
-- ----------------------------
drop table if exists sys_menu;
create table sys_menu (
  menu_id           bigint(20)      not null auto_increment    comment '菜单ID',
  menu_name         varchar(50)     not null                   comment '菜单名称',
  parent_id         bigint(20)      default 0                  comment '父菜单ID',
  order_num         int(4)          default 0                  comment '显示顺序',
  path              varchar(200)    default ''                 comment '路由地址',
  component         varchar(255)    default null               comment '组件路径',
  query             varchar(255)    default null               comment '路由参数',
  is_frame          int(1)          default 1                  comment '是否为外链（0是 1否）',
  is_cache          int(1)          default 0                  comment '是否缓存（0缓存 1不缓存）',
  menu_type         char(1)         default ''                 comment '菜单类型（M目录 C菜单 F按钮）',
  visible           char(1)         default 0                  comment '菜单状态（0显示 1隐藏）',
  status            char(1)         default 0                  comment '菜单状态（0正常 1停用）',
  perms             varchar(100)    default null               comment '权限标识',
  icon              varchar(100)    default '#'                comment '菜单图标',
  create_by         varchar(64)     default ''                 comment '创建者',
  create_time       datetime                                   comment '创建时间',
  update_by         varchar(64)     default ''                 comment '更新者',
  update_time       datetime                                   comment '更新时间',
  remark            varchar(500)    default ''                 comment '备注',
  primary key (menu_id)
) engine=innodb auto_increment=2000 comment = '菜单权限表';

-- ----------------------------
-- 初始化-菜单信息表数据
-- ----------------------------
-- 一级菜单
insert into sys_menu values ('1',  '监控大屏', '0', '1', 'view',             null, '', 1, 0, 'M', '0', '0', '',  'eye-open',    'admin', sysdate(), '', null, '监控大屏');
insert into sys_menu values ('2',  '能管态势', '0', '2', 'power-mgr',        null, '', 1, 0, 'M', '0', '0', '',  'energy',      'admin', sysdate(), '', null, '能流态势');
insert into sys_menu values ('3',  '数据分析', '0', '3', 'analysis',         null, '', 1, 0, 'M', '0', '0', '',  'analysis',    'admin', sysdate(), '', null, '数据分析');
insert into sys_menu values ('4',  '碳排监测', '0', '4', 'ca-analysis',      null, '', 1, 0, 'M', '0', '0', '',  'ca',          'admin', sysdate(), '', null, '碳排监测');
insert into sys_menu values ('5',  '设备管理', '0', '5', 'device-mgr',       null, '', 1, 0, 'M', '0', '0', '',  'devicemgr',   'admin', sysdate(), '', null, '设备管理');
insert into sys_menu values ('6',  '运维保障', '0', '6', 'oper-mgr',         null, '', 1, 0, 'M', '0', '0', '',  'opermgr',     'admin', sysdate(), '', null, '运维保障');
insert into sys_menu values ('7',  '业务配置', '0', '7', 'param-cfg',        null, '', 1, 0, 'M', '0', '0', '',  'paramcfg',    'admin', sysdate(), '', null, '业务配置');
insert into sys_menu values ('8',  '系统管理', '0', '8', 'system',           null, '', 1, 0, 'M', '0', '0', '',  'system',      'admin', sysdate(), '', null, '系统管理');
insert into sys_menu values ('9',  '系统对接', '0', '9', 'adapter',          null, '', 1, 0, 'M', '0', '0', '',  'client',      'admin', sysdate(), '', null, '系统对接');
insert into sys_menu values ('99', '开发工具', '0', '99', 'tool',            null, '', 1, 0, 'M', '0', '0', '',  'tool',        'admin', sysdate(), '', null, '开发工具');

-- 二级菜单
insert into sys_menu values ('100',  '服务区',         '1',   '1',   'hp-view-sa',         'view/servicearea',          '', 1, 0, 'C', '0', '0',   'view:service-area',      'servicearea',    'admin', sysdate(), '', null, '园区能源概览');
insert into sys_menu values ('101',  '主路光伏',       '1',   '2',   'hp-view-rpv',        'view/road/photovoltaic',    '', 1, 0, 'C', '0', '0',   'view:road-pv',           'photovoltaic',   'admin', sysdate(), '', null, '主路光伏概览');

insert into sys_menu values ('112',  '源网',            '2',    '1',  'strategy-pg',        'mgr/powergrid',             '', 1, 0, 'C', '0', '0',   'power-mgr:pg',           'powergrid',      'admin', sysdate(), '', null, '源网协调');
insert into sys_menu values ('113',  '储能',            '2',    '2',  'strategy-gs',        'mgr/powerstore',            '', 1, 0, 'C', '0', '0',   'power-mgr:gs',           'powerstore',     'admin', sysdate(), '', null, '网储互动');
insert into sys_menu values ('114',  '负荷',            '2',    '3',  'strategy-use',       'mgr/poweruse',              '', 1, 0, 'C', '0', '0',   'power-mgr:use',          'powerload',      'admin', sysdate(), '', null, '源荷互动');
insert into sys_menu values ('115',  '调度',            '2',    '4',  'strategy-mgr',       'mgr/strategy',              '', 1, 0, 'C', '0', '0',   'power-mgr:strategy',     'strategy',       'admin', sysdate(), '', null, '管能策略');
insert into sys_menu values ('116',  '配电',            '2',    '5',  'powerdist',          'mgr/powerdist',             '', 1, 0, 'C', '0', '0',   'power-mgr:dist',         'powerdist',      'admin', sysdate(), '', null, '配电监控');
insert into sys_menu values ('117',  '计费',            '2',    '6',  'charging',           'mgr/charging',              '', 1, 0, 'C', '0', '0',   'power-mgr:charging',     'charging',       'admin', sysdate(), '', null, '配电监控');

insert into sys_menu values ('126',  '产能分析',       '3',    '1',  'power-prod',         'analysis/power/prod',       '', 1, 0, 'C', '0', '0',    'analysis:power:prod',    'energyprod',     'admin', sysdate(), '', null, '产能分析');
insert into sys_menu values ('127',  '储能分析',       '3',    '2',  'power-store',        'analysis/power/store',      '', 1, 0, 'C', '0', '0',    'analysis:power:store',   'energystore',    'admin', sysdate(), '', null, '储能分析');
insert into sys_menu values ('128',  '用能分析',       '3',    '3',  'power-consume',      'analysis/power/consume',    '', 1, 0, 'C', '0', '0',    'analysis:power:consume', 'energyconsume',  'admin', sysdate(), '', null, '用能分析');
insert into sys_menu values ('129',  '节能分析',       '3',    '4',  'power-save',         'analysis/power/save',       '', 1, 0, 'C', '0', '0',    'analysis:power:save',    'energysave',     'admin', sysdate(), '', null, '节能分析');
insert into sys_menu values ('120',  '趋势预测',       '3',    '5',  'prediction',         '',                          '', 1, 0, 'M', '0', '0',    '',                       'prediction',     'admin', sysdate(), '', null, '趋势预测');
insert into sys_menu values ('121',  '数据报表',       '3',    '6',  'analysis-statement', '',                          '', 1, 0, 'M', '0', '0',    'analysis:statement',     'statement',      'admin', sysdate(), '', null, '数据报表');

insert into sys_menu values ('131',  '碳排计量',       '4',    '1',  'ca-emission',        'ca/emission',            '', 1, 0, 'C', '0', '0',   'ca-analysis:emission',   'caemission',     'admin', sysdate(), '', null, '碳排分析');
insert into sys_menu values ('132',  '碳汇测算',       '4',    '2',  'ca-sink',            'ca/sink',                '', 1, 0, 'C', '0', '0',   'ca-analysis:sink',       'casink',         'admin', sysdate(), '', null, '碳汇分析');

insert into sys_menu values ('141',  '设备状态',       '5',    '1',  'device-state',        'devmgr/state',           '', 1, 0, 'C', '0', '0',   'ems:device:list',        'devicestatus',   'admin', sysdate(), '', null, '设备状态');
insert into sys_menu values ('142',  '设备台账',       '5',    '2',  'device-el',           'devmgr/el',              '', 1, 0, 'C', '0', '0',   'device:el',              'excel',          'admin', sysdate(), '', null, '设备台账');
insert into sys_menu values ('143',  '设备告警',       '5',    '3',  'analysis-warn',       'analysis/device/warn',   '', 1, 0, 'C', '0', '0',   'analysis:device',        'deviceanalyze',  'admin', sysdate(), '', null, '设备分析');
insert into sys_menu values ('144',  '手动抄表',       '5',    '4',  'meterRead-manual',    'devmgr/meterRead',       '', 1, 0, 'C', '0', '0',   'ems:meterReading:list',  'meterReading',   'admin', sysdate(), '', null, '手动抄表');

INSERT INTO sys_menu VALUES ('151',  '告警策略',       '6',    '1',  'warn-strategy',       'alarm/index',            '', 1, 0, 'C', '0', '0',    'warn:strategy', 'warnstrategy', 'admin', '2024-08-29 15:40:27', 'admin', '2024-08-29 16:01:10', '告警策略');
INSERT INTO sys_menu VALUES ('152',  '告警列表',       '6',    '2',  'warn-list',           'alarm/alarm-info/index', '', 1, 0, 'C', '0', '0',    'warn:list', 'warnmsg', 'admin', '2024-08-29 15:40:27', 'admin', '2024-08-29 16:01:36', '告警策略');
INSERT INTO sys_menu VALUES ('153',  '巡检任务',       '6',    '3',  'oper-task',           'task/index',             '', 1, 0, 'C', '0', '0',    'oper-mgr:task', 'task', 'admin', '2024-08-29 15:40:27', 'admin', '2024-08-29 16:02:38', '巡检任务');
insert into sys_menu values ('154',  '巡检报告',       '6',    '4',  'oper-report',        'task/report/index',        '', 1, 0, 'C', '0', '0',   'oper-mgr:report',        'note',           'admin', sysdate(), '', null, '巡检报告');

insert into sys_menu values ('161',  '建筑区块',       '7',    '1',  'buildingcfg',        '',                       '', 1, 0, 'M', '0', '0',   'basecfg:building',       'building',       'admin', sysdate(), '', null, '用户管理菜单');
insert into sys_menu values ('162',  '设备设施',       '7',    '2',  'devicecfg',          '',                       '', 1, 0, 'M', '0', '0',   'basecfg:device',         'devicemgr',      'admin', sysdate(), '', null, '用户管理菜单');
insert into sys_menu values ('163',  '能源计量',       '7',    '3',  'energycfg',          '',                       '', 1, 0, 'M', '0', '0',   'basecfg:energy',         'energy',         'admin', sysdate(), '', null, '用户管理菜单');
insert into sys_menu values ('164',  '标签管理',       '7',    '4',  'emstag',             'basecfg/tag',            '', 1, 0, 'C', '0', '0',   'basecfg:tag:list',       'tree',           'admin', sysdate(), '', null, '标签菜单');

insert into sys_menu values ('170',  '用户管理',       '8',   '1',  'user',               'system/user/index',      '', 1, 0, 'C', '0', '0',   'system:user:list',       'user',           'admin', sysdate(), '', null, '用户管理菜单');
insert into sys_menu values ('171',  '角色管理',       '8',   '2',  'role',               'system/role/index',      '', 1, 0, 'C', '0', '0',   'system:role:list',       'peoples',        'admin', sysdate(), '', null, '角色管理菜单');
insert into sys_menu values ('172',  '菜单管理',       '8',   '3',  'menu',               'system/menu/index',      '', 1, 0, 'C', '0', '0',   'system:menu:list',       'tree-table',     'admin', sysdate(), '', null, '菜单管理菜单');
insert into sys_menu values ('173',  '部门管理',       '8',   '4',  'dept',               'system/dept/index',      '', 1, 0, 'C', '0', '0',   'system:dept:list',       'tree',           'admin', sysdate(), '', null, '部门管理菜单');
insert into sys_menu values ('174',  '岗位管理',       '8',   '5',  'post',               'system/post/index',      '', 1, 0, 'C', '0', '0',   'system:post:list',       'post',           'admin', sysdate(), '', null, '岗位管理菜单');
insert into sys_menu values ('175',  '字典管理',       '8',   '6',  'dict',               'system/dict/index',      '', 1, 0, 'C', '0', '0',   'system:dict:list',       'dict',           'admin', sysdate(), '', null, '字典管理菜单');
insert into sys_menu values ('176',  '参数设置',       '8',   '7',  'config',             'system/config/index',    '', 1, 0, 'C', '0', '0',   'system:config:list',     'edit',           'admin', sysdate(), '', null, '参数设置菜单');
insert into sys_menu values ('177',  '通知公告',       '8',   '8',  'notice',             'system/notice/index',    '', 1, 0, 'C', '0', '0',   'system:notice:list',     'message',        'admin', sysdate(), '', null, '通知公告菜单');
insert into sys_menu values ('178',  '日志管理',       '8',   '9',  'log',                '',                       '', 1, 0, 'M', '0', '0',   '',                       'log',            'admin', sysdate(), '', null, '日志管理菜单');
insert into sys_menu values ('179',  '在线用户',       '8',   '10', 'online',             'monitor/online/index',   '', 1, 0, 'C', '0', '0',   'monitor:online:list',    'online',         'admin', sysdate(), '', null, '在线用户菜单');
INSERT INTO sys_menu VALUES ('180',  '任务调度',       '8',   '10', 'task/job',           'monitor/job/index',      '', 1, 0, 'C', '0', '0',   'monitor:job',            'date-range',     'admin', sysdate(), '', NULL, '任务调度');


insert into sys_menu values ('190',  '系统信息',       '9',   '1',  'adapter-subsystem',  'adapter/subsystem/index',  '', 1, 0, 'C', '0', '0',   'adapter:subsystem:list',  'note',           'admin', sysdate(), '', null, '光伏');
insert into sys_menu values ('191',  '光伏',          '9',   '2',  'adapter-pv',         'adapter/pv/index',      '', 1, 0, 'C', '0', '0',   'adapter:user:list',       'photovoltaic',        'admin', sysdate(), '', null, '光伏');
insert into sys_menu values ('192',  '光储直柔',       '9',   '3',  'adapter-gczr',       'adapter/gczr/index',    '', 1, 0, 'C', '0', '0',   'adapter:role:list',       'deviceaccess',      'admin', sysdate(), '', null, '光储直柔');
insert into sys_menu values ('193',  '光储充',         '9',   '4',  'adapter-gcc',        'adapter/gcc/index',     '', 1, 0, 'C', '0', '0',   'adapter:menu:list',       'energyconsume',       'admin', sysdate(), '', null, '光储充');
insert into sys_menu values ('194',  '充电桩',         '9',   '5',  'adapter-cdz',        'adapter/cdz/index',     '', 1, 0, 'C', '0', '0',   'adapter:dept:list',       'powerstore',       'admin', sysdate(), '', null, '充电桩');
insert into sys_menu values ('195',  '智慧照明',       '9',   '6',  'adapter-zm',         'adapter/zm/index',      '', 1, 0, 'C', '0', '0',   'adapter:post:list',       'system',        'admin', sysdate(), '', null, '智慧照明');
insert into sys_menu values ('196',  '智慧海绵',       '9',   '7',  'adapter-hm',         'adapter/hm/index',      '', 1, 0, 'C', '0', '0',   'adapter:dict:list',       'system',        'admin', sysdate(), '', null, '智慧海绵');
insert into sys_menu values ('197',  '垃圾厨余',       '9',   '8',  'adapter-ljcy',       'adapter/ljcy/index',    '', 1, 0, 'C', '0', '0',   'adapter:config:list',     'system',      'admin', sysdate(), '', null, '垃圾厨余');
insert into sys_menu values ('198',  '能耗监测',       '9',   '9',  'adapter-nhjc',       'adapter/nhjc/index',    '', 1, 0, 'C', '0', '0',   'adapter:notice:list',     'system',      'admin', sysdate(), '', null, '能耗监测');
insert into sys_menu values ('199',  '设备管理',       '9',   '10',  'adapter-devc',       'adapter/devc/index',    '', 1, 0, 'M', '0', '0',   'adapter:devc:list',       'system',      'admin', sysdate(), '', null, '设备管理');

insert into sys_menu values ('997',  '表单构建',       '99',   '1',  'build',              'tool/build/index',       '', 1, 0, 'C', '0', '0',   'tool:build:list',        'build',          'admin', sysdate(), '', null, '表单构建菜单');
insert into sys_menu values ('998',  '代码生成',       '99',   '2',  'gen',                'tool/gen/index',         '', 1, 0, 'C', '0', '0',   'tool:gen:list',          'code',           'admin', sysdate(), '', null, '代码生成菜单');
insert into sys_menu values ('999',  '系统接口',       '99',   '3',  'http://localhost:9100/swagger-ui/index.html',   '', '', 0, 0, 'C', '0', '0', 'tool:swagger:list',   'swagger',        'admin', sysdate(), '', null, '系统接口菜单');

-- 三级菜单
-- 预测菜单
insert into sys_menu values ('1200',  '产能预测', '120', '1',  'prediction-prod',    'prediction/prod',        '', 1, 0, 'C', '0', '0',   'prediction:prod',        'energyprod',     'admin', sysdate(), '', null, '产能预测');
insert into sys_menu values ('1201',  '用能预测', '120', '2',  'prediction-consume', 'prediction/consume',     '', 1, 0, 'C', '0', '0',   'prediction:consume',     'energyconsume',  'admin', sysdate(), '', null, '用能预测');
insert into sys_menu values ('1202',  '碳排预测', '120', '3',  'prediction-ca',      'prediction/ca',          '', 1, 0, 'C', '0', '0',   'prediction:ca',          'caemission',     'admin', sysdate(), '', null, '碳排预测');
-- 报表菜单
insert into sys_menu values ('1210',  '产能报表',   '121', '1',  'statement-prod',    'analysis/statement/prod',     '', 1, 0, 'C', '0', '0',    'analysis:statement:prod',      'energyprod',     'admin', sysdate(), '', null, '产能报表');
insert into sys_menu values ('1211',  '用能报表',   '121', '2',  'statement-consume', 'analysis/statement/consume',  '', 1, 0, 'C', '0', '0',    'analysis:statement:consume',   'energyconsume',  'admin', sysdate(), '', null, '用能报表');
insert into sys_menu values ('1212',  '告警报表',   '121', '3',  'statement-warn',    'analysis/statement/warn',     '', 1, 0, 'C', '0', '0',    'analysis:statement:warn',      'warn',     'admin', sysdate(), '', null, '告警报表');
insert into sys_menu values ('1213',  '自定义',     '121', '4',  'statement-warn',    'analysis/statement/custom',   '', 1, 0, 'C', '0', '0',   'analysis:statement:custom',    'statement-zdy',   'admin', sysdate(), '', null, '自定义报表');
-- 业务配置菜单
insert into sys_menu values ('1610',  '地块划分',   '161', '1',  'basecfg-servicearea',    'basecfg/area/index',         '', 1, 0, 'C', '0', '0',   'basecfg:area:list',           'cfgwrite',   'admin', sysdate(), '', null, '服务区配置');
insert into sys_menu values ('1611',  '建筑配置',   '161', '2',  'basecfg-building',       'basecfg/building/index',     '', 1, 0, 'C', '0', '0',   'basecfg:building:list',        'cfgwrite',   'admin', sysdate(), '', null, '楼宇建筑配置');
insert into sys_menu values ('1612',  '功能分区',   '161', '3',  'basecfg-zoning',         'basecfg/zoning/index',       '', 1, 0, 'C', '0', '0',   'basecfg:zoning:list',          'cfgwrite',   'admin', sysdate(), '', null, '区块配置');
insert into sys_menu values ('1620',  '设施分类',   '162', '1',  'basecfg-facstype',       'basecfg/facstype/index',     '', 1, 0, 'C', '0', '0',   'basecfg:facstype:list',        'cfgwrite',   'admin', sysdate(), '', null, '设施配置');
insert into sys_menu values ('1621',  '能源设施',   '162', '2',  'basecfg-facscfg',        'basecfg/emsfacs/index',      '', 1, 0, 'C', '0', '0',   'basecfg:emsfacs:list',         'cfgwrite',   'admin', sysdate(), '', null, '设施配置');
insert into sys_menu values ('1622',  '能流关系',   '162', '3',  'basecfg-flowrel',        'basecfg/flowrel/index',      '', 1, 0, 'C', '0', '0',   'basecfg:flowrel:list',         'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
insert into sys_menu values ('1623',  '能源设备',   '162', '4',  'basecfg-devccfg',        'basecfg/device/index',       '', 1, 0, 'C', '0', '0',   'basecfg:device:list',          'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
insert into sys_menu values ('1624',  '配电设施',   '162', '5',  'basecfg-powerbox',       'basecfg/powerbox/index',     '', 1, 0, 'C', '0', '0',   'ems:powerbox:list',            'cfgwrite',   'admin', sysdate(), '', null, '配电设施');
insert into sys_menu values ('1630',  '价格策略',   '163', '1',  'basecfg-electricity',    'basecfg/price/index',        '', 1, 0, 'C', '0', '0',   'basecfg:price:list',           'cfgwrite',   'admin', sysdate(), '', null, '价格策略');
insert into sys_menu values ('1631',  '计量设备',   '163', '2',  'basecfg-meterdevc',      'basecfg/meterdevc/index',     '', 1, 0, 'C', '0', '0',  'ems:meterdevc:list',           'cfgwrite',   'admin', sysdate(), '', null, '计量设备');
insert into sys_menu values ('1632',  '碳核算',     '163', '3',  'basecfg-cacfg',          'basecfg/cacfg/index',        '', 1, 0, 'C', '0', '0',   'basecfg:cacfg:list',           'cfgwrite',   'admin', sysdate(), '', null, '碳排因子');

-- 用户管理按钮
insert into sys_menu values ('1700', '用户查询', '170', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:query',          '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1701', '用户新增', '170', '2',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:add',            '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1702', '用户修改', '170', '3',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit',           '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1703', '用户删除', '170', '4',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove',         '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1704', '用户导出', '170', '5',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:export',         '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1705', '用户导入', '170', '6',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:import',         '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1706', '重置密码', '170', '7',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd',       '#', 'admin', sysdate(), '', null, '');
-- 角色管理按钮
insert into sys_menu values ('1710', '角色查询', '171', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:role:query',          '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1711', '角色新增', '171', '2',  '', '', '', 1, 0, 'F', '0', '0', 'system:role:add',            '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1712', '角色修改', '171', '3',  '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit',           '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1713', '角色删除', '171', '4',  '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove',         '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1714', '角色导出', '171', '5',  '', '', '', 1, 0, 'F', '0', '0', 'system:role:export',         '#', 'admin', sysdate(), '', null, '');
-- 菜单管理按钮
insert into sys_menu values ('1720', '菜单查询', '172', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query',          '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1721', '菜单新增', '172', '2',  '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add',            '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1722', '菜单修改', '172', '3',  '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit',           '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1723', '菜单删除', '172', '4',  '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove',         '#', 'admin', sysdate(), '', null, '');
-- 部门管理按钮
insert into sys_menu values ('1730', '部门查询', '173', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query',          '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1731', '部门新增', '173', '2',  '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add',            '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1732', '部门修改', '173', '3',  '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit',           '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1733', '部门删除', '173', '4',  '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove',         '#', 'admin', sysdate(), '', null, '');
-- 岗位管理按钮
insert into sys_menu values ('1740', '岗位查询', '174', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:post:query',          '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1741', '岗位新增', '174', '2',  '', '', '', 1, 0, 'F', '0', '0', 'system:post:add',            '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1742', '岗位修改', '174', '3',  '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit',           '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1743', '岗位删除', '174', '4',  '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove',         '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1744', '岗位导出', '174', '5',  '', '', '', 1, 0, 'F', '0', '0', 'system:post:export',         '#', 'admin', sysdate(), '', null, '');
-- 字典管理按钮
insert into sys_menu values ('1750', '字典查询', '175', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query',          '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1751', '字典新增', '175', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add',            '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1752', '字典修改', '175', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit',           '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1753', '字典删除', '175', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove',         '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1754', '字典导出', '175', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export',         '#', 'admin', sysdate(), '', null, '');
-- 参数设置按钮
insert into sys_menu values ('1760', '参数查询', '176', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query',        '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1761', '参数新增', '176', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add',          '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1762', '参数修改', '176', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit',         '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1763', '参数删除', '176', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove',       '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1764', '参数导出', '176', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export',       '#', 'admin', sysdate(), '', null, '');
-- 通知公告按钮
insert into sys_menu values ('1770',  '公告查询', '177', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query',        '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1771',  '公告新增', '177', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add',          '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1772',  '公告修改', '177', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit',         '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1773',  '公告删除', '177', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove',       '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1780',  '操作日志', '178', '1',  'operlog',           'system/operlog/index',       '', 1, 0, 'C', '0', '0',    'system:operlog:list',          'form',          'admin', sysdate(), '', null, '操作日志菜单');
insert into sys_menu values ('1781',  '登录日志', '178', '2',  'logininfor',        'system/logininfor/index',    '', 1, 0, 'C', '0', '0',    'system:logininfor:list',       'logininfor',    'admin', sysdate(), '', null, '登录日志菜单');

-- 操作日志按钮
insert into sys_menu values ('17800', '操作查询', '1780', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:operlog:query',       '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('17801', '操作删除', '1780', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:operlog:remove',      '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('17802', '日志导出', '1780', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:operlog:export',      '#', 'admin', sysdate(), '', null, '');
-- 登录日志按钮
insert into sys_menu values ('17810', '登录查询', '1781', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:query',    '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('17811', '登录删除', '1781', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:remove',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('17812', '日志导出', '1781', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:export',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('17813', '账户解锁', '1781', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:unlock',   '#', 'admin', sysdate(), '', null, '');
-- 在线用户按钮
insert into sys_menu values ('1790', '在线查询', '179', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query',       '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1791', '批量强退', '179', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('1792', '单条强退', '179', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', sysdate(), '', null, '');
-- 服务区配置按钮
insert into sys_menu values ('16100', '地块新增', '1610', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:area:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16101', '地块修改', '1610', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:area:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16102', '地块删除', '1610', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:area:remove','#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16103', '地块导出', '1610', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:area:export','#', 'admin', sysdate(), '', null, '');
-- 服务区建筑配置按钮
insert into sys_menu values ('16110', '建筑新增', '1611', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:building:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16111', '建筑修改', '1611', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:building:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16112', '建筑删除', '1611', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:building:remove','#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16113', '建筑导出', '1611', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:building:export','#', 'admin', sysdate(), '', null, '');
-- 服务区建筑区块配置按钮
insert into sys_menu values ('16120', '分区新增', '1612', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16121', '分区修改', '1612', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16122', '分区删除', '1612', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:remove','#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16123', '分区导出', '1612', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:export','#', 'admin', sysdate(), '', null, '');
-- 能源设施分类配置按钮
insert into sys_menu values ('16200', '分类新增', '1620', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:facstype:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16201', '分类修改', '1620', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:facstype:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16202', '分类删除', '1620', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:facstype:remove','#', 'admin', sysdate(), '', null, '');
-- 服务区能源设施配置按钮
insert into sys_menu values ('16210', '设施新增', '1621', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16211', '设施修改', '1621', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16212', '设施删除', '1621', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:remove','#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16213', '设施导出', '1621', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:export','#', 'admin', sysdate(), '', null, '');
-- 服务区能流关系配置按钮
insert into sys_menu values ('16220', '关系新增', '1622', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16221', '关系修改', '1622', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16222', '关系删除', '1622', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:remove','#', 'admin', sysdate(), '', null, '');
-- 服务区设备配置按钮
insert into sys_menu values ('16230', '设备新增', '1623', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16231', '设备修改', '1623', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16232', '设备删除', '1623', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:remove','#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('16233', '设备导出', '1623', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:export','#', 'admin', sysdate(), '', null, '');

-- 能源策略按钮
INSERT INTO sys_menu VALUES (1150, 'list', 115, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu VALUES (1151, 'export', 115, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu VALUES (1152, 'query', 115, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu VALUES (1153, 'add', 115, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu VALUES (1154, 'edit', 115, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu VALUES (1155, 'remove', 115, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 源网协调按钮
INSERT INTO `sys_menu` VALUES (1120, 'list',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1121, 'export',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1122, 'query',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1123, 'add',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1124, 'edit',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1125, 'remove',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:remove', '#', 'admin', sysdate(), '', NULL, '');
-- 网储互动
INSERT INTO `sys_menu` VALUES (1130,'list',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1131,'export',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1132,'query',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1133,'add',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1134,'edit',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1135,'remove',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 告警策略
INSERT INTO sys_menu VALUES (1510, 'list', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1511, 'export', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1512, 'query', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1513, 'add', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1514, 'edit', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1515, 'remove', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');

-- 告警列表
INSERT INTO sys_menu VALUES (1520, 'list', 152, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-info:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1521, 'export', 152, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-info:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1522, 'query', 152, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-info:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1523, 'add', 152, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-info:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1524, 'edit', 152, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-info:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1525, 'remove', 152, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-info:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');

-- 产能预测
INSERT INTO `sys_menu` VALUES (12000,'list',1200, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12001,'export',1200, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12002,'query',1200, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12003,'add',1200, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12004,'edit',1200, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12005,'remove',1200, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 用能预测
INSERT INTO `sys_menu` VALUES (12010,'list',1201, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12011,'export',1201, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12012,'query',1201, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12013,'add',1201, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12014,'edit',1201, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12015,'remove',1201, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 碳排预测
INSERT INTO `sys_menu` VALUES (12020,'list',1202, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12021,'export',1202, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12022,'query',1202, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12023,'add',1202, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12024,'edit',1202, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (12025,'remove',1202, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 碳排计量
INSERT INTO `sys_menu` VALUES (1310,'list',131, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1311,'export',131, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1312,'query',131, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1313,'add',131, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1314,'edit',131, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1315,'remove',131, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 碳汇计量
INSERT INTO `sys_menu` VALUES (1320,'list',132, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1321,'export',132, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1322,'query',132, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1323,'add',132, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1324,'edit',132, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (1325,'remove',132, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:remove', '#', 'admin', sysdate(), '', NULL, '');


-- 巡检任务
INSERT INTO sys_menu VALUES (1531, 'list', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1532, 'export', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1534, 'query', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1535, 'add', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1536, 'edit', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1537, 'remove', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1538, '执行一次', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:auto-task:exc', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1539, '任务查询权限', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:auto-task:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');

-- 巡检报告
INSERT INTO sys_menu VALUES (1541, '查询', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1542, '导出', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1543, '查询权限', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1544, '新增', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1545, '修改', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1546, '删除', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');

-- 任务调度
INSERT INTO sys_menu VALUES (1800, '任务列表', 180, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1801, '任务到出', 180, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1802, '任务查询', 180, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1803, '新增任务', 180, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1804, '编辑任务', 180, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1805, '移除任务', 180, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1806, '修改任务状态', 180, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (1807, '执行任务', 180, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:run', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');


-- ----------------------------
-- 6、用户和角色关联表  用户N-1角色
-- ----------------------------
drop table if exists sys_user_role;
create table sys_user_role (
  user_id   bigint(20) not null comment '用户ID',
  role_id   bigint(20) not null comment '角色ID',
  primary key(user_id, role_id)
) engine=innodb comment = '用户和角色关联表';

-- ----------------------------
-- 初始化-用户和角色关联表数据
-- ----------------------------
insert into sys_user_role values ('1', '1');
insert into sys_user_role values ('2', '2');


-- ----------------------------
-- 7、角色和菜单关联表  角色1-N菜单
-- ----------------------------
drop table if exists sys_role_menu;
create table sys_role_menu (
  role_id   bigint(20) not null comment '角色ID',
  menu_id   bigint(20) not null comment '菜单ID',
  primary key(role_id, menu_id)
) engine=innodb comment = '角色和菜单关联表';

-- ----------------------------
-- 初始化-角色和菜单关联表数据
-- ----------------------------
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 2);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 3);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 4);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 5);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 6);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 7);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 8);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 9);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 99);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 100);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 101);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 112);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 113);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 114);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 115);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 116);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 120);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 121);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 126);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 127);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 128);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 129);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 131);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 132);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 141);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 142);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 143);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 144);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 151);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 152);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 153);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 154);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 161);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 162);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 163);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 164);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 170);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 171);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 172);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 173);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 174);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 175);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 176);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 177);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 178);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 179);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 180);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 190);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 191);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 192);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 193);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 194);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 195);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 196);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 197);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 198);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 199);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 997);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 998);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 999);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1120);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1121);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1122);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1123);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1124);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1125);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1130);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1131);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1132);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1133);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1134);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1135);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1150);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1151);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1152);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1153);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1154);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1155);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1200);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1201);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1202);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1210);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1211);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1212);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1213);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1310);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1311);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1312);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1313);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1314);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1315);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1320);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1321);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1322);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1323);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1324);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1325);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1510);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1511);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1512);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1513);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1514);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1515);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1520);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1521);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1522);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1523);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1524);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1525);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1531);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1532);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1534);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1535);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1536);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1537);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1538);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1539);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1541);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1542);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1543);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1544);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1545);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1546);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1610);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1611);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1612);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1620);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1621);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1622);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1623);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1624);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1630);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1631);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1632);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1700);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1701);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1702);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1703);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1704);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1705);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1706);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1710);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1711);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1712);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1713);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1714);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1720);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1721);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1722);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1723);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1730);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1731);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1732);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1733);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1740);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1741);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1742);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1743);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1744);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1750);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1751);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1752);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1753);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1754);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1760);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1761);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1762);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1763);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1764);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1770);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1771);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1772);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1773);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1780);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1781);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1790);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1791);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1792);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1800);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1801);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1802);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1803);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1804);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1805);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1806);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 1807);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12000);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12001);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12002);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12003);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12004);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12005);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12010);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12011);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12012);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12013);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12014);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12015);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12020);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12021);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12022);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12023);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12024);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 12025);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16100);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16101);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16102);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16103);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16110);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16111);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16112);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16113);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16120);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16121);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16122);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16123);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16200);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16201);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16202);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16210);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16211);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16212);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16213);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16220);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16221);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16222);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16230);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16231);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16232);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 16233);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 17800);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 17801);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 17802);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 17810);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 17811);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 17812);
INSERT INTO sys_role_menu (`role_id`, `menu_id`) VALUES (2, 17813);

-- ----------------------------
-- 8、角色和部门关联表  角色1-N部门
-- ----------------------------
drop table if exists sys_role_dept;
create table sys_role_dept (
  role_id   bigint(20) not null comment '角色ID',
  dept_id   bigint(20) not null comment '部门ID',
  primary key(role_id, dept_id)
) engine=innodb comment = '角色和部门关联表';

-- ----------------------------
-- 初始化-角色和部门关联表数据
-- ----------------------------
insert into sys_role_dept values ('2', '100');
insert into sys_role_dept values ('2', '101');
insert into sys_role_dept values ('2', '105');


-- ----------------------------
-- 9、用户与岗位关联表  用户1-N岗位
-- ----------------------------
drop table if exists sys_user_post;
create table sys_user_post
(
  user_id   bigint(20) not null comment '用户ID',
  post_id   bigint(20) not null comment '岗位ID',
  primary key (user_id, post_id)
) engine=innodb comment = '用户与岗位关联表';

-- ----------------------------
-- 初始化-用户与岗位关联表数据
-- ----------------------------
insert into sys_user_post values ('1', '1');
insert into sys_user_post values ('2', '2');


-- ----------------------------
-- 10、操作日志记录
-- ----------------------------
drop table if exists sys_oper_log;
create table sys_oper_log (
  oper_id           bigint(20)      not null auto_increment    comment '日志主键',
  title             varchar(50)     default ''                 comment '模块标题',
  business_type     int(2)          default 0                  comment '业务类型（0其它 1新增 2修改 3删除）',
  method            varchar(100)    default ''                 comment '方法名称',
  request_method    varchar(10)     default ''                 comment '请求方式',
  operator_type     int(1)          default 0                  comment '操作类别（0其它 1后台用户 2手机端用户）',
  oper_name         varchar(50)     default ''                 comment '操作人员',
  dept_name         varchar(50)     default ''                 comment '部门名称',
  oper_url          varchar(255)    default ''                 comment '请求URL',
  oper_ip           varchar(128)    default ''                 comment '主机地址',
  oper_location     varchar(255)    default ''                 comment '操作地点',
  oper_param        varchar(2000)   default ''                 comment '请求参数',
  json_result       varchar(2000)   default ''                 comment '返回参数',
  status            int(1)          default 0                  comment '操作状态（0正常 1异常）',
  error_msg         varchar(2000)   default ''                 comment '错误消息',
  oper_time         datetime                                   comment '操作时间',
  cost_time         bigint(20)      default 0                  comment '消耗时间',
  primary key (oper_id),
  key idx_sys_oper_log_bt (business_type),
  key idx_sys_oper_log_s  (status),
  key idx_sys_oper_log_ot (oper_time)
) engine=innodb auto_increment=100 comment = '操作日志记录';


-- ----------------------------
-- 11、字典类型表
-- ----------------------------
drop table if exists sys_dict_type;
create table sys_dict_type
(
  dict_id          bigint(20)      not null auto_increment    comment '字典主键',
  dict_name        varchar(100)    default ''                 comment '字典名称',
  dict_type        varchar(100)    default ''                 comment '字典类型',
  status           char(1)         default '0'                comment '状态（0正常 1停用）',
  create_by        varchar(64)     default ''                 comment '创建者',
  create_time      datetime                                   comment '创建时间',
  update_by        varchar(64)     default ''                 comment '更新者',
  update_time      datetime                                   comment '更新时间',
  remark           varchar(500)    default null               comment '备注',
  primary key (dict_id),
  unique (dict_type)
) engine=innodb auto_increment=100 comment = '字典类型表';

insert into sys_dict_type values(1,  '用户性别', 'sys_user_sex',        '0', 'admin', sysdate(), '', null, '用户性别列表');
insert into sys_dict_type values(2,  '菜单状态', 'sys_show_hide',       '0', 'admin', sysdate(), '', null, '菜单状态列表');
insert into sys_dict_type values(3,  '系统开关', 'sys_normal_disable',  '0', 'admin', sysdate(), '', null, '系统开关列表');
insert into sys_dict_type values(4,  '任务状态', 'sys_job_status',      '0', 'admin', sysdate(), '', null, '任务状态列表');
insert into sys_dict_type values(5,  '任务分组', 'sys_job_group',       '0', 'admin', sysdate(), '', null, '任务分组列表');
insert into sys_dict_type values(6,  '系统是否', 'sys_yes_no',          '0', 'admin', sysdate(), '', null, '系统是否列表');
insert into sys_dict_type values(7,  '通知类型', 'sys_notice_type',     '0', 'admin', sysdate(), '', null, '通知类型列表');
insert into sys_dict_type values(8,  '通知状态', 'sys_notice_status',   '0', 'admin', sysdate(), '', null, '通知状态列表');
insert into sys_dict_type values(9,  '操作类型', 'sys_oper_type',       '0', 'admin', sysdate(), '', null, '操作类型列表');
insert into sys_dict_type values(10, '系统状态', 'sys_common_status',   '0', 'admin', sysdate(), '', null, '登录状态列表');
INSERT INTO `sys_dict_type` VALUES (100, '设备状态', 'sys_device_stat', '0', 'admin', '2024-08-07 10:21:42', '', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (101, '策略类型', 'strategy_type', '0', 'admin', '2024-08-08 14:45:51', 'admin', '2024-08-08 14:46:11', '1:源网协调，2：源荷互动');
INSERT INTO `sys_dict_type` VALUES (102, '执行模式', 'exec_mode', '0', 'admin', '2024-08-08 14:48:15', '', NULL, '0：固定策略 1：规则引擎 2：定时执行（cron）99：手动执行');
INSERT INTO `sys_dict_type` VALUES (103, '是否允许修改标记', 'allow_modify', '0', 'admin', '2024-08-08 17:00:42', '', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (104, '计量类型', 'meter_type', '0', 'admin', '2024-08-09 10:23:03', 'admin', '2024-08-09 10:23:30', '计量类型 0：不区分 1：峰电计量  2：谷电计量');
INSERT INTO `sys_dict_type` VALUES (105, '设施对象类型', 'obj_type', '0', 'admin', '2024-08-12 14:22:40', 'admin', '2024-08-28 15:33:20', '对象类型 0：园区，1：区块，2：设施，3：设备');
INSERT INTO `sys_dict_type` VALUES (106, '标签', 'basecfg_lable', '0', 'admin', '2024-08-19 10:44:49', '', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (107, '告警规则', 'alarm_thre_type', '0', 'admin', '2024-08-26 10:26:49', '', NULL, '1大于；2小于');
INSERT INTO `sys_dict_type` VALUES (108, '告警类型', 'alarm_type', '0', 'admin', '2024-08-26 10:28:04', '', NULL, '1：一般告警 2：重要告警 3：紧急告警 4：恢复告警 5：诊断告警 6：其他告警');
INSERT INTO `sys_dict_type` VALUES (109, '告警状态', 'alarm_state', '0', 'admin', '2024-08-26 11:39:44', 'admin', '2024-08-26 11:40:27', '0-新增，1-处置中，2-已处置，3-消散');
INSERT INTO `sys_dict_type` VALUES (110, '设备台账对象类型', 'device_type', '0', 'admin', '2024-08-27 15:00:16', '', NULL, '设备台账对象类型');
INSERT INTO `sys_dict_type` VALUES (111, '巡检类型', 'task_type', '0', 'admin', '2024-08-29 14:28:37', '', NULL, '1自动；2手动');
INSERT INTO `sys_dict_type` VALUES (112, '巡检状态', 'task_status', '0', 'admin', '2024-08-29 14:30:35', 'admin', '2024-08-29 16:18:01', '0未完成，1进行中，2已完成，3已超期');
INSERT INTO `sys_dict_type` VALUES (113, '巡检结果', 'inspection_result', '0', 'admin', '2024-08-29 16:49:17', '', NULL, '结果状态 0：正常  1：异常');


-- ----------------------------
-- 12、字典数据表
-- ----------------------------
drop table if exists sys_dict_data;
create table sys_dict_data
(
  dict_code        bigint(20)      not null auto_increment    comment '字典编码',
  dict_sort        int(4)          default 0                  comment '字典排序',
  dict_label       varchar(100)    default ''                 comment '字典标签',
  dict_value       varchar(100)    default ''                 comment '字典键值',
  dict_type        varchar(100)    default ''                 comment '字典类型',
  css_class        varchar(100)    default null               comment '样式属性（其他样式扩展）',
  list_class       varchar(100)    default null               comment '表格回显样式',
  is_default       char(1)         default 'N'                comment '是否默认（Y是 N否）',
  status           char(1)         default '0'                comment '状态（0正常 1停用）',
  create_by        varchar(64)     default ''                 comment '创建者',
  create_time      datetime                                   comment '创建时间',
  update_by        varchar(64)     default ''                 comment '更新者',
  update_time      datetime                                   comment '更新时间',
  remark           varchar(500)    default null               comment '备注',
  primary key (dict_code)
) engine=innodb auto_increment=100 comment = '字典数据表';

insert into sys_dict_data values(1,  1,  '男',       '0',       'sys_user_sex',        '',   '',        'Y', '0', 'admin', sysdate(), '', null, '性别男');
insert into sys_dict_data values(2,  2,  '女',       '1',       'sys_user_sex',        '',   '',        'N', '0', 'admin', sysdate(), '', null, '性别女');
insert into sys_dict_data values(3,  3,  '未知',     '2',       'sys_user_sex',        '',   '',        'N', '0', 'admin', sysdate(), '', null, '性别未知');
insert into sys_dict_data values(4,  1,  '显示',     '0',       'sys_show_hide',       '',   'primary', 'Y', '0', 'admin', sysdate(), '', null, '显示菜单');
insert into sys_dict_data values(5,  2,  '隐藏',     '1',       'sys_show_hide',       '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '隐藏菜单');
insert into sys_dict_data values(6,  1,  '正常',     '0',       'sys_normal_disable',  '',   'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
insert into sys_dict_data values(7,  2,  '停用',     '1',       'sys_normal_disable',  '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '停用状态');
insert into sys_dict_data values(8,  1,  '正常',     '0',       'sys_job_status',      '',   'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
insert into sys_dict_data values(9,  2,  '暂停',     '1',       'sys_job_status',      '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '停用状态');
insert into sys_dict_data values(10, 1,  '默认',     'DEFAULT', 'sys_job_group',       '',   '',        'Y', '0', 'admin', sysdate(), '', null, '默认分组');
insert into sys_dict_data values(11, 2,  '系统',     'SYSTEM',  'sys_job_group',       '',   '',        'N', '0', 'admin', sysdate(), '', null, '系统分组');
insert into sys_dict_data values(12, 1,  '是',       'Y',       'sys_yes_no',          '',   'primary', 'Y', '0', 'admin', sysdate(), '', null, '系统默认是');
insert into sys_dict_data values(13, 2,  '否',       'N',       'sys_yes_no',          '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '系统默认否');
insert into sys_dict_data values(14, 1,  '通知',     '1',       'sys_notice_type',     '',   'warning', 'Y', '0', 'admin', sysdate(), '', null, '通知');
insert into sys_dict_data values(15, 2,  '公告',     '2',       'sys_notice_type',     '',   'success', 'N', '0', 'admin', sysdate(), '', null, '公告');
insert into sys_dict_data values(16, 1,  '正常',     '0',       'sys_notice_status',   '',   'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
insert into sys_dict_data values(17, 2,  '关闭',     '1',       'sys_notice_status',   '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '关闭状态');
insert into sys_dict_data values(18, 99, '其他',     '0',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', sysdate(), '', null, '其他操作');
insert into sys_dict_data values(19, 1,  '新增',     '1',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', sysdate(), '', null, '新增操作');
insert into sys_dict_data values(20, 2,  '修改',     '2',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', sysdate(), '', null, '修改操作');
insert into sys_dict_data values(21, 3,  '删除',     '3',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '删除操作');
insert into sys_dict_data values(22, 4,  '授权',     '4',       'sys_oper_type',       '',   'primary', 'N', '0', 'admin', sysdate(), '', null, '授权操作');
insert into sys_dict_data values(23, 5,  '导出',     '5',       'sys_oper_type',       '',   'warning', 'N', '0', 'admin', sysdate(), '', null, '导出操作');
insert into sys_dict_data values(24, 6,  '导入',     '6',       'sys_oper_type',       '',   'warning', 'N', '0', 'admin', sysdate(), '', null, '导入操作');
insert into sys_dict_data values(25, 7,  '强退',     '7',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '强退操作');
insert into sys_dict_data values(26, 8,  '生成代码', '8',       'sys_oper_type',       '',   'warning', 'N', '0', 'admin', sysdate(), '', null, '生成操作');
insert into sys_dict_data values(27, 9,  '清空数据', '9',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '清空操作');
insert into sys_dict_data values(28, 1,  '成功',     '0',       'sys_common_status',   '',   'primary', 'N', '0', 'admin', sysdate(), '', null, '正常状态');
insert into sys_dict_data values(29, 2,  '失败',     '1',       'sys_common_status',   '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '停用状态');
INSERT INTO `sys_dict_data` VALUES (100, 0, '运行', '0', 'sys_device_stat', NULL, 'default', 'N', '0', 'admin', '2024-08-07 10:22:55', 'admin', '2024-08-07 11:12:50', NULL);
INSERT INTO `sys_dict_data` VALUES (101, 0, '故障', '1', 'sys_device_stat', NULL, 'default', 'N', '0', 'admin', '2024-08-07 10:23:36', 'admin', '2024-08-07 11:12:56', NULL);
INSERT INTO `sys_dict_data` VALUES (102, 0, '未运行', '2', 'sys_device_stat', NULL, 'default', 'N', '0', 'admin', '2024-08-07 10:23:48', 'admin', '2024-08-07 11:13:00', NULL);
INSERT INTO `sys_dict_data` VALUES (103, 0, '源网协调', '1', 'strategy_type', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:46:37', '', NULL, NULL);
INSERT INTO `sys_dict_data` VALUES (104, 0, '源荷互动', '2', 'strategy_type', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:46:55', '', NULL, NULL);
INSERT INTO `sys_dict_data` VALUES (105, 0, '固定策略', '0', 'exec_mode', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:48:38', '', NULL, NULL);
INSERT INTO `sys_dict_data` VALUES (106, 0, '规则引擎', '1', 'exec_mode', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:48:51', '', NULL, NULL);
INSERT INTO `sys_dict_data` VALUES (107, 0, '定时执行（cron）', '2', 'exec_mode', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:49:06', '', NULL, NULL);
INSERT INTO `sys_dict_data` VALUES (108, 0, '手动执行', '99', 'exec_mode', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:49:34', '', NULL, '手动执行');
INSERT INTO `sys_dict_data` VALUES (109, 0, '是', '0', 'allow_modify', NULL, 'default', 'N', '0', 'admin', '2024-08-08 17:01:57', 'admin', '2024-08-08 17:03:14', NULL);
INSERT INTO `sys_dict_data` VALUES (110, 0, '否', '1', 'allow_modify', NULL, 'default', 'N', '0', 'admin', '2024-08-08 17:03:04', '', NULL, NULL);
INSERT INTO `sys_dict_data` VALUES (111, 0, '不区分', '0', 'meter_type', NULL, 'default', 'N', '0', 'admin', '2024-08-09 10:23:59', '', NULL, '0：不区分 ');
INSERT INTO `sys_dict_data` VALUES (112, 0, '峰电计量', '1', 'meter_type', NULL, 'default', 'N', '0', 'admin', '2024-08-09 10:24:14', '', NULL, '1：峰电计量  ');
INSERT INTO `sys_dict_data` VALUES (113, 0, '谷电计量', '2', 'meter_type', NULL, 'default', 'N', '0', 'admin', '2024-08-09 10:24:24', '', NULL, '2：谷电计量');
INSERT INTO `sys_dict_data` VALUES (114, 0, '区块', '1', 'obj_type', NULL, 'default', 'N', '0', 'admin', '2024-08-12 14:23:19', 'admin', '2024-08-28 15:33:44', '');
INSERT INTO `sys_dict_data` VALUES (115, 0, '设施 ', '2', 'obj_type', NULL, 'default', 'N', '0', 'admin', '2024-08-12 14:23:30', '', NULL, ' 2-设施 ');
INSERT INTO `sys_dict_data` VALUES (116, 0, '设备', '3', 'obj_type', NULL, 'default', 'N', '0', 'admin', '2024-08-12 14:23:40', 'admin', '2024-08-12 14:23:47', '3-设备');
INSERT INTO `sys_dict_data` VALUES (117, 1, ' photovoltaic', '100', 'basecfg_lable', NULL, 'default', 'N', '0', 'admin', '2024-08-19 10:50:16', 'admin', '2024-08-19 14:33:00', '光伏');
INSERT INTO `sys_dict_data` VALUES (118, 2, 'energy', '200', 'basecfg_lable', NULL, 'default', 'N', '0', 'admin', '2024-08-19 10:50:59', '', NULL, '能源');
INSERT INTO `sys_dict_data` VALUES (119, 3, 'Energy storage', '300', 'basecfg_lable', NULL, 'default', 'N', '0', 'admin', '2024-08-19 10:51:30', '', NULL, '储能');
INSERT INTO `sys_dict_data` VALUES (120, 0, '大于', '1', 'alarm_thre_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:27:12', '', NULL, NULL);
INSERT INTO `sys_dict_data` VALUES (121, 0, '小于', '2', 'alarm_thre_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:27:26', '', NULL, NULL);
INSERT INTO `sys_dict_data` VALUES (122, 0, '一般告警', '1', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:28:19', 'admin', '2024-08-27 14:41:59', '1：一般告警 2：重要告警 3：紧急告警 4：恢复告警 5：诊断告警 6：其他告警');
INSERT INTO `sys_dict_data` VALUES (123, 0, '重要告警', '2', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:28:27', 'admin', '2024-08-26 10:28:40', '1：一般告警 2：重要告警 3：紧急告警 4：恢复告警 5：诊断告警 6：其他告警');
INSERT INTO `sys_dict_data` VALUES (124, 0, '紧急告警', '3', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:28:53', '', NULL, '3：紧急告警 4：恢复告警 5：诊断告警 6：其他告警');
INSERT INTO `sys_dict_data` VALUES (125, 0, '恢复告警', '4', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:29:17', '', NULL, '4：恢复告警 ');
INSERT INTO `sys_dict_data` VALUES (126, 0, '诊断告警', '5', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:29:30', '', NULL, '5：诊断告警 ');
INSERT INTO `sys_dict_data` VALUES (127, 0, '其他告警', '6', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:29:38', '', NULL, '6：其他告警');
INSERT INTO `sys_dict_data` VALUES (128, 0, '新增', '0', 'alarm_state', NULL, 'default', 'N', '0', 'admin', '2024-08-26 11:40:51', '', NULL, '0-新增，');
INSERT INTO `sys_dict_data` VALUES (129, 0, '处置中', '1', 'alarm_state', NULL, 'default', 'N', '0', 'admin', '2024-08-26 11:41:06', '', NULL, '1-处置中，');
INSERT INTO `sys_dict_data` VALUES (130, 0, '已处置', '2', 'alarm_state', NULL, 'default', 'N', '0', 'admin', '2024-08-26 11:41:19', '', NULL, '2-已处置，');
INSERT INTO `sys_dict_data` VALUES (131, 0, '消散', '3', 'alarm_state', NULL, 'default', 'N', '0', 'admin', '2024-08-26 11:41:30', '', NULL, '3-消散');
INSERT INTO `sys_dict_data` VALUES (132, 1, '设备', '0', 'device_type', NULL, 'default', 'N', '0', 'admin', '2024-08-27 15:02:01', '', NULL, NULL);
INSERT INTO `sys_dict_data` VALUES (133, 2, '设施', '1', 'device_type', NULL, 'default', 'N', '0', 'admin', '2024-08-27 15:02:15', '', NULL, NULL);
INSERT INTO `sys_dict_data` VALUES (134, 0, '园区', '0', 'obj_type', NULL, 'default', 'N', '0', 'admin', '2024-08-28 15:34:10', '', NULL, '对象类型 0：园区，1：区块，2：设施，3：设备');
INSERT INTO `sys_dict_data` VALUES (135, 0, '自动', '1', 'task_type', NULL, 'default', 'N', '0', 'admin', '2024-08-29 14:28:57', '', NULL, '1自动；2手动');
INSERT INTO `sys_dict_data` VALUES (136, 0, '手动', '2', 'task_type', NULL, 'default', 'N', '0', 'admin', '2024-08-29 14:29:12', '', NULL, '手动');
INSERT INTO `sys_dict_data` VALUES (137, 0, '自动巡检', 'EMS_AUTO_TASK', 'sys_job_group', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:11:54', 'admin', '2024-08-29 16:12:21', NULL);
INSERT INTO `sys_dict_data` VALUES (138, 0, '未完成', '0', 'task_status', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:18:23', '', NULL, '0未完成，');
INSERT INTO `sys_dict_data` VALUES (139, 0, '进行中', '1', 'task_status', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:18:39', '', NULL, '1进行中，');
INSERT INTO `sys_dict_data` VALUES (140, 0, '已完成', '2', 'task_status', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:18:55', '', NULL, '2已完成，');
INSERT INTO `sys_dict_data` VALUES (141, 0, '已超期', '3', 'task_status', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:19:05', '', NULL, '3已超期');
INSERT INTO `sys_dict_data` VALUES (142, 0, '正常', '0', 'inspection_result', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:49:39', '', NULL, '结果状态 0：正常  1：异常');
INSERT INTO `sys_dict_data` VALUES (143, 0, '异常', '1', 'inspection_result', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:49:55', '', NULL, NULL);


-- ----------------------------
-- 13、参数配置表
-- ----------------------------
drop table if exists sys_config;
create table sys_config (
  config_id         int(5)          not null auto_increment    comment '参数主键',
  config_name       varchar(100)    default ''                 comment '参数名称',
  config_key        varchar(100)    default ''                 comment '参数键名',
  config_value      varchar(500)    default ''                 comment '参数键值',
  config_type       char(1)         default 'N'                comment '系统内置（Y是 N否）',
  create_by         varchar(64)     default ''                 comment '创建者',
  create_time       datetime                                   comment '创建时间',
  update_by         varchar(64)     default ''                 comment '更新者',
  update_time       datetime                                   comment '更新时间',
  remark            varchar(500)    default null               comment '备注',
  primary key (config_id)
) engine=innodb auto_increment=100 comment = '参数配置表';

insert into sys_config values(1, '主框架页-默认皮肤样式名称',     'sys.index.skinName',       'skin-blue',     'Y', 'admin', sysdate(), '', null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' );
insert into sys_config values(2, '用户管理-账号初始密码',         'sys.user.initPassword',    '123456',        'Y', 'admin', sysdate(), '', null, '初始化密码 123456' );
insert into sys_config values(3, '主框架页-侧边栏主题',           'sys.index.sideTheme',      'theme-dark',    'Y', 'admin', sysdate(), '', null, '深色主题theme-dark，浅色主题theme-light' );
insert into sys_config values(4, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false',         'Y', 'admin', sysdate(), '', null, '是否开启注册用户功能（true开启，false关闭）');
insert into sys_config values(5, '用户登录-黑名单列表',           'sys.login.blackIPList',    '',              'Y', 'admin', sysdate(), '', null, '设置登录IP黑名单限制，多个匹配项以;分隔，支持匹配（*通配、网段）');


-- ----------------------------
-- 14、系统访问记录
-- ----------------------------
drop table if exists sys_logininfor;
create table sys_logininfor (
  info_id        bigint(20)     not null auto_increment   comment '访问ID',
  user_name      varchar(50)    default ''                comment '用户账号',
  ipaddr         varchar(128)   default ''                comment '登录IP地址',
  status         char(1)        default '0'               comment '登录状态（0成功 1失败）',
  msg            varchar(255)   default ''                comment '提示信息',
  access_time    datetime                                 comment '访问时间',
  primary key (info_id),
  key idx_sys_logininfor_s  (status),
  key idx_sys_logininfor_lt (access_time)
) engine=innodb auto_increment=100 comment = '系统访问记录';


-- ----------------------------
-- 15、定时任务调度表
-- ----------------------------
drop table if exists sys_job;
create table sys_job (
  job_id              bigint(20)    not null auto_increment    comment '任务ID',
  job_name            varchar(64)   default ''                 comment '任务名称',
  job_group           varchar(64)   default 'DEFAULT'          comment '任务组名',
  invoke_target       varchar(500)  not null                   comment '调用目标字符串',
  cron_expression     varchar(255)  default ''                 comment 'cron执行表达式',
  misfire_policy      varchar(20)   default '3'                comment '计划执行错误策略（1立即执行 2执行一次 3放弃执行）',
  concurrent          char(1)       default '1'                comment '是否并发执行（0允许 1禁止）',
  status              char(1)       default '0'                comment '状态（0正常 1暂停）',
  create_by           varchar(64)   default ''                 comment '创建者',
  create_time         datetime                                 comment '创建时间',
  update_by           varchar(64)   default ''                 comment '更新者',
  update_time         datetime                                 comment '更新时间',
  remark              varchar(500)  default ''                 comment '备注信息',
  primary key (job_id, job_name, job_group)
) engine=innodb auto_increment=100 comment = '定时任务调度表';

INSERT INTO sys_job VALUES (100, '设施自动巡检', 'EMS_AUTO_TASK', 'facInspectionTask.execute()', '* 0/4 * * * ?', '1', '1', '1', 'admin', '2024-09-02 14:59:06', '', '2024-09-04 10:21:43', '');


-- ----------------------------
-- 16、定时任务调度日志表
-- ----------------------------
drop table if exists sys_job_log;
create table sys_job_log (
  job_log_id          bigint(20)     not null auto_increment    comment '任务日志ID',
  job_name            varchar(64)    not null                   comment '任务名称',
  job_group           varchar(64)    not null                   comment '任务组名',
  invoke_target       varchar(500)   not null                   comment '调用目标字符串',
  job_message         varchar(500)                              comment '日志信息',
  status              char(1)        default '0'                comment '执行状态（0正常 1失败）',
  exception_info      varchar(2000)  default ''                 comment '异常信息',
  create_time         datetime                                  comment '创建时间',
  primary key (job_log_id)
) engine=innodb comment = '定时任务调度日志表';


-- ----------------------------
-- 17、通知公告表
-- ----------------------------
drop table if exists sys_notice;
create table sys_notice (
  notice_id         int(4)          not null auto_increment    comment '公告ID',
  notice_title      varchar(50)     not null                   comment '公告标题',
  notice_type       char(1)         not null                   comment '公告类型（1通知 2公告）',
  notice_content    longblob        default null               comment '公告内容',
  status            char(1)         default '0'                comment '公告状态（0正常 1关闭）',
  create_by         varchar(64)     default ''                 comment '创建者',
  create_time       datetime                                   comment '创建时间',
  update_by         varchar(64)     default ''                 comment '更新者',
  update_time       datetime                                   comment '更新时间',
  remark            varchar(255)    default null               comment '备注',
  primary key (notice_id)
) engine=innodb auto_increment=10 comment = '通知公告表';

-- ----------------------------
-- 初始化-公告信息表数据
-- ----------------------------
insert into sys_notice values('1', '温馨提醒：2018-07-01 若依新版本发布啦', '2', '新版本内容', '0', 'admin', sysdate(), '', null, '管理员');
insert into sys_notice values('2', '维护通知：2018-07-01 若依系统凌晨维护', '1', '维护内容',   '0', 'admin', sysdate(), '', null, '管理员');


-- ----------------------------
-- 18、代码生成业务表
-- ----------------------------
drop table if exists gen_table;
create table gen_table (
  table_id          bigint(20)      not null auto_increment    comment '编号',
  table_name        varchar(200)    default ''                 comment '表名称',
  table_comment     varchar(500)    default ''                 comment '表描述',
  sub_table_name    varchar(64)     default null               comment '关联子表的表名',
  sub_table_fk_name varchar(64)     default null               comment '子表关联的外键名',
  class_name        varchar(100)    default ''                 comment '实体类名称',
  tpl_category      varchar(200)    default 'crud'             comment '使用的模板（crud单表操作 tree树表操作）',
  tpl_web_type      varchar(30)     default ''                 comment '前端模板类型（element-ui模版 element-plus模版）',
  package_name      varchar(100)                               comment '生成包路径',
  module_name       varchar(30)                                comment '生成模块名',
  business_name     varchar(30)                                comment '生成业务名',
  function_name     varchar(50)                                comment '生成功能名',
  function_author   varchar(50)                                comment '生成功能作者',
  gen_type          char(1)         default '0'                comment '生成代码方式（0zip压缩包 1自定义路径）',
  gen_path          varchar(200)    default '/'                comment '生成路径（不填默认项目路径）',
  options           varchar(1000)                              comment '其它生成选项',
  create_by         varchar(64)     default ''                 comment '创建者',
  create_time 	    datetime                                   comment '创建时间',
  update_by         varchar(64)     default ''                 comment '更新者',
  update_time       datetime                                   comment '更新时间',
  remark            varchar(500)    default null               comment '备注',
  primary key (table_id)
) engine=innodb auto_increment=1 comment = '代码生成业务表';


-- ----------------------------
-- 19、代码生成业务表字段
-- ----------------------------
drop table if exists gen_table_column;
create table gen_table_column (
  column_id         bigint(20)      not null auto_increment    comment '编号',
  table_id          bigint(20)                                 comment '归属表编号',
  column_name       varchar(200)                               comment '列名称',
  column_comment    varchar(500)                               comment '列描述',
  column_type       varchar(100)                               comment '列类型',
  java_type         varchar(500)                               comment 'JAVA类型',
  java_field        varchar(200)                               comment 'JAVA字段名',
  is_pk             char(1)                                    comment '是否主键（1是）',
  is_increment      char(1)                                    comment '是否自增（1是）',
  is_required       char(1)                                    comment '是否必填（1是）',
  is_insert         char(1)                                    comment '是否为插入字段（1是）',
  is_edit           char(1)                                    comment '是否编辑字段（1是）',
  is_list           char(1)                                    comment '是否列表字段（1是）',
  is_query          char(1)                                    comment '是否查询字段（1是）',
  query_type        varchar(200)    default 'EQ'               comment '查询方式（等于、不等于、大于、小于、范围）',
  html_type         varchar(200)                               comment '显示类型（文本框、文本域、下拉框、复选框、单选框、日期控件）',
  dict_type         varchar(200)    default ''                 comment '字典类型',
  sort              int                                        comment '排序',
  create_by         varchar(64)     default ''                 comment '创建者',
  create_time 	    datetime                                   comment '创建时间',
  update_by         varchar(64)     default ''                 comment '更新者',
  update_time       datetime                                   comment '更新时间',
  primary key (column_id)
) engine=innodb auto_increment=1 comment = '代码生成业务表字段';
