You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
目的:实现类似这样的sql:where (id = 1) and (id = 1 and id in (1, 2)) and (id = 1 or id in (1, 2, 3))
单元测试如下:
@Testvoidm1() {
// String sql = "where (id = 1) and (id = 1 and id in (1, 2)) and (id = 1 or id in (1, 2, 3))";LambdaEsQueryWrapper<User> w = lambdaQuery(User.class)
.eq(User::getId, 1L)
.and(i -> i
.eq(User::getId, 1L)
.in(User::getId, newArrayList(1L, 2L)))
.and(i -> i
.eq(User::getId, 2L)
.or()
.in(User::getId, newArrayList(1L, 2L, 3L)));
List<User> users = userMapper.selectList(w);
System.err.println(users);
}
目的:实现类似这样的sql:
where (id = 1) and (id = 1 and id in (1, 2)) and (id = 1 or id in (1, 2, 3))
单元测试如下:
控制台打印的DSL(json较长,去掉了不影响说明问题的部分),下方的should和must错乱了,出问题的地方下方我使用了注释标记
假如我把wrapper中的第一个and删掉,变成如下,那打印出来的DSL语句又变成正确的了
The text was updated successfully, but these errors were encountered: