-- ----------------------------
-- 订单师傅推荐关联表
-- ----------------------------
CREATE TABLE `kx_order_rider_recommend` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `order_no` varchar(50) NOT NULL COMMENT '订单编号',
  `rider_id` bigint(20) NOT NULL COMMENT '推荐的师傅ID',
  `rider_name` varchar(50) DEFAULT NULL COMMENT '师傅姓名',
  `match_score` decimal(5,2) DEFAULT NULL COMMENT '匹配度分数',
  `recommend_order` int(11) DEFAULT NULL COMMENT '推荐排序(1表示最优推荐)',
  `status` int(11) DEFAULT '0' COMMENT '推荐状态(0-待处理, 1-已分配, 2-师傅拒绝, 3-超时)',
  `recommend_time` datetime DEFAULT NULL COMMENT '推荐时间',
  `process_time` datetime DEFAULT NULL COMMENT '处理时间',
  `remark` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_order_no` (`order_no`) USING BTREE,
  KEY `idx_rider_id` (`rider_id`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE,
  KEY `idx_recommend_order` (`recommend_order`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='订单师傅推荐关联表';
