Bootstrap

mybatis-plus and or 查询写法

queryWrapper.lambda().eq(ShopInfoEntity::getShopName,shopName).or().eq(ShopInfoEntity::getShopTitle,shopName);

这种写法等同于sql里面的 select * from shop where shop_name = 'aaa' or shop_title = 'aaaa'

 

queryWrapper.lambda().and(shopInfoEntityLambdaQueryWrapper ->
        shopInfoEntityLambdaQueryWrapper.like(StrUtil.isNotBlank(finalKeyword),ShopInfoEntity::getShopTitle, finalKeyword)
                .or().like(StrUtil.isNotBlank(finalKeyword),ShopInfoEntity::getYijiCategoryName, finalKeyword)
                .or().like(StrUtil.isNotBlank(finalKeyword),ShopInfoEntity::getCategoryName, finalKeyword)
                .or().like(StrUtil.isNotBlank(finalKeyword),ShopInfoEntity::getDescribeShop, finalKeyword));

这种写法等同于

select * from shop where (shop_name = 'aaa' or shop_title = 'aaa')

记录一下

;