
create table kwf_driver_conduct_rules
(
    id                               bigint         NOT NULL AUTO_INCREMENT COMMENT '主键',
    ent_id                           bigint         NOT NULL DEFAULT '-1'comment '企业id',
    unload_serious_timeout           int            NOT NULL DEFAULT '-1'comment '单趟严重超时（违规次数/扣分）',
    unload_serious_timeout_multiple  decimal(8,2)   NOT NULL DEFAULT '00.00' comment '单趟严重超时倍数',
    document_error_missing           int            NOT NULL DEFAULT '-1'comment '单据错误/缺失（违规次数/扣分）',
    not_on_time_arrive               int            NOT NULL DEFAULT '-1'comment '未按时到场（违规次数/扣分）',
    fake_unload                      int            NOT NULL DEFAULT '-1'comment '虚假卸货（违规次数/扣分）',
    fake_unload_distance             int            NOT NULL DEFAULT '-1'comment '虚假卸货偏差距离',
    illegal_cancel_order             int            NOT NULL DEFAULT '-1'comment '违规取消运单（违规次数/扣分）',
    illegal_cancel_order_minutes     int            NOT NULL DEFAULT '-1'comment '违规取消运单分钟数',
    continuous_on_time_arrive        int            NOT NULL DEFAULT '-1'comment '连续按时到场（达标次数/加分）',
    continuous_on_time_arrive_times  int            NOT NULL DEFAULT '-1'comment '连续按时到场次数',
    continuous_on_time_unload        int            NOT NULL DEFAULT '-1'comment '连续准时卸货（达标次数/加分）',
    continuous_on_time_unload_times  int            NOT NULL DEFAULT '-1'comment '连续准时卸货次数',
    continuous_accurate_unload       int            NOT NULL DEFAULT '-1'comment '连续准确填写卸货信息（达标次数/加分）',
    continuous_accurate_unload_times int            NOT NULL DEFAULT '-1'comment '连续准确填写卸货信息次数',
    create_time                     datetime        NOT NULL default CURRENT_TIMESTAMP comment '创建时间',
    update_time                     datetime        NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP comment '更新时间',
    create_user                     bigint          NOT NULL DEFAULT '-1' comment '创建人',
    update_user                     bigint          NOT NULL DEFAULT '-1' comment '更新人',
    PRIMARY KEY (`id`) USING BTREE
) comment '司机行为规则表';



create table kwf_driver_conduct_rules_log
(
    id                              bigint          NOT NULL AUTO_INCREMENT COMMENT '主键',
    dcr_id                          bigint          NOT NULL DEFAULT '-1' comment '司机行为规则id',
    description                     varchar(255)    CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci   DEFAULT NULL COMMENT '日志内容',
    del_flag                        int             NOT NULL DEFAULT '0' COMMENT '是否删除（0未删除，1删除）',
    create_time                     datetime        NOT NULL default CURRENT_TIMESTAMP comment '创建时间',
    update_time                     datetime        NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP comment '更新时间',
    create_user                     bigint          NOT NULL DEFAULT '-1' comment '创建人',
    update_user                     bigint          NOT NULL DEFAULT '-1' comment '更新人',
    PRIMARY KEY (`id`) USING BTREE
) comment '司机行为规则日志表';


create table kwt_truck_dispatch_coefficient
(
    id                              bigint          NOT NULL AUTO_INCREMENT COMMENT '主键',
    ent_id                          bigint          NOT NULL DEFAULT '-1' comment '企业id',
    vehicle_work_hours              int             NOT NULL DEFAULT '-1' comment  '车辆工作时长',
    vehicle_loading_hours           int             NOT NULL DEFAULT '-1' comment  '车辆装货时长',
    vehicle_unloading_hours         int             NOT NULL DEFAULT '-1' comment '车辆卸货时长',
    driver_timeout_limit            int             NOT NULL DEFAULT '-1' comment '司机超时限制',
    vehicle_avg_load                int             NOT NULL DEFAULT '-1' comment '车辆平均载重',
    vehicle_avg_speed               int             NOT NULL DEFAULT '-1' comment '车辆平均速度',
    vehicle_max_tasks               int             NOT NULL DEFAULT '-1' comment '车辆最大任务数',
    driver_order_limit              int             NOT NULL DEFAULT '-1' comment '司机接单限制',
    yard_vehicle_capacity           int             NOT NULL DEFAULT '-1' comment '场内车辆容量',
    max_ratio                       int             NOT NULL DEFAULT '-1' comment '最大占比',
    buffer_coefficient              decimal(8,2)    NOT NULL DEFAULT '00.00' comment '缓冲系数',
    create_time                     datetime        NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间',
    update_time                     datetime        NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP comment '更新时间',
    create_user                     bigint          NOT NULL DEFAULT '-1' comment '创建人',
    update_user                     bigint          NOT NULL DEFAULT '-1' comment '更新人',
    PRIMARY KEY (`id`) USING BTREE
) comment '自动派单系数表';


