-
Notifications
You must be signed in to change notification settings - Fork 0
/
db_film.sql
191 lines (171 loc) · 14.8 KB
/
db_film.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/*
Navicat MySQL Data Transfer
Source Server : root
Source Server Type : MySQL
Source Server Version : 5.7
Source Host : localhost:3306
Source Schema : db_film
Target Server Type : MySQL
Target Server Version : 5.7
File Encoding : 65001
Date: 12/04/2021 17:18:36
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for t_admin
-- ----------------------------
DROP TABLE IF EXISTS `t_admin`;
CREATE TABLE `t_admin` (
`admin_id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '管理员id',
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '管理员姓名',
`password` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '管理员密码',
`sex` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '管理员性别',
`phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '管理员联系电话',
`birthday` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '出生年月日',
`avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '管理员头像',
PRIMARY KEY (`admin_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_admin
-- ----------------------------
INSERT INTO `t_admin` VALUES (1, 'admin', 'admin', '男', '13279112887', '1999-2-28', '/images/admin/admin.jpg');
-- ----------------------------
-- Table structure for t_cinema
-- ----------------------------
DROP TABLE IF EXISTS `t_cinema`;
CREATE TABLE `t_cinema` (
`cinema_id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '影院id',
`cinema_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '影院名称',
`cinema_phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '影院电话',
`province` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '影院所在省份',
`city` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '影院所在市',
`county` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '影院所在区县',
`specified_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '影院详细地址',
PRIMARY KEY (`cinema_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_cinema
-- ----------------------------
INSERT INTO `t_cinema` VALUES (1, '幸福蓝海国际影城(马鞍山金鹰店)', '13279112887', '安徽', '马鞍山', '花山区', '花山区湖南西路与湖东北路交叉口金鹰天地7楼');
INSERT INTO `t_cinema` VALUES (2, '横店影城(马鞍山伟星时代广场店)', '13279112887', '安徽', '马鞍山', '雨山区', '雨山区红旗路和湖南路交叉口伟星时代广场四楼');
-- ----------------------------
-- Table structure for t_hall
-- ----------------------------
DROP TABLE IF EXISTS `t_hall`;
CREATE TABLE `t_hall` (
`hall_id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '影厅id',
`cinema_id` int(4) UNSIGNED NULL DEFAULT NULL COMMENT '影院id',
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '影厅名称',
PRIMARY KEY (`hall_id`) USING BTREE,
INDEX `t_hall_ibfk_1`(`cinema_id`) USING BTREE,
CONSTRAINT `t_hall_ibfk_1` FOREIGN KEY (`cinema_id`) REFERENCES `t_cinema` (`cinema_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_hall
-- ----------------------------
INSERT INTO `t_hall` VALUES (1, 2, '1号横影巨幕S-PLUS厅');
INSERT INTO `t_hall` VALUES (2, 2, '2号激光厅');
INSERT INTO `t_hall` VALUES (3, 1, '1号厅');
INSERT INTO `t_hall` VALUES (4, 1, '2号巨幕厅');
-- ----------------------------
-- Table structure for t_movie
-- ----------------------------
DROP TABLE IF EXISTS `t_movie`;
CREATE TABLE `t_movie` (
`movie_id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '电影id',
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '电影名称',
`poster` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '电影海报',
`director` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '导演',
`actor` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '主演',
`movie_long` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '电影片长',
`language` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '电影语言版本',
`intro` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '电影简介',
`type` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '电影类型',
`public_date` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '电影上映时间',
`wish_num` int(4) UNSIGNED NULL DEFAULT 0 COMMENT '想看人数',
`score` decimal(4, 1) NULL DEFAULT NULL COMMENT '电影综合评分',
PRIMARY KEY (`movie_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 39 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_movie
-- ----------------------------
INSERT INTO `t_movie` VALUES (1, '驯龙高手3', '/images/movie/hot1.jpg', '迪恩·德布洛斯', '刘昊然', '130分钟', '英语', '统领伯克岛的酋长嗝嗝(刘昊然 配音),与阿丝翠德(亚美莉卡·费雷拉 配音)共同打造了一个奇妙而热闹的飞龙乌托邦。一只雌性光煞飞龙的意外出现,加上一个前所未有的威胁的到来,令嗝嗝和没牙仔不得不离开自己唯一的家园,前往他们本以为只存在于神话之中的隐秘之境。在发现自己真正的命运之后,飞龙与骑士将携手殊死奋战,保护他们所珍爱的一切。', '动漫', '2021-12-3', 0, 0.0);
INSERT INTO `t_movie` VALUES (2, '我的英雄学院', '/images/movie/hot6.jpg', '长崎健司', '生濑胜久', '96分钟', '日语', '讲述在绝大多数人都有超能力的未来时代,没有天赋的异能少年,如何凭努力与坚持打破绝境,成长为最强英雄,守卫世界和平的故事。 剧场版以移动科研都市“我之岛”为舞台,描绘正反两派的殊死激战。在第一英雄被困之际,少年与英雄科同学拼死克敌,却在无意中探得隐秘真相,剧情随之反转', '科幻', '2021-10-1', 1, NULL);
INSERT INTO `t_movie` VALUES (3, '如影随心', '/images/movie/2.jpg', '霍建起', '马苏', '96分钟', '国语', '小提琴家陆松(陈晓 饰)与室内设计师文罂(杜鹃 饰)巴黎邂逅,不打不相识,彼此迷恋越陷越深。爱情之名怂恿着他们为爱再大胆一次,走出各自问题满满的情感关系。仿佛只要现任变前任,幸福就唾手可得。然而前任们也都是战士,文罂的前任郑可(华少 饰)是个理性至极的医生,陆松的前任刘娟(马苏 饰)则在情感社区开启了喋喋不休的骂战,是继续坚持对爱的信仰,还是选择放下与原谅重新开始?现代都市情感危机在北京与巴黎街头上演。越是深爱的,往往也正是痛苦的源头,爱情,像是影子,抓不住却也离不开,如影随心', '爱情', '2021-2-3', 2, NULL);
INSERT INTO `t_movie` VALUES (4, '复仇者联盟4', '/images/movie/7.jpg', '乔·罗素', '小罗伯特·唐尼', '181分钟', '英语', '改编自漫威漫画,也是漫威电影宇宙第22部影片。复仇者联盟的一众超级英雄,必须抱着牺牲一切的信念,与史上最强大反派灭霸殊死一搏,阻止其摧毁宇宙的邪恶计划。', '动作', '2021-4-8', 3, 0.0);
INSERT INTO `t_movie` VALUES (5, '撞死了一只羊', '/images/movie/8.jpg', '万玛才旦', '金巴', '87分钟', '国语', '司机金巴(金巴 饰)在路上撞死了一只羊,决意超度此羊;杀手金巴(更登彭措 饰)即将找到杀父仇人,准备报仇雪恨。阴差阳错,杀手金巴搭上了司机金巴的卡车。于是,两个叫金巴的男人的命运便神秘地联系在了一起,一段惊心动魄的旅程开始……', '剧情', '2021-3-4', 0, NULL);
INSERT INTO `t_movie` VALUES (6, '阿丽塔', '/images/movie/hot8.jpg', '罗伯特·罗德里', '罗莎·萨拉查', '123分钟', '英语', '未来26世纪,科技发展,人类与机械改造人共存,弱肉强食是钢铁城唯一的生存法则。依德(克里斯托夫·沃尔兹 饰)是钢铁城著名的改造人医生,他在垃圾场发现了一个半机械少女残躯,依德医生将其拯救后为她取名阿丽塔(罗莎·萨拉扎尔 饰)。阿丽塔虽然重获生命却失去了记忆,如一个新生儿一样对这个世界充满新鲜感。在依德医生与好友雨果(基恩·约翰逊 饰)的帮助下,她逐步适应着新生活和街头险恶。一次偶然的机会,阿丽塔发现自己竟有着惊人的战斗天赋。 一次次猎杀激发着她的觉醒,阿丽塔逐渐明白自己注定为战斗而生,为正义而战。一场揭开自己身世之谜,并打破宇宙旧秩序的史诗级冒险之旅就这样展开。', '动作', '2021-4-8', 0, NULL);
INSERT INTO `t_movie` VALUES (7, '一个母亲的复仇', '/images/movie/1563173524205.jpg', '王明', '张三', '118分钟', '国语', '一个母亲的复仇', '悬疑', '2022-5-13', 0, 0.0);
INSERT INTO `t_movie` VALUES (8, '银河补习班', '/images/movie/1563180596034.jpg', '李四', '王五', '156分钟', '英语', '银河补习班', '喜剧', '2021-5-16', 0, NULL);
-- ----------------------------
-- Table structure for t_order
-- ----------------------------
DROP TABLE IF EXISTS `t_order`;
CREATE TABLE `t_order` (
`order_id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '订单id',
`user_id` int(4) UNSIGNED NULL DEFAULT NULL COMMENT '用户id',
`schedule_id` int(4) UNSIGNED NULL DEFAULT NULL COMMENT '影院id',
`order_phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '下单手机',
`order_date` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '用户下单时间',
`ticket_num` int(1) UNSIGNED NULL DEFAULT NULL COMMENT '购买电影票数',
`ticket_total_price` decimal(10, 2) UNSIGNED NULL DEFAULT NULL COMMENT '电影票单价',
`order_seat_info` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '座位信息',
`pay_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '支付方式',
`phone_code` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '手机取票码',
PRIMARY KEY (`order_id`) USING BTREE,
INDEX `t_order_ibfk_1`(`user_id`) USING BTREE,
INDEX `t_order_ibfk_2`(`schedule_id`) USING BTREE,
CONSTRAINT `t_order_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `t_order_ibfk_2` FOREIGN KEY (`schedule_id`) REFERENCES `t_schedule` (`schedule_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 101 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_order
-- ----------------------------
INSERT INTO `t_order` VALUES (1, 1, 1, '13279112887', '2021-4-12', 1, 50.00, '[36]', '1', '992569');
-- ----------------------------
-- Table structure for t_schedule
-- ----------------------------
DROP TABLE IF EXISTS `t_schedule`;
CREATE TABLE `t_schedule` (
`schedule_id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '排片id',
`movie_id` int(4) UNSIGNED NULL DEFAULT NULL COMMENT '电影id',
`cinema_id` int(4) UNSIGNED NULL DEFAULT NULL COMMENT '影院id',
`hall_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '影厅名字',
`show_date` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '放映日期',
`show_time` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '放映时间',
`price` decimal(10, 2) NULL DEFAULT NULL COMMENT '电影售价',
`seat_info` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '座位信息',
PRIMARY KEY (`schedule_id`) USING BTREE,
INDEX `hall_id`(`hall_name`) USING BTREE,
INDEX `t_schedule_ibfk_1`(`movie_id`) USING BTREE,
INDEX `t_schedule_ibfk_2`(`cinema_id`) USING BTREE,
CONSTRAINT `t_schedule_ibfk_1` FOREIGN KEY (`movie_id`) REFERENCES `t_movie` (`movie_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `t_schedule_ibfk_2` FOREIGN KEY (`cinema_id`) REFERENCES `t_cinema` (`cinema_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 102 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_schedule
-- ----------------------------
INSERT INTO `t_schedule` VALUES (1, 4, 2, '1号横影巨幕S-PLUS厅', '2021-4-13', '8:05', 50.00, '[36]');
INSERT INTO `t_schedule` VALUES (2, 5, 2, '1号横影巨幕S-PLUS厅', '2021-4-20', '8:05', 100.00, NULL);
INSERT INTO `t_schedule` VALUES (3, 1, 1, '1号厅', '2021-12-3', '8:05', 60.00, NULL);
-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
`user_id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户id',
`user_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '用户名',
`avatar` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '用户头像',
`password` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '用户密码',
`phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '用户手机号码',
`sex` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '用户性别',
`birthday` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '用户出生年月日',
`sign` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '用户签名',
PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 55 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_user
-- ----------------------------
INSERT INTO `t_user` VALUES (1, '17891609310', '/images/avatar/1618210662674.jpg', '123456', '17891609310', '男', '1999-2-28', '安工大电影');
SET FOREIGN_KEY_CHECKS = 1;