refactor: remove unused database columns and related code
This commit is contained in:
parent
d790495890
commit
5a54ab4ab9
@ -11,19 +11,6 @@ import java.util.List;
|
||||
public class StudentService {
|
||||
private final StudentDAO studentDAO = DAOFactory.getStudentDAO();
|
||||
|
||||
/**
|
||||
* 添加学生
|
||||
* @param student 学生信息
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
public boolean addStudent(Student student) {
|
||||
// 检查学号是否已存在
|
||||
if (studentDAO.findByStudentId(student.getStudentId()) != null) {
|
||||
return false;
|
||||
}
|
||||
return studentDAO.insert(student) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新学生信息
|
||||
* @param student 学生信息
|
||||
@ -43,15 +30,6 @@ public class StudentService {
|
||||
return studentDAO.update(student) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学生
|
||||
* @param id 学生ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
public boolean deleteStudent(int id) {
|
||||
return studentDAO.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询学生
|
||||
* @param id 学生ID
|
||||
@ -78,15 +56,6 @@ public class StudentService {
|
||||
return studentDAO.findAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据班级查询学生
|
||||
* @param className 班级名称
|
||||
* @return 学生列表
|
||||
*/
|
||||
public List<Student> getStudentsByClass(String className) {
|
||||
return studentDAO.findByClassName(className);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据姓名模糊查询学生
|
||||
* @param name 学生姓名
|
||||
|
Loading…
x
Reference in New Issue
Block a user