use `sys-user`;

UPDATE `sys-user`.`sys_menu` SET `is_deleted` = 'Y' WHERE `id` = '82';
UPDATE `sys-user`.`sys_menu` SET `is_deleted` = 'Y' WHERE `id` = '89';

INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `order_no`, `remark`) VALUES('N','1970-01-01 12:00:00','1970-01-01 12:00:00','-1','0','知识库基础维护','-1','LT-ZSKJCWH','120','朗通-知识库基础维护');
INSERT INTO `sys_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `order_no`, `remark`) VALUES('N','1970-01-01 12:00:00','1970-01-01 12:00:00','-1','0','基础术语维护','93','LT-ZSKJCWH-JCSYWH','1','朗通-知识库基础维护-基础术语维护');
INSERT INTO `sys_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `order_no`, `remark`) VALUES('N','1970-01-01 12:00:00','1970-01-01 12:00:00','-1','0','基础术语类型维护','93','LT-ZSKJCWH-JCSYLXWH','2','朗通-知识库基础维护-基础术语类型维护');
INSERT INTO `sys_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `order_no`, `remark`) VALUES('N','1970-01-01 12:00:00','1970-01-01 12:00:00','-1','0','基础关系类型维护','93','LT-ZSKJCWH-JCGXLXWH','3','朗通-知识库基础维护-基础关系类型维护');
INSERT INTO `sys_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `order_no`, `remark`) VALUES('N','1970-01-01 12:00:00','1970-01-01 12:00:00','-1','0','知识库扩展维护','-1','LT-ZSKKZWH','121','朗通-知识库扩展维护-知识库扩展维护');
INSERT INTO `sys_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `order_no`, `remark`) VALUES('N','1970-01-01 12:00:00','1970-01-01 12:00:00','-1','0','树形结构维护','97','LT-ZSKKZWH-SXJGWH','1','朗通-知识库扩展维护-树形结构维护');
INSERT INTO `sys_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `order_no`, `remark`) VALUES('N','1970-01-01 12:00:00','1970-01-01 12:00:00','-1','0','疾病相关维护','97','LT-ZSKKZWH-JBXGWH','2','朗通-知识库扩展维护-疾病相关维护');
INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `order_no`, `remark`) VALUES('N','1970-01-01 12:00:00','1970-01-01 12:00:00','-1','0','静态信息维护','97','LT-ZSKKZWH-JTXXWH','3','朗通-知识库扩展维护-静态信息维护');
INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `order_no`, `remark`) VALUES('N','1970-01-01 12:00:00','1970-01-01 12:00:00','-1','0','规则维护','97','LT-ZSKKZWH-GZWH','4','朗通-知识库扩展维护-规则维护');

INSERT INTO `sys-user`.`sys_role` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `roleLevel`, `descritpion`, `menuItems`, `remark`) VALUES ('18', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'CDSS知识库', '0', '', '', NULL);


INSERT INTO sys_role_menu (role_id, menu_id,remark) SELECT c.id, a.id,a.remark  FROM sys_menu a INNER JOIN sys_role c
  WHERE a.name IN (
      "知识库基础维护",
      "基础术语维护",
      "基础术语类型维护",
      "基础关系类型维护",
      "知识库扩展维护",
      "树形结构维护",
      "疾病相关维护",
      "静态信息维护",
      "规则维护") AND a.is_deleted = "N"  AND a.creator = - 1  AND c.name = "CDSS知识库";



INSERT INTO `sys-user`.`sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '18', '48', NULL);
INSERT INTO `sys-user`.`sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '18', '63', NULL);


INSERT INTO `sys-user`.`sys_user` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');
INSERT INTO `sys-user`.`sys_user` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk1', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护1', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');
INSERT INTO `sys-user`.`sys_user` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk2', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护2', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');
INSERT INTO `sys-user`.`sys_user` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk3', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护3', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');
INSERT INTO `sys-user`.`sys_user` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk4', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护4', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');
INSERT INTO `sys-user`.`sys_user` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk5', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护5', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');
INSERT INTO `sys-user`.`sys_user` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk6', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护6', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');
INSERT INTO `sys-user`.`sys_user` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk7', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护7', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');
INSERT INTO `sys-user`.`sys_user` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk8', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护8', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');
INSERT INTO `sys-user`.`sys_user` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk9', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护9', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');
INSERT INTO `sys-user`.`sys_user` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `username`, `password`, `linkman`, `phone`, `position`, `dept`, `email`, `auth_status`, `passauth_time`, `type`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '-1', '0', 'cdsszsk10', '{bcrypt}$2a$10$TPhFrVA7nEF86WnVNnnUB.FXeQflUktxgNDtnE5IFuIKuCwdrjz2.', 'CDSS知识库维护10', '13700000008', '医学人员', '医学人员', 'sadfsd@163.com', '0', '1970-01-01 12:00:00', '1', '');


INSERT INTO sys_user_role (user_id,role_id)
SELECT
    a.id,
   c.id
  FROM
    sys_user a
    INNER JOIN sys_role c
  WHERE a.username IN (
      "cdsszsk",
      "cdsszsk1",
      "cdsszsk2",
      "cdsszsk3",
      "cdsszsk4",
      "cdsszsk5",
      "cdsszsk6",
      "cdsszsk7",
      "cdsszsk8",
      "cdsszsk9",
      "cdsszsk10"
    )
    AND a.is_deleted = "N"
    AND a.creator = - 1
    AND c.name = "CDSS知识库";