/*
 Navicat MySQL Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50717
 Source Host           : localhost:3306
 Source Schema         : lyr-one

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

 Date: 13/10/2023 09:51:58
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for ea_electronic_attachment
-- ----------------------------
DROP TABLE IF EXISTS `ea_electronic_attachment`;
CREATE TABLE `ea_electronic_attachment` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `business_id` bigint(20) NOT NULL COMMENT '业务id',
  `business_type` varchar(30) NOT NULL COMMENT '业务类型',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updater` varchar(64) DEFAULT NULL COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `create_by` varchar(20) DEFAULT NULL COMMENT '制单人',
  `creator` varchar(20) DEFAULT NULL COMMENT '创建者',
  `company_id` bigint(20) DEFAULT NULL COMMENT '业务实体id',
  `company` varchar(30) DEFAULT NULL COMMENT '业务实体',
  `del_status` varchar(2) DEFAULT '0' COMMENT '删除状态',
  `suffix` varchar(10) DEFAULT NULL COMMENT '文件后缀',
  `file_url` varchar(255) DEFAULT NULL COMMENT '文件地址',
  `file_ap` varchar(255) DEFAULT NULL COMMENT '绝对路径',
  `flow_code` varchar(40) DEFAULT NULL COMMENT '流程号',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除',
  `note` varchar(255) DEFAULT NULL COMMENT '摘要',
  `dept_id` bigint(20) DEFAULT NULL COMMENT '所属部门id',
  `dept_name` varchar(30) DEFAULT NULL COMMENT '所属部门',
  `tenant_id` bigint(20) NOT NULL COMMENT '租户编号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='电子档案附件表';



-- 菜单 SQL
INSERT INTO system_menu(
    name, permission, type, sort, parent_id,
    path, icon, component, status, component_name
)
VALUES (
    '电子档案附件管理', '', 2, 0, 2379,
    'electronic-attachment', '', 'ea/electronicAttachment/index', 0, 'ElectronicAttachment'
);

-- 按钮父菜单ID
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话，需要手动修改 @parentId 的部分的代码
SELECT @parentId := LAST_INSERT_ID();

-- 按钮 SQL
INSERT INTO system_menu(
    name, permission, type, sort, parent_id,
    path, icon, component, status
)
VALUES (
    '电子档案附件查询', 'ea:electronic-attachment:query', 3, 1, @parentId,
    '', '', '', 0
);
INSERT INTO system_menu(
    name, permission, type, sort, parent_id,
    path, icon, component, status
)
VALUES (
    '电子档案附件创建', 'ea:electronic-attachment:create', 3, 2, @parentId,
    '', '', '', 0
);
INSERT INTO system_menu(
    name, permission, type, sort, parent_id,
    path, icon, component, status
)
VALUES (
    '电子档案附件更新', 'ea:electronic-attachment:update', 3, 3, @parentId,
    '', '', '', 0
);
INSERT INTO system_menu(
    name, permission, type, sort, parent_id,
    path, icon, component, status
)
VALUES (
    '电子档案附件删除', 'ea:electronic-attachment:delete', 3, 4, @parentId,
    '', '', '', 0
);
INSERT INTO system_menu(
    name, permission, type, sort, parent_id,
    path, icon, component, status
)
VALUES (
    '电子档案附件导出', 'ea:electronic-attachment:export', 3, 5, @parentId,
    '', '', '', 0
);

