From 4cea2e37d446ba628b6a81cc102fb89a67064a35 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Wed, 17 Jul 2024 16:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=88=86=E9=A1=B5=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xxl/job/admin/api/log/JobLogApiImpl.java | 14 ++++---------- .../job/admin/service/impl/XxlJobServiceImpl.java | 2 ++ .../resources/mybatis-mapper/XxlJobInfoMapper.xml | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) 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}