@OverridepublicList<ProductDTO>queryProductByTypes(List<String> typeList){String types = typeList.stream().collect(Collectors.joining(","));List<OpProduct> list =this.list(newLambdaQueryWrapper<OpProduct>().inSql(OpProduct::getId,"select id from op_product where FIND_IN_SET("+"type ,'"+ types +"')"));List<ProductDTO> productDTOS =BeanUtil.copyToList(list,ProductDTO.class);return productDTOS;}
2、运算符Service
@OverridepublicList<ProductDTO>queryProductByTypes(List<String> typeList){// String types = typeList.stream().map(s -> "\'" + s + "\'").collect(Collectors.joining(","));String types = typeList.stream().map(newFunction<String,String>(){@OverridepublicStringapply(String s){return"\'"+ s +"\'";}}).collect(Collectors.joining(","));List<OpProduct> list =this.list(newLambdaQueryWrapper<OpProduct>().inSql(OpProduct::getType, types));List<ProductDTO> productDTOS =BeanUtil.copyToList(list,ProductDTO.class);return productDTOS;}