Closed qq243329721 closed 2 weeks ago
补充, 带leftjoin条件 selectJoinList也是null
依赖能用starter
我也同样遇到了records返回都是null的情况,这个错误可能是因为自定义sqlSessionFactory导致的,我引用的mybatis-plus-join-boot-starter但可能因为公司组件自定义的sqlSessionFactory影响了MPJInterceptor的添加,手动配置最后一个添加MPJInterceptor后正常了。 https://mybatisplusjoin.com/pages/problem.html#invalid-bound-statement-not-found
当前使用版本(必填,否则不予处理)
该问题是如何引起的?(确定最新版也有问题再提!!!)
MPJLambdaWrapper query = new MPJLambdaWrapper<>();
query.selectAll(StationGas.class);
query.selectCollection(StationGasGun.class, StationGas::getStationGasGunList);
query.leftJoin(StationGasGun.class, StationGasGun::getStationGasId, StationGas::getId);
query.eq(StationGasGun::getType, 1);
Page iPage = this.stationGasService.selectJoinListPage(selectPage, StationGas.class, query);
query.selectCollection(StationGasGun.class, StationGas::getStationGasGunList); query.leftJoin(StationGasGun.class, StationGasGun::getStationGasId, StationGas::getId); query.eq(StationGasGun::getType, 1); 不加这三行的时候时候返回正常
重现步骤(如果有就写完整)
同上
报错信息
无报错