freecms支持分页查询,很多Service中都有用到,可以作为参考。
如果想支持分页查询,Action需要从BaseAction中派生出来,BaseAction中有order, currPage, pageSize等属性,在查询时传给Service,如 **Service.find(**, order, currPage, pageSize)。在Service的查询中,需要使用 mapper 的 selectPageByExample, 在 mapper中加入 selectPageByExample接口,然后参照其它的 mapper 修改 mapper.xml文件,加入selectPageByExample方法,即可完成分页查询。
……
本文介绍如何在Freecms系统中实现分页查询功能。主要步骤包括:从BaseAction派生Action类并传递分页参数给Service;在Service层调用mapper的selectPageByExample方法实现分页;在mapper.xml中加入selectPageByExample方法。
1586

被折叠的 条评论
为什么被折叠?



