use `qc`;
-- 所有环境已经执行
-- ALTER TABLE `med_behospital_info` ADD COLUMN `is_placefile` varchar(2) NOT NULL DEFAULT '0' COMMENT '是否归档（0：未归档，1：已归档）' AFTER `director_doctor_name`;

ALTER TABLE `med_qcresult_detail` ADD COLUMN `grade_type` tinyint(4) DEFAULT '1' COMMENT '初始类型(1：机器，2：人工)' AFTER `is_reject`;
ALTER TABLE `med_qcresult_detail` ADD COLUMN `opt_type` tinyint(4) DEFAULT '1' COMMENT '操作类型(1：新增，2：删除，3：修改)' AFTER `grade_type`;

UPDATE `sys_permission` SET `is_deleted` = 'Y' WHERE `id` = '10';

update `sys_dictionary_info` set is_deleted = 'N' where group_type = 12 and `name` = '病案首页';
DROP TABLE IF EXISTS `qc_mode`;
CREATE TABLE `qc_mode` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(128) DEFAULT NULL COMMENT '数据模块名称',
  `order_no` int(11) DEFAULT '1' COMMENT '排序号',
  `parent_id` bigint(20) DEFAULT NULL COMMENT '上级模块',
  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(60) DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COMMENT='数据模块表';

INSERT INTO `qc_mode` VALUES ('1', '入院记录', '2', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('2', '首次病程录', '10', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('3', '死亡病例讨论记录', '40', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('4', '查房记录', '20', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('5', '出院小结', '800', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('6', '病案首页', '1', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('7', '会诊记录', '170', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('8', '医嘱信息', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('9', '交接班记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('10', '输血/血制品病程记录', '130', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('11', '术前讨论、术前小结', '50', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('12', '麻醉记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('13', '麻醉知情同意书', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('14', '麻醉术前访视记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('15', '麻醉术后访视记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('16', '手术知情同意书', '80', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('17', '手术记录', '60', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('18', '术后首次病程及谈话记录', '70', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('19', '疑难病例讨论记录', '30', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('20', '手术风险评估表', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('21', '手术安全核查表', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('22', '抢救记录', '90', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('23', '危急值记录', '100', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('24', '死亡记录', '250', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('25', '病危通知书', '120', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('26', '转入记录', '190', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('27', '转出记录', '200', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('28', '阶段小结', '110', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('29', '病重通知书', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('30', '会诊申请单', '150', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('31', '会诊结果单', '160', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('32', '输血后效果评价', '140', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('33', '专科交接单', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('34', '转科记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('35', '病理检验送检单', '180', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('36', '自定义病程记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('37', '病程信息', '3', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('52', '授权知情同意书', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('53', '知情同意书', '260', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('54', '谈话告知书', '270', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
INSERT INTO `qc_mode` VALUES ('55', '其他', '999', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);

ALTER TABLE `sys_task_cron` ADD COLUMN `param` varchar(500) DEFAULT '' COMMENT '参数' AFTER `cron`;
UPDATE `sys_task_cron` SET `param` = 1,`is_deleted` = 'N' where cron_code = 'TASK_CX';
UPDATE `sys_task_cron` SET `param` = 3,`is_deleted` = 'N',`remark` = '评分未评分的数据' where cron_code = 'TASK001';

INSERT INTO `sys_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES (89, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷占比（内页）', 'FUNC000089', '/console/entryGroupByEntryInnerPage', 'ALL', '控制台-条目缺陷占比（内页）', NULL);
INSERT INTO `sys_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES (90, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷占比-科室（内页）', 'FUNC000090', '/consoleByDept/entryGroupByEntryAndDeptInnerPage', 'ALL', '控制台（科室）-条目缺陷占比-科室（内页）', NULL);
INSERT INTO `sys_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES (91, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '各科室质控平均分（首页）-根据内外科系统统计', 'FUNC000091', '/console/getAverageScoreByDeptClass', 'ALL', '控制台-各科室质控平均分（首页）-根据内外科系统统计', NULL);
INSERT INTO `sys_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES (92, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '各科室缺陷占比（内页）-根据内外科系统统计', 'FUNC000092', '/console/levelStatisticsByDeptClass', 'ALL', '控制台-各科室缺陷占比（内页）-根据内外科系统统计', NULL);

INSERT INTO `sys_menu_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `remark`) VALUES (62, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 20, 89, '控制台-条目缺陷占比（内页）');
INSERT INTO `sys_menu_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `remark`) VALUES (63, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 27, 90, '控制台（科室）-条目缺陷占比-科室（内页）');
INSERT INTO `sys_menu_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `remark`) VALUES (64, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 1, 91, '控制台-各科室质控平均分（首页）-根据内外科系统统计');
INSERT INTO `sys_menu_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `remark`) VALUES (65, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 31, 92, '控制台-各科室缺陷占比（内页）-根据内外科系统统计');

INSERT INTO `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', -1, 89, '控制台-条目缺陷占比（内页）');
INSERT INTO `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', -1, 90, '控制台（科室）-条目缺陷占比-科室（内页）');
INSERT INTO `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', -1, 91, '控制台-各科室质控平均分（首页）-根据内外科系统统计');
INSERT INTO `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', -1, 92, '控制台-各科室缺陷占比（内页）-根据内外科系统统计');
