From a229521dd750b369738a90b899b1d6b3ffee84e2 Mon Sep 17 00:00:00 2001 From: yulichang <570810310@qq.com> Date: Fri, 17 Mar 2023 22:22:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/github/yulichang/interceptor/MPJInterceptor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/interceptor/MPJInterceptor.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/interceptor/MPJInterceptor.java index f3e51eb..fa5e29b 100644 --- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/interceptor/MPJInterceptor.java +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/interceptor/MPJInterceptor.java @@ -87,7 +87,12 @@ public class MPJInterceptor implements Interceptor { String id = ms.getId() + StringPool.DASH + (resultType.getName().replaceAll("\\.", StringPool.DASH)); if (ew instanceof MPJLambdaWrapper) { MPJLambdaWrapper wrapper = (MPJLambdaWrapper) ew; - wrapper.setEntityClass(MPJTableMapperHelper.getEntity(getEntity(ms.getId()))); + if (wrapper.getEntityClass() == null) { + wrapper.setEntityClass(MPJTableMapperHelper.getEntity(getEntity(ms.getId()))); + } + if (wrapper.getSelectColumns().isEmpty() && wrapper.getEntityClass() != null) { + wrapper.selectAll(wrapper.getEntityClass()); + } //TODO 重构缓存 -> 根据sql缓存 //不走缓存 }