Skip to content

Conversation

@loren-coding
Copy link

@loren-coding loren-coding commented Sep 24, 2024

#6511 分页参数 IPage 支持在 Map 参数中生效。方便兼容陈年旧代码:

      Map<String, Object> map = Map.of(
            "pageable", new Page<>(),
            "name", "mybatis-plus",
            "age", 18
      );
     userMapper.testPage(map);

     ...

     //------ UserMapper.java ------
     @Select("select * from h2user where name=#{name}")
     IPage<H2User> testPage(Map<String, Object> param);

@loren-coding loren-coding changed the title IPage 支持在 Map 参数中生效. IPage 支持在 Map 参数中生效. Sep 24, 2024
@loren-coding loren-coding marked this pull request as draft February 17, 2025 00:59
@loren-coding loren-coding marked this pull request as ready for review February 17, 2025 00:59
@totoro52
Copy link

不现实,如果多个values均为page对象不就炸了

@loren-coding
Copy link
Author

不现实,如果多个values均为page对象不就炸了

@totoro52 不会。和方法参数一样的,只取第一个 value 为 Page 类型的对象。与原来逻辑相差不大

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants