1.controller
Page<Student> page = new Page<Student>(pageNo, pageSize);
page.setRecords(studentService.getAllList(page, resquestParater));
2.service
public List<Student> getAllList(Page<Student> page, ResquestParater po){
return studentMapper.getAllList(page,po);
}
3.mapper
List<Student> getAllList(Page<Student> page, ResquestParameter po);
4.sql
<select id="getAllList" parameterType="com.example.module.bean.ResquestParameter" resultType="com.example.module.bean.Student" >
select id, name, age, sex, birthday, grade, class, address from student
where isdelete = 1
<!-- 根据姓名模糊查询 -->
<if test="name != null and name !='' ">
and name LIKE '%${name}%'
</if>
</select>