-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathhotelManage.sql
More file actions
154 lines (139 loc) · 4.95 KB
/
hotelManage.sql
File metadata and controls
154 lines (139 loc) · 4.95 KB
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
/*
Navicat Premium Data Transfer
Source Server : local
Source Server Type : MySQL
Source Server Version : 50727
Source Host : localhost:3306
Source Schema : jdgl
Target Server Type : MySQL
Target Server Version : 50727
File Encoding : 65001
Date: 03/09/2019 21:31:09
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for clean_distory
-- ----------------------------
DROP TABLE IF EXISTS `clean_distory`;
CREATE TABLE `clean_distory` (
`worker_id` int(8) NOT NULL,
`room_num` int(3) DEFAULT NULL,
`clean_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`clean_time`) USING BTREE,
KEY `clean` (`worker_id`) USING BTREE,
CONSTRAINT `clean` FOREIGN KEY (`worker_id`) REFERENCES `clean_worker` (`worker_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='clean worker_id jdgl clean_worker work_id NO ACTION NO ACTION\r\n';
-- ----------------------------
-- Table structure for clean_worker
-- ----------------------------
DROP TABLE IF EXISTS `clean_worker`;
CREATE TABLE `clean_worker` (
`worker_id` int(4) NOT NULL AUTO_INCREMENT,
`worker_name` varchar(255) DEFAULT NULL,
`clean_num` varchar(255) DEFAULT NULL,
PRIMARY KEY (`worker_id`) USING BTREE,
KEY `work_id` (`worker_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1004 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for custom
-- ----------------------------
DROP TABLE IF EXISTS `custom`;
CREATE TABLE `custom` (
`id` char(18) NOT NULL,
`costMoney` int(5) DEFAULT '0',
`costType` varchar(255) DEFAULT NULL,
`phone` varchar(15) DEFAULT NULL,
`sex` tinyint(2) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for dictionary
-- ----------------------------
DROP TABLE IF EXISTS `dictionary`;
CREATE TABLE `dictionary` (
`dic_name` varchar(255) DEFAULT NULL,
`key` tinyint(1) DEFAULT NULL,
`value` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for jdorder
-- ----------------------------
DROP TABLE IF EXISTS `jdorder`;
CREATE TABLE `jdorder` (
`order_id` int(8) NOT NULL AUTO_INCREMENT,
`customer_id` char(18) DEFAULT NULL,
`room` int(3) DEFAULT NULL,
`money` int(8) DEFAULT NULL,
`order_data` datetime DEFAULT NULL,
`costThing` varchar(255) DEFAULT NULL,
`do_person` varchar(255) DEFAULT NULL,
PRIMARY KEY (`order_id`) USING BTREE,
KEY `0` (`customer_id`) USING BTREE,
KEY `2` (`room`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for room
-- ----------------------------
DROP TABLE IF EXISTS `room`;
CREATE TABLE `room` (
`room_num` int(3) NOT NULL,
`room_stat` tinyint(1) NOT NULL DEFAULT '0',
`room_price` int(4) DEFAULT '110',
`custom` char(18) DEFAULT NULL,
`movein_date` datetime DEFAULT NULL,
`moveout_date` datetime DEFAULT NULL,
PRIMARY KEY (`room_num`) USING BTREE,
KEY `r` (`room_stat`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for salary_distory
-- ----------------------------
DROP TABLE IF EXISTS `salary_distory`;
CREATE TABLE `salary_distory` (
`salary` int(5) NOT NULL,
`worker_id` int(4) NOT NULL,
`do_date` datetime DEFAULT NULL,
KEY `worker` (`worker_id`) USING BTREE,
CONSTRAINT `worker` FOREIGN KEY (`worker_id`) REFERENCES `clean_worker` (`worker_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for vip
-- ----------------------------
DROP TABLE IF EXISTS `vip`;
CREATE TABLE `vip` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`vip_type` tinyint(1) DEFAULT '0',
`integral` int(8) DEFAULT '0',
`idCard` char(18) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`phone` varchar(15) DEFAULT NULL,
`sex` tinyint(2) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
KEY `v` (`vip_type`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=20551021 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for worker
-- ----------------------------
DROP TABLE IF EXISTS `worker`;
CREATE TABLE `worker` (
`worker_id` int(5) NOT NULL,
`worker_type` tinyint(1) NOT NULL DEFAULT '0',
`passwd` varchar(255) NOT NULL,
`worker_sex` tinyint(1) NOT NULL,
`worker_name` varchar(255) DEFAULT NULL,
`cleanRoom` int(3) DEFAULT NULL,
PRIMARY KEY (`worker_id`,`worker_type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Procedure structure for p_test
-- ----------------------------
DROP PROCEDURE IF EXISTS `p_test`;
delimiter ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p_test`()
BEGIN
update room set room_stat = 0;
END;
;;
delimiter ;
SET FOREIGN_KEY_CHECKS = 1;