数据库设计:
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
– Table structure for admin
DROP TABLE IF EXISTS admin
;
CREATE TABLE admin
(
id
int(10) NOT NULL COMMENT ‘管理员’,
username
varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ‘用户名’,
password
varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ‘密码’,
phone
varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ‘手机’,
sex
int(10) NULL DEFAULT NULL COMMENT ‘性别’,
email
varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ‘邮箱’,
PRIMARY KEY (id
) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
– Table structure for building
DROP TABLE IF EXISTS building
;
CREATE TABLE building
(
id
int(10) NOT NULL AUTO_INCREMENT,
name
varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
type
int(10) NULL DEFAULT NULL COMMENT ‘0:电梯;1:楼梯’,
PRIMARY KEY (id
) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
– Records of building
INSERT INTO building
VALUES (1, ‘A’, 0);
INSERT INTO building
VALUES (2, ‘B’, 0);
INSERT INTO building
VALUES (3, ‘C’, 1);
INSERT INTO building
VALUES (4, ‘D’, 1);
– Table structure for car
DROP TABLE IF EXISTS car
;
CREATE TABLE car
(
id
int(10) NOT NULL AUTO_INCREMENT,
name
varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ‘停车位名称’,
type
int(10) NULL DEFAULT NULL COMMENT ‘地面或者地下’,
status
int(10) NULL DEFAULT NULL COMMENT ‘是否为空’,
PRIMARY KEY (id
) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 61 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
– Records of car
INSERT INTO car
VALUES (1, ‘车位1’, 0, 1);
INSERT INTO car
VALUES (2, ‘车位2’, 0, 0);
INSERT INTO car
VALUES (3, ‘车位3’, 0, 1);
INSERT INTO car
VALUES (4, ‘车位4’, 0, 0);
INSERT INTO car
VALUES (5, ‘车位5’, 0, 0);
INSERT INTO car
VALUES (6, ‘车位6’, 0, 0);
INSERT INTO car
VALUES (7, ‘车位7’, 0, 0);
INSERT INTO car
VALUES (8, ‘车位8’, 0, 0);
INSERT INTO car
VALUES (9, ‘车位9’, 0, 0);
INSERT INTO car
VALUES (10, ‘车位10’, 0, 0);
INSERT INTO car
VALUES (11, ‘车位11’, 0, 0);
INSERT INTO car
VALUES (12, ‘车位12’, 0, 0);
INSERT INTO car
VALUES (13, ‘车位13’, 0, 0);
INSERT INTO car
VALUES (14, ‘车位14’, 0, 0);
INSERT INTO car
VALUES (15, ‘车位15’, 0, 0);
INSERT INTO car
VALUES (16, ‘车位16’, 0, 0);
INSERT INTO car
VALUES (17, ‘车位17’, 0, 0);
INSERT INTO car
VALUES (18, ‘车位18’, 0, 0);
INSERT INTO car
VALUES (19, ‘车位19’, 0, 0);
INSERT INTO car
VALUES (20, ‘车位20’, 1, 1);
INSERT INTO car
VALUES (21, ‘车位21’, 1, 0);
INSERT INTO car
VALUES (22, ‘车位22’, 1, 0);
INSERT INTO car
VALUES (23, ‘车位23’, 1, 0);
INSERT INTO car
VALUES (24, ‘车位24’, 1, 0);
INSERT INTO car
VALUES (25, ‘车位25’, 1, 0);
INSERT INTO car
VALUES (26, ‘车位26’, 1, 0);
INSERT INTO car
VALUES (27, ‘车位27’, 1, 0);
INSERT INTO car
VALUES (28, ‘车位28’, 1, 0);
INSERT INTO car
VALUES (29, ‘车位29’, 1, 0);
INSERT INTO car
VALUES (30, ‘车位30’, 1, 0);
INSERT INTO car
VALUES (31, ‘车位31’, 1, 0);
INSERT INTO car
VALUES (32, ‘车位32’, 1, 0);