Mybatis plus “and” 用法

查询商品自编码、无商品图片、价格虚高及库存不足的商品数量的多维度的情况:

QueryWrapper<ProductSkuEntity> queryErrorProductWrapper = new QueryWrapper<>();
queryErrorProductWrapper.eq("shop_info_id", shopInfoId);
queryErrorProductWrapper.and(wrapper -> wrapper.
like("sku_code", "auto").or().
eq("sku_img_url", "").or().
ge("price", 9999).or().
le("stock", 0).or().
and(w -> w.eq("mt_status", 2).or().eq("elm_status", 2))
);
int count = productSkuDb.count(queryErrorProductWrapper);

原文地址:https://www.cnblogs.com/pzyin/p/14600012.html