CREATE TABLE IF NOT EXISTS `man_order_print_template` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID', `tenant_id` bigint NOT NULL COMMENT '租户ID', `type` varchar(20) NOT NULL COMMENT '模板类型 in入库 out出库', `name` varchar(100) NOT NULL COMMENT '模板名称', `code` varchar(100) NOT NULL COMMENT '模板编码', `is_default` tinyint NOT NULL DEFAULT 0 COMMENT '是否默认模板 1是 0否', `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态 1正常 0冻结', `canvas_json` longtext NOT NULL COMMENT '模板配置JSON', `deleted` tinyint NOT NULL DEFAULT 0 COMMENT '是否删除 1是 0否', `create_by` bigint DEFAULT NULL COMMENT '创建人', `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_by` bigint DEFAULT NULL COMMENT '更新人', `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `memo` varchar(500) DEFAULT NULL COMMENT '备注', PRIMARY KEY (`id`), UNIQUE KEY `uk_order_print_template_tenant_type_code_deleted` (`tenant_id`, `type`, `code`, `deleted`), KEY `idx_order_print_template_tenant_type_default` (`tenant_id`, `type`, `is_default`), KEY `idx_order_print_template_tenant_type_status` (`tenant_id`, `type`, `status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单打印模板';