fix 修复 升级 mp 版本导致的问题

2.X
疯狂的狮子Li 1 year ago
parent 6caa89c532
commit 12b2e58000

@ -21,7 +21,7 @@
<spring-cloud.version>2022.0.4</spring-cloud.version> <spring-cloud.version>2022.0.4</spring-cloud.version>
<spring-boot-admin.version>3.1.4</spring-boot-admin.version> <spring-boot-admin.version>3.1.4</spring-boot-admin.version>
<spring-boot.mybatis>3.0.2</spring-boot.mybatis> <spring-boot.mybatis>3.0.2</spring-boot.mybatis>
<mybatis.version>3.5.10</mybatis.version> <mybatis.version>3.5.13</mybatis.version>
<mybatis-plus.version>3.5.3.2</mybatis-plus.version> <mybatis-plus.version>3.5.3.2</mybatis-plus.version>
<p6spy.version>3.9.1</p6spy.version> <p6spy.version>3.9.1</p6spy.version>
<dynamic-ds.version>4.1.3</dynamic-ds.version> <dynamic-ds.version>4.1.3</dynamic-ds.version>

@ -182,12 +182,12 @@ public interface BaseMapperPlus<T, V> extends BaseMapper<T> {
* VO * VO
*/ */
default <C, P extends IPage<C>> P selectVoPage(IPage<T> page, Wrapper<T> wrapper, Class<C> voClass) { default <C, P extends IPage<C>> P selectVoPage(IPage<T> page, Wrapper<T> wrapper, Class<C> voClass) {
IPage<T> pageData = this.selectPage(page, wrapper); List<T> list = this.selectList(page, wrapper);
IPage<C> voPage = new Page<>(pageData.getCurrent(), pageData.getSize(), pageData.getTotal()); IPage<C> voPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal());
if (CollUtil.isEmpty(pageData.getRecords())) { if (CollUtil.isEmpty(list)) {
return (P) voPage; return (P) voPage;
} }
voPage.setRecords(MapstructUtils.convert(pageData.getRecords(), voClass)); voPage.setRecords(MapstructUtils.convert(list, voClass));
return (P) voPage; return (P) voPage;
} }

@ -33,7 +33,8 @@ public interface TestDemoMapper extends BaseMapperPlus<TestDemo, TestDemoVo> {
@DataColumn(key = "deptName", value = "dept_id"), @DataColumn(key = "deptName", value = "dept_id"),
@DataColumn(key = "userName", value = "user_id") @DataColumn(key = "userName", value = "user_id")
}) })
<P extends IPage<TestDemo>> P selectPage(P page, @Param(Constants.WRAPPER) Wrapper<TestDemo> queryWrapper); List<TestDemo> selectList(IPage<TestDemo> page, @Param(Constants.WRAPPER) Wrapper<TestDemo> queryWrapper);
@Override @Override
@DataPermission({ @DataPermission({

Loading…
Cancel
Save