美文网首页
mybatis-plus用法

mybatis-plus用法

作者: codewd站长 | 来源:发表于2020-04-24 18:20 被阅读0次

    1.自定义查询的数据,可能like啥的,这种字段改了不写死

    QueryWrapper<StockLocation> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(StockLocation::getWarehouseId,inventoryRequest.getWarehouseId());
         if (CollUtil.isNotEmpty(inventoryRequest.getGoodsNos())){
             queryWrapper.lambda().in(StockLocation::getGoodsNo,inventoryRequest.getGoodsNos());
         }
         if (StrUtil.isNotBlank(inventoryRequest.getQualityStatus())){
             queryWrapper.lambda().eq(StockLocation::getQualityStatus,inventoryRequest.getQualityStatus());
         }
         List<StockLocation> list = stockLocationMapper.selectList(queryWrapper); 
    

    相关文章

      网友评论

          本文标题:mybatis-plus用法

          本文链接:https://www.haomeiwen.com/subject/utcqwhtx.html