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