USE `cdss`;

CREATE TABLE `tran_log` (
                            `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志ID',
                            `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
                            `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
                            `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
                            `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
                            `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
                            `patient_id` varchar(50) DEFAULT NULL COMMENT '病人唯一标识（病人id、病历号等）',
                            `hospital_id` bigint(20) DEFAULT NULL COMMENT '医院id',
                            `sub_hospital_code` varchar(255) DEFAULT NULL COMMENT '子医院编码',
                            `sub_hospital_name` varchar(255) DEFAULT NULL COMMENT '子医院名称',
                            `scene_name` varchar(100) NOT NULL DEFAULT '' COMMENT '场景名称',
                            `params` text COMMENT '输入参数',
                            `result` text COMMENT '返回参数',
                            `gmt_req` datetime(3) NOT NULL DEFAULT '1970-01-01 12:00:00.000' COMMENT '请求时间',
                            `gmt_resp` datetime(3) NOT NULL DEFAULT '1970-01-01 12:00:00.000' COMMENT '响应时间',
                            `exec_time` varchar(16) NOT NULL DEFAULT '0' COMMENT '耗时',
                            `success_flag` int(11) NOT NULL DEFAULT '1' COMMENT '调用是否成功（0：失败；1：成功）',
                            PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8 COMMENT='系统日志表';


/*
 Navicat Premium Data Transfer

 Source Server         : 192.168.2.236
 Source Server Type    : MySQL
 Source Server Version : 50735
 Source Host           : 192.168.2.236:3306
 Source Schema         : cdss

 Target Server Type    : MySQL
 Target Server Version : 50735
 File Encoding         : 65001

 Date: 28/10/2021 10:02:13
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu`  (
                             `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
                             `is_deleted` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
                             `gmt_create` datetime(0) NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
                             `gmt_modified` datetime(0) NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
                             `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
                             `modifier` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
                             `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '菜单名称',
                             `parent_id` bigint(20) NOT NULL DEFAULT -1 COMMENT '-1：表示顶级,其他值表示上级菜单的id',
                             `code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '编码，与前端对应',
                             `order_no` int(11) NOT NULL DEFAULT 0 COMMENT '排序，从小到大',
                             `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '备注',
                             PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统菜单' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
INSERT INTO `sys_menu` VALUES (1, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '医学术语库维护', -1, 'CDSS-YXSYK', 1, '');
INSERT INTO `sys_menu` VALUES (2, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '系统配置', -1, 'CDSS-XTPZ', 2, '');
INSERT INTO `sys_menu` VALUES (3, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '诊断关联维护', 1, 'YXSYK-ZDGLWH', 2, '医学术语库维护-诊断关联维护');
INSERT INTO `sys_menu` VALUES (4, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '检验关联维护', 1, 'YXSYK-JYGLWH', 3, '医学术语库维护-检验关联维护');
INSERT INTO `sys_menu` VALUES (5, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '检查关联维护', 1, 'YXSYK-JCGLWH', 4, '医学术语库维护-检验关联维护-检查关联维护');
INSERT INTO `sys_menu` VALUES (6, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '药品关联维护', 1, 'YXSYK-YPGLWH', 5, '');
INSERT INTO `sys_menu` VALUES (7, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '手术/操作关联维护', 1, 'YXSYK-SSCZGLWH', 6, '');
INSERT INTO `sys_menu` VALUES (8, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '科室关联维护', 1, 'YXSYK-KSGLWH', 8, '');
INSERT INTO `sys_menu` VALUES (9, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '医学术语静态知识维护', 1, 'YXSYK-JTZSWH', 1, '');
INSERT INTO `sys_menu` VALUES (10, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '关联维护设置', 1, 'YXSYK-GLWH', 100, '');
INSERT INTO `sys_menu` VALUES (11, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '电子病历方案配置', 2, 'XTPZ-DZBLFAPZ', 1, '');
INSERT INTO `sys_menu` VALUES (12, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '输血关联维护', 1, 'YXSYK-SXGLWH', 7, '');
INSERT INTO `sys_menu` VALUES (13, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '规则维护', -1, 'CDSS-GZWH', 3, '规则维护');
INSERT INTO `sys_menu` VALUES (14, 'Y', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '开单合理性规则维护', 13, 'GZWH-KDHLXGZWH', 1, '规则维护-开单合理性规则维护');
INSERT INTO `sys_menu` VALUES (15, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '规则维护', 13, 'GZWH-GZWH', 1, '规则维护-规则维护');
INSERT INTO `sys_menu` VALUES (16, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '量表关联维护', 1, 'YXSYK-LBGLWH', 9, '医学术语库维护-量表关联维护');
INSERT INTO `sys_menu` VALUES (17, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '护理关联维护', 1, 'YXSYK-HLGLWH', 10, '医学术语库维护-护理关联维护');
INSERT INTO `sys_menu` VALUES (18, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '中医疾病关联维护', 1, 'YXSYK-ZYJBGLWH', 13, '医学术语库维护-中医疾病关联维护');
INSERT INTO `sys_menu` VALUES (19, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '中医证候关联维护', 1, 'YXSYK-ZYZHGLWH', 14, '医学术语库维护-中医证候关联维护');
INSERT INTO `sys_menu` VALUES (20, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '子医院维护', 2, 'XTPZ-ZYYWH', 2, '');
INSERT INTO `sys_menu` VALUES (21, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '给药途径关联维护', 1, 'YXSYK-GYTJGLWH', 11, '医学术语库维护-给药途径关联维护');
INSERT INTO `sys_menu` VALUES (22, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '麻醉关联维护', 1, 'YXSYK-MZGLWH', 12, '医学术语库维护-麻醉关联维护');
INSERT INTO `sys_menu` VALUES (23, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '接口管理', -1, 'CDSS-JKGL', 4, '接口管理');
INSERT INTO `sys_menu` VALUES (24, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '调用记录', 23, 'JKGL-DYJL', 1, '接口管理-调用记录');


SET FOREIGN_KEY_CHECKS = 1;

INSERT INTO `sys_role_menu`(`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', -1, 21, NULL);
INSERT INTO `sys_role_menu`(`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', -1, 22, NULL);
INSERT INTO `sys_role_menu`(`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', -1, 23, NULL);
INSERT INTO `sys_role_menu`(`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', -1, 24, NULL);
