+
\ No newline at end of file
diff --git a/yyq/front/page/grade/list.html b/yyq/front/page/grade/list.html
new file mode 100644
index 0000000..c7cbfa4
--- /dev/null
+++ b/yyq/front/page/grade/list.html
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/grade/update.html b/yyq/front/page/grade/update.html
new file mode 100644
index 0000000..39565cf
--- /dev/null
+++ b/yyq/front/page/grade/update.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/notice/add.html b/yyq/front/page/notice/add.html
new file mode 100644
index 0000000..f23dc71
--- /dev/null
+++ b/yyq/front/page/notice/add.html
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/notice/list.html b/yyq/front/page/notice/list.html
new file mode 100644
index 0000000..9d87e47
--- /dev/null
+++ b/yyq/front/page/notice/list.html
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/notice/update.html b/yyq/front/page/notice/update.html
new file mode 100644
index 0000000..7f45771
--- /dev/null
+++ b/yyq/front/page/notice/update.html
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/org/add.html b/yyq/front/page/org/add.html
new file mode 100644
index 0000000..7e58062
--- /dev/null
+++ b/yyq/front/page/org/add.html
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/org/list.html b/yyq/front/page/org/list.html
new file mode 100644
index 0000000..3c7b12e
--- /dev/null
+++ b/yyq/front/page/org/list.html
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/org/update.html b/yyq/front/page/org/update.html
new file mode 100644
index 0000000..7883cf6
--- /dev/null
+++ b/yyq/front/page/org/update.html
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/repair/list.html b/yyq/front/page/repair/list.html
new file mode 100644
index 0000000..ec75e8b
--- /dev/null
+++ b/yyq/front/page/repair/list.html
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/selection/add.html b/yyq/front/page/selection/add.html
new file mode 100644
index 0000000..2b8b4e0
--- /dev/null
+++ b/yyq/front/page/selection/add.html
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/selection/distribute.html b/yyq/front/page/selection/distribute.html
new file mode 100644
index 0000000..4dac8c5
--- /dev/null
+++ b/yyq/front/page/selection/distribute.html
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/selection/list.html b/yyq/front/page/selection/list.html
new file mode 100644
index 0000000..70084bc
--- /dev/null
+++ b/yyq/front/page/selection/list.html
@@ -0,0 +1,208 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/front/page/selection/update.html b/yyq/front/page/selection/update.html
new file mode 100644
index 0000000..7dc4e2a
--- /dev/null
+++ b/yyq/front/page/selection/update.html
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/framework/exception/MyException.java b/yyq/src/main/java/com/yanzhen/framework/exception/MyException.java
new file mode 100644
index 0000000..b7d4f92
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/framework/exception/MyException.java
@@ -0,0 +1,15 @@
+package com.yanzhen.framework.exception;
+
+// 定义一个名为MyException的类,继承自RuntimeException
+public class MyException extends RuntimeException {
+
+ // 无参构造函数
+ public MyException() {
+ }
+
+ // 带一个字符串参数的构造函数
+ public MyException(String message) {
+ // 调用父类的构造函数,并传递消息参数
+ super(message);
+ }
+}
diff --git a/yyq/src/main/java/com/yanzhen/framework/jwt/JWTUtil.java b/yyq/src/main/java/com/yanzhen/framework/jwt/JWTUtil.java
new file mode 100644
index 0000000..2feed32
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/framework/jwt/JWTUtil.java
@@ -0,0 +1,237 @@
+package com.yanzhen.framework.jwt;
+
+import com.yanzhen.entity.Student; // 导入Student类
+import com.yanzhen.entity.User; // 导入User类
+import com.yanzhen.framework.exception.MyException; // 导入自定义异常类MyException
+import io.jsonwebtoken.*; // 导入JWT相关类
+import org.springframework.util.StringUtils; // 导入Spring框架的StringUtils工具类
+
+import java.util.Date; // 导入Date类
+import java.util.HashMap; // 导入HashMap类
+import java.util.Map; // 导入Map接口
+import java.util.UUID; // 导入UUID类
+
+//jwt的工具类
+public class JWTUtil {
+
+ // 定义静态变量token,用于存储token字符串
+ public static String token = "token";
+ //秘钥
+ // 定义静态变量jwt_secret,用于存储JWT签名的密钥
+ public static String jwt_secret="yanzhen@cms@cc596183363.";
+ //过期时长
+ // 定义静态变量jwt_expr,用于设置JWT的过期时间(单位:毫秒)
+ public static long jwt_expr = 3600*24*1000;
+
+ //1、生成token
+ // 定义静态方法sign,用于生成用户类型的JWT
+ public static String sign(User user){
+
+ //1、指定签名的时候使用的签名算法
+ // 使用HS256算法进行签名
+ SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
+ //2、生成签发时间
+ // 获取当前时间的毫秒数
+ long nowMillis = System.currentTimeMillis();
+ // 将毫秒数转换为Date对象
+ Date date = new Date(nowMillis);
+
+ //3、创建playLoad的私有声明
+ // 创建一个Map对象,用于存储JWT的负载信息
+ Map claims = new HashMap<>();
+ // 将用户的ID添加到负载中
+ claims.put("id",user.getId());
+ // 将用户名添加到负载中
+ claims.put("userName",user.getUserName());
+ // 添加类型信息到负载中
+ claims.put("type","USER");
+ //4、生成签发人
+ // 将用户名作为JWT的签发人
+ String subject = user.getUserName();
+
+ // 创建JwtBuilder对象,用于构建JWT
+ JwtBuilder builder = Jwts.builder()
+ // 设置JWT的负载信息
+ .setClaims(claims)
+ // 设置JWT的唯一标识符
+ .setId(UUID.randomUUID().toString())
+ // 设置JWT的签发时间
+ .setIssuedAt(date)
+ // 设置JWT的签发人
+ .setSubject(subject)
+ // 使用指定的签名算法和密钥对JWT进行签名
+ .signWith(signatureAlgorithm,jwt_secret);
+ //设置过期时间
+ // 计算JWT的过期时间
+ Date exprDate = new Date(nowMillis + jwt_expr);
+ // 设置JWT的过期时间
+ builder.setExpiration(exprDate);
+ // 生成并返回JWT字符串
+ return builder.compact();
+ }
+
+
+ //1、生成token
+ // 定义静态方法signForStudent,用于生成学生类型的JWT
+ public static String signForStudent(Student student){
+
+ //1、指定签名的时候使用的签名算法
+ // 使用HS256算法进行签名
+ SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
+ //2、生成签发时间
+ // 获取当前时间的毫秒数
+ long nowMillis = System.currentTimeMillis();
+ // 将毫秒数转换为Date对象
+ Date date = new Date(nowMillis);
+
+ //3、创建playLoad的私有声明
+ // 创建一个Map对象,用于存储JWT的负载信息
+ Map claims = new HashMap<>();
+ // 将学生的ID添加到负载中
+ claims.put("id",student.getId());
+ // 将学号添加到负载中
+ claims.put("stuNo",student.getStuNo());
+ // 添加类型信息到负载中
+ claims.put("type","STUDENT");
+ //4、生成签发人
+ // 将学号作为JWT的签发人
+ String subject = student.getStuNo();
+ // 创建JwtBuilder对象,用于构建JWT
+ JwtBuilder builder = Jwts.builder()
+ // 设置JWT的负载信息
+ .setClaims(claims)
+ // 设置JWT的唯一标识符
+ .setId(UUID.randomUUID().toString())
+ // 设置JWT的签发时间
+ .setIssuedAt(date)
+ // 设置JWT的签发人
+ .setSubject(subject)
+ // 使用指定的签名算法和密钥对JWT进行签名
+ .signWith(signatureAlgorithm,jwt_secret);
+ //设置过期时间
+ // 计算JWT的过期时间
+ Date exprDate = new Date(nowMillis + jwt_expr);
+ // 设置JWT的过期时间
+ builder.setExpiration(exprDate);
+ // 生成并返回JWT字符串
+ return builder.compact();
+ }
+
+ //2、验证token
+ // 定义静态方法verify,用于验证JWT是否合法
+ public static boolean verify(String token){
+ try {
+ // 如果token为空,则返回false
+ if(StringUtils.isEmpty(token)){
+ return false;
+ }
+ // 解析JWT并验证签名
+ Jwts.parser().setSigningKey(jwt_secret).parseClaimsJws(token).getBody();
+ // 如果解析成功且签名合法,则返回true
+ return true;
+ // 如果解析或验证过程中发生异常,则捕获异常
+ } catch (Exception e) {
+ // 打印异常堆栈信息
+ e.printStackTrace();
+ // 返回false表示验证失败
+ return false;
+ }
+ }
+
+ // 定义静态方法getType,用于获取JWT的类型信息
+ public static String getType(String token){
+ try {
+ // 如果token为空,则抛出自定义异常
+ if(StringUtils.isEmpty(token)){
+ throw new MyException("token不能为空");
+ }
+ // 如果token验证通过,则解析JWT并获取类型信息
+ if(verify(token)){
+ // 解析JWT并获取负载信息
+ Claims claims = Jwts.parser().setSigningKey(jwt_secret).parseClaimsJws(token).getBody();
+ // 返回类型信息
+ return claims.get("type")+"";
+ }else{
+ // 如果token验证失败,则抛出自定义异常
+ throw new MyException("超时或不合法token");
+ }
+ // 如果解析或验证过程中发生异常,则捕获异常
+ } catch (Exception e) {
+ // 抛出自定义异常
+ throw new MyException("超时或不合法token");
+ }
+ }
+
+ //3、获取用户信息
+ // 定义静态方法getUser,用于从JWT中提取用户信息
+ public static User getUser(String token){
+ try {
+ // 如果token为空,则抛出自定义异常
+ if(StringUtils.isEmpty(token)){
+ throw new MyException("token不能为空");
+ }
+ // 如果token验证通过,则解析JWT并获取用户信息
+ if(verify(token)){
+ // 解析JWT并获取负载信息
+ Claims claims = Jwts.parser().setSigningKey(jwt_secret).parseClaimsJws(token).getBody();
+ // 创建User对象
+ User user = new User();
+ // 从负载中提取用户ID并设置到User对象中
+ user.setId(Integer.parseInt(claims.get("id")+""));
+ // 从负载中提取用户名并设置到User对象中
+ user.setUserName(claims.get("userName")+"");
+ // 返回User对象
+ return user;
+ }else{
+ // 如果token验证失败,则抛出自定义异常
+ throw new MyException("超时或不合法token");
+ }
+ // 如果解析或验证过程中发生异常,则捕获异常
+ } catch (Exception e) {
+ // 抛出自定义异常
+ throw new MyException("超时或不合法token");
+ }
+ }
+
+ // 定义静态方法getStudent,用于从JWT中提取学生信息
+ public static Student getStudent(String token){
+ try {
+ // 如果token为空,则抛出自定义异常
+ if(StringUtils.isEmpty(token)){
+ throw new MyException("token不能为空");
+ }
+ // 如果token验证通过,则解析JWT并获取学生信息
+ if(verify(token)){
+ // 解析JWT并获取负载信息
+ Claims claims = Jwts.parser().setSigningKey(jwt_secret).parseClaimsJws(token).getBody();
+ // 创建Student对象
+ Student student = new Student();
+ // 从负载中提取学生ID并设置到Student对象中
+ student.setId(Integer.parseInt(claims.get("id")+""));
+ // 从负载中提取学号并设置到Student对象中
+ student.setStuNo(claims.get("stuNo")+"");
+ // 返回Student对象
+ return student;
+ }else{
+ // 如果token验证失败,则抛出自定义异常
+ throw new MyException("超时或不合法token");
+ }
+ // 如果解析或验证过程中发生异常,则捕获异常
+ } catch (Exception e) {
+ // 抛出自定义异常
+ throw new MyException("超时或不合法token");
+ }
+ }
+
+ // 主方法,程序入口点
+ public static void main(String[] args) {
+ // 创建User对象
+ User user = new User();
+ // 设置用户ID
+ user.setId(1);
+ // 设置用户名
+ user.setUserName("admin");
+ // 生成用户类型的JWT并打印输出
+ System.out.println(sign(user));
+ }
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/framework/mvc/GlobalControllerAdvice.java b/yyq/src/main/java/com/yanzhen/framework/mvc/GlobalControllerAdvice.java
new file mode 100644
index 0000000..1d888b0
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/framework/mvc/GlobalControllerAdvice.java
@@ -0,0 +1,37 @@
+package com.yanzhen.framework.mvc;
+
+import com.yanzhen.framework.exception.MyException; // 导入自定义异常类
+import com.yanzhen.utils.Result; // 导入结果处理工具类
+import org.springframework.web.bind.annotation.ControllerAdvice; // 导入Spring MVC的ControllerAdvice注解
+import org.springframework.web.bind.annotation.ExceptionHandler; // 导入Spring MVC的ExceptionHandler注解
+import org.springframework.web.bind.annotation.RequestBody; // 导入Spring MVC的RequestBody注解
+import org.springframework.web.bind.annotation.ResponseBody; // 导入Spring MVC的ResponseBody注解
+
+// 全局异常处理类
+@ControllerAdvice
+public class GlobalControllerAdvice {
+
+ // 处理所有RuntimeException类型的异常
+ @ExceptionHandler(RuntimeException.class)
+ @ResponseBody
+ // 定义处理方法,参数为捕获到的异常
+ public Result handle(RuntimeException exception){
+ // 打印异常堆栈信息
+ exception.printStackTrace();
+ // 返回失败的结果对象,包含异常信息
+ return Result.fail(exception.getMessage());
+ }
+
+ // 处理所有MyException类型的异常
+ @ExceptionHandler(MyException.class)
+ // 将返回值作为HTTP响应体
+ @ResponseBody
+ // 定义处理方法,参数为捕获到的异常
+ public Result handle(MyException exception){
+ // 打印异常堆栈信息
+ exception.printStackTrace();
+ // 返回失败的结果对象,包含错误码和异常信息
+ return Result.fail(Result.TOKEN_ERROR,exception.getMessage());
+ }
+
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/framework/mvc/MyWebMvcConfigurer.java b/yyq/src/main/java/com/yanzhen/framework/mvc/MyWebMvcConfigurer.java
new file mode 100644
index 0000000..e65c2ac
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/framework/mvc/MyWebMvcConfigurer.java
@@ -0,0 +1,42 @@
+package com.yanzhen.framework.mvc; // 定义包名
+
+import org.springframework.context.annotation.Bean; // 导入@Bean注解
+import org.springframework.context.annotation.Configuration; // 导入@Configuration注解
+import org.springframework.web.cors.CorsConfiguration; // 导入CorsConfiguration类
+import org.springframework.web.cors.CorsConfigurationSource; // 导入CorsConfigurationSource接口
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource; // 导入UrlBasedCorsConfigurationSource类
+import org.springframework.web.filter.CorsFilter; // 导入CorsFilter类
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry; // 导入InterceptorRegistry类
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; // 导入WebMvcConfigurer接口
+
+@Configuration // 标记该类为配置类
+public class MyWebMvcConfigurer implements WebMvcConfigurer { // 实现WebMvcConfigurer接口
+
+ @Bean // 将方法返回的对象注册为Spring容器中的Bean
+ public TokenInterceptor tokenInterceptor(){ // 定义tokenInterceptor方法,返回TokenInterceptor对象
+ return new TokenInterceptor(); // 创建并返回TokenInterceptor实例
+ }
+
+ @Override // 重写父类的方法
+ public void addInterceptors(InterceptorRegistry registry) { // 定义addInterceptors方法,参数为InterceptorRegistry对象
+ registry.addInterceptor(tokenInterceptor()) // 添加自定义拦截器
+ .addPathPatterns("/**") // 设置拦截所有路径
+ .excludePathPatterns("/login"); // 排除登录路径不拦截
+ }
+
+ //使用CorsFilter解决跨域的问题
+ @Bean // 将方法返回的对象注册为Spring容器中的Bean
+ public CorsFilter corsFilter(){ // 定义corsFilter方法,返回CorsFilter对象
+ CorsConfiguration corsConfiguration = new CorsConfiguration(); // 创建CorsConfiguration实例
+ //允许跨域请求的域名
+ corsConfiguration.addAllowedOrigin("*"); // 允许所有域名进行跨域请求
+ corsConfiguration.addAllowedMethod("*"); // 允许所有HTTP方法进行跨域请求
+ //允许任何头部
+ corsConfiguration.addAllowedHeader("*"); // 允许所有头部信息进行跨域请求
+ UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource(); // 创建UrlBasedCorsConfigurationSource实例
+ urlBasedCorsConfigurationSource.registerCorsConfiguration("/**",corsConfiguration); // 注册跨域配置到URL模式
+ CorsFilter corsFilter = new CorsFilter(urlBasedCorsConfigurationSource); // 创建CorsFilter实例
+ return corsFilter; // 返回CorsFilter实例
+ }
+
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/framework/mvc/TokenInterceptor.java b/yyq/src/main/java/com/yanzhen/framework/mvc/TokenInterceptor.java
new file mode 100644
index 0000000..9ccc70f
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/framework/mvc/TokenInterceptor.java
@@ -0,0 +1,53 @@
+package com.yanzhen.framework.mvc; // 定义包名
+
+import com.yanzhen.entity.Student; // 导入Student类
+import com.yanzhen.entity.User; // 导入User类
+import com.yanzhen.framework.exception.MyException; // 导入自定义异常类MyException
+import com.yanzhen.framework.jwt.JWTUtil; // 导入JWT工具类JWTUtil
+import org.springframework.web.servlet.HandlerInterceptor; // 导入Spring MVC的HandlerInterceptor接口
+import org.springframework.web.servlet.ModelAndView; // 导入Spring MVC的ModelAndView类
+
+import javax.servlet.http.HttpServletRequest; // 导入HttpServletRequest类
+import javax.servlet.http.HttpServletResponse; // 导入HttpServletResponse类
+
+public class TokenInterceptor implements HandlerInterceptor { // 定义TokenInterceptor类并实现HandlerInterceptor接口
+
+ @Override // 重写preHandle方法,在请求处理之前进行调用
+ public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+ String token = request.getHeader(JWTUtil.token); // 从请求头中获取token
+
+ String type = JWTUtil.getType(token); // 根据token获取类型
+ if("USER".equals(type)){ // 如果类型是USER
+ //根据token获取user对象
+ User user = JWTUtil.getUser(token); // 通过JWT工具类获取User对象
+ if(user == null){ // 如果User对象为空
+ throw new MyException("超时或不合法的token"); // 抛出自定义异常
+ }
+ String newToken = JWTUtil.sign(user); // 重新生成新的token
+ response.setHeader(JWTUtil.token,newToken); // 将新token设置到响应头中
+ response.setHeader("Access-Control-Expose-Headers", JWTUtil.token); // 设置允许暴露的响应头
+ request.setAttribute("user",user); // 将User对象设置到请求属性中
+ }else if("STUDENT".equals(type)){ // 如果类型是STUDENT
+ //根据token获取user对象
+ Student student = JWTUtil.getStudent(token); // 通过JWT工具类获取Student对象
+ if(student == null){ // 如果Student对象为空
+ throw new MyException("超时或不合法的token"); // 抛出自定义异常
+ }
+ String newToken = JWTUtil.signForStudent(student); // 重新生成新的token
+ response.setHeader(JWTUtil.token,newToken); // 将新token设置到响应头中
+ response.setHeader("Access-Control-Expose-Headers", JWTUtil.token); // 设置允许暴露的响应头
+ request.setAttribute("student",student); // 将Student对象设置到请求属性中
+ }
+ return true; // 返回true表示继续执行后续的拦截器和处理器
+ }
+
+ @Override // 重写postHandle方法,在请求处理之后但在视图渲染之前进行调用
+ public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
+
+ }
+
+ @Override // 重写afterCompletion方法,在整个请求结束之后进行调用
+ public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
+
+ }
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/AbsenceMapper.java b/yyq/src/main/java/com/yanzhen/mapper/AbsenceMapper.java
new file mode 100644
index 0000000..b9eb34e
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/AbsenceMapper.java
@@ -0,0 +1,25 @@
+package com.yanzhen.mapper; // 定义包名,表示该接口属于com.yanzhen.mapper包
+
+import java.util.List; // 导入Java的List类,用于处理列表数据结构
+
+import com.yanzhen.entity.Absence; // 导入Absence缺勤实体类,用于操作缺勤信息
+
+public interface AbsenceMapper { // 定义AbsenceMapper接口,提供对Absence缺勤实体进行数据库操作的方法
+
+ // 创建一个新的Absence缺勤记录
+ public int create(Absence absence);
+
+ // 根据id删除缺勤
+ public int delete(Integer id);
+ // 更新缺勤记录
+ public int update(Absence absence);
+ // 选择性地更新缺勤记录
+ public int updateSelective(Absence absence);
+ // 根据条件查询缺勤记录,返回缺勤列表
+ public List query(Absence absence);
+ // 根据id查询一个缺勤记录的详细信息
+ public Absence detail(Integer id);
+ // 统计缺勤记录的数量
+ public int count(Absence absence);
+
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/AbsenceMapper.xml b/yyq/src/main/java/com/yanzhen/mapper/AbsenceMapper.xml
new file mode 100644
index 0000000..132f5b7
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/AbsenceMapper.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into tb_absence(
+ student_id,
+ dormitory_id,
+ start_time,
+ end_time,
+ remark
+ )values(
+ #{studentId},
+ #{dormitoryId},
+ #{startTime},
+ #{endTime},
+ #{remark}
+ )
+
+
+
+
+
+
+
+
+
+ delete from tb_absence where id = #{id}
+
+
+ update tb_absence set
+ student_id=#{studentId},
+ dormitory_id=#{dormitoryId},
+ start_time=#{startTime},
+ end_time=#{endTime},
+ remark=#{remark}
+ where id = #{id}
+
+
+
+ update tb_absence
+
+ student_id = #{studentId},
+ dormitory_id = #{dormitoryId},
+ start_time = #{startTime},
+ end_time = #{endTime},
+ remark = #{remark},
+
+ where id = #{id}
+
+
+
+
+ and id = #{id}
+ and student_id = #{studentId}
+ and dormitory_id = #{dormitoryId}
+ and remark = #{remark}
+
+
+
+
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/BedMapper.java b/yyq/src/main/java/com/yanzhen/mapper/BedMapper.java
new file mode 100644
index 0000000..5533109
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/BedMapper.java
@@ -0,0 +1,27 @@
+package com.yanzhen.mapper; // 定义包名,表示该接口属于com.yanzhen.mapper包
+
+import java.util.List; // 导入Java的List类,用于处理列表数据结构
+
+import com.yanzhen.entity.Bed; // 导入Bed床实体类,用于操作床位信息
+
+// 定义接口,提供对Bed床实体进行数据库操作的方法
+public interface BedMapper {
+ // 创建一个新的Bed记录,返回影响的行数
+ public int create(Bed bed);
+ // 根据id删除一个Bed记录
+ public int delete(Integer id);
+ // 根据宿舍ID删除相关的Bed记录
+ public int deleteByDormitoryId(Integer dormitoryId);
+ // 更新一个Bed记录
+ public int update(Bed bed);
+ // 选择性地更新一个Bed记录
+ public int updateSelective(Bed bed);
+ // 根据设置的条件查询Bed记录,返回符合条件的Bed列表
+ public List query(Bed bed);
+ // 根据id查询一个Bed记录的详细信息
+ public Bed detail(Integer id);
+
+ // 统计Bed记录的数量,返回数量
+ public int count(Bed bed);
+
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/BedMapper.xml b/yyq/src/main/java/com/yanzhen/mapper/BedMapper.xml
new file mode 100644
index 0000000..5f18bed
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/BedMapper.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+ insert into tb_bed(
+ bno,
+ dormitory_id
+ )values(
+ #{bno},
+ #{dormitoryId}
+ )
+
+
+
+
+
+
+
+
+
+ delete from tb_bed where id = #{id}
+
+
+
+ delete from tb_bed where dormitory_id = #{dormitoryId}
+
+
+
+ update tb_bed set
+ bno=#{bno},
+ dormitory_id=#{dormitoryId}
+ where id = #{id}
+
+
+
+ update tb_bed set
+ bno = #{bno},
+ dormitory_id = #{dormitoryId}
+ where id = #{id}
+
+
+
+
+ and id = #{id}
+ and bno = #{bno}
+ and dormitory_id = #{dormitoryId}
+
+
+
+
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/BuildingMapper.java b/yyq/src/main/java/com/yanzhen/mapper/BuildingMapper.java
new file mode 100644
index 0000000..0ad876c
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/BuildingMapper.java
@@ -0,0 +1,24 @@
+package com.yanzhen.mapper; // 定义包名,表示该接口属于com.yanzhen.mapper包
+
+import java.util.List; // 导入Java的List类,用于处理列表数据结构
+
+import com.yanzhen.entity.Building; // 导入Building楼宇实体类,用于操作楼宇信息
+// 定义BuildingMapper接口
+public interface BuildingMapper {
+ // 创建一个新的Building楼宇记录
+ public int create(Building building);
+ // 根据id删除一个Building
+ public int delete(Integer id);
+ // 更新一个Building
+ public int update(Building building);
+ // 选择性地更新一个Building
+ public int updateSelective(Building building);
+
+ // 根据条件查询Building,返回符合条件的Building楼宇列表
+ public List query(Building building);
+ // 根据id查询一个Building楼宇记录的详细信息
+ public Building detail(Integer id);
+ // 根据条件统计Building楼宇记录的数量
+ public int count(Building building);
+
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/BuildingMapper.xml b/yyq/src/main/java/com/yanzhen/mapper/BuildingMapper.xml
new file mode 100644
index 0000000..5fbeed8
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/BuildingMapper.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into tb_building(
+ name,
+ type,
+ storey_num,
+ sex,
+ remark,
+ user_id
+ )values(
+ #{name},
+ #{type},
+ #{storeyNum},
+ #{sex},
+ #{remark},
+ #{userId}
+ )
+
+
+
+
+
+
+
+
+
+ delete from tb_building where id = #{id}
+
+
+ update tb_building set
+ name=#{name},
+ type=#{type},
+ storey_num=#{storeyNum},
+ sex=#{sex},
+ remark=#{remark},
+ user_id=#{userId}
+ where id = #{id}
+
+
+
+ update tb_building set
+ name = #{name},
+ type = #{type},
+ storey_num = #{storeyNum},
+ sex = #{sex},
+ remark = #{remark},
+ user_id = #{userId}
+ where id = #{id}
+
+
+
+
+ and id = #{id}
+ and name like concat('%',#{name},'%')
+ and type = #{type}
+ and storey_num = #{storeyNum}
+ and sex = #{sex}
+ and remark = #{remark}
+ and user_id = #{userId}
+
+
+
+
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/DormitoryMapper.java b/yyq/src/main/java/com/yanzhen/mapper/DormitoryMapper.java
new file mode 100644
index 0000000..f7065cf
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/DormitoryMapper.java
@@ -0,0 +1,29 @@
+package com.yanzhen.mapper; // 定义包名,表示该接口属于com.yanzhen.mapper包
+
+import java.util.List; // 导入Java的List类,用于处理列表数据结构
+
+import com.yanzhen.entity.Dormitory; // 导入Dormitory宿舍实体类,用于操作宿舍信息
+import org.apache.ibatis.annotations.Param; // 导入MyBatis的Param注解,用于传递参数到SQL语句中
+
+// 定义DormitoryMapper接口,提供对Dormitory的方法
+public interface DormitoryMapper {
+ // 创建Dormitory宿舍记录
+ public int create(Dormitory dormitory);
+ // 根据id删除Dormitory宿舍记录
+ public int delete(Integer id);
+ // 更新一个Dormitory
+ public int update(Dormitory dormitory);
+ // 选择性地更新一个Dormitory
+ public int updateSelective(Dormitory dormitory);
+
+ // 根据条件查询Dormitory并返回符合设置条件的Dormitory宿舍列表
+ public List query(Dormitory dormitory);
+ // 根据id查询Dormitory宿舍记录的详细信息
+ public Dormitory detail(Integer id);
+ // 根据条件统计Dormitory的数量
+ public int count(Dormitory dormitory);
+
+ // 根据建筑ID和楼层ID删除Dormitory
+ public int deleteByBuildingIdAndStoryId(@Param("buildingId") Integer buildingId, @Param("storeyId")Integer storeyId);
+
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/DormitoryMapper.xml b/yyq/src/main/java/com/yanzhen/mapper/DormitoryMapper.xml
new file mode 100644
index 0000000..3a6302a
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/DormitoryMapper.xml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into tb_dormitory(
+ no,
+ sex,
+ type,
+ capacity,
+ storey_id,
+ building_id
+ )values(
+ #{no},
+ #{sex},
+ #{type},
+ #{capacity},
+ #{storeyId},
+ #{buildingId}
+ )
+
+
+
+
+
+
+
+
+
+ delete from tb_dormitory where id = #{id}
+
+
+
+ delete from tb_dormitory where building_id = #{buildingId} and storey_id = #{storeyId}
+
+
+
+
+ update tb_dormitory set
+ no=#{no},
+ sex=#{sex},
+ type=#{type},
+ capacity=#{capacity},
+ storey_id=#{storeyId},
+ building_id=#{buildingId}
+ where id = #{id}
+
+
+
+ update tb_dormitory set
+ no = #{no},
+ sex = #{sex},
+ type = #{type},
+ capacity = #{capacity},
+ storey_id = #{storeyId},
+ building_id = #{buildingId}
+ where id = #{id}
+
+
+
+
+ and id = #{id}
+ and no = #{no}
+ and sex = #{sex}
+ and type = #{type}
+ and capacity = #{capacity}
+ and storey_id = #{storeyId}
+ and building_id = #{buildingId}
+
+
+
+
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/DormitorySetMapper.java b/yyq/src/main/java/com/yanzhen/mapper/DormitorySetMapper.java
new file mode 100644
index 0000000..2577924
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/DormitorySetMapper.java
@@ -0,0 +1,24 @@
+package com.yanzhen.mapper; // 定义包名,表示该接口属于com.yanzhen.mapper包
+
+import java.util.List; // 导入Java的List类,用于处理列表数据结构
+
+import com.yanzhen.entity.DormitorySet; // 导入DormitorySet宿舍设置实体类,用于操作宿舍设置信息
+
+// 定义DormitorySetMapper接口,提供对DormitorySet宿舍设置实体的方法
+public interface DormitorySetMapper {
+ //创建新的宿舍设置记录
+ public int create(DormitorySet dormitorySet);
+ //删除宿舍设置记录
+ public int delete(Integer id);
+ // 更新一个DormitorySet宿舍设置记录
+ public int update(DormitorySet dormitorySet);
+ // 选择性地更新一个宿舍设置记录
+ public int updateSelective(DormitorySet dormitorySet);
+ // 根据条件查询宿舍设置记录
+ public List query(DormitorySet dormitorySet);
+ // 根据id查询一个宿舍设置记录的详细信息
+ public DormitorySet detail(Integer id);
+ // 根据条件统计宿舍设置记录的数量,返回记录数量
+ public int count(DormitorySet dormitorySet);
+
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/DormitorySetMapper.xml b/yyq/src/main/java/com/yanzhen/mapper/DormitorySetMapper.xml
new file mode 100644
index 0000000..4733d93
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/DormitorySetMapper.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into tb_dormitory_set(
+ prefix,
+ start,
+ end,
+ building_id,
+ storey_id,
+ capacity
+ )values(
+ #{prefix},
+ #{start},
+ #{end},
+ #{buildingId},
+ #{storeyId},
+ #{capacity}
+ )
+
+
+
+
+
+
+
+
+
+ delete from tb_dormitory_set where id = #{id}
+
+
+ update tb_dormitory_set set
+ prefix=#{prefix},
+ start=#{start},
+ end=#{end},
+ building_id=#{buildingId},
+ storey_id=#{storeyId},
+ capacity=#{capacity}
+ where id = #{id}
+
+
+
+ update tb_dormitory_set set
+ prefix = #{prefix},
+ start = #{start},
+ end = #{end},
+ building_id = #{buildingId},
+ storey_id = #{storeyId},
+ capacity = #{capacity}
+ where id = #{id}
+
+
+
+
+ and id = #{id}
+ and prefix = #{prefix}
+ and start = #{start}
+ and end = #{end}
+ and building_id = #{buildingId}
+ and storey_id = #{storeyId}
+ and capacity = #{capacity}
+
+
+
+
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/DormitoryStudentMapper.java b/yyq/src/main/java/com/yanzhen/mapper/DormitoryStudentMapper.java
new file mode 100644
index 0000000..0d70748
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/DormitoryStudentMapper.java
@@ -0,0 +1,32 @@
+// 定义包名,表示该接口属于com.yanzhen.mapper包
+package com.yanzhen.mapper;
+
+import java.util.List; // 导入Java的List类,用于处理列表数据结构
+import java.util.Map; // 导入Java的Map类,用于处理键值对数据结构
+
+import com.yanzhen.entity.DormitoryStudent; // 导入DormitoryStudent实体类,用于操作学生宿舍信息
+import org.apache.ibatis.annotations.Param; // 导入MyBatis的Param注解,用于传递参数到SQL语句中
+
+// 定义DormitoryStudentMapper接口,提供对DormitoryStudent实体的方法
+public interface DormitoryStudentMapper {
+ // 创建一个新的DormitoryStudent记录
+ public int create(DormitoryStudent dormitoryStudent);
+ // 根据id删除一个记录
+ public int delete(Integer id);
+ // 根据条件删除记录
+ public int deleteByCond(@Param("studentId") Integer studentId, @Param("dormitoryId")Integer dormitoryId);
+ // 更新一个记录
+ public int update(DormitoryStudent dormitoryStudent);
+ // 选择性地更新一个DormitoryStudent记录
+ public int updateSelective(DormitoryStudent dormitoryStudent);
+ // 根据条件查询DormitoryStudent记录,返回符合条件的DormitoryStudent列表
+ public List query(DormitoryStudent dormitoryStudent);
+ // 根据id查询一个DormitoryStudent记录的详细信息
+ public DormitoryStudent detail(Integer id);
+ // 根据条件统计记录的数量
+ public int count(DormitoryStudent dormitoryStudent);
+ // 根据buildingId统计DormitoryStudent记录的数量
+ public int countByBuildingId(Integer buildingId);
+ // 根据bedId查询学生信息,返回包含学生信息的Map对象
+ public Map queryStudentByBedId(Integer bedId);
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/DormitoryStudentMapper.xml b/yyq/src/main/java/com/yanzhen/mapper/DormitoryStudentMapper.xml
new file mode 100644
index 0000000..e801b02
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/DormitoryStudentMapper.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into tb_dormitory_student(
+ dormitory_id,
+ bed_id,
+ student_id,
+ checkin,
+ status
+ )values(
+ #{dormitoryId},
+ #{bedId},
+ #{studentId},
+ #{checkin},
+ #{status}
+ )
+
+
+
+
+
+
+
+
+
+ delete from tb_dormitory_student where id = #{id}
+
+
+
+ delete from tb_dormitory_student where student_id = #{studentId}
+
+
+
+
+ update tb_dormitory_student set
+ dormitory_id=#{dormitoryId},
+ bed_id=#{bedId},
+ student_id=#{studentId},
+ checkin=#{checkin},
+ status=#{status}
+ where id = #{id}
+
+
+
+ update tb_dormitory_student set
+ dormitory_id = #{dormitoryId},
+ bed_id = #{bedId},
+ student_id = #{studentId},
+ checkin = #{checkin},
+ status = #{status}
+ where id = #{id}
+
+
+
+
+ and id = #{id}
+ and dormitory_id = #{dormitoryId}
+ and bed_id = #{bedId}
+ and student_id = #{studentId}
+ and status = #{status}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/GradeMapper.java b/yyq/src/main/java/com/yanzhen/mapper/GradeMapper.java
new file mode 100644
index 0000000..e54ec94
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/GradeMapper.java
@@ -0,0 +1,26 @@
+// 定义包名,表示该接口属于com.yanzhen.mapper包
+package com.yanzhen.mapper;
+
+import java.util.List; // 导入Java的List类,用于处理列表数据结构
+import java.util.Map; // 导入Java的Map类,用于处理键值对数据结构
+
+import com.yanzhen.entity.Grade; // 导入Grade实体类,用于操作年级信息
+
+// 定义GradeMapper接口
+public interface GradeMapper {
+ // 创建一个新的Grade记录
+ public int create(Grade grade);
+ // 根据id删除一个Grade
+ public int delete(Integer id);
+ // 更新一个Grade
+ public int update(Grade grade);
+ // 选择性地更新一个Grade记录
+ public int updateSelective(Grade grade);
+ // 根据条件查询Grade记录,返回符合条件的Grade列表
+ public List query(Grade grade);
+ // 从id查询一个Grade的详细信息,返回Grade对象
+ public Grade detail(Integer id);
+ // 根据条件统计Grade记录的数量
+ public int count(Grade grade);
+
+}
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/GradeMapper.xml b/yyq/src/main/java/com/yanzhen/mapper/GradeMapper.xml
new file mode 100644
index 0000000..0488fb4
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/GradeMapper.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+ insert into tb_grade(
+ name
+ )values(
+ #{name}
+ )
+
+
+
+
+
+
+
+
+
+ delete from tb_grade where id = #{id}
+
+
+ update tb_grade set
+ name=#{name}
+ where id = #{id}
+
+
+
+ update tb_grade set
+ name = #{name}
+ where id = #{id}
+
+
+
+
+ and id = #{id}
+ and name = #{name}
+
+
+
+
\ No newline at end of file
diff --git a/yyq/src/main/java/com/yanzhen/mapper/MenuMapper.java b/yyq/src/main/java/com/yanzhen/mapper/MenuMapper.java
new file mode 100644
index 0000000..5ecdb16
--- /dev/null
+++ b/yyq/src/main/java/com/yanzhen/mapper/MenuMapper.java
@@ -0,0 +1,24 @@
+// 定义包名
+package com.yanzhen.mapper;
+
+import com.yanzhen.entity.Menu; // 导入Menu实体类
+import com.yanzhen.entity.User; // 导入User实体类
+import org.apache.ibatis.annotations.Param; // 导入MyBatis的@Param注解
+
+import java.util.List; // 导入List集合
+// 定义MenuMapper接口
+public interface MenuMapper {
+ // 根据用户ID查询菜单列表
+ public List