ALTER TABLE `review_repo`.`sys_user`
    ADD COLUMN `department_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID' AFTER `name`;
ALTER TABLE `review_repo`.`sys_user`
    ADD COLUMN `type` varchar(10) NULL COMMENT '1销售2服务3专家' AFTER `user_id_card`;
ALTER TABLE `review_repo`.`sys_user`
    ADD COLUMN `corpinfo_id` varchar(32) NULL COMMENT '企业' AFTER `name`;
ALTER TABLE `review_repo`.`bus_review_report`
    ADD COLUMN `is_ignore` int NULL COMMENT '是否忽略1是' AFTER `descr`;
CREATE TABLE `oa_department` (
                                 `department_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
                                 `parent_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '父ID',
                                 `corpinfo_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '所属企业',
                                 `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '名称',
                                 `headman` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '负责人',
                                 `phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '电话',
                                 `level` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '部门级别',
                                 `createor` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
                                 `create_time` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建时间',
                                 `operator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
                                 `operat_time` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改时间',
                                 `order_by` int DEFAULT NULL COMMENT '排序',
                                 `is_delete` int DEFAULT NULL COMMENT '是否删除',
                                 PRIMARY KEY (`department_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `review_repo`.`sys_role`
    MODIFY COLUMN `type` int NULL DEFAULT NULL COMMENT '1运营角色2企业角色' AFTER `role_name`;


--11/25

CREATE TABLE `bus_file_system_report` (
                                          `file_system_report_id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
                                          `review_report_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '记录ID',
                                          `item_file_system_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件类型',
                                          `item_file_system_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '文件类型',
                                          `file_key` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '附件表关联ID',
                                          PRIMARY KEY (`file_system_report_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `bus_item_file_system` (
                                        `item_file_system_id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
                                        `review_config_item_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '评审项',
                                        `review_template_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '评审模板',
                                        `name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '文件名',
                                        `order_by` int DEFAULT NULL COMMENT '排序',
                                        `is_delete` int DEFAULT NULL COMMENT '是否删除',
                                        PRIMARY KEY (`item_file_system_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='配置项文件类型';
ALTER TABLE `review_repo`.`sys_log`
    CHANGE COLUMN `customerinfo_id` `corpinfo_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户id' AFTER `create_date`;
ALTER TABLE `review_repo`.`sys_log_2024`
    CHANGE COLUMN `customerinfo_id` `corpinfo_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户id' AFTER `create_date`;


--1210
ALTER TABLE `review_repo`.`bus_corpinfo`
    ADD COLUMN `is_hosting` int NULL DEFAULT 0 COMMENT '是否托管1是' AFTER `first_review_date`,
ADD COLUMN `first_serve_date` varbinary(10) NULL COMMENT '开始服务日期' AFTER `is_hosting`;

CREATE TABLE `bus_revisit` (
                               `revisit_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
                               `corpinfo_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '企业',
                               `cycle_start_date` varchar(10) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '周期开始时间',
                               `cycle_end_date` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '周期结束时间',
                               `status` int DEFAULT '0' COMMENT '0未回访1已回访',
                               `content` varchar(1000) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '记录',
                               `operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
                               `operat_time` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改时间',
                               `is_delete` int DEFAULT NULL COMMENT '是否删除',
                               PRIMARY KEY (`revisit_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='回访记录';

CREATE TABLE `bus_review_unreported` (
                                         `review_unreported_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
                                         `corpinfo_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '企业',
                                         `review_config_item_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '评审项',
                                         `review_template_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '评审模板',
                                         `cycle_start_date` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '周期开始时间',
                                         `cycle_end_date` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '周期结束时间',
                                         `status` int DEFAULT '0' COMMENT '0未补录1已补录',
                                         `review_report_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '补录记录id',
                                         `operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
                                         `operat_time` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改时间',
                                         `is_delete` int DEFAULT NULL COMMENT '是否删除',
                                         PRIMARY KEY (`review_unreported_id`) USING BTREE,
                                         KEY `index_undocount` (`corpinfo_id`,`review_config_item_id`,`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='超期未上报记录';
