1.Mybatis-Plus Update继承BaseMapper,set的值不能为空,为空的话等于忽略。
用lambda把对象集合提取成<属性值,对象>
List<Doc> docs = new ArrayList<>();
Map<Long, Doc> docMap = docs.stream().collect(Collectors.toMap(Doc::getId, doc -> doc));
用lambda把对象集合提取成<属性值的集合>
List<Long> longs = bannerList.stream().map(Banner::getCompanyId).collect(Collectors.toList());
网友评论