1. 程式人生 > >guns 在伺服器端分頁

guns 在伺服器端分頁

控制層
1、加資料字典

Page<ReceivingTask> page = new PageFactory<ReceivingTask>().defaultPage();
        List<Map<String, Object>> lists = receivingTaskService.selectLists(page,logType,taskType,actionType,taskId,correlateId);
        page.setRecords((List<ReceivingTask>) new ReceivingTaskWarpper(lists).warp());
        return super.packForBT(page);

2、不加資料字典

Page<MappingTask> page = new PageFactory<MappingTask>().defaultPage();
        mappingTaskService.selectLists(page,correlateId,beginTime,endTime,taskId,resultCode);
        List<MappingTask> lists = mappingTaskService.selectLists(page,correlateId,beginTime,endTime,taskId,resultCode);
        return super.packForBT(page.setRecords(lists));

service層

 @Override
    public List<Map<String, Object>> selectLists(Page<ReceivingTask> page, String logType, String taskType, String actionType,String taskId,String correlateId) {
        return super.baseMapper.selectLists(page,logType,taskType,actionType,taskId,correlateId);
    }

js

$(function () {
	var defaultColunms = ReceivingTask.initColumn();
	var table = new BSTable(ReceivingTask.id, "/receivingTask/list", defaultColunms);
	table.setPaginationType("server");
	ReceivingTask.table = table.init();
	
});