|
|
|
@ -1,9 +1,18 @@
|
|
|
|
|
package com.zsz.mapper;
|
|
|
|
|
|
|
|
|
|
// 导入 MyBatis-Plus 提供的核心基础 Mapper 接口,该接口包含了通用的 CRUD(创建、读取、更新、删除)操作方法
|
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
|
|
// 导入年级实体类,用于将数据库中年级表的数据映射到 Java 对象
|
|
|
|
|
import com.zsz.pojo.Grade;
|
|
|
|
|
// 导入 Spring 框架的注解,用于将该接口标记为数据访问层组件,Spring 会自动将其纳入组件扫描并进行管理
|
|
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 年级数据访问层接口,继承自 MyBatis-Plus 的 BaseMapper 接口,用于对年级表进行数据库操作
|
|
|
|
|
*/
|
|
|
|
|
@Repository
|
|
|
|
|
// 定义年级 Mapper 接口,泛型指定为 Grade 类,表示该接口操作的实体对象是 Grade
|
|
|
|
|
public interface GradeMapper extends BaseMapper<Grade> {
|
|
|
|
|
}
|
|
|
|
|
// 由于继承了 BaseMapper,此接口默认具备了对 Grade 实体的基本数据库操作能力,如插入、更新、删除、查询等
|
|
|
|
|
// 若有额外的、复杂的数据库操作需求,可以在该接口中定义自定义的方法
|
|
|
|
|
}
|