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