1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
|
CREATE TABLE oms_order ( id BIGINT NOT NULL AUTO_INCREMENT COMMENT 'ID', member_id BIGINT COMMENT 'Member ID', order_sn CHAR(32) COMMENT 'Order number', coupon_id BIGINT COMMENT 'Coupon used', create_time DATETIME COMMENT 'Create time', member_username VARCHAR(200) COMMENT 'Username', total_amount DECIMAL(18,4) COMMENT 'Total order amount', pay_amount DECIMAL(18,4) COMMENT 'Amount payable', freight_amount DECIMAL(18,4) COMMENT 'Freight amount', promotion_amount DECIMAL(18,4) COMMENT 'Promotion optimization amount (Promotion price, full reduction, ladder price)', integration_amount DECIMAL(18,4) COMMENT 'Integration deduction amount', coupon_amount DECIMAL(18,4) COMMENT 'Coupon deduction amount', discount_amount DECIMAL(18,4) COMMENT 'Discount amount for background adjustment order', pay_type TINYINT COMMENT 'Payment method [1->Alipay; 2->WeChat; 3->UnionPay; 4->Cash on delivery;]', source_type TINYINT COMMENT 'Order source [0->PC order; 1->app order]', status TINYINT COMMENT 'Order status [0->To be paid; 1->To be delivered; 2->Delivered; 3->Completed; 4->Closed; 5->Invalid order]', delivery_company VARCHAR(64) COMMENT 'Logistics company (delivery method)', delivery_sn VARCHAR(64) COMMENT 'Logistics order number', auto_confirm_day INT COMMENT 'Automatic confirmation time (days)', integration INT COMMENT 'Points that can be obtained', growth INT COMMENT 'Growth value that can be obtained', bill_type TINYINT COMMENT 'Invoice type [0->No invoice; 1->Electronic invoice; 2->Paper invoice]', bill_header VARCHAR(255) COMMENT 'Invoice title', bill_content VARCHAR(255) COMMENT 'Invoice content', bill_receiver_phone VARCHAR(32) COMMENT 'Invoice receiver phone', bill_receiver_email VARCHAR(64) COMMENT 'Invoice receiver email', receiver_name VARCHAR(100) COMMENT 'Receiver name', receiver_phone VARCHAR(32) COMMENT 'Receiver phone', receiver_post_code VARCHAR(32) COMMENT 'Receiver zip code', receiver_province VARCHAR(32) COMMENT 'Province/direct municipality', receiver_city VARCHAR(32) COMMENT 'City', receiver_region VARCHAR(32) COMMENT 'District', receiver_detail_address VARCHAR(200) COMMENT 'Detailed address', note VARCHAR(500) COMMENT 'Order note', confirm_status TINYINT COMMENT 'Confirmation receipt status [0->Not confirmed; 1->Confirmed]', delete_status TINYINT COMMENT 'Deletion status [0->Not deleted; 1->Deleted]', use_integration INT COMMENT 'Integration used when placing an order', payment_time DATETIME COMMENT 'Payment time', delivery_time DATETIME COMMENT 'Delivery time', receive_time DATETIME COMMENT 'Confirmation receipt time', comment_time DATETIME COMMENT 'Evaluation time', modify_time DATETIME COMMENT 'Modify time', PRIMARY KEY (id) );
ALTER TABLE oms_order COMMENT 'Order';
CREATE TABLE oms_order_item ( id BIGINT NOT NULL AUTO_INCREMENT COMMENT 'ID', order_id BIGINT COMMENT 'Order ID', order_sn CHAR(32) COMMENT 'Order SN', spu_id BIGINT COMMENT 'Spu ID', spu_name VARCHAR(255) COMMENT 'Spu name', spu_pic VARCHAR(500) COMMENT 'Spu picture', spu_brand VARCHAR(200) COMMENT 'Brand', category_id BIGINT COMMENT 'Product category id', sku_id BIGINT COMMENT 'Product sku number', sku_name VARCHAR(255) COMMENT 'Product sku name', sku_pic VARCHAR(500) COMMENT 'Product sku picture', sku_price DECIMAL(18,4) COMMENT 'Product sku price', sku_quantity INT COMMENT 'Quantity of products purchased', sku_attrs_vals VARCHAR(500) COMMENT 'Product sales attribute combination (JSON)', promotion_amount DECIMAL(18,4) COMMENT 'Product promotion decomposition amount', coupon_amount DECIMAL(18,4) COMMENT 'Coupon discount decomposition amount', integration_amount DECIMAL(18,4) COMMENT 'Integration discount decomposition amount', real_amount DECIMAL(18,4) COMMENT 'Decomposition amount after the product is discounted', gift_integration INT COMMENT 'Gift points', gift_growth INT COMMENT 'Gift growth value', PRIMARY KEY (id) );
ALTER TABLE oms_order_item COMMENT 'Order item information';
CREATE TABLE oms_order_operate_history ( id BIGINT NOT NULL AUTO_INCREMENT COMMENT 'ID', order_id BIGINT COMMENT 'Order ID', operate_man VARCHAR(100) COMMENT 'Operator [User; System; Background administrator]', create_time DATETIME COMMENT 'Operation time', order_status TINYINT COMMENT 'Order status [0->To be paid; 1->To be delivered; 2->Delivered; 3->Completed; 4->Closed; 5->Invalid order]', note VARCHAR(500) COMMENT 'Remarks', PRIMARY KEY (id) );
ALTER TABLE oms_order_operate_history COMMENT 'Order operation history record';
CREATE TABLE oms_order_return_apply ( id BIGINT NOT NULL AUTO_INCREMENT COMMENT 'ID', order_id BIGINT COMMENT 'Order ID', sku_id BIGINT COMMENT 'Return product ID', order_sn CHAR(32) COMMENT 'Order number', create_time DATETIME COMMENT 'Application time', member_username VARCHAR(64) COMMENT 'Member username', return_amount DECIMAL(18,4) COMMENT 'Refund amount', return_name VARCHAR(100) COMMENT 'Returnee name', return_phone VARCHAR(20) COMMENT 'Returnee phone', status TINYINT COMMENT 'Application status [0->To be processed; 1->Returning; 2->Completed; 3->Refused]', handle_time DATETIME COMMENT 'Processing time', sku_img VARCHAR(500) COMMENT 'Product picture', sku_name VARCHAR(200) COMMENT 'Product name', sku_brand VARCHAR(200) COMMENT 'Product brand', sku_attrs_vals VARCHAR(500) COMMENT 'Product sales attribute (JSON)', sku_count INT COMMENT 'Return quantity', sku_price DECIMAL(18,4) COMMENT 'Product unit price', sku_real_price DECIMAL(18,4) COMMENT 'Product actual payment unit price', reason VARCHAR(200) COMMENT 'Reason', description VARCHAR(500) COMMENT 'Description', desc_pics VARCHAR(2000) COMMENT 'Voucher pictures, separated by commas', handle_note VARCHAR(500) COMMENT 'Processing remarks', handle_man VARCHAR(200) COMMENT 'Processing personnel', receive_man VARCHAR(100) COMMENT 'Receiver', receive_time DATETIME COMMENT 'Receiving time', receive_note VARCHAR(500) COMMENT 'Receiving remarks', receive_phone VARCHAR(20) COMMENT ' Receive phone', company_address VARCHAR(500) COMMENT 'Company receiving address', PRIMARY KEY (id) );
ALTER TABLE oms_order_return_apply COMMENT 'Order return application';
CREATE TABLE oms_order_return_reason ( id BIGINT NOT NULL AUTO_INCREMENT COMMENT 'ID', name VARCHAR(200) COMMENT 'Return reason name', sort INT COMMENT 'Sorting', status TINYINT(1) COMMENT 'Enable status', create_time DATETIME COMMENT 'Create time', PRIMARY KEY (id) );
ALTER TABLE oms_order_return_reason COMMENT 'Return reason';
CREATE TABLE oms_order_setting ( id BIGINT NOT NULL AUTO_INCREMENT COMMENT 'ID', flash_order_overtime INT COMMENT 'Seckill order timeout closing time (min)', normal_order_overtime INT COMMENT 'Normal order timeout time (min)', confirm_overtime INT COMMENT 'Automatic confirmation receipt time after delivery (days)', finish_overtime INT COMMENT 'Automatic completion of transaction time, cannot apply for return (days)', comment_overtime INT COMMENT 'Automatic evaluation time after order completion (days)', member_level TINYINT(2) COMMENT 'Member level [0-Unlimited member level, all universal; Other-Corresponding other member level]', PRIMARY KEY (id) );
ALTER TABLE oms_order_setting COMMENT 'Order configuration information';
CREATE TABLE oms_payment_info ( id BIGINT NOT NULL AUTO_INCREMENT COMMENT 'ID', order_sn CHAR(32) COMMENT 'Order number (external business number)', order_id BIGINT COMMENT 'Order ID', alipay_trade_no VARCHAR(50) COMMENT 'Alipay transaction serial number', total_amount DECIMAL(18,4) COMMENT 'Total payment amount', subject VARCHAR(200) COMMENT 'Transaction content', payment_status VARCHAR(20) COMMENT 'Payment status', create_time DATETIME COMMENT 'Create time', confirm_time DATETIME COMMENT 'Confirmation time', callback_content VARCHAR(4000) COMMENT 'Callback content', callback_time DATETIME COMMENT 'Callback time', PRIMARY KEY (id) );
ALTER TABLE oms_payment_info COMMENT 'Payment information table';
CREATE TABLE oms_refund_info ( id BIGINT NOT NULL AUTO_INCREMENT COMMENT 'ID', order_return_id BIGINT COMMENT 'Refund order', refund DECIMAL(18,4) COMMENT 'Refund amount', refund_sn VARCHAR(64) COMMENT 'Refund transaction serial number', refund_status TINYINT(1) COMMENT 'Refund status', refund_channel TINYINT COMMENT 'Refund channel [1-Alipay, 2-WeChat, 3-UnionPay, 4-Remittance]', refund_content VARCHAR(5000), PRIMARY KEY (id) );
ALTER TABLE oms_refund_info COMMENT 'Refund information';
|