Springboot mybatis

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);

}

 

posted @ 2020-04-02 23:46  N神3  阅读(198)  评论(0编辑  收藏  举报