Files
cattleTransportation/tradeCattle/create_order_table.sql
2025-10-27 17:38:20 +08:00

21 lines
1.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 创建订单管理表
-- 用于管理订单信息,包括买方、卖方、结算方式等
CREATE TABLE IF NOT EXISTS `order` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`buyer_id` varchar(500) DEFAULT NULL COMMENT '买方ID多个买家用逗号分隔',
`seller_id` varchar(500) DEFAULT NULL COMMENT '卖方ID多个卖家用逗号分隔',
`settlement_type` int(11) NOT NULL COMMENT '结算方式1-上车重量2-下车重量3-按肉价结算',
`is_delete` tinyint(1) DEFAULT 0 COMMENT '逻辑删除标记(0-正常,1-已删除)',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`created_by` int(11) DEFAULT NULL COMMENT '创建人ID',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`updated_by` int(11) DEFAULT NULL COMMENT '更新人ID',
PRIMARY KEY (`id`),
KEY `idx_is_delete` (`is_delete`),
KEY `idx_created_by` (`created_by`),
KEY `idx_create_time` (`create_time`),
KEY `idx_settlement_type` (`settlement_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单管理表';