You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
1.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.zsz.mapper;
// 引入 MyBatis-Plus 框架提供的基础 Mapper 接口,此接口封装了通用的数据库操作方法,
// 如插入、删除、更新、查询等,能显著减少重复代码的编写。
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
// 引入教师实体类,该类用来封装教师的相关属性,和数据库里的教师表相对应。
import com.zsz.pojo.Teacher;
// 引入 Spring 框架的 Repository 注解,它的作用是把该接口标记成数据访问层组件,
// 让 Spring 容器能够对其进行管理,同时也能在出现数据访问异常时进行恰当的转换。
import org.springframework.stereotype.Repository;
/**
* 教师数据访问层接口,继承自 MyBatis-Plus 的 BaseMapper 接口,
* 用于对数据库中的教师表执行各种数据库操作。
*/
@Repository
// 定义教师 Mapper 接口,借助泛型指定操作的实体类型为 Teacher
// 这表明该接口主要针对教师表开展操作。
public interface TeacherMapper extends BaseMapper<Teacher> {
// 由于继承了 BaseMapper 接口,这个接口默认具备对 Teacher 实体的基本数据库操作能力,
// 比如插入一条教师记录、更新教师信息、删除教师记录以及查询教师信息等。
// 若有特殊的数据库操作需求,可在该接口内自定义方法。
}