当前位置:   article > 正文

MyBatisPlus中使用or()和and()拼接用法_mybatisplusor条件拼接

mybatisplusor条件拼接
        List<WhseStoreVo> whseStoreVos = baseStoreService.list(new QueryWrapper<BaseStore>().lambda().eq(BaseStore::getShopWarehouse, CommonConstant.store_whse.whseType).and(e -> e.like(BaseStore::getStoreId, whseInfo).or().like(BaseStore::getStoreName, whseInfo)));

  • 1
  • 2

如下对应sql:

SELECT * FROM task WHERE  shop_warehouse = ? AND (store_id LIKE ? OR store_name LIKE ?)``

  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/158321
推荐阅读
  

闽ICP备14008679号