
DROP TABLE IF EXISTS `ecw_batch_order_fee_apply`;
CREATE TABLE `ecw_batch_order_fee_apply`  (
    `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
    `no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编号',
    `order_ids` varchar(512) NOT NULL COMMENT '订单ids(逗号连接)',
    `details` json NOT NULL COMMENT '申请详情',
    `reason` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '原因',
    `state` tinyint DEFAULT 1 COMMENT '状态：0 已取消 1 申请中 2 已通过 3 已驳回',
    `form_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程表单实例ID',
    `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `audit` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '审核人',
    `audit_time` datetime DEFAULT NULL COMMENT '审核时间',
    `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `no_key` (`no`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic COMMENT = '批量费用申请' ;


-- 新增费用申请记录流程类型
alter table ecw_order_fee_application
    add COLUMN  `bpm_type` tinyint DEFAULT 1 COMMENT '流程类型: 1 费用申请 2 批量订单费用申请' after `bpm_process_id`;