现在我想排除我的mybatis页面选择的count sql,这是我的Java代码:
public PageInfo userPageWithOutCount(ReportUserRequest reportUserRequest) {
if (CollectionUtils.isNotEmpty(reportUserRequest.getAppMarks())) {
String joinedFirstNames = reportUserRequest.getAppMarks().stream()
.collect(Collectors.joining(","));
reportUserRequest.setAppMarkConcat(joinedFirstNames);
}
String orderBy = getOrderby(reportUserRequest) + " " + getDirection(reportUserRequest);
Page<ReportUser> page = new Page<ReportUser>();
page.setOrderBy(orderBy);
page.setPageNum(reportUserRequest.getPageNum());
page.setPageSize(reportUserRequest.getPageSize());
page.setCount(false);
PageInfo pageInfo = PageHelper.startPage(page).doSelectPageInfo(() -> {
customReportUserMapper.userPage(reportUserRequest, publicPumpUserId);
}
);
return pageInfo;
}
当我运行此代码时,显示错误:
at com.sportswin.soa.illidan.service.impl.user.ReportUserService$$FastClassBySpringCGLIB$$71fb9c24.invoke(<generated>) ~[classes!/:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72) ~[druid-1.1.9.jar!/:1.1.9]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at com.sportswin.soa.illidan.service.impl.user.ReportUserService$$EnhancerBySpringCGLIB$$8a6479ae.userPageWithOutCount(<generated>) ~[classes!/:na]
at com.sportswin.soa.illidan.service.impl.user.ReportUserService$$FastClassBySpringCGLIB$$71fb9c24.invoke(<generated>) ~[classes!/:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72) ~[druid-1.1.9.jar!/:1.1.9]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at com.sportswin.soa.illidan.service.impl.user.ReportUserService$$EnhancerBySpringCGLIB$$8d04a6e4.userPageWithOutCount(<generated>) ~[classes!/:na]
at com.sportswin.soa.illidan.controller.impl.user.ReportUserController.queryHadesUserInfo(ReportUserController.java:232) ~[classes!/:na]
at com.sportswin.soa.illidan.controller.impl.user.ReportUserController.userPage(ReportUserController.java:197) ~[classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_252]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_252]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_252]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_252]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) [spring-web-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) [spring-web-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) [spring-webmvc-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:893) ~[spring-webmvc-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:798) ~[spring-webmvc-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) [spring-webmvc-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
... 52 common frames omitted
从我的代码中,我没有发现任何问题。我应该怎么做才能解决这个问题?