@Service @Transactional(rollbackFor = Exception.class) public class StudentServiceImpl implements StudentService { @Resource private StudentInfoMapper studentInfoMapper; @Override public StudentInfo studentLogin(String studentTel, String studentPwd) { return studentInfoMapper.selectByTelAndPwd(studentTel, studentPwd); } @Override public int studentReg(StudentInfo studentInfo) { return studentInfoMapper.insertStudent(studentInfo); } @Override public int updStudent(String studentId, String studentName, String studentTel, String studentPwd, String studentcard, String studentEmail) { int intid = Integer.valueOf(studentId); return studentInfoMapper.updStudent(intid, studentName, studentTel, studentPwd, studentcard, studentEmail); } @Override public int getStudentCount(String studentTel) { return studentInfoMapper.selectCountByTel(studentTel); } @Override public int getStudentcount(String studentCard) { return studentInfoMapper.selectCountByCard(studentCard); } @Override public List<EntryVo> getEntryList(String studentid, String page) { int studentId = Integer.valueOf(studentid); int nowpage = (Integer.valueOf(page) - 1) * 5; return studentInfoMapper.selectEntryList(studentId, nowpage, 5); }
时间: 2024-04-28 12:26:41 浏览: 77
Java注解@Transactional事务类内调用不生效问题及解决办法
这段代码在之前的基础上新增了一个方法getEntryList,用于获取学生的入驻列表。该方法接收两个参数,分别是学生的id和页码(每页显示5条数据),并通过调用StudentInfoMapper中的selectEntryList方法来获取对应的入驻列表数据。其中,学生的id需要进行类型转换,而页码需要进行计算转换。返回的数据类型为List<EntryVo>,即入驻列表数据的集合。
阅读全文