/*
 Navicat Premium Dump SQL

 Source Server         : 123.60.88.248
 Source Server Type    : MySQL
 Source Server Version : 50744 (5.7.44)
 Source Host           : 123.60.88.248:3306
 Source Schema         : 7.23ks

 Target Server Type    : MySQL
 Target Server Version : 50744 (5.7.44)
 File Encoding         : 65001

 Date: 23/07/2024 15:14:15
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for bicycle
-- ----------------------------
DROP TABLE IF EXISTS `bicycle`;
CREATE TABLE `bicycle`  (
  `bicycle_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '序号',
  `bicycle_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '车辆编号',
  `type_id` int(11) NULL DEFAULT NULL COMMENT '车辆类型',
  `status_id` int(11) NULL DEFAULT NULL COMMENT '状态',
  `user_id` int(11) NULL DEFAULT NULL COMMENT '用户姓名',
  `bicycle_time` datetime NULL DEFAULT NULL COMMENT '开始用车时间',
  `bicycle_driving` int(11) NULL DEFAULT NULL COMMENT '用车时长(分钟)',
  `bicycle_traveldistance` int(11) NULL DEFAULT NULL COMMENT '行驶距离',
  `bicycle_price` int(11) NULL DEFAULT NULL COMMENT '费用',
  `bicycle_ridingstatus` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态',
  PRIMARY KEY (`bicycle_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of bicycle
-- ----------------------------
INSERT INTO `bicycle` VALUES (1, 'HGb4322323', 1, 1, 1, '2222-02-02 00:00:00', 1, 1, 1, '已结束');
INSERT INTO `bicycle` VALUES (2, 'SH64234232', 2, 2, 1, '2024-07-24 09:20:58', 23, 23, 40, '骑行中');
INSERT INTO `bicycle` VALUES (3, 'SH64223578', 3, 1, 1, '2024-07-24 09:20:58', 23, 12, 30, '已结束');
INSERT INTO `bicycle` VALUES (4, 'SH64287654', 4, 2, 2, '2024-07-24 09:20:58', 54, 34, 45, '已结束');
INSERT INTO `bicycle` VALUES (5, 'SH64123455', 2, 1, 2, '2024-07-24 09:20:58', 24, 12, 30, '骑行中');

-- ----------------------------
-- Table structure for status
-- ----------------------------
DROP TABLE IF EXISTS `status`;
CREATE TABLE `status`  (
  `status_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '状态唯一标识',
  `status_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态名称',
  PRIMARY KEY (`status_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of status
-- ----------------------------
INSERT INTO `status` VALUES (1, '未出租');
INSERT INTO `status` VALUES (2, '已出租');

-- ----------------------------
-- Table structure for type
-- ----------------------------
DROP TABLE IF EXISTS `type`;
CREATE TABLE `type`  (
  `type_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '类型唯一标识',
  `type_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型名称',
  PRIMARY KEY (`type_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of type
-- ----------------------------
INSERT INTO `type` VALUES (1, '入门公路车');
INSERT INTO `type` VALUES (2, '入门山地车');
INSERT INTO `type` VALUES (3, '基础公路车');
INSERT INTO `type` VALUES (4, '基础山地车');

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`  (
  `user_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户编号',
  `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户账号',
  `user_pwd` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户密码',
  `user_role` int(11) NULL DEFAULT NULL COMMENT '用户角色',
  `user_tell` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户手机号',
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, 'root', '123', 1, '15505250208');
INSERT INTO `user` VALUES (2, 'tom', '123', 2, '17582850208');

SET FOREIGN_KEY_CHECKS = 1;
