mybatis-plus复杂where查询

多个组合条件or查询

LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.and(c -> c.isNull(SysUser::getDepart).eq(SysUser::getSalt, "123"));
queryWrapper.or(c -> c.in(SysUser::getDepart, Arrays.asList(1, 2, 3)).eq(SysUser::getCreateBy, -1L));
List<SysUser> sysUserList = sysUserService.list(queryWrapper);

==>  Preparing: SELECT id,job_number,user_name FROM upms_auth_user WHERE
         (depart IS NULL AND salt = ?) OR (depart IN (?,?,?) AND create_by = ?)
==> Parameters: 123(String), 1(Integer), 2(Integer), 3(Integer), -1(Long)
# Mybatis  

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×