QueryWrapper.eq("name", name).or().eq("mark", mark)); entityMapper.selectList(wrapper);等价sqlSELECT id FROM t_entity _mybatis plus 括号">
赞
踩
QueryWrapper<Entity> wrapper = new QueryWrapper<>();
wrapper.ne("id", param.getId())
wrapper.and(QueryWrapper -> QueryWrapper.eq("name", name).or().eq("mark", mark));
entityMapper.selectList(wrapper);
SELECT id FROM t_entity WHERE (id <> ? AND (name = ? OR mark = ?))
每个and相当于一个括号
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。