2026_04_08_kws_weighbridge_create.sql 1.7 KB

123456789101112131415161718192021222324
  1. CREATE TABLE `kws_weighbridge`
  2. (
  3. `id` bigint NOT NULL COMMENT '主键ID',
  4. `ent_id` bigint NOT NULL COMMENT '所属企业ID',
  5. `weighbridge_name` varchar(100) NOT NULL DEFAULT '' COMMENT '地磅名称',
  6. `unique_code` varchar(64) NOT NULL DEFAULT '' COMMENT '唯一编码',
  7. `online_status` tinyint NOT NULL DEFAULT 0 COMMENT '在线状态: 0-离线, 1-在线',
  8. `printer_id` bigint NULL COMMENT '关联打印机ID',
  9. `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述',
  10. `diff_config` text NULL COMMENT '差异化配置(JSON)',
  11. `last_restart_time` datetime NULL COMMENT '最近重启时间',
  12. `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  13. `status` tinyint NOT NULL DEFAULT 0 COMMENT '启停状态: 0-启用, 1-停用',
  14. `create_by` bigint NOT NULL DEFAULT 0 COMMENT '创建人',
  15. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  16. `update_by` bigint NOT NULL DEFAULT 0 COMMENT '更新人',
  17. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  18. `del_flag` int NOT NULL DEFAULT 0 COMMENT '删除标识: 0-正常, 1-删除',
  19. PRIMARY KEY (`id`) USING BTREE,
  20. UNIQUE KEY `uk_unique_code_del_flag` (`unique_code`, `del_flag`) USING BTREE,
  21. KEY `idx_ent_id` (`ent_id`) USING BTREE,
  22. KEY `idx_printer_id` (`printer_id`) USING BTREE,
  23. KEY `idx_create_time` (`create_time`) USING BTREE
  24. ) COMMENT ='无人地磅表';