/*
 Navicat Premium Data Transfer

 Source Server         : 0测试数据库_47.113.226.116
 Source Server Type    : MySQL
 Source Server Version : 50716
 Source Host           : 47.113.226.116:3306
 Source Schema         : idea_settle_down

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

 Date: 15/11/2024 13:19:02
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for flow_main
-- ----------------------------
DROP TABLE IF EXISTS `flow_main`;
CREATE TABLE `flow_main`  (
  `id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
  `apply_theme` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '申请主题',
  `form_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应表单id',
  `apply_user` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '申请人id',
  `dept_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应部门(sys_dept表)id',
  `flow_status` int(4) NULL DEFAULT NULL COMMENT '申请状态(1审批中,2,退回发起人,3,已结束,4已撤回)',
  `cc_list` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抄送人列表格式例如:,张三,李四,也发现用不到,已经存在cc表中了',
  `flow_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程名称',
  `flow_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程类型/名称(off_work请假申请;paymen付款申请;use_money费用报支(因为比较繁杂,用英文字符串表示))',
  `flow_post` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前流程邮递操作人(frame_user)id(有时候存在代理人,但是使用的是审核人的身份) 去除岗位的设定',
  `flow_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程id(processInstanceId)',
  `task_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程任务id',
  `return_status` int(4) NULL DEFAULT NULL COMMENT '0/null无状态,1已撤回并且已重新发起',
  `last_main_log_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '最后一次操作的表(flow_main_log)id',
  `condition_map` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '业务流程判断条件,json格式例如{},发现很业务的东西,所以暂时不用',
  `status` int(4) NULL DEFAULT NULL COMMENT '状态0正常',
  `created_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人id',
  `created_at` datetime NULL DEFAULT NULL COMMENT '创建时间/申请时间',
  `updated_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改人id',
  `updated_at` datetime NULL DEFAULT NULL COMMENT '修改时间',
  `group_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '集团ID',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `flow_result` int(4) NULL DEFAULT NULL COMMENT '审核结果0/null无状态,1审核通过结束,2审核不通过结束',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '主表_主申请审核表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for flow_main_cc
-- ----------------------------
DROP TABLE IF EXISTS `flow_main_cc`;
CREATE TABLE `flow_main_cc`  (
  `id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
  `flow_main_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应表flow_main的id',
  `cc_user` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抄送人id',
  `main_log_ids` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '选择抄送人时的记录表id(flow_main_log):例如:112122',
  `status` int(4) NULL DEFAULT NULL COMMENT '状态0正常',
  `created_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `updated_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改人id',
  `updated_at` datetime NULL DEFAULT NULL COMMENT '修改时间',
  `group_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '集团ID',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `is_read` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否阅读 2-已阅',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '抄送汇总表_流程记录_主申请审核表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for flow_main_log
-- ----------------------------
DROP TABLE IF EXISTS `flow_main_log`;
CREATE TABLE `flow_main_log`  (
  `id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
  `flow_main_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应表flow_main的id',
  `form_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应表单id',
  `audit_user` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '审批人id',
  `audit_content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '审批意见',
  `audit_result` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '审批结果(1同意或者2不同意驳回到申请人,3不同意驳回到上一个审核人,4,委托别人进行审核,null没有审核)',
  `audit_type` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '审批类型(0流程开始状态还是1流程审核状态还是2流程结束状态还是3申请人暂停状态4申请人结束状态)',
  `flow_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程类型/名称(off_work请假申请;paymen付款申请;use_money费用报支(因为比较繁杂,用英文字符串表示))',
  `flow_post` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前流程邮递操作人(frame_user)id(有时候存在代理人,但是使用的是审核人的身份) 去除岗位的设定',
  `flow_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程id(processInstanceId)',
  `task_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程任务id',
  `next_persons` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一环节操作人(审核人/委托人/退回申请人),因为感觉用不到,暂时不放进去,列表例如:,张三,李四,',
  `up_main_log_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上个节点审核时的表(flow_main_log)id',
  `cc_list` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抄送人列表格式例如:,张三,李四,',
  `node_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '节点名称',
  `status` int(4) NULL DEFAULT NULL COMMENT '状态0正常',
  `created_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间/审批时间',
  `group_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '集团ID',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `push_user_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '推送时彭总给的key值,就是推送人员本人最本质的身份',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '流程记录_主申请审核表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for flow_main_push
-- ----------------------------
DROP TABLE IF EXISTS `flow_main_push`;
CREATE TABLE `flow_main_push`  (
  `id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
  `flow_main_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应表apply_main的id',
  `form_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对应表单id',
  `push_user` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '推送人id',
  `push_user_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '推送时彭总给的key值,就是推送人员本人最本质的身份',
  `push_type` int(4) NULL DEFAULT NULL COMMENT '推送类型1单流程推送,2串联推送,3并联推送',
  `push_role` int(4) NULL DEFAULT NULL COMMENT '推送人身份:1本人审核,2被委托人(代理审核人审核权限)',
  `flow_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程类型/名称(off_work请假申请;paymen付款申请;use_money费用报支(因为比较繁杂,用英文字符串表示))',
  `flow_post` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前流程邮递操作人(frame_user)id 去除岗位的设定,可以认为是被委托人id',
  `flow_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程id(processInstanceId)',
  `task_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程任务id',
  `up_main_log_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '本节点审核时的表(flow_main_log)id',
  `status` int(4) NULL DEFAULT NULL COMMENT '状态0正常,1已完成审核进行物理删除,2他人已完成审核本审核人进行隐藏3申请人撤回申请进行隐藏',
  `created_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间/审批时间',
  `updated_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '删除人id',
  `updated_at` datetime NULL DEFAULT NULL COMMENT '删除时间',
  `group_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '集团ID',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `node_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '节点名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '流程推送待审核_主申请审核表' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
