| 字段 | 类型 | 键 | 可空 | 默认 | 注释 |
|---|---|---|---|---|---|
| id | char(36) | PRI | NO | ||
| shift_no | varchar(64) | UNI | YES | 班次号 | |
| store_id | char(36) | MUL | YES | ||
| merchant_id | char(36) | YES | |||
| cashier_id | char(36) | MUL | YES | ||
| cashier_name | varchar(64) | YES | |||
| start_at | datetime(3) | YES | |||
| end_at | datetime(3) | YES | |||
| opening_cash | decimal(12,2) | YES | 0.00 | 备用金 | |
| closing_cash | decimal(12,2) | YES | 交班现金 | ||
| cash_sales | decimal(12,2) | YES | 0.00 | 现金销售 | |
| wechat_sales | decimal(12,2) | YES | 0.00 | ||
| alipay_sales | decimal(12,2) | YES | 0.00 | ||
| member_sales | decimal(12,2) | YES | 0.00 | 储值扣款 | |
| refund_amount | decimal(12,2) | YES | 0.00 | ||
| order_count | int(11) | YES | 0 | ||
| diff_amount | decimal(12,2) | YES | 长短款 | ||
| status | tinyint(4) | YES | 0 | 0进行中 1已交班 | |
| remark | longtext | YES | |||
| is_deleted | tinyint(1) | YES | 0 | ||
| created_at | datetime(3) | YES | |||
| updated_at | datetime(3) | YES |
| 索引名 | 字段 | 类型 |
|---|---|---|
| idx_shift_cashier | cashier_id,start_at | 普通 |
| idx_shift_store | store_id,start_at | 普通 |
| PRIMARY | id | 唯一 |
| uk_shift_no | shift_no | 普通 |
| id | shift_no | store_id | merchant_id | cashier_id | cashier_name | start_at | end_at | opening_cash | closing_cash | cash_sales | wechat_sales |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 666c92be-5b13-4b05-a99a-76457bd1462d | BC20261107093147144 | 694d9cbf-1e76-4a15-9430-e443489c71b4 | 59a626f8-7ce1-4fd5-a638-a3563f765429 | admin | NULL | 2026-11-07 09:31:47.701000 | 2026-11-07 09:45:53.052000 | 100.00 | 112.00 | 0.00 | 0.00 |
| 73e8756e-1e6f-468f-bfe3-6b7537c23248 | BC20261107092120991 | 4ad3efb6-6913-4a67-af89-5304861bf08e | de000063-1000-4000-8000-000000000003 | storemgr01 | 周店长 | 2026-11-07 09:21:20.348000 | 2026-11-07 09:21:20.351000 | 500.00 | 512.50 | 0.00 | 0.00 |
| d2418eab-968a-4660-aae9-cd8438f1f4f0 | BC20261107092213345 | 4ad3efb6-6913-4a67-af89-5304861bf08e | de000063-1000-4000-8000-000000000003 | storemgr01 | 周店长 | 2026-11-07 09:22:13.846000 | 2026-11-07 09:22:13.849000 | 500.00 | 512.50 | 0.00 | 0.00 |