CREATE TABLE `kwc_contract_logistics_score` (
    `id` bigint NOT NULL COMMENT '主键',
    `provider_ent_id` bigint NOT NULL COMMENT '供应商企业id',
    `logistics_ent_id` bigint NOT NULL COMMENT '物流企业id',
    `score` decimal(10,2) NOT NULL COMMENT '物流企业评分',
    `create_by` bigint NOT NULL DEFAULT '-1',
    `create_time` datetime NOT NULL,
    `update_by` bigint NOT NULL DEFAULT '-1',
    `update_time` datetime NOT NULL COMMENT '更新时间',
    `del_flag` int NOT NULL DEFAULT '0' COMMENT '是否删除(0未删除，1删除)',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `provider_logistics_id_index` (`provider_ent_id`,`logistics_ent_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='物流企业评分表';


CREATE TABLE `kwc_contract_logistics_score_detail` (
   `id` bigint NOT NULL COMMENT '主键',
   `score_id` bigint NOT NULL COMMENT '评分主键id',
   `influence_by` bigint NOT NULL COMMENT '影响人id',
   `action` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '行为',
   `score_change` decimal(10,2) DEFAULT NULL COMMENT '评分变动',
   `score` decimal(10,2) DEFAULT NULL COMMENT '变动后评分',
   `status` int NOT NULL DEFAULT '1' COMMENT '审核状态0-待审核，1-审核通过',
   `create_by` bigint NOT NULL DEFAULT '-1',
   `create_time` datetime NOT NULL,
   `update_by` bigint NOT NULL DEFAULT '-1',
   `update_time` datetime NOT NULL,
   `del_flag` int NOT NULL DEFAULT '0' COMMENT '是否删除(0未删除，1删除)',
   PRIMARY KEY (`id`) USING BTREE,
   KEY `score_id_index` (`score_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='物流企业评分明细表';


CREATE TABLE `kwf_driver_score` (
    `id` bigint NOT NULL COMMENT '主键',
    `provider_ent_id` bigint NOT NULL COMMENT '供应商企业id',
    `logistics_ent_id` bigint NOT NULL COMMENT '物流企业id',
    `driver_id` bigint NOT NULL COMMENT '司机id',
    `score` decimal(10,2) NOT NULL DEFAULT '60.00' COMMENT '司机评分',
    `create_by` bigint NOT NULL DEFAULT '-1',
    `create_time` datetime NOT NULL,
    `update_by` bigint NOT NULL DEFAULT '-1',
    `update_time` datetime NOT NULL COMMENT '更新时间',
    `del_flag` int NOT NULL DEFAULT '0' COMMENT '是否删除(0未删除，1删除)',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `provider_logistics_driver_id_index` (`provider_ent_id`,`logistics_ent_id`,`driver_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='司机评分表';


CREATE TABLE `kwf_driver_score_detail` (
   `id` bigint NOT NULL COMMENT '主键',
   `score_id` bigint NOT NULL COMMENT '评分主键id',
   `driver_id` bigint NOT NULL COMMENT '司机id',
   `action` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '行为',
   `score_change` decimal(10,2) DEFAULT NULL COMMENT '评分变动',
   `score` decimal(10,2) DEFAULT NULL COMMENT '变动后评分',
   `create_by` bigint NOT NULL DEFAULT '-1',
   `create_time` datetime NOT NULL,
   `update_by` bigint NOT NULL DEFAULT '-1',
   `update_time` datetime NOT NULL,
   `del_flag` int NOT NULL DEFAULT '0' COMMENT '是否删除(0未删除，1删除)',
   PRIMARY KEY (`id`) USING BTREE,
   KEY `driver_score_id_index` (`score_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='司机评分明细表';