1、分页查询
/**
* Dao层
*/
public interface TestMapper {
//mysql分页查询
@Select("${sql} limit #{start},#{size}")
public List<Map> getPageList(@Param("sql") String sql, @Param("start") int start, @Param("end") int size);
//oracle分页查询
@Select("select * from (select t.*, rownum rn from (${sql}) t where rownum <= #{end}) where rn > #{start}")
public List<Map> getPageList(@Param("sql") String sql, @Param("start") int start, @Param("end") int size);
}