drop table if exists production_product_main;
create table production_product_main
(
    id            bigint auto_increment
        primary key,
    product_no    varchar(255) not null comment '报工单号',
    user_id       bigint       not null comment '报工用户id',
    work_order_id bigint       not null comment '工单id',
    status        int          not null comment '状态 0 待报工 1 待确认',
    create_time   datetime     null comment '录入时间',
    tenant_id          bigint         not null comment '租户id'
);

drop table if exists production_product_output;
create table production_product_output
(
    id               bigint auto_increment
        primary key,
    product_main_id  bigint         not null comment '报工单id',
    product_model_id bigint         not null comment '产品id',
    quantity         numeric(16, 4) not null comment '数量',
    create_time      datetime       null comment '录入时间',
    tenant_id          bigint         not null comment '租户id'
);

drop table if exists production_product_input;
create table production_product_input
(
    id               bigint auto_increment
        primary key,
    product_main_id  bigint         not null comment '报工单id',
    product_model_id bigint         not null comment '产品id',
    quantity         numeric(16, 4) not null comment '数量',
    create_time      datetime       null comment '录入时间',
    tenant_id          bigint         not null comment '租户id'
)
