--
-- Host: hanyu-db.mysql.database.azure.com    Database: nsysu_booking
-- ------------------------------------------------------


--
-- Table structure for table `log_use`
--

CREATE TABLE `log_use` (
  `rid` int NOT NULL AUTO_INCREMENT,
  `codeNo` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '程式代碼',
  `remark` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '備註',
  `user_ip` varchar(250) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '連線ip',
  `user_id` int DEFAULT NULL COMMENT '使用者ID',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '建檔日期',
  PRIMARY KEY (`rid`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='使用記錄表';

--
-- Dumping data for table `log_use`
--

INSERT INTO `log_use` VALUES (1,'login','','127.0.0.1',1,'2025-03-14 14:46:40'),(2,'login','','125.229.116.28',1,'2025-03-14 15:49:09'),(3,'login','','140.117.104.150',2,'2025-03-21 11:54:01'),(4,'login','','125.229.116.28',2,'2025-03-24 10:34:55'),(5,'login','','::1',2,'2025-03-24 11:36:36'),(6,'login','','140.117.104.150',2,'2025-03-24 13:48:31'),(7,'login','','140.117.104.150',3,'2025-03-24 13:53:05'),(8,'login','','140.117.104.150',3,'2025-03-24 14:22:49'),(9,'login','','125.229.116.28',1,'2025-03-24 14:38:52'),(10,'login','','125.229.116.28:51207',1,'2025-03-24 16:03:39'),(11,'login','','211.22.250.218:38740',2,'2025-04-01 15:11:55'),(12,'login','','125.229.116.28',1,'2025-04-07 14:13:56');

--
-- Table structure for table `meeting_rooms`
--

CREATE TABLE `meeting_rooms` (
  `room_id` int NOT NULL AUTO_INCREMENT COMMENT '會議室ID',
  `room_name` varchar(100) NOT NULL COMMENT '會議室名稱',
  `capacity` int NOT NULL COMMENT '容納人數',
  `location` varchar(50) DEFAULT NULL COMMENT '位置描述',
  `facilities` varchar(255) DEFAULT NULL COMMENT '設備描述',
  `status` enum('available','maintenance','disabled') NOT NULL DEFAULT 'available' COMMENT '會議室狀態',
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '建檔日期',
  `updated_by` varchar(100) DEFAULT NULL COMMENT '更新人員',
  PRIMARY KEY (`room_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='會議室基本資料';

--
-- Dumping data for table `meeting_rooms`
--

INSERT INTO `meeting_rooms` VALUES (1,'國4006-2',30,'國際研究大樓4樓','（視聽教室）單槍投影機、白板、電腦','available','2025-03-13 10:24:03','2025-03-07 09:33:39','admin'),(2,'國4006-1',12,'國際研究大樓4樓','（會議室）單槍投影機、白板、電腦','available','2025-03-13 10:23:51','2025-03-07 09:33:39','admin'),(3,'國5013',12,'國際研究大樓5樓','（一般教室）單槍投影機、白板','available','2025-03-13 10:25:17','2025-03-07 09:33:39','admin'),(4,'國5014',12,'國際研究大樓5樓','（一般教室）單槍投影機、白板','available','2025-03-13 10:25:28','2025-03-07 09:33:39','admin'),(5,'國5015',12,'國際研究大樓5樓','（一般教室）單槍投影機、白板','available','2025-03-13 10:25:35','2025-03-07 09:33:39','admin'),(6,'國5016',12,'國際研究大樓5樓','（一般教室）單槍投影機、白板','available','2025-03-13 10:25:45','2025-03-12 17:43:01','admin'),(7,'國5017-1',12,'國際研究大樓5樓','（一般教室）單槍投影機、白板','available','2025-03-13 10:25:54','2025-03-12 17:43:41','admin'),(8,'國5017-2',12,'國際研究大樓5樓','（複合式教學教室）單槍投影機、白板','available','2025-03-13 10:24:18','2025-03-12 17:44:09','admin'),(9,'國5018',12,'國際研究大樓5樓','（一般教室）單槍投影機、白板','available','2025-03-13 10:26:05','2025-03-12 17:44:49','admin'),(10,'國5019',12,'國際研究大樓5樓','（複合式教學教室）單槍投影機、白板','available','2025-03-13 10:24:35','2025-03-12 17:45:11','admin'),(11,'國5020',12,'國際研究大樓5樓','（一般教室）單槍投影機、白板','available','2025-03-13 10:26:17','2025-03-12 17:45:32','admin'),(12,'國5021',12,'國際研究大樓5樓','（一般教室）單槍投影機、白板','available','2025-03-13 10:26:26','2025-03-12 17:45:51','admin'),(13,'國5022',12,'國際研究大樓5樓','（複合式教學教室）單槍投影機、白板','available','2025-03-13 10:24:49','2025-03-12 17:46:16','admin'),(14,'國5023',12,'國際研究大樓5樓','（一般教室）單槍投影機、白板','available','2025-03-13 10:26:35','2025-03-12 17:46:41','admin');

--
-- Table structure for table `reservations`
--

CREATE TABLE `reservations` (
  `reservation_id` int NOT NULL AUTO_INCREMENT COMMENT '預約ID',
  `room_id` int NOT NULL COMMENT '會議室ID',
  `user_id` int NOT NULL COMMENT '預約人ID',
  `room_no` varchar(100) DEFAULT NULL COMMENT '教室代號',
  `title` varchar(100) NOT NULL COMMENT '會議標題',
  `description` varchar(500) DEFAULT NULL COMMENT '會議說明',
  `start_time` datetime NOT NULL COMMENT '開始時間',
  `end_time` datetime NOT NULL COMMENT '結束時間',
  `is_recurring` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否為周期性會議',
  `recurrence_type` varchar(30) DEFAULT NULL COMMENT '周期類型ENUM(''daily'', ''weekly'', ''monthly'', ''custom'')',
  `recurrence_pattern` varchar(100) DEFAULT NULL COMMENT '周期模式(例如: 每週一三五/每月1號/每月第一個星期一)',
  `recurrence_end_date` date DEFAULT NULL COMMENT '週期結束日期',
  `slot_name` varchar(100) DEFAULT NULL COMMENT '時段名稱',
  `borrower` varchar(100) DEFAULT NULL COMMENT '借用人',
  `status` varchar(30) NOT NULL DEFAULT 'pending' COMMENT '預約狀態ENUM(''pending'', ''approved'', ''rejected'', ''cancelled'', ''completed'')',
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '建檔日期',
  `updated_by` varchar(100) DEFAULT NULL COMMENT '更新人員',
  `root_id` int DEFAULT '0' COMMENT '預約ID-表頭',
  PRIMARY KEY (`reservation_id`),
  KEY `room_id` (`room_id`),
  KEY `user_id` (`user_id`),
  KEY `root_id` (`root_id`),
  CONSTRAINT `reservations_ibfk_1` FOREIGN KEY (`room_id`) REFERENCES `meeting_rooms` (`room_id`),
  CONSTRAINT `reservations_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=258 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='會議預約記錄';

--
-- Dumping data for table `reservations`
--

INSERT INTO `reservations` VALUES (1,5,2,'國5015','我愛華語aa','','2025-03-13 14:10:00','2025-03-13 15:00:00',1,'weekly','每週週四','2025-03-26','第6節','系辦','approved','2025-03-14 11:21:08','2025-03-12 10:28:50','u01',1),(2,5,2,'國5015','我愛華語aa','','2025-03-20 14:10:00','2025-03-20 15:00:00',1,'weekly','每週週四','2025-03-26','第6節','系辦','approved','2025-03-14 11:21:08','2025-03-12 10:28:50','u01',1),(47,1,1,'國4006-2','菲律賓團','','2025-04-29 09:10:00','2025-04-29 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:34','u01',47),(51,1,1,'國4006-2','菲律賓團','','2025-04-30 09:10:00','2025-04-30 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(52,1,1,'國4006-2','菲律賓團','','2025-05-01 09:10:00','2025-05-01 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(53,1,1,'國4006-2','菲律賓團','','2025-05-02 09:10:00','2025-05-02 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(54,1,1,'國4006-2','菲律賓團','','2025-05-05 09:10:00','2025-05-05 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(55,1,1,'國4006-2','菲律賓團','','2025-05-06 09:10:00','2025-05-06 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(56,1,1,'國4006-2','菲律賓團','','2025-05-07 09:10:00','2025-05-07 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(57,1,1,'國4006-2','菲律賓團','','2025-05-08 09:10:00','2025-05-08 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(58,1,1,'國4006-2','菲律賓團','','2025-05-09 09:10:00','2025-05-09 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(59,1,1,'國4006-2','菲律賓團','','2025-05-12 09:10:00','2025-05-12 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(60,1,1,'國4006-2','菲律賓團','','2025-05-13 09:10:00','2025-05-13 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(61,1,1,'國4006-2','菲律賓團','','2025-05-14 09:10:00','2025-05-14 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(62,1,1,'國4006-2','菲律賓團','','2025-05-15 09:10:00','2025-05-15 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(63,1,1,'國4006-2','菲律賓團','','2025-05-16 09:10:00','2025-05-16 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(64,1,1,'國4006-2','菲律賓團','','2025-05-19 09:10:00','2025-05-19 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(65,1,1,'國4006-2','菲律賓團','','2025-05-20 09:10:00','2025-05-20 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(66,1,1,'國4006-2','菲律賓團','','2025-05-21 09:10:00','2025-05-21 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-22','','CLC','approved','2025-03-14 11:31:41','2025-03-13 18:03:35','u01',47),(77,6,1,'國4006-1','商務中文','','2025-02-19 09:10:00','2025-02-19 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 13:13:34','2025-03-14 13:13:34','u01',77),(78,2,1,'國4006-1','商務中文','','2025-02-26 09:10:00','2025-02-26 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:02:12','2025-03-14 13:13:34','u01',77),(79,6,1,'國4006-1','商務中文','','2025-03-05 09:10:00','2025-03-05 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 13:13:34','2025-03-14 13:13:34','u01',77),(80,2,1,'國4006-1','商務中文','','2025-03-12 09:10:00','2025-03-12 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:00:54','2025-03-14 13:13:34','u01',77),(81,2,1,'國4006-1','商務中文','','2025-03-19 09:10:00','2025-03-19 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:01:09','2025-03-14 13:13:34','u01',77),(82,2,1,'國4006-1','商務中文','','2025-03-26 09:10:00','2025-03-26 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:01:09','2025-03-14 13:13:34','u01',77),(83,2,1,'國4006-1','商務中文','','2025-04-02 09:10:00','2025-04-02 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:01:09','2025-03-14 13:13:34','u01',77),(84,2,1,'國4006-1','商務中文','','2025-04-09 09:10:00','2025-04-09 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:01:09','2025-03-14 13:13:34','u01',77),(85,2,1,'國4006-1','商務中文','','2025-04-16 09:10:00','2025-04-16 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:01:09','2025-03-14 13:13:34','u01',77),(86,2,1,'國4006-1','商務中文','','2025-04-23 09:10:00','2025-04-23 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:01:09','2025-03-14 13:13:34','u01',77),(87,2,1,'國4006-1','商務中文','','2025-04-30 09:10:00','2025-04-30 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:01:09','2025-03-14 13:13:34','u01',77),(88,2,1,'國4006-1','商務中文','','2025-05-07 09:10:00','2025-05-07 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:01:09','2025-03-14 13:13:34','u01',77),(89,2,1,'國4006-1','商務中文','','2025-05-14 09:10:00','2025-05-14 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:01:09','2025-03-14 13:13:34','u01',77),(90,2,1,'國4006-1','商務中文','','2025-05-21 09:10:00','2025-05-21 12:00:00',1,'weekly','每週週三','2025-05-28','','蔡淑芬','approved','2025-03-14 14:01:09','2025-03-14 13:13:34','u01',77),(209,3,1,'國5013','TEST','','2025-03-24 09:00:00','2025-03-24 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(210,3,1,'國5013','TEST','','2025-03-25 09:00:00','2025-03-25 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(211,3,1,'國5013','TEST','','2025-03-26 09:00:00','2025-03-26 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(212,3,1,'國5013','TEST','','2025-03-27 09:00:00','2025-03-27 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(213,3,1,'國5013','TEST','','2025-03-28 09:00:00','2025-03-28 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(214,3,1,'國5013','TEST','','2025-03-31 09:00:00','2025-03-31 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(215,3,1,'國5013','TEST','','2025-04-01 09:00:00','2025-04-01 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(219,3,1,'國5013','TEST','','2025-04-07 09:00:00','2025-04-07 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(220,3,1,'國5013','TEST','','2025-04-08 09:00:00','2025-04-08 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(221,3,1,'國5013','TEST','','2025-04-09 09:00:00','2025-04-09 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(222,3,1,'國5013','TEST','','2025-04-10 09:00:00','2025-04-10 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(223,3,1,'國5013','TEST','','2025-04-11 09:00:00','2025-04-11 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(224,3,1,'國5013','TEST','','2025-04-14 09:00:00','2025-04-14 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(225,3,1,'國5013','TEST','','2025-04-15 09:00:00','2025-04-15 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(226,3,1,'國5013','TEST','','2025-04-16 09:00:00','2025-04-16 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(227,3,1,'國5013','TEST','','2025-04-17 09:00:00','2025-04-17 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(228,3,1,'國5013','TEST','','2025-04-18 09:00:00','2025-04-18 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(229,3,1,'國5013','TEST','','2025-04-21 09:00:00','2025-04-21 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(230,3,1,'國5013','TEST','','2025-04-22 09:00:00','2025-04-22 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(231,3,1,'國5013','TEST','','2025-04-23 09:00:00','2025-04-23 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(232,3,1,'國5013','TEST','','2025-04-24 09:00:00','2025-04-24 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(233,3,1,'國5013','TEST','','2025-04-25 09:00:00','2025-04-25 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(234,3,1,'國5013','TEST','','2025-04-28 09:00:00','2025-04-28 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(235,3,1,'國5013','TEST','','2025-04-29 09:00:00','2025-04-29 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(236,3,1,'國5013','TEST','','2025-04-30 09:00:00','2025-04-30 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(237,3,1,'國5013','TEST','','2025-05-01 09:00:00','2025-05-01 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(238,3,1,'國5013','TEST','','2025-05-02 09:00:00','2025-05-02 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(239,3,1,'國5013','TEST','','2025-05-05 09:00:00','2025-05-05 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(240,3,1,'國5013','TEST','','2025-05-06 09:00:00','2025-05-06 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(241,3,1,'國5013','TEST','','2025-05-07 09:00:00','2025-05-07 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(242,3,1,'國5013','TEST','','2025-05-08 09:00:00','2025-05-08 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(243,3,1,'國5013','TEST','','2025-05-09 09:00:00','2025-05-09 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(244,3,1,'國5013','TEST','','2025-05-12 09:00:00','2025-05-12 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(245,3,1,'國5013','TEST','','2025-05-13 09:00:00','2025-05-13 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(246,3,1,'國5013','TEST','','2025-05-14 09:00:00','2025-05-14 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(247,3,1,'國5013','TEST','','2025-05-15 09:00:00','2025-05-15 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(248,3,1,'國5013','TEST','','2025-05-16 09:00:00','2025-05-16 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(249,3,1,'國5013','TEST','','2025-05-19 09:00:00','2025-05-19 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(250,3,1,'國5013','TEST','','2025-05-20 09:00:00','2025-05-20 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(251,3,1,'國5013','TEST','','2025-05-21 09:00:00','2025-05-21 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(252,3,1,'國5013','TEST','','2025-05-22 09:00:00','2025-05-22 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(253,3,1,'國5013','TEST','','2025-05-23 09:00:00','2025-05-23 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(254,3,1,'國5013','TEST','','2025-05-26 09:00:00','2025-05-26 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(255,3,1,'國5013','TEST','','2025-05-27 09:00:00','2025-05-27 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(256,3,1,'國5013','TEST','','2025-05-28 09:00:00','2025-05-28 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209),(257,3,1,'國5013','TEST','','2025-05-29 09:00:00','2025-05-29 12:00:00',1,'weekly','每週週一、週二、週三、週四、週五','2025-05-30','','CLC','approved','2025-03-24 14:57:59','2025-03-24 14:57:59','u01',209);

--
-- Table structure for table `sql_err`
--

CREATE TABLE `sql_err` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主鍵，自動遞增',
  `sql_msg` text NOT NULL COMMENT 'SQL 錯誤發生時的 SQL 語句',
  `sql_err` int NOT NULL COMMENT 'SQL 錯誤代碼',
  `sql_errmsg` text NOT NULL COMMENT 'SQL 錯誤訊息',
  `PHP_SELF` varchar(255) NOT NULL COMMENT '執行發生錯誤的 PHP 檔案',
  `REQUEST_URI` varchar(255) NOT NULL COMMENT '發送請求的 URI',
  `REQUEST` text NOT NULL COMMENT '完整的請求參數 ($_REQUEST)',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '記錄錯誤發生時間',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='SQL 錯誤日誌記錄表';

--
-- Dumping data for table `sql_err`
--


--
-- Table structure for table `system_logs`
--

CREATE TABLE `system_logs` (
  `log_id` int NOT NULL AUTO_INCREMENT COMMENT '紀錄ID',
  `user_id` int DEFAULT NULL COMMENT '操作人員ID',
  `action` varchar(100) NOT NULL COMMENT '操作動作',
  `target_table` varchar(100) DEFAULT NULL COMMENT '目標資料表',
  `target_id` int DEFAULT NULL COMMENT '目標記錄ID',
  `action_detail` text COMMENT '操作詳情',
  `ip_address` varchar(50) DEFAULT NULL COMMENT 'IP位址',
  `action_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '操作時間',
  PRIMARY KEY (`log_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `system_logs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系統操作紀錄';

--
-- Dumping data for table `system_logs`
--


--
-- Table structure for table `system_news`
--

CREATE TABLE `system_news` (
  `news_id` int NOT NULL AUTO_INCREMENT COMMENT '公告編號',
  `news_title` varchar(255) NOT NULL COMMENT '公告標題',
  `news_content` text NOT NULL COMMENT '公告內容',
  `publish_date` datetime DEFAULT NULL COMMENT '發佈日期',
  `publish_unit` varchar(255) DEFAULT NULL COMMENT '發佈單位',
  `attachment_url` varchar(999) DEFAULT NULL COMMENT '附件下載URL',
  `remove_date` datetime DEFAULT NULL COMMENT '下架日期',
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '建檔日期',
  `updated_by` varchar(100) DEFAULT NULL COMMENT '更新人員',
  PRIMARY KEY (`news_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系統公告表';

--
-- Dumping data for table `system_news`
--

INSERT INTO `system_news` VALUES (1,'教室預約開始囉~~','2025.03.12起開始預約','2025-03-06 16:43:00','','','2026-03-06 00:00:00','2025-03-12 09:29:05','2025-03-06 16:52:55','u01');

--
-- Table structure for table `time_slots`
--

CREATE TABLE `time_slots` (
  `slot_id` int NOT NULL AUTO_INCREMENT COMMENT '時段ID',
  `slot_name` varchar(100) NOT NULL COMMENT '時段名稱',
  `start_time` time NOT NULL COMMENT '開始時間',
  `end_time` time NOT NULL COMMENT '結束時間',
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '建檔日期',
  `updated_by` varchar(100) DEFAULT NULL COMMENT '更新人員',
  PRIMARY KEY (`slot_id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='標準預約時段定義';

--
-- Dumping data for table `time_slots`
--

INSERT INTO `time_slots` VALUES (1,'第1節','08:10:00','09:04:00','2025-03-12 13:47:09','2025-03-06 14:30:47','u01'),(2,'第2節','09:10:00','10:00:00','2025-03-06 17:34:50','2025-03-06 17:34:37',NULL),(3,'第3節','10:10:00','11:00:00','2025-03-06 17:37:18','2025-03-06 17:37:18',NULL),(5,'第4節','11:10:00','12:00:00','2025-03-06 14:31:30','2025-03-06 14:30:47',NULL),(6,'午休','12:10:00','13:00:00','2025-03-06 17:34:50','2025-03-06 17:34:37',NULL),(7,'第5節','13:10:00','14:00:00','2025-03-06 17:37:18','2025-03-06 17:37:18',NULL),(8,'第6節','14:10:00','15:00:00','2025-03-06 14:31:30','2025-03-06 14:30:47',NULL),(9,'第7節','15:10:00','16:00:00','2025-03-06 17:34:50','2025-03-06 17:34:37',NULL),(10,'第8節','16:10:00','17:00:00','2025-03-06 14:31:30','2025-03-06 14:30:47',NULL),(11,'第9節','17:10:00','18:00:00','2025-03-06 17:34:50','2025-03-06 17:34:37',NULL),(12,'第C節','18:10:00','19:00:00','2025-03-06 14:31:30','2025-03-06 14:30:47',NULL),(13,'第D節','19:10:00','20:00:00','2025-03-06 17:34:50','2025-03-06 17:34:37',NULL),(14,'第E節','20:10:00','21:00:00','2025-03-06 14:31:30','2025-03-06 14:30:47',NULL),(15,'第F節','21:10:00','22:00:00','2025-03-06 17:37:18','2025-03-06 17:37:18',NULL);


