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);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM