/*
 Navicat Premium Data Transfer

 Source Server         : 本机
 Source Server Type    : MySQL
 Source Server Version : 80040 (8.0.40)
 Source Host           : localhost:3306
 Source Schema         : smms

 Target Server Type    : MySQL
 Target Server Version : 80040 (8.0.40)
 File Encoding         : 65001

 Date: 19/05/2025 10:59:22
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for smms_clazz
-- ----------------------------
DROP TABLE IF EXISTS `smms_clazz`;
CREATE TABLE `smms_clazz`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `clazz_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '班级名称',
  `clazz_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '班级编码',
  `clazzs` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '学级',
  `clazz_ads` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '学届',
  `user_id` bigint NOT NULL COMMENT '责任人',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id_fk_clazz`(`user_id` ASC) USING BTREE,
  CONSTRAINT `user_id_fk_clazz` FOREIGN KEY (`user_id`) REFERENCES `smms_user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '班级表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of smms_clazz
-- ----------------------------
INSERT INTO `smms_clazz` VALUES (1, '大数据23', 'big_date', '2023', '2026', 20, '', NULL, '管理员', '2025-05-16 13:55:32');
INSERT INTO `smms_clazz` VALUES (2, '人工智能23', 'rgzn', '2023', '2026', 20, '管理员', '2025-05-08 11:04:05', '管理员', '2025-05-16 13:55:24');
INSERT INTO `smms_clazz` VALUES (4, '计算机2306', 'jsj2306', '2023', '2026', 56, '管理员', '2025-05-16 16:10:40', '', NULL);

-- ----------------------------
-- Table structure for smms_credit_records
-- ----------------------------
DROP TABLE IF EXISTS `smms_credit_records`;
CREATE TABLE `smms_credit_records`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `credit` int NOT NULL COMMENT '增减学分',
  `credit_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '学分增减范围，1：本周学分；2：本科学分',
  `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '学分增减原因',
  `number` bigint NOT NULL COMMENT '学号',
  `student_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '学生姓名',
  `clazz_id` bigint NOT NULL COMMENT '班级Id',
  `clazz_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '班级名称',
  `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作人姓名',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 783 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '学分记录信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of smms_credit_records
-- ----------------------------
INSERT INTO `smms_credit_records` VALUES (782, -2, '2', '请假扣分', 1234567890111, '唐凯', 1, '大数据23', '刘老师', '刘老师', '2025-05-16 16:47:30');

-- ----------------------------
-- Table structure for smms_leave
-- ----------------------------
DROP TABLE IF EXISTS `smms_leave`;
CREATE TABLE `smms_leave`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `student_id` bigint NOT NULL COMMENT '学生id',
  `teacher_id` bigint NOT NULL COMMENT '审批教师id',
  `info` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '请假申请信息',
  `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '审批状态,0:等待审核；1：审核通过；2：审核不通过',
  `remark` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '审批回复',
  `apply_time` datetime NOT NULL COMMENT '申请时间',
  `approve_time` datetime NULL DEFAULT NULL COMMENT '审批时间',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '请假记录表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of smms_leave
-- ----------------------------
INSERT INTO `smms_leave` VALUES (4, 1, 4, '肚子不舒服', '1', '快去吧', '2025-05-16 16:45:57', '2025-05-18 11:40:45', '唐凯', '2025-05-16 16:45:57', '刘老师', '2025-05-18 11:40:45');
INSERT INTO `smms_leave` VALUES (5, 1, 4, '...', '2', '审核超时', '2025-05-16 21:03:02', '2025-05-18 11:54:51', '唐凯', '2025-05-16 21:03:02', 'admin', '2025-05-18 11:54:51');
INSERT INTO `smms_leave` VALUES (6, 8, 4, '家里有事', '2', '审核超时', '2025-05-17 10:19:55', '2025-05-18 11:54:51', '郭东剑', '2025-05-17 10:19:55', 'admin', '2025-05-18 11:54:51');

-- ----------------------------
-- Table structure for smms_role
-- ----------------------------
DROP TABLE IF EXISTS `smms_role`;
CREATE TABLE `smms_role`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名',
  `role_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色编码',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of smms_role
-- ----------------------------
INSERT INTO `smms_role` VALUES (1, '管理员', 'admin', 'admin', '2025-05-02 20:17:08', 'admin', '2025-05-02 20:17:17');
INSERT INTO `smms_role` VALUES (2, '老师', 'teacher', 'admin', '2025-05-02 20:17:12', 'admin', '2025-05-02 20:17:20');
INSERT INTO `smms_role` VALUES (3, '学生', 'student', 'admin', '2025-05-02 20:17:14', 'admin', '2025-05-02 20:17:22');

-- ----------------------------
-- Table structure for smms_student
-- ----------------------------
DROP TABLE IF EXISTS `smms_student`;
CREATE TABLE `smms_student`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `clazz_id` bigint NOT NULL COMMENT '班级',
  `user_id` bigint NOT NULL COMMENT '用户',
  `number` bigint NOT NULL COMMENT '学号',
  `birthday` date NULL DEFAULT NULL COMMENT '生日',
  `major` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '专业',
  `honor` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '个人荣誉',
  `score_now` int NOT NULL COMMENT '本周当前学分',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `number_idx`(`number` ASC) USING BTREE,
  INDEX `user_id_idx`(`user_id` ASC) USING BTREE,
  INDEX `clazz_id_idx`(`clazz_id` ASC) USING BTREE,
  CONSTRAINT `clazz_id_fk_student` FOREIGN KEY (`clazz_id`) REFERENCES `smms_clazz` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `user_id_fk_student` FOREIGN KEY (`user_id`) REFERENCES `smms_user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 87 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '学生信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of smms_student
-- ----------------------------
INSERT INTO `smms_student` VALUES (1, 1, 3, 1234567890111, '2004-01-28', '大数据', 'xxxx,xxxxxx,xxxxxx', 100, 'liyueheng', '2025-05-03 08:35:04', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (8, 1, 22, 2300700001, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (9, 1, 23, 2300700002, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (10, 1, 24, 2300700003, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (11, 1, 25, 2300700004, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (12, 1, 26, 2300700005, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (13, 1, 27, 2300700006, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (14, 1, 28, 2300700007, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (15, 1, 29, 2300700008, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (16, 1, 30, 2300700009, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (17, 1, 31, 2300700010, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (18, 1, 32, 2300700011, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (19, 1, 33, 2300700012, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (20, 1, 34, 2300700013, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (21, 1, 35, 2300700014, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (22, 1, 36, 2300700015, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (23, 1, 37, 2300700016, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (24, 1, 38, 2300700017, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (25, 1, 39, 2300700019, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (26, 1, 40, 2300700020, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (27, 1, 41, 2300700021, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (28, 1, 42, 2300700022, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (29, 1, 43, 2300700023, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (30, 1, 44, 2300700024, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (31, 1, 45, 2300700025, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (32, 1, 46, 2300700026, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (33, 1, 47, 2300700027, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (34, 1, 48, 2300700028, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (35, 1, 49, 2300700029, '2003-12-31', '大数据', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (36, 2, 50, 2300700030, '2003-12-31', '人工智能', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (37, 2, 51, 2300700031, '2003-12-31', '人工智能', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (38, 2, 52, 2300700032, '2003-12-31', '人工智能', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (39, 2, 53, 2300700033, '2003-12-31', '人工智能', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (40, 2, 54, 2300700034, '2003-12-31', '人工智能', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (41, 2, 55, 2300700035, '2003-12-31', '人工智能', '无', 100, 'admin', '2025-05-16 14:04:18', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (42, 4, 57, 2300600001, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (43, 4, 58, 2300600002, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (44, 4, 59, 2300600003, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (45, 4, 60, 2300600004, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (46, 4, 61, 2300600005, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (47, 4, 62, 2300600006, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (48, 4, 63, 2300600007, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (49, 4, 64, 2300600008, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (50, 4, 65, 2300600009, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (51, 4, 66, 2300600010, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (52, 4, 67, 2300600011, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (53, 4, 68, 2300600012, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (54, 4, 69, 2300600013, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (55, 4, 70, 2300600014, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (56, 4, 71, 2300600015, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (57, 4, 72, 2300600016, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (58, 4, 73, 2300600017, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (59, 4, 74, 2300600018, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (60, 4, 75, 2300600019, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (61, 4, 76, 2300600020, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (62, 4, 77, 2300600021, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (63, 4, 78, 2300600022, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (64, 4, 79, 2300600023, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (65, 4, 80, 2300600024, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (66, 4, 81, 2300600025, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (67, 4, 82, 2300600026, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (68, 4, 83, 2300600027, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (69, 4, 84, 2300600028, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (70, 4, 85, 2300600029, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (71, 4, 86, 2300600030, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (72, 4, 87, 2300600031, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (73, 4, 88, 2300600032, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (74, 4, 89, 2300600033, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (75, 4, 90, 2300600034, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (76, 4, 91, 2300600035, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (77, 4, 92, 2300600036, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (78, 4, 93, 2300600037, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (79, 4, 94, 2300600038, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');
INSERT INTO `smms_student` VALUES (80, 4, 95, 2300600039, '2023-12-31', '计算机应用技术', '无', 100, 'admin', '2025-05-16 16:15:58', 'admin', '2025-05-19 10:35:10');

-- ----------------------------
-- Table structure for smms_teacher
-- ----------------------------
DROP TABLE IF EXISTS `smms_teacher`;
CREATE TABLE `smms_teacher`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` bigint NOT NULL COMMENT '关联用户',
  `is_counselor` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '是否是辅导员，y:是；n:不是',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '教师表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of smms_teacher
-- ----------------------------
INSERT INTO `smms_teacher` VALUES (2, 16, 'n', 'admin', '2025-05-08 15:13:48', 'admin', '2025-05-16 13:56:17');
INSERT INTO `smms_teacher` VALUES (4, 20, 'y', 'admin', '2025-05-16 13:53:54', '', NULL);
INSERT INTO `smms_teacher` VALUES (6, 56, 'y', 'admin', '2025-05-16 16:09:40', 'admin', '2025-05-16 16:10:55');
INSERT INTO `smms_teacher` VALUES (8, 97, 'n', 'admin', '2025-05-16 16:44:14', 'admin', '2025-05-17 19:37:30');
INSERT INTO `smms_teacher` VALUES (9, 98, 'n', 'admin', '2025-05-16 16:45:17', '', NULL);

-- ----------------------------
-- Table structure for smms_teacher_clazz
-- ----------------------------
DROP TABLE IF EXISTS `smms_teacher_clazz`;
CREATE TABLE `smms_teacher_clazz`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `teacher_id` bigint NOT NULL COMMENT '教师ID',
  `clazz_id` bigint NOT NULL COMMENT '班级ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 36 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '教师与班级关联表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of smms_teacher_clazz
-- ----------------------------
INSERT INTO `smms_teacher_clazz` VALUES (15, 4, 1);
INSERT INTO `smms_teacher_clazz` VALUES (16, 4, 2);
INSERT INTO `smms_teacher_clazz` VALUES (20, 6, 4);
INSERT INTO `smms_teacher_clazz` VALUES (25, 9, 4);
INSERT INTO `smms_teacher_clazz` VALUES (34, 8, 1);
INSERT INTO `smms_teacher_clazz` VALUES (35, 8, 2);

-- ----------------------------
-- Table structure for smms_user
-- ----------------------------
DROP TABLE IF EXISTS `smms_user`;
CREATE TABLE `smms_user`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role_id` bigint NOT NULL COMMENT '角色',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名',
  `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '性别，0男，1女',
  `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
  `pass_word` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '111111' COMMENT '密码',
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系方式',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `user_name`(`user_name` ASC) USING BTREE,
  INDEX `role_id`(`role_id` ASC) USING BTREE,
  CONSTRAINT `role_id_fk_user` FOREIGN KEY (`role_id`) REFERENCES `smms_role` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 107 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of smms_user
-- ----------------------------
INSERT INTO `smms_user` VALUES (1, 1, '管理员', '0', 'admin', 'cfe7b0e818326739bf097484612b4031:9390cbdb19d4a1ebaead4f356681020f9da2be9e0e84950f7d49d4ba2d7d9b91', '15555555555', 'admin', '2025-05-03 08:35:24', 'admin', '2025-05-13 11:22:17');
INSERT INTO `smms_user` VALUES (3, 3, '唐凯', '0', 'tangkai', '6a1c49045467435049fff1590621a42f:7d110931fd764bad1d8d90a49928651b5a56ae5f4e6ffb135e5fa1dd4a6bb19f', '15555555555', 'admin', '2025-05-03 08:35:59', 'tangkai', '2025-05-13 11:14:43');
INSERT INTO `smms_user` VALUES (20, 2, '刘老师', '0', 'liuyang', '743a15ad821d2fc0639eb458f61ba8a7:dfd4383f0d5ec281903b568282ec89a3089190640091c135967c563621bd0561', '18888888888', 'admin', '2025-05-16 13:53:54', '', NULL);
INSERT INTO `smms_user` VALUES (22, 3, '郭东剑', '0', 'guodongjian', 'd59f6c929536c5e30fe86be2da317aa8:72df31033f19930c25c56cce0065d5577ff3690e93427abfb654395bbf31955c', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (23, 3, '李禹鑫', '0', 'liyuxin', '8e1f914eb2384fe906a077ee32a7e92b:c71b4875497a38995ed1c535f92f62c505059c078cf233dc854c41e40789b7c1', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (24, 3, '李志杰', '1', 'lizhijie', '39243ffd371bba6ef46a050639f3603c:0abcf0b53892ea41b93f4ebd9f913986857ecc0df4981db6d55cfdf7cdd3eeaa', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (25, 3, '林子雄', '0', 'linzixiong', 'd22a858665ead4d23728d01f09ff32b7:94cca2937b39741a70b64711b35f57c7c8a820e9e8ed7af442ef2732357a744d', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (26, 3, '周子淇', '0', 'zhouziqi', 'fb36f291877003fd175520ee93c87a34:b33c880f3d66436b07c15f2053a32c7d8d24427f132bf562b8bd44a147bab376', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (27, 3, '张翀', '0', 'zhangchong', '14a4deff64a2ccf42340091bf971383e:1156f80ad520c2b67e92ce34c480c468744d0de2e57e500324b2f5944b5b95b1', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (28, 3, '张继文', '0', 'zhangjiwen', '523be8b4ae161a066880e50bc4c6a84d:3444e77c303962e474da1907f714174a922de984672eafa130cdca3aa5a002d5', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (29, 3, '张姊妍', '1', 'zhangziyan', '9fe606b4a749b04424feb2149626450b:97f777f09d89863a0931e2bd644a1ad77abb9e002a1c49f6b4309a162e9eff4c', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (30, 3, '蒋松竹', '1', 'jiangsongzhu', 'b0b38dc1939d20a4f62b8bb0e5e1e0e0:b0d2a7ab69cf8fa5ec370e479e65ca41ead9367623bdc20e83ff4ec1f8b68d62', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (31, 3, '王建达', '0', 'wangjianda', '859f3073d0bd16a25733949cddde3d7e:4d9741e8139895f04995cd00353e288ae1df78d7aef12e0f630ba29c6597bd4e', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (32, 3, '艾君婷', '1', 'aijunting', 'afdaf4005ec756d3083b33cbff8c9df9:3e14e625a4413929d278e8af532f3ac754963323f27fdd3f717e5951beeed9be', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (33, 3, '李福升', '0', 'lifusheng', '4b45fc7d79bdb44486100907ba95ecfe:9539f321cbc1f61fb2cd2f7c688e456d19614b9ccf1a236470d2e21e7f746114', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (34, 3, '田昕', '0', 'tianxin', '1571d44daa98a74c26cca1312321c1e7:ffca75792708dfb8d18ba9ac29ea8dfbaedc59d89b83a408914a6eeee38a7818', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (35, 3, '李士龙', '0', 'lishilong', 'dcf94f48fa0a0f94504a47062f520233:575a88541546354de0e489a65a23dc9eeb1e7e58310ff3a0c435bf4769ef7809', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (36, 3, '尹红博', '0', 'yinhongbo', 'ae6a7c67a1894f952afce38fdda15d1a:7c36ed9aecbd299ef153cdfff5ccc96d1ff05a2ec1602575ddc2f79e3f8d3b04', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (37, 3, '阮诚', '0', 'ruancheng', '6c860af89b84992694c41d695ace3c45:2afaf1ab84a5fc1bf8d7f95d3c9fdf5a11bb3b0c361752d22cd0c066bb3cc4a6', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (38, 3, '马镜博', '0', 'majingbo', 'a74dab4e90009cf988fb4e048f3c494f:9687f1b96f54e932ca6e72799ab3bb9af7d300a58a18ec3247814f4c551cd005', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (39, 3, '刘运达', '0', 'liuyunda', 'eba1a67893fa285f4ddeaa82b9a9b9ef:df0761e0b0f1ab233c501c6532f98e906a236a5bf5cb50b87ab1edc89d39b1f7', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (40, 3, '冯思远', '0', 'fengsiyuan', '57b6871c2951617555becc492b5760e3:203a4a7ae50e311be8b36ff1cdce24b0cbf009b86402adafa25b9ad484ea75fc', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (41, 3, '刘静仪', '1', 'liujingyi', 'ff8a6e861341a96bc8297005cb456267:d10578ba74bd0de4920b0894c0107af0392a25c800aa0cac7cab89b3d9e4c4b6', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (42, 3, '冯小刚', '0', 'fengxiaogang', 'd7ec76db1ad27c5e379a9700ed947a30:3ef8e3723d709577d96f26da6b304e54927118ae241ddf565f465f4f7b57fc5b', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (43, 3, '宿云捷', '1', 'suyunjie', '52831eb8dba526c5cb2fe9d169e3cabd:c3e167d0b9c9f10c73886802a99e190856b89bb8af54700a97b119acb60ee174', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (44, 3, '屈美鑫', '1', 'qumeixin', 'e15354ad82261bef0ca27b3237d30188:cf1522cd1931091e7e4de0b8e55b01de32684e8f46c925f353c3d1932a9f7652', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (45, 3, '姚博原', '1', 'yaoboyuan', '3391b168c838d45264939fdf5e46ce58:00ecfe489ee2af643aaec24db66d3d9cc43f526b116a84e32e0225048ae8958f', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (46, 3, '李名赫', '0', 'liminghe', '5a9f6a0ba5bf217726a22549c9c47a89:afc80d3e0012983508fa23c78f5072c79e30e0caa98c99935f4561308569d6eb', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (47, 3, '刘嘉成', '0', 'liujiacheng', '11abe255d22b905a11a0a429583b23de:a8b5e7cffb0109f740a1af9f9521c82573350b6169915306c308bed17c5e309e', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (48, 3, '池雨桐', '1', 'chiyutong', 'b15f668e72a051bbffc8847b2ec7bb12:9bfeadcf0ffc86d8b733eb63a2bd3aa176745f3476db2c5db3665eb2e4ad539c', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (49, 3, '陈佳怡', '1', 'chenjiayi', 'de0fb97838114e3036b99bff7df98181:948a93199a0c700e5f122104caa0e49c92373190316924027a5c27c359b40eb3', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (50, 3, '孙铭远', '0', 'sunmingyuan', 'ae349bb30cf83a9522ffcbd1d9324ebf:852c59efc42184b42ba6ccde0c51c1219f768d8cb3dfa21fea56a149c8121774', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (51, 3, '王天磊', '0', 'wangtianlei', '4079dcfb23a07ef9f7445b37d60fc911:4099c184b754efb421bdf4480c01e3147e905066b149ea1ccb4b02fce16c2430', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (52, 3, '孙恺', '0', 'sunkai', 'e8a03ba378ef09528b31d747ee707d28:23da071d3956c0d005f1b96b2d87e47c326a3bb6abc1f2b127a2d2ccdd04f34d', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (53, 3, '谭力夫', '0', 'tanlifu', '24bf96cdcfd0d129215aa34337a59fbe:28e26301d0fe4e9d7dc6c8342b968bceb57c19b15a00d5723a1aab5636deabdd', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (54, 3, '杨朔一', '0', 'yangshuoyi', 'd48fb36a8c343de9256cf00a8105e282:c65a93d3a5379e66e0aeb7fd45d7d32227227ef17942338acafdffb457f0be81', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (55, 3, '李金宇', '0', 'lijinyu', '23a590efb3850f70b0da0ccc2d63fa37:7e5c880c8a8174a709002010cf43fdb795847a0d31a5e32d7e8e03aa2a4ebdba', '18888888888', 'admin', '2025-05-16 14:04:18', '', NULL);
INSERT INTO `smms_user` VALUES (56, 2, '宿老师', '1', 'sumingyuan', '5bc337b4df16977a05d3ce619699af2e:ffb1ec00af4a981f5fe544cd44dab1e98939d7d6135f8f19182ad97e1b587117', '18888888888', 'admin', '2025-05-16 16:09:40', 'sumingyuan', '2025-05-16 16:10:55');
INSERT INTO `smms_user` VALUES (57, 3, '邹佳洋', '0', 'zoujiayang', 'c3ff11e2819faef47c677480f4f0f620:7e376b80165dea42437e3712ab034e018d3f67527be1c000f10e24fbc44242bc', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (58, 3, '周靖沅', '0', 'zhoujingyuan', '604d9274db127aee4aaed1a1ed073c89:8d9eb5ec3d4dacbe99f532fc77a846e51ccf795f64ff30585fab16dd6525c60e', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (59, 3, '郑健', '0', 'zhengjian', '7c209c8e622f46eaa8805ba90be90353:056b8b17d7b4025ce1edb738acadc3fa5b5fb584d47bcbe4295e5769547f5de1', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (60, 3, '赵可鑫', '1', 'zhaokexin', '4f8c1cc9129efaee5d9b1d9b3877699c:7dd52fbd40bc9fec060219e55ebc7b3cd833f3edb4273a61affbe2306c721e49', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (61, 3, '张展鹏', '0', 'zhangzhanpeng', '0b23c37974e78597d498490d6c6a7216:55f4262e1c22eb5326fefa4b0a18769a5d6a154e118f14636fd38ab454dd24aa', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (62, 3, '张馨月', '1', 'zhangxinyue', '95004a8ba87eadbc17a88f230f838538:3c4812731caacd0ea2f5e36a9888c37528693e903e8011eaa1a897839707b006', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (63, 3, '张思宇', '1', 'zhangsiyu', '7fb435bc5a38d9dc54a605c8f8c7d24c:2e0b8793a86d55ae3d67989310858899e57ee68dfaf42f809e5816232dd6d90d', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (64, 3, '张凯强', '0', 'zhangkaiqiang', 'aa22d8692c1aba7d22e71bfb9501c04f:e7a239c03d99f04da490c8232e35bb114fcfd42d62d04aeed9cf3b5c015e8c51', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (65, 3, '张嘉琦', '0', 'zhangjiaqi', '6dab00f31c120e82cfab3e6f3539f655:abeebc6976425821be19d67ac875962ddc6db66a14cc8294b722522c3db15827', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (66, 3, '张浩燃', '0', 'zhanghaoran', '3e2a7eb384a87498624061442cd8c884:2553b1b29dd5bdb959c2310355af892d964410a731df291f8656c512273627ee', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (67, 3, '焉潆丹', '1', 'yanyingdan', 'fd5220913243a69282aa20ba33abef9a:b9b3831f9bf176a0e1c3083837739b7e61c3251389850b1dfc24c1b65fb07120', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (68, 3, '薛博雯', '1', 'xuebowen', 'a16221293bf88dc806d8772a05fe467a:eb26d5610b99908db911382a6ef2dcf5af92fc584caaff6334e6a69d9eeaa461', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (69, 3, '魏洛洋', '0', 'weiluoyang', 'f71a6eb3ff82437595ddf67e320eb237:e574165fa2449f530fe9c496d989c8a18d6ae226ffd3f2c8d6a5a1986ccfbc47', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (70, 3, '王欣宇', '0', 'wangxinyu', 'f1a87acaad56be1cb2243f7543532252:8283bfd17238a6844ba50991a38adccdd2f1985335c93bed0393d72f387efe80', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (71, 3, '王梁玉', '1', 'wangliangyu', '4675460143c6147686b6963e578315d0:391a509655e79afe79a7d6049b1cd83bac7c25cf9abeef23eca15432a8602526', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (72, 3, '王凯', '0', 'wangkai', '11a2c5231d7bd8aa02fcc7bd9c00b360:b976af1f7c2e41b25ea7390f102af196a366f7cf5c1e40c1c7f021f700dc0842', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (73, 3, '王泓博', '0', 'wanghongbo', '31bd911b5c6639436ef8ee9d96bda15e:2e0ab547aad2224b98338a60a2f0a08e44ccd237f3ccc5d024e19f13145f3e27', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (74, 3, '王博', '0', 'wangbo', '73c1178ace89d42d53d6248ddd32d802:1459d8b676e4d58410180f42daccdc3732313ec58b5c6be95d6e3ee54c562b46', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (75, 3, '万玺峻', '0', 'wanxijun', '8f7beaaf9f5f61da88274588c1bfcaaf:3d6b2f68c1d535836e84d1cbd1672d1dd9c9ed882432c8039b0a5d2a7b4018d1', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (76, 3, '孙嘉远', '0', 'sunjiayuan', '47b012561c29c2f8973d0febbba29e32:a2a07feea4bb78e2541acd8a797f3bb69a4141399d1a10f5cbf790335d666b7a', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (77, 3, '孙涵', '0', 'sunhan', '9b4e8480b6fa3a8903fbafde552591d8:72294af66d458a3e49b8aacb026a9ab7c9c8624f8da79436485e5e810b776992', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (78, 3, '沈枫轩', '0', 'shenfengxuan', '889728498a827bedb575741c78f629e1:fa0129c6c66107b895272fd6fb12a28cdef65bc84b719eb83bb08757c97ecdce', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (79, 3, '邱建东', '0', 'qiujiandong', 'f8b3c2d2ce1635e2be0d06816264492a:589b3dec930685dc5fddde7c8c173066a423254c08863a9cf3bdc50b6bb9ac1f', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (80, 3, '罗帅', '0', 'luoshuai', 'c5b0d692f2b73aa997588b07e8342d42:f31bc6ea3e747c72f5eaf0fa6d3066c02b18b9c1f12de7987750c11a9a0ccd1d', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (81, 3, '刘奕萌', '1', 'liuyimeng', '811d09fa34b0af018d09e06e8608b424:27c1210988d66d9ec8a5d7a4117a4cf892f2e33d61734e8269dc1ee53eedafce', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (82, 3, '刘美煊', '1', 'liumeixuan', '869dc56e8c264465e41985bd73836530:f1724ba1623f6b589f8f611c374f2b874dcec3bc04903b131e73a10345ab6766', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (83, 3, '刘珈源', '0', 'liujiayuan', '2f3f3a092073b10a604dbe782329ebe3:f717d58118f5c4845fa98d9aa88a412ec2da63c68e2831ad41c2732863a305ca', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (84, 3, '刘佳铜', '0', 'liujiatong', '688bdfb24ddf477796da8840cfb4f172:7dcc04ac9e9132f5f006f30f09bce98aa010444c066d66d57566a6dc99c796e5', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (85, 3, '李卓睿', '0', 'lizhuorui', 'b5a659f34e13fbeac743e46e194999d5:2ab70e2549cee7ec1287196d07befd6d6b977b5be6f94940630acdf42897fa58', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (86, 3, '李鹏达', '0', 'lipengda', '8f06c168537a93d374f875a38e1ab3b7:dc4c599f0ff83822b52916f1f0cf4d855fe6118a0172c6f7918b5fe25e12b2c2', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (87, 3, '李明', '0', 'liming', '5b62d0609be52d679e707c20a08a0773:91f007652196c2fde8dfc8eee80eeda53a5c95784bb0e0a13dcba1d57e8fc0c8', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (88, 3, '李春浩', '0', 'lichunhao', 'bb9cc818641d65c35c7b138dc00cf7bd:efff0fbe3d520a5e3d607b6ed477a947f35fdbb05000aec3fffca00290ecfa61', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (89, 3, '雷彤', '1', 'leitong', 'c7726cef32678606fc6d33d2cc6f47a8:4e00545e0c92f1826503a59f08c4c761799f0c607c1beaa74582078c4162fa03', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (90, 3, '姜雅玲', '1', 'jiangyaling', '5a8af235644c535fdf89881b5b98e1d7:e6e85aad047f58a1456dc283eb8e47f80dadd2dc355033fe5c0fd5c9b11b0792', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (91, 3, '胡育铭', '0', 'huyuming', '1d82c9461f34df6719429b2a3650ba28:28e3bbce538e701d36b461017a2472b7b8e3e3b090bbf44ba7ad6a87bd0e19c5', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (92, 3, '高誉荧', '1', 'gaoyuying', '00011325798f858e3076cbbe5fca709f:14ab098ac77bfcfec3fd82de5510a554dd1180e72c794fa9a88a7f1363db5fdb', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (93, 3, '陈浩铮', '0', 'chenhaozheng', 'ac7203e5e0e965b711bf7801ad1e19f3:286939a8e7d9cfe62f605729ce8432595fee17ebb131fd2614490fda3dd7dc8b', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (94, 3, '卞胤淇', '0', 'bianyinqi', '1371e1bbc18979d2a21cafdcf4bee0ea:3381ec3fa49e5c4f47fec579c0064f5050c7aaa7ccb468f8f3a30f4ddbb745c3', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (95, 3, '毕洪博', '0', 'bihongbo', '4ae00365c2983b48566b9317e799ca9b:36344f0b49c7741d821b6d138e6af8c8fe7dc4fafc05ab9ed35df8e938997da9', '18888888888', 'admin', '2025-05-16 16:15:58', '', NULL);
INSERT INTO `smms_user` VALUES (97, 2, '李月恒', '0', 'liyueheng', '43def75240375976f0f0174a6e7f47ea:a33f22309f1414fecbb631b66cadcbe87f818c04aba85b78ae3ddad590dbbc6b', '18888888888', 'admin', '2025-05-16 16:44:14', 'liyueheng', '2025-05-17 19:37:30');
INSERT INTO `smms_user` VALUES (98, 2, '康师傅', '0', 'kang', 'b36e0884cd9875170ddf91782024b069:a4c65f72a0febe8884edc219c42aec58f70a4f3a04e58425f12c579bf409a615', '18888888888', 'admin', '2025-05-16 16:45:17', '', NULL);

-- ----------------------------
-- Table structure for smms_week_credit_record
-- ----------------------------
DROP TABLE IF EXISTS `smms_week_credit_record`;
CREATE TABLE `smms_week_credit_record`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `student_id` bigint NOT NULL COMMENT '学生ID',
  `student_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '学生姓名',
  `credit` int NOT NULL COMMENT '学分',
  `adjust` datetime NOT NULL COMMENT '核算时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 76 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '周学分记录信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of smms_week_credit_record
-- ----------------------------
INSERT INTO `smms_week_credit_record` VALUES (2, 42, '邹佳洋', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (3, 43, '周靖沅', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (4, 44, '郑健', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (5, 45, '赵可鑫', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (6, 46, '张展鹏', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (7, 47, '张馨月', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (8, 48, '张思宇', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (9, 49, '张凯强', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (10, 50, '张嘉琦', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (11, 51, '张浩燃', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (12, 52, '焉潆丹', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (13, 53, '薛博雯', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (14, 54, '魏洛洋', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (15, 55, '王欣宇', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (16, 56, '王梁玉', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (17, 57, '王凯', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (18, 58, '王泓博', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (19, 59, '王博', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (20, 60, '万玺峻', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (21, 61, '孙嘉远', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (22, 62, '孙涵', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (23, 63, '沈枫轩', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (24, 64, '邱建东', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (25, 65, '罗帅', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (26, 66, '刘奕萌', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (27, 67, '刘美煊', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (28, 68, '刘珈源', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (29, 69, '刘佳铜', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (30, 70, '李卓睿', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (31, 71, '李鹏达', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (32, 72, '李明', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (33, 73, '李春浩', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (34, 74, '雷彤', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (35, 75, '姜雅玲', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (36, 76, '胡育铭', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (37, 77, '高誉荧', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (38, 78, '陈浩铮', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (39, 79, '卞胤淇', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (40, 80, '毕洪博', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (41, 8, '郭东剑', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (42, 9, '李禹鑫', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (43, 10, '李志杰', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (44, 11, '林子雄', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (45, 12, '周子淇', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (46, 13, '张翀', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (47, 14, '张继文', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (48, 15, '张姊妍', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (49, 16, '蒋松竹', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (50, 17, '王建达', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (51, 18, '艾君婷', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (52, 19, '李福升', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (53, 20, '田昕', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (54, 21, '李士龙', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (55, 22, '尹红博', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (56, 23, '阮诚', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (57, 24, '马镜博', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (58, 25, '刘运达', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (59, 26, '冯思远', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (60, 27, '刘静仪', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (61, 28, '冯小刚', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (62, 29, '宿云捷', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (63, 30, '屈美鑫', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (64, 31, '姚博原', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (65, 32, '李名赫', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (66, 33, '刘嘉成', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (67, 34, '池雨桐', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (68, 35, '陈佳怡', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (69, 36, '孙铭远', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (70, 37, '王天磊', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (71, 38, '孙恺', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (72, 39, '谭力夫', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (73, 40, '杨朔一', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (74, 41, '李金宇', 100, '2025-05-19 10:35:10');
INSERT INTO `smms_week_credit_record` VALUES (75, 1, '唐凯', 90, '2025-05-19 10:35:10');

-- ----------------------------
-- Procedure structure for smms_drop
-- ----------------------------
DROP PROCEDURE IF EXISTS `smms_drop`;
delimiter ;;
CREATE PROCEDURE `smms_drop`()
BEGIN
    DECLARE v_cnt INT;
    DECLARE v_finished INT DEFAULT FALSE;
    DECLARE v_id BIGINT;

    -- 声明游标
    DECLARE myCursor CURSOR FOR 
        SELECT c.id FROM smms_clazz c WHERE clazz_ads + 2 < YEAR(CURDATE());

    -- 处理游标读取完毕的情况
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_finished = TRUE;

    -- 查询符合条件的数据条数
    SELECT COUNT(1) INTO v_cnt FROM smms_clazz c WHERE clazz_ads + 4 < YEAR(CURDATE());

    IF v_cnt > 0 THEN
        OPEN myCursor;

        read_loop: LOOP
            FETCH myCursor INTO v_id;
            IF v_finished THEN 
                LEAVE read_loop;
            END IF;

            -- 业务处理逻辑
						DELETE FROM smms_user WHERE id IN (SELECT user_id FROM smms_student WHERE clazz_id = v_id);
						DELETE FROM smms_student WHERE clazz_id = v_id;
						DELETE FROM smms_teacher_clazz WHERE clazz_id = v_id;
						DELETE FROM smms_clazz WHERE id = v_id;
        END LOOP;

        CLOSE myCursor;
    END IF;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for smms_leave_status_change
-- ----------------------------
DROP PROCEDURE IF EXISTS `smms_leave_status_change`;
delimiter ;;
CREATE PROCEDURE `smms_leave_status_change`()
BEGIN
    DECLARE v_cnt INT;
    DECLARE v_finished INT DEFAULT FALSE;
    DECLARE v_id BIGINT;

    -- 声明游标
    DECLARE myCursor CURSOR FOR 
        SELECT l.id FROM smms_leave l WHERE ADDDATE(l.apply_time, INTERVAL 1 DAY) < SYSDATE();

    -- 处理游标读取完毕的情况
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_finished = TRUE;

    -- 查询符合条件的数据条数
    SELECT COUNT(1) INTO v_cnt FROM smms_leave l WHERE l.apply_time < SYSDATE();

    IF v_cnt > 0 THEN
        OPEN myCursor;

        read_loop: LOOP
            FETCH myCursor INTO v_id;
            IF v_finished THEN 
                LEAVE read_loop;
            END IF;

            -- 业务处理逻辑
            UPDATE smms_leave 
            SET status = '2',-- 表示“已过期自动审批”
								remark = '审核超时',
                approve_time = SYSDATE(),
                update_by = 'admin',
                update_time = SYSDATE()
            WHERE id = v_id AND status = '0';
        END LOOP;

        CLOSE myCursor;
    END IF;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for smms_week_credit_change
-- ----------------------------
DROP PROCEDURE IF EXISTS `smms_week_credit_change`;
delimiter ;;
CREATE PROCEDURE `smms_week_credit_change`()
BEGIN
		DECLARE v_cnt INT;
    DECLARE v_finished INT DEFAULT FALSE;
    DECLARE v_id BIGINT;

    -- 声明游标
    DECLARE myCursor CURSOR FOR 
        SELECT s.id FROM smms_student s;

    -- 处理游标读取完毕的情况
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_finished = TRUE;

    -- 查询符合条件的数据条数
    SELECT COUNT(1) INTO v_cnt FROM smms_student s;

    IF v_cnt > 0 THEN
        OPEN myCursor;

        read_loop: LOOP
            FETCH myCursor INTO v_id;
            IF v_finished THEN 
                LEAVE read_loop;
            END IF;

            -- 业务处理逻辑
            INSERT INTO smms_week_credit_record (student_id,student_name,credit,adjust)
						SELECT s.id,u.name,s.score_now,SYSDATE() FROM smms_student s ,smms_user u WHERE s.user_id = u.id AND s.id = v_id;
						UPDATE smms_student SET score_now = 100,update_by = 'admin',update_time = SYSDATE() WHERE id = v_id;
        END LOOP;

        CLOSE myCursor;
    END IF;
END
;;
delimiter ;

-- ----------------------------
-- Event structure for smms_drop
-- ----------------------------
DROP EVENT IF EXISTS `smms_drop`;
delimiter ;;
CREATE EVENT `smms_drop`
ON SCHEDULE
EVERY '1' YEAR STARTS '2025-01-01 00:00:00'
DO CALL smms_drop
;;
delimiter ;

-- ----------------------------
-- Event structure for smms_leave_status_change
-- ----------------------------
DROP EVENT IF EXISTS `smms_leave_status_change`;
delimiter ;;
CREATE EVENT `smms_leave_status_change`
ON SCHEDULE
EVERY '1' DAY STARTS '2025-05-06 00:00:00'
DO CALL smms_leave_status_change
;;
delimiter ;

-- ----------------------------
-- Event structure for smms_week_credit_change
-- ----------------------------
DROP EVENT IF EXISTS `smms_week_credit_change`;
delimiter ;;
CREATE EVENT `smms_week_credit_change`
ON SCHEDULE
EVERY '1' WEEK STARTS '2025-05-28 00:00:00'
DO CALL smms_week_credit_change
;;
delimiter ;

SET FOREIGN_KEY_CHECKS = 1;
