diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/api/log/JobLogApiImpl.java b/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/api/log/JobLogApiImpl.java index 9287b8b68..fc165a2d2 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/api/log/JobLogApiImpl.java +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/api/log/JobLogApiImpl.java @@ -56,19 +56,13 @@ public class JobLogApiImpl implements JobLogApi { Date beginTime, Date endTime, Integer status) { - JobLogPageReqDTO jobLogPageReqDTO = new JobLogPageReqDTO(); - jobLogPageReqDTO.setPageNo(pageNo); - jobLogPageReqDTO.setPageSize(pageSize); - jobLogPageReqDTO.setJobId(jobId); - jobLogPageReqDTO.setHandlerName(handlerName); - jobLogPageReqDTO.setBeginTime(beginTime); - jobLogPageReqDTO.setEndTime(endTime); - jobLogPageReqDTO.setStatus(status); // 设置默认组为3 int jobGroup = 3; + // 计算起始页数 + pageNo = (pageNo - 1) * pageSize; // page query - List list = xxlJobLogDao.apiPageList(jobLogPageReqDTO.getPageNo(), jobLogPageReqDTO.getPageSize(), jobGroup, jobLogPageReqDTO.getJobId(), jobLogPageReqDTO.getBeginTime(), jobLogPageReqDTO.getEndTime(), status, jobLogPageReqDTO.getHandlerName()); - int list_count = xxlJobLogDao.apiPageListCount(jobLogPageReqDTO.getPageNo(), jobLogPageReqDTO.getPageSize(), jobGroup, jobLogPageReqDTO.getJobId(), jobLogPageReqDTO.getBeginTime(), jobLogPageReqDTO.getEndTime(), status, jobLogPageReqDTO.getHandlerName()); + List list = xxlJobLogDao.apiPageList(pageNo, pageSize, jobGroup, jobId, beginTime, endTime, status, handlerName); + int list_count = xxlJobLogDao.apiPageListCount(pageNo, pageSize, jobGroup, jobId, beginTime, endTime, status, handlerName); // package result PageResult pageResult = new PageResult<>(); pageResult.setTotal((long) list_count); diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java b/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java index 778c035bc..250eea773 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java @@ -482,6 +482,8 @@ public class XxlJobServiceImpl implements XxlJobService { public PageResult apiPage(Integer pageNo, Integer pageSize, String name, Integer status, String handlerName) { PageResult pageResult = new PageResult<>(); if (status != null && status == 2) status = 0; + // 计算起始页数 + pageNo = (pageNo - 1) * pageSize; pageResult.setList(xxlJobInfoDao.apiPage(pageNo, pageSize, name, status, handlerName)); pageResult.setTotal(xxlJobInfoDao.apiPageCount(name, status, handlerName)); return pageResult; diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml index 4bba1c088..748933037 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml @@ -273,7 +273,7 @@ - LIMIT #{pageSize} OFFSET ${(pageNo - 1) * pageSize} + LIMIT #{pageNo}, #{pageSize}