赞
踩
mybatis-plus 中 queryWrapper and与or嵌套
(…and …) or (…and …) 格式
QueryWrapper<entity> query = new QueryWrapper<>();
query.and(wrapper->wrapper.eq("SEND_USER_ID",sendUserId).eq("RECEIVE_USER_ID",receiveUserId))
.or(wrapper->wrapper.eq("SEND_USER_ID",receiveUserId).eq("RECEIVE_USER_ID",sendUserId));
效果
sql: 条件组成
WHERE ((SEND_USER_ID = ? AND RECEIVE_USER_ID = ?) OR (SEND_USER_ID = ? AND RECEIVE_USER_ID = ?))
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。