mybatis-plus的LambdaQueryWrapper中and、or的用法

//WHERE (phone = ? AND (syr_id = ? OR sale_id = ?))
receptionQuery.eq(ScrmReceptionInfo::getPhone, queryDTO.getPhone());
receptionQuery.and(wrapper->{
            wrapper.eq(ScrmReceptionInfo::getSyrId, queryDTO.getSyrId());
            wrapper.or().eq(ScrmReceptionInfo::getSaleId,queryDTO.getCreateId());
        });

参考文档地址: https://blog.csdn.net/monody666/article/details/121955426

posted @ 2022-03-23 17:20  进击的小蔡鸟  阅读(11436)  评论(0编辑  收藏  举报