We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.5.2
MPJLambdaWrapper<DeviceProtocolPo> from1 = JoinWrappers.lambda(DeviceProtocolPo.class) .selectAs("t.gatewayTotal",DeviceProtocolPageDto::getGatewayTotal) .selectAssociation("t", DeviceProtocolPo.class, DeviceProtocolPageDto::getProtocolPo) .selectAssociation("t1", SysDimensionPo.class, DeviceProtocolPageDto::getSysDimensionPo) .from(from -> { wrapper(from.setAlias("r") .selectAll(DeviceProtocolPo.class) .selectCount(DeviceGatewayPo::getId, "gatewayTotal") .leftJoin(DeviceGatewayPo.class, "t2", DeviceGatewayPo::getProtocolId, DeviceProtocolPo::getId) .in(DeviceProtocolPo::getOrgId,dimens) .groupBy(DeviceProtocolPo::getId) .having("COUNT( r.id ) >= {0}", 0), param); return from; }).leftJoin(SysDimensionPo.class, SysDimensionPo::getId, DeviceProtocolPo::getOrgId); Page<DeviceProtocolPageDto> page = getBaseMapper().selectJoinPage(page(param),DeviceProtocolPageDto.class, from1);
你好,大佬,上面执行的日志打印出sql查出来的结果有4条,但实际page的记录只有3条 如果去掉.selectAs("t.gatewayTotal",DeviceProtocolPageDto::getGatewayTotal)这段代码,结果就是4条 这是什么问题呢?要怎么解决?非常感谢
The text was updated successfully, but these errors were encountered:
换了一种写法,问题还是一样
MPJLambdaWrapper<DeviceProtocolPo> wrapper = new MPJLambdaWrapper<DeviceProtocolPo>() .selectAssociation("t",DeviceProtocolPo.class,DeviceProtocolPageDto::getProtocolPo) //.selectCount(DeviceGatewayPo::getId, DeviceProtocolPageDto::getGatewayTotal) .leftJoin(DeviceGatewayPo.class, "t2", DeviceGatewayPo::getProtocolId, DeviceProtocolPo::getId) .leftJoin(SysDimensionPo.class,"t1", SysDimensionPo::getId, DeviceProtocolPo::getOrgId) .in(DeviceProtocolPo::getOrgId, dimens) .groupBy(DeviceProtocolPo::getId) .having("COUNT( t.id ) >= {0}", 0); Page<DeviceProtocolPageDto> page = getBaseMapper().selectJoinPage(page(param), DeviceProtocolPageDto.class, wrapper);
.selectCount(DeviceGatewayPo::getId, DeviceProtocolPageDto::getGatewayTotal) 加上该语句,sql日志查询的结果数量是对的,但是获取到的page对象中结果集数量是不对的
Sorry, something went wrong.
No branches or pull requests
确认
当前程序版本
1.5.2
问题描述
你好,大佬,上面执行的日志打印出sql查出来的结果有4条,但实际page的记录只有3条
如果去掉.selectAs("t.gatewayTotal",DeviceProtocolPageDto::getGatewayTotal)这段代码,结果就是4条
这是什么问题呢?要怎么解决?非常感谢
详细堆栈日志
The text was updated successfully, but these errors were encountered: