-- https://www.phpmyadmin.net/
--
-- 主機： 127.0.0.1
-- 產生時間： 2025-10-20 06:24:48
-- 伺服器版本： 8.0.42
-- PHP 版本： 8.2.12

START TRANSACTION;



--
-- 資料庫： `nsysu_salary`
--

-- --------------------------------------------------------

--
-- 資料表結構 `class_schedules`
--

CREATE TABLE `class_schedules` (
  `class_id` int NOT NULL,
  `employee_id` int NOT NULL,
  `class_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '課名',
  `class_hours` decimal(5,2) DEFAULT NULL COMMENT '時數',
  `class_day` date DEFAULT NULL COMMENT '上課日期',
  `start_time` time DEFAULT NULL COMMENT '開始時間',
  `end_time` time DEFAULT NULL COMMENT '結束時間',
  `hourly_fee` int DEFAULT NULL COMMENT '鐘點費',
  `other_flag` int NOT NULL DEFAULT '1' COMMENT '是否計入特休,0:其他雜項(不計)',
  `overtime_rate` decimal(10,2) DEFAULT NULL COMMENT '加班1.34',
  `overtime_rate_167` decimal(10,2) DEFAULT NULL COMMENT '加班1.67',
  `is_recurring` int DEFAULT '0' COMMENT '是否為周期性會議',
  `recurrence_type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '周期類型ENUM(daily,weekly,monthly,custom)',
  `recurrence_pattern` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '周期模式(例如: 每週一三五/每月1號/每月第一個星期一)',
  `recurrence_end_date` date DEFAULT NULL COMMENT '週期結束日期',
  `slot_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '時段名稱',
  `class_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '備註',
  `root_id` int DEFAULT '0' COMMENT 'class_id-表頭',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '建檔日期',
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人員'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- 傾印資料表的資料 `class_schedules`
--

INSERT INTO `class_schedules` (`class_id`, `employee_id`, `class_name`, `class_hours`, `class_day`, `start_time`, `end_time`, `hourly_fee`, `other_flag`, `overtime_rate`, `overtime_rate_167`, `is_recurring`, `recurrence_type`, `recurrence_pattern`, `recurrence_end_date`, `slot_name`, `class_remark`, `root_id`, `create_date`, `update_date`, `updated_by`) VALUES
(1, 1, 'class01', 3.00, '2025-06-02', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(2, 1, 'class01', 3.00, '2025-06-04', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(3, 1, 'class01', 3.00, '2025-06-09', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(4, 1, 'class01', 3.00, '2025-06-11', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(5, 1, 'class01', 3.00, '2025-06-16', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(6, 1, 'class01', 3.00, '2025-06-18', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(7, 1, 'class01', 3.00, '2025-06-23', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(8, 1, 'class01', 3.00, '2025-06-25', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(9, 1, 'class01', 3.00, '2025-06-30', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(10, 1, 'class01', 3.00, '2025-07-02', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(11, 1, 'class01', 3.00, '2025-07-07', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(12, 1, 'class01', 3.00, '2025-07-09', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(13, 1, 'class01', 3.00, '2025-07-14', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(14, 1, 'class01', 3.00, '2025-07-16', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(15, 1, 'class01', 3.00, '2025-07-21', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(16, 1, 'class01', 3.00, '2025-07-23', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(17, 1, 'class01', 3.00, '2025-07-28', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(18, 1, 'class01', 3.00, '2025-07-30', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(19, 1, 'class01', 3.00, '2025-08-04', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(20, 1, 'class01', 3.00, '2025-08-06', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(21, 1, 'class01', 3.00, '2025-08-11', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(22, 1, 'class01', 3.00, '2025-08-13', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(23, 1, 'class01', 3.00, '2025-08-18', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(24, 1, 'class01', 3.00, '2025-08-20', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(25, 1, 'class01', 3.00, '2025-08-25', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(26, 1, 'class01', 3.00, '2025-08-27', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(27, 1, 'class01', 3.00, '2025-09-01', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(28, 1, 'class01', 3.00, '2025-09-03', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(29, 1, 'class01', 3.00, '2025-09-08', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(30, 1, 'class01', 3.00, '2025-09-10', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(31, 1, 'class01', 3.00, '2025-09-15', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(32, 1, 'class01', 3.00, '2025-09-17', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(33, 1, 'class01', 3.00, '2025-09-22', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(34, 1, 'class01', 3.00, '2025-09-24', '09:10:00', '12:00:00', 500, 1, NULL, NULL, 1, 'weekly', '每週1,3', '2025-09-24', '', '', 1, '2025-07-02 16:10:13', '2025-07-02 16:10:13', 'u01'),
(36, 2, 'class02', 2.00, '2025-06-03', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(37, 2, 'class02', 2.00, '2025-06-04', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(38, 2, 'class02', 2.00, '2025-06-06', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(39, 2, 'class02', 2.00, '2025-06-11', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(40, 2, 'class02', 2.00, '2025-06-13', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(41, 2, 'class02', 2.00, '2025-06-18', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(42, 2, 'class02', 2.00, '2025-06-20', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(43, 2, 'class02', 2.00, '2025-06-25', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(44, 2, 'class02', 2.00, '2025-06-27', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(45, 2, 'class02', 2.00, '2025-07-02', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(46, 2, 'class02', 2.00, '2025-07-04', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(47, 2, 'class02', 2.00, '2025-07-09', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(48, 2, 'class02', 2.00, '2025-07-11', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(49, 2, 'class02', 2.00, '2025-07-16', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(50, 2, 'class02', 2.00, '2025-07-18', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(51, 2, 'class02', 2.00, '2025-07-23', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(52, 2, 'class02', 2.00, '2025-07-25', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(53, 2, 'class02', 2.00, '2025-07-30', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(54, 2, 'class02', 2.00, '2025-08-01', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(55, 2, 'class02', 2.00, '2025-08-06', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(56, 2, 'class02', 2.00, '2025-08-08', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(57, 2, 'class02', 2.00, '2025-08-13', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(58, 2, 'class02', 2.00, '2025-08-15', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(59, 2, 'class02', 2.00, '2025-08-20', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(60, 2, 'class02', 2.00, '2025-08-22', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(61, 2, 'class02', 2.00, '2025-08-27', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(62, 2, 'class02', 2.00, '2025-08-29', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(63, 2, 'class02', 2.00, '2025-09-03', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:22', '2025-07-02 16:12:22', 'u01'),
(64, 2, 'class02', 2.00, '2025-09-05', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:23', '2025-07-02 16:12:23', 'u01'),
(65, 2, 'class02', 2.00, '2025-09-10', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:23', '2025-07-02 16:12:23', 'u01'),
(66, 2, 'class02', 2.00, '2025-09-12', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:23', '2025-07-02 16:12:23', 'u01'),
(67, 2, 'class02', 2.00, '2025-09-17', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:23', '2025-07-02 16:12:23', 'u01'),
(68, 2, 'class02', 2.00, '2025-09-19', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:23', '2025-07-02 16:12:23', 'u01'),
(69, 2, 'class02', 2.00, '2025-09-24', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:23', '2025-07-02 16:12:23', 'u01'),
(70, 2, 'class02', 2.00, '2025-09-26', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:23', '2025-07-02 16:12:23', 'u01'),
(71, 2, 'class02', 2.00, '2025-10-01', '16:10:00', '18:00:00', 480, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-10-01', '', '', 36, '2025-07-02 16:12:23', '2025-07-02 16:12:23', 'u01'),
(78, 1, '雜支', 1.00, '2025-09-12', NULL, NULL, 1688, 0, NULL, NULL, 0, 'daily', '', '2025-09-12', '', '', 78, '2025-09-12 10:52:05', '2025-09-12 11:06:13', 'u01'),
(79, 2, 'aaa', 2.00, '2025-09-17', '10:10:00', '12:00:00', 555, 1, NULL, NULL, 0, 'weekly', '', '2025-09-17', '', '', 79, '2025-09-17 10:44:40', '2025-09-17 10:44:40', 'u01'),
(95, 2, 'ggg', 1.00, '2025-09-01', '19:05:00', '20:05:00', 600, 1, NULL, NULL, 0, 'weekly', '', '2025-09-01', '', '', 95, '2025-09-17 11:06:01', '2025-09-17 11:06:01', 'u01'),
(121, 2, '123', 1.00, '2025-09-09', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(122, 2, '123', 1.00, '2025-09-11', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(123, 2, '123', 1.00, '2025-09-16', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(124, 2, '123', 1.00, '2025-09-18', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(125, 2, '123', 1.00, '2025-09-23', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(126, 2, '123', 1.00, '2025-09-25', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(127, 2, '123', 1.00, '2025-09-30', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(128, 2, '123', 1.00, '2025-10-02', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(129, 2, '123', 1.00, '2025-10-07', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(130, 2, '123', 1.00, '2025-10-09', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(131, 2, '123', 1.00, '2025-10-14', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(132, 2, '123', 1.00, '2025-10-16', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(133, 2, '123', 1.00, '2025-10-21', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(134, 2, '123', 1.00, '2025-10-23', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(135, 2, '123', 1.00, '2025-10-28', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(136, 2, '123', 1.00, '2025-10-30', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(137, 2, '123', 1.00, '2025-11-04', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(138, 2, '123', 1.00, '2025-11-06', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(139, 2, '123', 1.00, '2025-11-11', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(140, 2, '123', 1.00, '2025-11-13', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(141, 2, '123', 1.00, '2025-11-18', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(142, 2, '123', 1.00, '2025-11-20', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(143, 2, '123', 1.00, '2025-11-25', '18:32:00', '19:32:00', 500, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-25', '', '', 121, '2025-09-17 12:32:33', '2025-09-17 12:32:33', 'u01'),
(145, 2, 'aaa', 1.00, '2025-09-08', '08:35:00', '21:35:00', 11, 1, NULL, NULL, 0, 'weekly', 'weekly#0', '2025-09-08', '', '', 145, '2025-09-17 12:36:00', '2025-09-17 12:36:00', 'u01'),
(146, 2, 'ccc', 1.00, '2025-09-01', '17:37:00', '18:37:00', 99, 1, NULL, NULL, 1, 'weekly', '每週3,5', '2025-09-30', '', '', 146, '2025-09-17 12:37:34', '2025-09-17 12:37:34', 'u01'),
(184, 1, 'night', 1.00, '2025-09-01', '18:12:00', '20:12:00', 555, 1, NULL, NULL, 1, 'weekly', '每週1', '2025-09-29', '', '', 184, '2025-09-18 15:12:53', '2025-09-18 15:12:53', 'u01'),
(185, 1, 'night', 1.00, '2025-09-08', '18:12:00', '20:12:00', 555, 1, NULL, NULL, 1, 'weekly', '每週1', '2025-09-29', '', '', 184, '2025-09-18 15:12:53', '2025-09-18 15:12:53', 'u01'),
(186, 1, 'night', 1.00, '2025-09-15', '18:12:00', '20:12:00', 555, 1, NULL, NULL, 1, 'weekly', '每週1', '2025-09-29', '', '', 184, '2025-09-18 15:12:53', '2025-09-18 15:12:53', 'u01'),
(187, 1, 'night', 1.00, '2025-09-22', '18:12:00', '20:12:00', 555, 1, NULL, NULL, 1, 'weekly', '每週1', '2025-09-29', '', '', 184, '2025-09-18 15:12:53', '2025-09-18 15:12:53', 'u01'),
(188, 1, 'night', 1.00, '2025-09-29', '18:12:00', '20:12:00', 555, 1, NULL, NULL, 1, 'weekly', '每週1', '2025-09-29', '', '', 184, '2025-09-18 15:12:53', '2025-09-18 15:12:53', 'u01'),
(189, 1, 'ttt', 1.00, '2025-09-02', '16:16:00', '17:16:00', 600, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-09-30', '', '', 189, '2025-09-18 15:17:04', '2025-09-18 15:17:04', 'u01'),
(190, 1, 'ttt', 1.00, '2025-09-04', '16:16:00', '17:16:00', 600, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-09-30', '', '', 189, '2025-09-18 15:17:04', '2025-09-18 15:17:04', 'u01'),
(191, 1, 'ttt', 1.00, '2025-09-09', '16:16:00', '17:16:00', 600, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-09-30', '', '', 189, '2025-09-18 15:17:04', '2025-09-18 15:17:04', 'u01'),
(192, 1, 'ttt', 1.00, '2025-09-11', '16:16:00', '17:16:00', 600, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-09-30', '', '', 189, '2025-09-18 15:17:04', '2025-09-18 15:17:04', 'u01'),
(193, 1, 'ttt', 1.00, '2025-09-16', '16:16:00', '17:16:00', 600, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-09-30', '', '', 189, '2025-09-18 15:17:04', '2025-09-18 15:17:04', 'u01'),
(194, 1, 'ttt', 1.00, '2025-09-18', '16:16:00', '17:16:00', 600, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-09-30', '', '', 189, '2025-09-18 15:17:04', '2025-09-18 15:17:04', 'u01'),
(195, 1, 'ttt', 1.00, '2025-09-23', '16:16:00', '17:16:00', 600, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-09-30', '', '', 189, '2025-09-18 15:17:04', '2025-09-18 15:17:04', 'u01'),
(196, 1, 'ttt', 1.00, '2025-09-25', '16:16:00', '17:16:00', 600, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-09-30', '', '', 189, '2025-09-18 15:17:04', '2025-09-18 15:17:04', 'u01'),
(197, 1, 'ttt', 1.00, '2025-09-30', '16:16:00', '17:16:00', 600, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-09-30', '', '', 189, '2025-09-18 15:17:04', '2025-09-18 15:17:04', 'u01'),
(198, 1, 'test', 2.00, '2025-10-13', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(199, 1, 'test', 2.00, '2025-10-14', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(200, 1, 'test', 2.00, '2025-10-16', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(201, 1, 'test', 2.00, '2025-10-21', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(203, 1, 'test', 2.00, '2025-10-28', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(204, 1, 'test', 2.00, '2025-10-30', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(205, 1, 'test', 2.00, '2025-11-04', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(206, 1, 'test', 2.00, '2025-11-06', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(207, 1, 'test', 2.00, '2025-11-11', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(208, 1, 'test', 2.00, '2025-11-13', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(209, 1, 'test', 2.00, '2025-11-18', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(210, 1, 'test', 2.00, '2025-11-20', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(211, 1, 'test', 2.00, '2025-11-25', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01'),
(212, 1, 'test', 2.00, '2025-11-27', '20:10:00', '21:00:00', 700, 1, NULL, NULL, 1, 'weekly', '每週2,4', '2025-11-30', 't8-9', '', 198, '2025-10-15 09:50:07', '2025-10-15 09:50:07', 'u01');

-- --------------------------------------------------------

--
-- 資料表結構 `insurance`
--

CREATE TABLE `insurance` (
  `insurance_id` int NOT NULL,
  `employee_id` int NOT NULL,
  `insurance_date` date NOT NULL COMMENT '投保日期',
  `salary` int DEFAULT '0' COMMENT '投保薪資',
  `health_insurance_employer` int DEFAULT '0' COMMENT '健保公提金',
  `labor_insurance_employer` int DEFAULT '0' COMMENT '勞保公提金',
  `health_insurance_employee` int DEFAULT '0' COMMENT '健保費',
  `health_insurance_dependent` int DEFAULT '0' COMMENT '眷屬健保費',
  `labor_insurance_employee` int DEFAULT '0' COMMENT '勞保費',
  `retirement_fund` int DEFAULT NULL COMMENT '勞退金6%',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '建檔日期',
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人員'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- 傾印資料表的資料 `insurance`
--

INSERT INTO `insurance` (`insurance_id`, `employee_id`, `insurance_date`, `salary`, `health_insurance_employer`, `labor_insurance_employer`, `health_insurance_employee`, `health_insurance_dependent`, `labor_insurance_employee`, `retirement_fund`, `create_date`, `update_date`, `updated_by`) VALUES
(1, 1, '2025-06-01', 45000, 2124, 3841, 681, 0, 1098, 2634, '2025-06-30 14:24:08', '2025-07-02 16:52:50', 'system'),
(2, 2, '2025-01-01', 38500, 1849, 3342, 592, 592, 955, 2292, '2025-07-02 16:23:07', '2025-07-02 16:26:46', 'system');

-- --------------------------------------------------------

--
-- 資料表結構 `labor_insurance_levels`
--

CREATE TABLE `labor_insurance_levels` (
  `id` int NOT NULL,
  `year` year NOT NULL COMMENT '適用年度',
  `level_no` int NOT NULL COMMENT '投保薪資等級',
  `salary_range_min` decimal(10,2) DEFAULT NULL COMMENT '月薪資總額最低',
  `salary_range_max` decimal(10,2) DEFAULT NULL COMMENT '月薪資總額最高',
  `salary_range_text` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '月薪資總額範圍文字',
  `insured_salary` decimal(10,2) NOT NULL COMMENT '月投保薪資',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_date` datetime DEFAULT NULL,
  `updated_by` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '更新人員'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='勞工保險投保薪資分級表';

--
-- 傾印資料表的資料 `labor_insurance_levels`
--

INSERT INTO `labor_insurance_levels` (`id`, `year`, `level_no`, `salary_range_min`, `salary_range_max`, `salary_range_text`, `insured_salary`, `create_date`, `update_date`, `updated_by`) VALUES
(1, '2025', 1, 0.00, 28590.00, '28,590元以下', 28590.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(2, '2025', 2, 28591.00, 28800.00, '28,591元至28,800元', 28800.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(3, '2025', 3, 28801.00, 30300.00, '28,801元至30,300元', 30300.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(4, '2025', 4, 30301.00, 31800.00, '30,301元至31,800元', 31800.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(5, '2025', 5, 31801.00, 33300.00, '31,801元至33,300元', 33300.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(6, '2025', 6, 33301.00, 34800.00, '33,301元至34,800元', 34800.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(7, '2025', 7, 34801.00, 36300.00, '34,801元至36,300元', 36300.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(8, '2025', 8, 36301.00, 38200.00, '36,301元至38,200元', 38200.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(9, '2025', 9, 38201.00, 40100.00, '38,201元至40,100元', 40100.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(10, '2025', 10, 40101.00, 42000.00, '40,101元至42,000元', 42000.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(11, '2025', 11, 42001.00, 43900.00, '42,001元至43,900元', 43900.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(12, '2025', 12, 43901.00, NULL, '43,901元以上', 45800.00, '2025-06-26 16:16:43', '2025-06-26 16:16:43', ''),
(13, '2024', 1, 0.00, 27470.00, '27,470元以下', 27470.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(14, '2024', 2, 27471.00, 27600.00, '27,471元至27,600元', 27600.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(15, '2024', 3, 27601.00, 28800.00, '27,601元至28,800元', 28800.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(16, '2024', 4, 28801.00, 30300.00, '28,801元至30,300元', 30300.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(17, '2024', 5, 30301.00, 31800.00, '30,301元至31,800元', 31800.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(18, '2024', 6, 31801.00, 33300.00, '31,801元至33,300元', 33300.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(19, '2024', 7, 33301.00, 34800.00, '33,301元至34,800元', 34800.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(20, '2024', 8, 34801.00, 36300.00, '34,801元至36,300元', 36300.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(21, '2024', 9, 36301.00, 38200.00, '36,301元至38,200元', 38200.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(22, '2024', 10, 38201.00, 40100.00, '38,201元至40,100元', 40100.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(23, '2024', 11, 40101.00, 42000.00, '40,101元至42,000元', 42000.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(24, '2024', 12, 42001.00, 43900.00, '42,001元至43,900元', 43900.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN'),
(25, '2024', 13, 43901.00, 999999.00, '43,901元以上', 45800.00, '2025-06-26 17:13:17', '2025-06-26 17:14:10', 'ADMIN');

-- --------------------------------------------------------

--
-- 資料表結構 `log_use`
--

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

-- --------------------------------------------------------

--
-- 資料表結構 `monthly_settlement`
--

CREATE TABLE `monthly_settlement` (
  `monthly_id` int NOT NULL COMMENT '主鍵ID',
  `settlement_date` date NOT NULL COMMENT '結算日期',
  `employee_id` int NOT NULL COMMENT '員工ID',
  `employeeNo` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '員工編號',
  `employeeName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '員工姓名',
  `tot_salary` int DEFAULT '0' COMMENT '總薪資',
  `tot_hour` decimal(10,2) DEFAULT NULL COMMENT '總時數',
  `last_salary` decimal(10,2) DEFAULT NULL COMMENT '基本薪資',
  `labor_insurance_employer` int DEFAULT '0' COMMENT '雇主勞保負擔',
  `health_insurance_employer` int DEFAULT '0' COMMENT '雇主健保負擔',
  `labor_insurance_employee` int DEFAULT '0' COMMENT '員工勞保負擔',
  `health_insurance_employee` int DEFAULT '0' COMMENT '員工健保負擔',
  `health_insurance_dependent` int DEFAULT '0' COMMENT '眷屬健保費',
  `retirement_fund` int DEFAULT '0' COMMENT '退休金提撥',
  `other_salary` int NOT NULL DEFAULT '0' COMMENT '其他薪資',
  `net_salary` int DEFAULT '0' COMMENT '淨薪資',
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '建檔日期',
  `updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '更新人員'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='員工資月結檔';

--
-- 傾印資料表的資料 `monthly_settlement`
--

INSERT INTO `monthly_settlement` (`monthly_id`, `settlement_date`, `employee_id`, `employeeNo`, `employeeName`, `tot_salary`, `tot_hour`, `last_salary`, `labor_insurance_employer`, `health_insurance_employer`, `labor_insurance_employee`, `health_insurance_employee`, `health_insurance_dependent`, `retirement_fund`, `other_salary`, `net_salary`, `update_date`, `create_date`, `updated_by`) VALUES
(3, '2025-06-30', 1, 't001', '王大同', 13500, 27.00, 45000.00, 3841, 2124, 1098, 681, 0, 2634, 0, 11721, '2025-07-02 16:36:19', '2025-07-02 16:36:19', NULL),
(4, '2025-06-30', 2, 't002', '林立', 8640, 18.00, 38500.00, 3342, 1849, 955, 1184, 0, 2292, 0, 6501, '2025-07-02 16:36:19', '2025-07-02 16:36:19', NULL),
(9, '2025-09-30', 1, 't001', '王大同', 20175, 38.00, 45000.00, 3841, 2124, 1098, 681, 0, 2634, 1688, 20084, '2025-10-07 10:28:32', '2025-10-07 10:28:32', NULL),
(10, '2025-09-30', 2, 't002', '林立', 13000, 28.00, 38500.00, 3342, 1849, 955, 592, 592, 2292, 0, 11453, '2025-10-07 10:28:32', '2025-10-07 10:28:32', NULL);

-- --------------------------------------------------------

--
-- 資料表結構 `salary_grades`
--

CREATE TABLE `salary_grades` (
  `id` int NOT NULL,
  `year` int NOT NULL COMMENT '年度',
  `grade_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '級距名稱',
  `salary_amount` int NOT NULL COMMENT '薪資金額',
  `company_labor_insurance` int NOT NULL COMMENT '公司負擔勞保',
  `company_health_insurance` int NOT NULL COMMENT '公司負擔健保',
  `company_employment_insurance` int NOT NULL COMMENT '公司負擔職保',
  `company_labor_pension` int NOT NULL COMMENT '公司負擔勞退6%',
  `company_total` int NOT NULL COMMENT '公司負擔合計',
  `employee_salary_base` int NOT NULL COMMENT '員工負擔薪資基數',
  `employee_labor_insurance` int NOT NULL COMMENT '員工負擔勞保',
  `employee_health_insurance` int NOT NULL COMMENT '員工負擔健保',
  `employee_total` int NOT NULL COMMENT '員工負擔合計',
  `remarks` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '備註',
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '建檔日期',
  `updated_by` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '更新人員'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- 傾印資料表的資料 `salary_grades`
--

INSERT INTO `salary_grades` (`id`, `year`, `grade_name`, `salary_amount`, `company_labor_insurance`, `company_health_insurance`, `company_employment_insurance`, `company_labor_pension`, `company_total`, `employee_salary_base`, `employee_labor_insurance`, `employee_health_insurance`, `employee_total`, `remarks`, `update_date`, `create_date`, `updated_by`) VALUES
(113, 2024, '0', 1497, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '2025-06-27 17:00:42', '2025-06-27 17:00:42', ''),
(197, 2025, '部分工時', 1500, 972, 1384, 35, 90, 2481, 1500, 277, 443, 720, '勞退最低級距', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(198, 2025, '', 3000, 972, 1384, 35, 180, 2571, 3000, 277, 443, 720, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(199, 2025, '', 4500, 972, 1384, 35, 270, 2661, 4500, 277, 443, 720, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(200, 2025, '', 6000, 972, 1384, 35, 360, 2751, 6000, 277, 443, 720, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(201, 2025, '', 7500, 972, 1384, 35, 450, 2841, 7500, 277, 443, 720, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(202, 2025, '', 8700, 972, 1384, 35, 522, 2913, 8700, 277, 443, 720, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(203, 2025, '', 9900, 972, 1384, 35, 594, 2985, 9900, 277, 443, 720, '健保最低級距', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(204, 2025, '', 11100, 972, 1384, 35, 666, 3057, 11100, 277, 443, 720, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(205, 2025, '', 12540, 1097, 1384, 35, 752, 3268, 12540, 313, 443, 756, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(206, 2025, '', 13500, 1182, 1384, 35, 810, 3411, 13500, 338, 443, 781, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(207, 2025, '', 15840, 1386, 1384, 36, 950, 3756, 15840, 396, 443, 839, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(208, 2025, '', 16500, 1444, 1384, 36, 990, 3854, 16500, 413, 443, 856, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(209, 2025, '', 17280, 1512, 1384, 36, 1037, 3969, 17280, 432, 443, 875, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(210, 2025, '', 17880, 1564, 1384, 36, 1073, 4057, 17880, 447, 443, 890, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(211, 2025, '', 19047, 1666, 1384, 37, 1143, 4230, 19047, 476, 443, 919, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(212, 2025, '', 20008, 1751, 1384, 37, 1200, 4372, 20008, 500, 443, 943, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(213, 2025, '', 21009, 1838, 1384, 37, 1261, 4520, 21009, 525, 443, 968, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(214, 2025, '', 22000, 1925, 1384, 38, 1320, 4667, 22000, 550, 443, 993, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(215, 2025, '', 23100, 2022, 1384, 38, 1386, 4830, 23100, 577, 443, 1020, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(216, 2025, '', 24000, 2100, 1384, 38, 1440, 4962, 24000, 600, 443, 1043, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(217, 2025, '', 25250, 2210, 1384, 38, 1515, 5147, 25250, 632, 443, 1075, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(218, 2025, '', 26400, 2310, 1384, 39, 1584, 5121, 26400, 660, 443, 1103, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(219, 2025, '', 27600, 2415, 1384, 39, 1656, 5494, 27600, 690, 443, 1133, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(220, 2025, '1', 28590, 2501, 1384, 39, 1715, 5639, 28590, 715, 443, 1158, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(221, 2025, '2', 28800, 2520, 1394, 39, 1728, 5681, 28800, 720, 447, 1167, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(222, 2025, '3', 30300, 2651, 1466, 42, 1818, 5977, 30300, 758, 470, 1228, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(223, 2025, '4', 31800, 2783, 1539, 43, 1908, 6273, 31800, 795, 493, 1288, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(224, 2025, '5', 33300, 2914, 1611, 45, 1998, 6568, 33300, 833, 516, 1349, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(225, 2025, '6', 34800, 3045, 1684, 48, 2088, 6865, 34800, 870, 540, 1410, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(226, 2025, '7', 36300, 3176, 1757, 49, 2178, 7160, 36300, 908, 563, 1471, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(227, 2025, '8', 38200, 3342, 1849, 53, 2292, 7536, 38200, 955, 592, 1547, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(228, 2025, '9', 40100, 3509, 1940, 55, 2406, 7910, 40100, 1002, 622, 1624, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(229, 2025, '10', 42000, 3675, 2032, 58, 2520, 8285, 42000, 1050, 651, 1701, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(230, 2025, '11', 43900, 3841, 2124, 60, 2634, 8659, 43900, 1098, 681, 1779, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(231, 2025, '12', 45800, 4008, 2216, 62, 2748, 9034, 45800, 1145, 710, 1855, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(232, 2025, '13', 48200, 4008, 2332, 65, 2892, 9297, 48200, 1145, 748, 1893, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(233, 2025, '14', 50600, 4008, 2449, 67, 3036, 9560, 50600, 1145, 785, 1930, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(234, 2025, '15', 53000, 4008, 2565, 70, 3180, 9823, 53000, 1145, 822, 1967, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(235, 2025, '16', 55400, 4008, 2681, 72, 3324, 10085, 55400, 1145, 859, 2004, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(236, 2025, '17', 57800, 4008, 2797, 75, 3468, 10348, 57800, 1145, 896, 2041, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(237, 2025, '18', 60800, 4008, 2942, 78, 3648, 10676, 60800, 1145, 943, 2088, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(238, 2025, '19', 63800, 4008, 3087, 82, 3828, 11005, 63800, 1145, 990, 2135, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(239, 2025, '20', 66800, 4008, 3233, 85, 4008, 11334, 66800, 1145, 1036, 2181, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(240, 2025, '21', 69800, 4008, 3378, 88, 4188, 11662, 69800, 1145, 1083, 2228, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(241, 2025, '22', 72800, 4008, 3523, 92, 4368, 11991, 72800, 1145, 1129, 2274, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(242, 2025, '23', 76500, 4008, 3702, 92, 4590, 12392, 76500, 1145, 1187, 2332, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(243, 2025, '24', 80200, 4008, 3881, 92, 4812, 12793, 80200, 1145, 1244, 2389, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(244, 2025, '25', 83900, 4008, 4060, 92, 5034, 13194, 83900, 1145, 1301, 2446, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(245, 2025, '26', 87600, 4008, 4239, 92, 5256, 13595, 87600, 1145, 1359, 2504, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(246, 2025, '27', 92100, 4008, 4457, 92, 5526, 14083, 92100, 1145, 1428, 2573, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(247, 2025, '28', 96600, 4008, 4675, 92, 5796, 14571, 96600, 1145, 1498, 2643, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(248, 2025, '29', 101100, 4008, 4892, 92, 6066, 15058, 101100, 1145, 1568, 2713, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(249, 2025, '30', 105600, 4008, 5110, 92, 6336, 15546, 105600, 1145, 1638, 2783, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(250, 2025, '31', 110100, 4008, 5328, 92, 6606, 16034, 110100, 1145, 1708, 2853, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(251, 2025, '32', 115500, 4008, 5589, 92, 6930, 16619, 115500, 1145, 1791, 2936, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(252, 2025, '33', 120900, 4008, 5850, 92, 7254, 17204, 120900, 1145, 1875, 3020, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(253, 2025, '34', 126300, 4008, 6112, 92, 7578, 17790, 126300, 1145, 1959, 3104, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(254, 2025, '35', 131700, 4008, 6373, 92, 7902, 18375, 131700, 1145, 2043, 3188, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(255, 2025, '36', 137100, 4008, 6634, 92, 8226, 18960, 137100, 1145, 2126, 3271, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(256, 2025, '37', 142500, 4008, 6896, 92, 8550, 19546, 142500, 1145, 2210, 3355, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(257, 2025, '38', 147900, 4008, 7157, 92, 8874, 20131, 147900, 1145, 2294, 3439, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(258, 2025, '39', 150000, 4008, 7259, 92, 9000, 20359, 150000, 1145, 2327, 3472, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(259, 2025, '40', 156400, 4008, 7568, 92, 9000, 20668, 156400, 1145, 2426, 3571, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(260, 2025, '41', 162800, 4008, 7878, 92, 9000, 20978, 162800, 1145, 2525, 3670, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(261, 2025, '42', 169200, 4008, 8188, 92, 9000, 21288, 169200, 1145, 2624, 3769, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(262, 2025, '43', 175600, 4008, 8497, 92, 9000, 21597, 175600, 1145, 2724, 3869, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(263, 2025, '44', 182000, 4008, 8807, 92, 9000, 21907, 182000, 1145, 2823, 3968, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(264, 2025, '45', 189500, 4008, 9170, 92, 9000, 22270, 189500, 1145, 2939, 4084, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(265, 2025, '46', 197000, 4008, 9533, 92, 9000, 22633, 197000, 1145, 3055, 4200, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(266, 2025, '47', 204500, 4008, 9896, 92, 9000, 22996, 204500, 1145, 3172, 4317, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(267, 2025, '48', 212000, 4008, 10259, 92, 9000, 23359, 212000, 1145, 3288, 4433, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(268, 2025, '49', 219500, 4008, 10622, 92, 9000, 23722, 219500, 1145, 3404, 4549, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(269, 2025, '50', 228200, 4008, 11043, 92, 9000, 24143, 228200, 1145, 3539, 4684, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(270, 2025, '51', 236900, 4008, 11464, 92, 9000, 24564, 236900, 1145, 3674, 4819, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(271, 2025, '52', 245600, 4008, 11885, 92, 9000, 24985, 245600, 1145, 3809, 4954, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(272, 2025, '53', 254300, 4008, 12306, 92, 9000, 25406, 254300, 1145, 3944, 5089, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(273, 2025, '54', 263000, 4008, 12727, 92, 9000, 25827, 263000, 1145, 4079, 5224, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(274, 2025, '55', 273000, 4008, 13211, 92, 9000, 26311, 273000, 1145, 4234, 5379, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(275, 2025, '56', 283000, 4008, 13695, 92, 9000, 26795, 283000, 1145, 4389, 5534, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(276, 2025, '57', 293000, 4008, 14179, 92, 9000, 27279, 293000, 1145, 4544, 5689, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(277, 2025, '58', 303000, 4008, 14663, 92, 9000, 27763, 303000, 1145, 4700, 5845, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN'),
(278, 2025, '59', 313000, 4008, 15146, 92, 9000, 28246, 313000, 1145, 4855, 6000, '', '2025-09-16 13:29:37', '2025-09-16 13:29:38', 'ADMIN');

-- --------------------------------------------------------

--
-- 資料表結構 `sql_err`
--

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

-- --------------------------------------------------------

--
-- 資料表結構 `system_logs`
--

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

-- --------------------------------------------------------

--
-- 資料表結構 `system_news`
--

CREATE TABLE `system_news` (
  `news_id` int NOT NULL COMMENT '公告編號',
  `news_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告標題',
  `news_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告內容',
  `publish_date` datetime DEFAULT NULL COMMENT '發佈日期',
  `publish_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '發佈單位',
  `attachment_url` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人員'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系統公告表';

-- --------------------------------------------------------

--
-- 資料表結構 `time_slots`
--

CREATE TABLE `time_slots` (
  `slot_id` int NOT NULL COMMENT '時段ID',
  `slot_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人員'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='標準預約時段定義';

--
-- 傾印資料表的資料 `time_slots`
--

INSERT INTO `time_slots` (`slot_id`, `slot_name`, `start_time`, `end_time`, `update_date`, `create_date`, `updated_by`) VALUES
(1, 't8-9', '20:10:00', '21:00:00', '2025-09-18 17:21:55', '2025-09-18 17:21:55', '');

-- --------------------------------------------------------

--
-- 資料表結構 `vacation_payments`
--

CREATE TABLE `vacation_payments` (
  `vacation_id` int NOT NULL,
  `employee_id` int NOT NULL COMMENT '員工id',
  `year_start` date NOT NULL COMMENT '年度開始',
  `year_end` date NOT NULL COMMENT '年度結束',
  `total_hours` decimal(10,2) NOT NULL COMMENT '上課總時數',
  `vacation_days` decimal(10,2) NOT NULL COMMENT '特休日數',
  `monthly_salary` decimal(10,2) NOT NULL COMMENT '當月薪資',
  `seniority_years` decimal(10,2) NOT NULL COMMENT '年資',
  `jan_hour` decimal(10,2) DEFAULT '0.00' COMMENT '1月上課時數',
  `feb_hour` decimal(10,2) DEFAULT '0.00' COMMENT '2月上課時數',
  `mar_hour` decimal(10,2) DEFAULT '0.00' COMMENT '3月上課時數',
  `apr_hour` decimal(10,2) DEFAULT '0.00' COMMENT '4月上課時數',
  `may_hour` decimal(10,2) DEFAULT '0.00' COMMENT '5月上課時數',
  `jun_hour` decimal(10,2) DEFAULT '0.00' COMMENT '6月上課時數',
  `jul_hour` decimal(10,2) DEFAULT '0.00' COMMENT '7月上課時數',
  `aug_hour` decimal(10,2) DEFAULT '0.00' COMMENT '8月上課時數',
  `sep_hour` decimal(10,2) DEFAULT '0.00' COMMENT '9月上課時數',
  `oct_hour` decimal(10,2) DEFAULT '0.00' COMMENT '10月上課時數',
  `nov_hour` decimal(10,2) DEFAULT '0.00' COMMENT '11月上課時數',
  `dec_hour` decimal(10,2) DEFAULT '0.00' COMMENT '12月上課時數',
  `nov_salary` decimal(10,2) DEFAULT '0.00' COMMENT '11月薪資',
  `dec_salary` decimal(10,2) DEFAULT '0.00' COMMENT '去年12月薪資',
  `vacation_hours` decimal(10,2) NOT NULL COMMENT '特休時數',
  `hourly_rate` decimal(10,2) NOT NULL COMMENT '11月時薪',
  `vacation_payment` decimal(10,2) NOT NULL COMMENT '特休費',
  `hire_date` date DEFAULT NULL COMMENT '最近投保日',
  `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '建檔日期',
  `update_date` datetime DEFAULT NULL COMMENT '更新日期',
  `updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人員'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- 傾印資料表的資料 `vacation_payments`
--

INSERT INTO `vacation_payments` (`vacation_id`, `employee_id`, `year_start`, `year_end`, `total_hours`, `vacation_days`, `monthly_salary`, `seniority_years`, `jan_hour`, `feb_hour`, `mar_hour`, `apr_hour`, `may_hour`, `jun_hour`, `jul_hour`, `aug_hour`, `sep_hour`, `oct_hour`, `nov_hour`, `dec_hour`, `nov_salary`, `dec_salary`, `vacation_hours`, `hourly_rate`, `vacation_payment`, `hire_date`, `create_date`, `update_date`, `updated_by`) VALUES
(12, 1, '2024-12-01', '2025-11-30', 51.00, 14.00, 0.00, 3.33, 0.00, 0.00, 0.00, 0.00, 0.00, 27.00, 0.00, 0.00, 24.00, 0.00, 0.00, 0.00, 0.00, 0.00, 112.00, 0.00, 0.00, '2021-09-01', '2025-09-15 17:03:27', '2025-09-15 17:03:27', 'May'),
(13, 2, '2024-12-01', '2025-11-30', 34.00, 13.90, 0.00, 2.98, 0.00, 0.00, 0.00, 0.00, 0.00, 18.00, 0.00, 0.00, 16.00, 0.00, 0.00, 0.00, 0.00, 0.00, 111.20, 0.00, 0.00, '2022-01-08', '2025-09-15 17:03:27', '2025-09-15 17:03:27', 'May');

--
-- 已傾印資料表的索引
--

--
-- 資料表索引 `class_schedules`
--
ALTER TABLE `class_schedules`
  ADD PRIMARY KEY (`class_id`);

--
-- 資料表索引 `insurance`
--
ALTER TABLE `insurance`
  ADD PRIMARY KEY (`insurance_id`);

--
-- 資料表索引 `labor_insurance_levels`
--
ALTER TABLE `labor_insurance_levels`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uk_year_level` (`year`,`level_no`),
  ADD KEY `idx_year` (`year`),
  ADD KEY `idx_level_no` (`level_no`),
  ADD KEY `idx_insured_salary` (`insured_salary`);

--
-- 資料表索引 `log_use`
--
ALTER TABLE `log_use`
  ADD PRIMARY KEY (`rid`);

--
-- 資料表索引 `monthly_settlement`
--
ALTER TABLE `monthly_settlement`
  ADD PRIMARY KEY (`monthly_id`),
  ADD UNIQUE KEY `settlement_date_2` (`settlement_date`,`employee_id`) COMMENT '結算日期與員工ID的唯一約束',
  ADD KEY `settlement_date` (`settlement_date`) COMMENT '結算日期索引',
  ADD KEY `employee_id` (`employee_id`) COMMENT '員工ID索引';

--
-- 資料表索引 `salary_grades`
--
ALTER TABLE `salary_grades`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_year_salary` (`year`,`salary_amount`),
  ADD KEY `idx_year` (`year`),
  ADD KEY `idx_salary_amount` (`salary_amount`);

--
-- 資料表索引 `sql_err`
--
ALTER TABLE `sql_err`
  ADD PRIMARY KEY (`id`);

--
-- 資料表索引 `system_logs`
--
ALTER TABLE `system_logs`
  ADD PRIMARY KEY (`log_id`),
  ADD KEY `user_id` (`user_id`);

--
-- 資料表索引 `system_news`
--
ALTER TABLE `system_news`
  ADD PRIMARY KEY (`news_id`);

--
-- 資料表索引 `time_slots`
--
ALTER TABLE `time_slots`
  ADD PRIMARY KEY (`slot_id`);

--
-- 資料表索引 `vacation_payments`
--
ALTER TABLE `vacation_payments`
  ADD PRIMARY KEY (`vacation_id`);

--
-- 在傾印的資料表使用自動遞增(AUTO_INCREMENT)
--

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `class_schedules`
--
ALTER TABLE `class_schedules`
  MODIFY `class_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=213;

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `insurance`
--
ALTER TABLE `insurance`
  MODIFY `insurance_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `labor_insurance_levels`
--
ALTER TABLE `labor_insurance_levels`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `log_use`
--
ALTER TABLE `log_use`
  MODIFY `rid` int NOT NULL AUTO_INCREMENT;

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `monthly_settlement`
--
ALTER TABLE `monthly_settlement`
  MODIFY `monthly_id` int NOT NULL AUTO_INCREMENT COMMENT '主鍵ID', AUTO_INCREMENT=11;

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `salary_grades`
--
ALTER TABLE `salary_grades`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=279;

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `sql_err`
--
ALTER TABLE `sql_err`
  MODIFY `id` int NOT NULL AUTO_INCREMENT COMMENT '主鍵，自動遞增';

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `system_logs`
--
ALTER TABLE `system_logs`
  MODIFY `log_id` int NOT NULL AUTO_INCREMENT COMMENT '紀錄ID';

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `system_news`
--
ALTER TABLE `system_news`
  MODIFY `news_id` int NOT NULL AUTO_INCREMENT COMMENT '公告編號';

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `time_slots`
--
ALTER TABLE `time_slots`
  MODIFY `slot_id` int NOT NULL AUTO_INCREMENT COMMENT '時段ID', AUTO_INCREMENT=2;

--
-- 使用資料表自動遞增(AUTO_INCREMENT) `vacation_payments`
--
ALTER TABLE `vacation_payments`
  MODIFY `vacation_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- 已傾印資料表的限制式
--

--
-- 資料表的限制式 `system_logs`
--
ALTER TABLE `system_logs`
  ADD CONSTRAINT `system_logs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`);
COMMIT;

