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 ('102',  '源网',            '2',    '1',  'strategy-pg',        'mgr/powergrid',             '', 1, 0, 'C', '0', '0',   'power-mgr:pg',           'powergrid',      'admin', sysdate(), '', null, '源网协调');
insert into sys_menu values ('103',  '储能',            '2',    '2',  'strategy-gs',        'mgr/powerstore',            '', 1, 0, 'C', '0', '0',   'power-mgr:gs',           'powerstore',     'admin', sysdate(), '', null, '网储互动');
insert into sys_menu values ('104',  '负荷',            '2',    '3',  'strategy-use',       'mgr/poweruse',              '', 1, 0, 'C', '0', '0',   'power-mgr:use',          'powerload',      'admin', sysdate(), '', null, '源荷互动');
insert into sys_menu values ('105',  '配电',            '2',    '4',  'strategy-dist',      'mgr/powerdist',             '', 1, 0, 'C', '0', '0',   'power-mgr:dist',         'powerdist',      'admin', sysdate(), '', null, '配电监控');
insert into sys_menu values ('106',  '调度',            '2',    '5',  'strategy-mgr',       'mgr/strategy',              '', 1, 0, 'C', '0', '0',   'power-mgr:strategy',     'strategy',       'admin', sysdate(), '', null, '管能策略');

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

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

insert into sys_menu values ('115',  '设备状态',       '5',    '1',  'device-state',        'devmgr/state',           '', 1, 0, 'C', '0', '0',  'device:status',          'devicestatus',   'admin', sysdate(), '', null, '设备状态');
insert into sys_menu values ('116',  '设备台账',       '5',    '2',  'device-el',          'device/el',              '', 1, 0, 'C', '0', '0',   'device:el',              'excel',       'admin', sysdate(), '', null, '设备台账');
insert into sys_menu values ('117',  '设备告警',       '5',    '3',  'analysis-warn',      'analysis/device/warn',   '', 1, 0, 'C', '0', '0',   'analysis:device',        'deviceanalyze',  'admin', sysdate(), '', null, '设备分析');

insert into sys_menu values ('118',  '告警策略',       '6',    '1',  'warn-strategy',      'warn/strategy',          '', 1, 0, 'C', '0', '0',   'warn:strategy',          'warnstrategy',   'admin', sysdate(), '', null, '告警策略');
insert into sys_menu values ('119',  '告警列表',       '6',    '2',  'warn-list',          'warn/list',              '', 1, 0, 'C', '0', '0',   'warn:list',              'warnmsg',        'admin', sysdate(), '', null, '告警策略');
insert into sys_menu values ('120',  '巡检任务',       '6',    '3',  'oper-task',          'oper-mgr/task',          '', 1, 0, 'C', '0', '0',   'oper-mgr:task',          'task',           'admin', sysdate(), '', null, '巡检任务');
insert into sys_menu values ('121',  '巡检报告',       '6',    '4',  'oper-report',        'oper-mgr/report',        '', 1, 0, 'C', '0', '0',   'oper-mgr:report',        'note',           'admin', sysdate(), '', null, '巡检报告');

insert into sys_menu values ('122',  '建筑区块',       '7',    '1',  'buildingcfg',        '',                       '', 1, 0, 'M', '0', '0',   'basecfg:building',       'building',       'admin', sysdate(), '', null, '建筑区块菜单');
insert into sys_menu values ('123',  '设备设施',       '7',    '2',  'devicecfg',          '',                       '', 1, 0, 'M', '0', '0',   'basecfg:device',         'devicemgr',      'admin', sysdate(), '', null, '设备设施菜单');
insert into sys_menu values ('124',  '能源计量',       '7',    '3',  'energycfg',          '',                       '', 1, 0, 'M', '0', '0',   'basecfg:energy',         'energy',         'admin', sysdate(), '', null, '能源计量菜单');
insert into sys_menu values ('125',  '标签管理',       '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',  '系统信息',       '9',   '1',  'adapter-subsystem',  'adapter/subsystem/index',  '', 1, 0, 'C', '0', '0',   'adapter:subsystem:list',  'note',           'admin', sysdate(), '', null, '光伏');
insert into sys_menu values ('181',  '光伏',          '9',   '2',  'adapter-pv',         'adapter/pv/index',         '', 1, 0, 'C', '0', '0',   'adapter:pv:list',         'photovoltaic',   'admin', sysdate(), '', null, '光伏');
insert into sys_menu values ('182',  '光储直柔',       '9',   '3',  'adapter-gczr',       'adapter/gczr/index',       '', 1, 0, 'C', '0', '0',   'adapter:gczr:list',       'deviceaccess',   'admin', sysdate(), '', null, '光储直柔');
insert into sys_menu values ('183',  '光储充',         '9',   '4',  'adapter-gcc',        'adapter/gcc/index',        '', 1, 0, 'C', '0', '0',   'adapter:gcc:list',       'energyconsume',   'admin', sysdate(), '', null, '光储充');
insert into sys_menu values ('184',  '充电桩',         '9',   '5',  'adapter-cdz',        'adapter/cdz/index',        '', 1, 0, 'C', '0', '0',   'adapter:cdz:list',       'powerstore',      'admin', sysdate(), '', null, '充电桩');
insert into sys_menu values ('185',  '智慧照明',       '9',   '6',  'adapter-zm',         'adapter/zm/index',         '', 1, 0, 'C', '0', '0',   'adapter:zm:list',        'illumination',    'admin', sysdate(), '', null, '智慧照明');
insert into sys_menu values ('186',  '智慧海绵',       '9',   '7',  'adapter-hm',         'adapter/hm/index',         '', 1, 0, 'C', '0', '0',   'adapter:hm:list',        'sponge',          'admin', sysdate(), '', null, '智慧海绵');
insert into sys_menu values ('187',  '垃圾厨余',       '9',   '8',  'adapter-ljcy',       'adapter/ljcy/index',       '', 1, 0, 'C', '0', '0',   'adapter:ljcy:list',      'foodwaste',       'admin', sysdate(), '', null, '垃圾厨余');
insert into sys_menu values ('188',  '能耗监测',       '9',   '9',  'adapter-nhjc',       'adapter/nhjc/index',       '', 1, 0, 'C', '0', '0',   'adapter:nhjc:list',      'econsumption',    'admin', sysdate(), '', null, '能耗监测');
insert into sys_menu values ('189',  '设备管理',       '9',   '10', 'adapter-devc',       'adapter/devc/index',       '', 1, 0, 'M', '0', '0',   'adapter:devc:list',      'devicemgr',         'admin', sysdate(), '', null, '设备管理');
INSERT INTO sys_menu VALUES (190, '任务调度', 8, 0, 'task/job', 'monitor/job/index', NULL, 1, 0, 'C', '0', '0', 'monitor:job', 'date-range', '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 ('1110',  '产能预测', '111', '1',  'prediction-prod',    'prediction/prod',        '', 1, 0, 'C', '0', '0',   'prediction:prod',        'energyprod',     'admin', sysdate(), '', null, '产能预测');
insert into sys_menu values ('1111',  '用能预测', '111', '2',  'prediction-consume', 'prediction/consume',     '', 1, 0, 'C', '0', '0',   'prediction:consume',     'energyconsume',  'admin', sysdate(), '', null, '用能预测');
insert into sys_menu values ('1112',  '碳排预测', '111', '3',  'prediction-ca',      'prediction/ca',          '', 1, 0, 'C', '0', '0',   'prediction:ca',          'caemission',     'admin', sysdate(), '', null, '碳排预测');
-- 报表菜单
insert into sys_menu values ('1120',  '产能报表',   '112', '1',  'statement-prod',    'analysis/statement/prod',     '', 1, 0, 'C', '0', '0',    'analysis:statement:prod',      'energyprod',     'admin', sysdate(), '', null, '产能报表');
insert into sys_menu values ('1121',  '用能报表',   '112', '2',  'statement-consume', 'analysis/statement/consume',  '', 1, 0, 'C', '0', '0',    'analysis:statement:consume',   'energyconsume',  'admin', sysdate(), '', null, '用能报表');
insert into sys_menu values ('1122',  '告警报表',   '112', '3',  'statement-warn',    'analysis/statement/warn',     '', 1, 0, 'C', '0', '0',    'analysis:statement:warn',      'warn',     'admin', sysdate(), '', null, '告警报表');
insert into sys_menu values ('1123',  '自定义',     '112', '4',  'statement-warn',    'analysis/statement/custom',   '', 1, 0, 'C', '0', '0',   'analysis:statement:custom',    'statement-zdy',   'admin', sysdate(), '', null, '自定义报表');
-- 业务配置菜单
insert into sys_menu values ('1220',  '地块划分',   '122', '1',  'basecfg-servicearea',    'basecfg/area/index',         '', 1, 0, 'C', '0', '0',   'basecfg:area:list',           'cfgwrite',   'admin', sysdate(), '', null, '地块划分');
insert into sys_menu values ('1221',  '建筑配置',   '122', '2',  'basecfg-building',       'basecfg/building/index',     '', 1, 0, 'C', '0', '0',   'basecfg:building:list',        'cfgwrite',   'admin', sysdate(), '', null, '建筑配置');
insert into sys_menu values ('1222',  '功能分区',   '122', '3',  'basecfg-zoning',         'basecfg/zoning/index',       '', 1, 0, 'C', '0', '0',   'basecfg:zoning:list',          'cfgwrite',   'admin', sysdate(), '', null, '功能分区');
insert into sys_menu values ('1230',  '设施分类',   '123', '1',  'basecfg-facstype',       'basecfg/facstype/index',     '', 1, 0, 'C', '0', '0',   'basecfg:facstype:list',        'cfgwrite',   'admin', sysdate(), '', null, '设施分类');
insert into sys_menu values ('1231',  '能源设施',   '123', '2',  'basecfg-facscfg',        'basecfg/emsfacs/index',      '', 1, 0, 'C', '0', '0',   'basecfg:emsfacs:list',         'cfgwrite',   'admin', sysdate(), '', null, '能源设施');
insert into sys_menu values ('1232',  '能流关系',   '123', '3',  'basecfg-flowrel',        'basecfg/flowrel/index',      '', 1, 0, 'C', '0', '0',   'basecfg:flowrel:list',         'cfgwrite',   'admin', sysdate(), '', null, '能流关系');
insert into sys_menu values ('1233',  '能源设备',   '123', '4',  'basecfg-devccfg',        'basecfg/device/index',       '', 1, 0, 'C', '0', '0',   'basecfg:device:list',          'cfgwrite',   'admin', sysdate(), '', null, '能源设备');
insert into sys_menu values ('1234',  '配电设施',   '123', '5',  'basecfg-powerbox',       'basecfg/powerbox/index',     '', 1, 0, 'C', '0', '0',   'ems:powerbox:list',            'cfgwrite',   'admin', sysdate(), '', null, '配电设施');
insert into sys_menu values ('1240',  '价格策略',   '124', '1',  'basecfg-electricity',    'basecfg/price/index',        '', 1, 0, 'C', '0', '0',   'basecfg:price:list',           'cfgwrite',   'admin', sysdate(), '', null, '价格策略');
insert into sys_menu values ('1241',  '计量设备',   '124', '2',  'basecfg-meterdevc',      'basecfg/meterdevc/index',     '', 1, 0, 'C', '0', '0',  'ems:meterdevc:list',           'cfgwrite',   'admin', sysdate(), '', null, '计量设备');
insert into sys_menu values ('1242',  '碳核算',     '124', '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 ('12200', '地块新增', '1220', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:area:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12201', '地块修改', '1220', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:area:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12202', '地块删除', '1220', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:area:remove','#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12203', '地块导出', '1220', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:area:export','#', 'admin', sysdate(), '', null, '');
-- 服务区建筑配置按钮
insert into sys_menu values ('12210', '建筑新增', '1221', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:building:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12211', '建筑修改', '1221', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:building:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12212', '建筑删除', '1221', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:building:remove','#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12213', '建筑导出', '1221', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:building:export','#', 'admin', sysdate(), '', null, '');
-- 服务区建筑区块配置按钮
insert into sys_menu values ('12220', '区块新增', '1222', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12221', '区块修改', '1222', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12222', '区块删除', '1222', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:remove','#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12223', '区块导出', '1222', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:zoning:export','#', 'admin', sysdate(), '', null, '');
-- 能源设施分类配置按钮
insert into sys_menu values ('12300', '分类新增', '1230', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:facstype:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12301', '分类修改', '1230', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:facstype:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12302', '分类删除', '1230', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:facstype:remove','#', 'admin', sysdate(), '', null, '');
-- 服务区能源设施配置按钮
insert into sys_menu values ('12310', '设施新增', '1231', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12311', '设施修改', '1231', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12312', '设施删除', '1231', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:remove','#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12313', '设施导出', '1231', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emsfacs:export','#', 'admin', sysdate(), '', null, '');
-- 服务区能流关系配置按钮
insert into sys_menu values ('12320', '关系新增', '1232', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12321', '关系修改', '1232', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12322', '关系删除', '1232', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:remove','#', 'admin', sysdate(), '', null, '');
-- 服务区设备配置按钮
insert into sys_menu values ('12330', '设备新增', '1233', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:add',   '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12331', '设备修改', '1233', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:edit',  '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12332', '设备删除', '1233', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:remove','#', 'admin', sysdate(), '', null, '');
insert into sys_menu values ('12333', '设备导出', '1233', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:export','#', 'admin', sysdate(), '', null, '');

-- 能源策略按钮
INSERT INTO sys_menu VALUES (2000, 'list', 103, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu VALUES (2001, 'export', 103, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu VALUES (2002, 'query', 103, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu VALUES (2003, 'add', 103, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu VALUES (2004, 'edit', 103, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu VALUES (2005, 'remove', 103, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:strategy:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 源网协调按钮
INSERT INTO `sys_menu` VALUES ( 2006, 'list',104, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES ( 2007, 'export',104, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES ( 2008, 'query',104, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES ( 2009, 'add',104, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES ( 2010, 'edit',104, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES ( 2011, 'remove',104, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:pg:remove', '#', 'admin', sysdate(), '', NULL, '');
-- 网储互动
INSERT INTO `sys_menu` VALUES (2012,'list',105, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2013,'export',105, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2014,'query',105, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2015,'add',105, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2016,'edit',105, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2017,'remove',105, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:remove', '#', 'admin', sysdate(), '', NULL, '');
-- 产能预测
INSERT INTO `sys_menu` VALUES (2018,'list',1100, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2019,'export',1100, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2020,'query',1100, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2021,'add',1100, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2022,'edit',1100, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2023,'remove',1100, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:prod:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 用能预测
INSERT INTO `sys_menu` VALUES (2024,'list',1101, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2025,'export',1101, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2026,'query',1101, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2027,'add',1101, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2028,'edit',1101, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2029,'remove',1101, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:consume:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 碳排预测
INSERT INTO `sys_menu` VALUES (2030,'list',1102, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2031,'export',1102, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2032,'query',1102, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2033,'add',1102, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2034,'edit',1102, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2035,'remove',1102, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'prediction:ca:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 碳排计量
INSERT INTO `sys_menu` VALUES (2036,'list',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2037,'export',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2038,'query',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2039,'add',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2040,'edit',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2041,'remove',112, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:emission:remove', '#', 'admin', sysdate(), '', NULL, '');


-- 碳排计量
INSERT INTO `sys_menu` VALUES (2042,'list',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:list', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2043,'export',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:export', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2044,'query',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2045,'add',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2046,'edit',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (2047,'remove',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 告警策略
INSERT INTO sys_menu VALUES(17823, 'list', 118, 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(17824, 'export', 118, 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(17825, 'query', 118, 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(17826, 'add', 118, 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(17827, 'edit', 118, 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 (17828, 'remove', 118, 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 (17829, 'list', 119, 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 (17830, 'export', 119, 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 (17831, 'query', 119, 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 (17832, 'add', 119, 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 (17833, 'edit', 119, 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 (17834, 'remove', 119, 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 (null, '任务列表', 190, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (null, '任务到出', 190, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (null, '任务查询', 190, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (null, '新增任务', 190, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (null, '编辑任务', 190, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (null, '移除任务', 190, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (null, '修改任务状态', 190, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
INSERT INTO sys_menu VALUES (null, '执行任务', 190, 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 values ('2',1);
insert into sys_role_menu values ('2',2);
insert into sys_role_menu values ('2',3);
insert into sys_role_menu values ('2',4);
insert into sys_role_menu values ('2',5);
insert into sys_role_menu values ('2',6);
insert into sys_role_menu values ('2',7);
insert into sys_role_menu values ('2',8);
insert into sys_role_menu values ('2',9);
insert into sys_role_menu values ('2',99);
insert into sys_role_menu values ('2',100);
insert into sys_role_menu values ('2',101);
insert into sys_role_menu values ('2',102);
insert into sys_role_menu values ('2',103);
insert into sys_role_menu values ('2',104);
insert into sys_role_menu values ('2',105);
insert into sys_role_menu values ('2',106);
insert into sys_role_menu values ('2',107);
insert into sys_role_menu values ('2',108);
insert into sys_role_menu values ('2',109);
insert into sys_role_menu values ('2',110);
insert into sys_role_menu values ('2',111);
insert into sys_role_menu values ('2',112);
insert into sys_role_menu values ('2',113);
insert into sys_role_menu values ('2',114);
insert into sys_role_menu values ('2',115);
insert into sys_role_menu values ('2',116);
insert into sys_role_menu values ('2',117);
insert into sys_role_menu values ('2',118);
insert into sys_role_menu values ('2',119);
insert into sys_role_menu values ('2',120);
insert into sys_role_menu values ('2',121);
insert into sys_role_menu values ('2',122);
insert into sys_role_menu values ('2',123);
insert into sys_role_menu values ('2',124);
insert into sys_role_menu values ('2',125);
insert into sys_role_menu values ('2',170);
insert into sys_role_menu values ('2',171);
insert into sys_role_menu values ('2',172);
insert into sys_role_menu values ('2',173);
insert into sys_role_menu values ('2',174);
insert into sys_role_menu values ('2',175);
insert into sys_role_menu values ('2',176);
insert into sys_role_menu values ('2',177);
insert into sys_role_menu values ('2',178);
insert into sys_role_menu values ('2',179);
insert into sys_role_menu values ('2',180);
insert into sys_role_menu values ('2',181);
insert into sys_role_menu values ('2',182);
insert into sys_role_menu values ('2',183);
insert into sys_role_menu values ('2',184);
insert into sys_role_menu values ('2',185);
insert into sys_role_menu values ('2',186);
insert into sys_role_menu values ('2',187);
insert into sys_role_menu values ('2',188);
insert into sys_role_menu values ('2',189);
insert into sys_role_menu values ('2',998);
insert into sys_role_menu values ('2',999);
insert into sys_role_menu values ('2',1110);
insert into sys_role_menu values ('2',1111);
insert into sys_role_menu values ('2',1112);
insert into sys_role_menu values ('2',1120);
insert into sys_role_menu values ('2',1121);
insert into sys_role_menu values ('2',1122);
insert into sys_role_menu values ('2',1123);
insert into sys_role_menu values ('2',1220);
insert into sys_role_menu values ('2',1221);
insert into sys_role_menu values ('2',1222);
insert into sys_role_menu values ('2',1230);
insert into sys_role_menu values ('2',1231);
insert into sys_role_menu values ('2',1232);
insert into sys_role_menu values ('2',1233);
insert into sys_role_menu values ('2',1234);
insert into sys_role_menu values ('2',1240);
insert into sys_role_menu values ('2',1241);
insert into sys_role_menu values ('2',1242);
insert into sys_role_menu values ('2',1700);
insert into sys_role_menu values ('2',1701);
insert into sys_role_menu values ('2',1702);
insert into sys_role_menu values ('2',1703);
insert into sys_role_menu values ('2',1704);
insert into sys_role_menu values ('2',1705);
insert into sys_role_menu values ('2',1706);
insert into sys_role_menu values ('2',1710);
insert into sys_role_menu values ('2',1711);
insert into sys_role_menu values ('2',1712);
insert into sys_role_menu values ('2',1713);
insert into sys_role_menu values ('2',1714);
insert into sys_role_menu values ('2',1720);
insert into sys_role_menu values ('2',1721);
insert into sys_role_menu values ('2',1722);
insert into sys_role_menu values ('2',1723);
insert into sys_role_menu values ('2',1730);
insert into sys_role_menu values ('2',1731);
insert into sys_role_menu values ('2',1732);
insert into sys_role_menu values ('2',1733);
insert into sys_role_menu values ('2',1740);
insert into sys_role_menu values ('2',1741);
insert into sys_role_menu values ('2',1742);
insert into sys_role_menu values ('2',1743);
insert into sys_role_menu values ('2',1744);
insert into sys_role_menu values ('2',1750);
insert into sys_role_menu values ('2',1751);
insert into sys_role_menu values ('2',1752);
insert into sys_role_menu values ('2',1753);
insert into sys_role_menu values ('2',1754);
insert into sys_role_menu values ('2',1760);
insert into sys_role_menu values ('2',1761);
insert into sys_role_menu values ('2',1762);
insert into sys_role_menu values ('2',1763);
insert into sys_role_menu values ('2',1764);
insert into sys_role_menu values ('2',1770);
insert into sys_role_menu values ('2',1771);
insert into sys_role_menu values ('2',1772);
insert into sys_role_menu values ('2',1773);
insert into sys_role_menu values ('2',1780);
insert into sys_role_menu values ('2',1781);
insert into sys_role_menu values ('2',1790);
insert into sys_role_menu values ('2',1791);
insert into sys_role_menu values ('2',1792);
insert into sys_role_menu values ('2',2000);
insert into sys_role_menu values ('2',2001);
insert into sys_role_menu values ('2',2002);
insert into sys_role_menu values ('2',2003);
insert into sys_role_menu values ('2',2004);
insert into sys_role_menu values ('2',2005);
insert into sys_role_menu values ('2',2006);
insert into sys_role_menu values ('2',2007);
insert into sys_role_menu values ('2',2008);
insert into sys_role_menu values ('2',2009);
insert into sys_role_menu values ('2',2010);
insert into sys_role_menu values ('2',2011);
insert into sys_role_menu values ('2',2012);
insert into sys_role_menu values ('2',2013);
insert into sys_role_menu values ('2',2014);
insert into sys_role_menu values ('2',2015);
insert into sys_role_menu values ('2',2016);
insert into sys_role_menu values ('2',2017);
insert into sys_role_menu values ('2',2018);
insert into sys_role_menu values ('2',2019);
insert into sys_role_menu values ('2',2020);
insert into sys_role_menu values ('2',2021);
insert into sys_role_menu values ('2',2022);
insert into sys_role_menu values ('2',2023);
insert into sys_role_menu values ('2',2024);
insert into sys_role_menu values ('2',2025);
insert into sys_role_menu values ('2',2026);
insert into sys_role_menu values ('2',2027);
insert into sys_role_menu values ('2',2028);
insert into sys_role_menu values ('2',2029);
insert into sys_role_menu values ('2',2030);
insert into sys_role_menu values ('2',2031);
insert into sys_role_menu values ('2',2032);
insert into sys_role_menu values ('2',2033);
insert into sys_role_menu values ('2',2034);
insert into sys_role_menu values ('2',2035);
insert into sys_role_menu values ('2',2036);
insert into sys_role_menu values ('2',2037);
insert into sys_role_menu values ('2',2038);
insert into sys_role_menu values ('2',2039);
insert into sys_role_menu values ('2',2040);
insert into sys_role_menu values ('2',2041);
insert into sys_role_menu values ('2',2042);
insert into sys_role_menu values ('2',2043);
insert into sys_role_menu values ('2',2044);
insert into sys_role_menu values ('2',2045);
insert into sys_role_menu values ('2',2046);
insert into sys_role_menu values ('2',2047);
insert into sys_role_menu values ('2',12200);
insert into sys_role_menu values ('2',12201);
insert into sys_role_menu values ('2',12202);
insert into sys_role_menu values ('2',12203);
insert into sys_role_menu values ('2',12210);
insert into sys_role_menu values ('2',12211);
insert into sys_role_menu values ('2',12212);
insert into sys_role_menu values ('2',12213);
insert into sys_role_menu values ('2',12220);
insert into sys_role_menu values ('2',12221);
insert into sys_role_menu values ('2',12222);
insert into sys_role_menu values ('2',12223);
insert into sys_role_menu values ('2',12300);
insert into sys_role_menu values ('2',12301);
insert into sys_role_menu values ('2',12302);
insert into sys_role_menu values ('2',12310);
insert into sys_role_menu values ('2',12311);
insert into sys_role_menu values ('2',12312);
insert into sys_role_menu values ('2',12313);
insert into sys_role_menu values ('2',12320);
insert into sys_role_menu values ('2',12321);
insert into sys_role_menu values ('2',12322);
insert into sys_role_menu values ('2',12330);
insert into sys_role_menu values ('2',12331);
insert into sys_role_menu values ('2',12332);
insert into sys_role_menu values ('2',12333);
insert into sys_role_menu values ('2',17800);
insert into sys_role_menu values ('2',17801);
insert into sys_role_menu values ('2',17802);
insert into sys_role_menu values ('2',17810);
insert into sys_role_menu values ('2',17811);
insert into sys_role_menu values ('2',17812);
insert into sys_role_menu 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, '登录状态列表');


-- ----------------------------
-- 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, '停用状态');


-- ----------------------------
-- 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(1, '系统默认（无参）', 'DEFAULT', 'ryTask.ryNoParams',        '0/10 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
insert into sys_job values(2, '系统默认（有参）', 'DEFAULT', 'ryTask.ryParams(\'ry\')',  '0/15 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
insert into sys_job values(3, '系统默认（多参）', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)',  '0/20 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');


-- ----------------------------
-- 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 = '代码生成业务表字段';
