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 95965ec..9aabb62 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 @@ -200,7 +200,8 @@ public class MPJInterceptor implements Interceptor { } else { // 主键列 resultMappings.add(new ResultMapping.Builder(ms.getConfiguration(), i.getTagProperty(), - StringUtils.getTargetColumn(i.getColumnName()), i.getKeyType()).build()); + StringUtils.getTargetColumn(i.getColumnName()), i.getKeyType()) + .flags(Collections.singletonList(ResultFlag.ID)).build()); } } Set columnSet = resultMappings.stream().map(ResultMapping::getColumn).collect(Collectors.toSet());