传统do实现方式:
public class StudentDaoImpl implements StudentDao {@Overridepublic List<Student> selectStudents() {SqlSession sqlSession = MybatisUtils.getSqlSession();String sqlId = "com.lifang.dao.StudentDao.selectStudents";List<Student> students = sqlSession.selectList(sqlId);return students;}@Overridepublic int insertStudent(Student student) {SqlSession sqlSession = MybatisUtils.getSqlSession();String sqlId = "com.lifang.dao.StudentDao.insertStudent";int nums = sqlSession.insert(sqlId,student);sqlSession.commit();sqlSession.close();return nums;}
}