java stream 字符串转换顺便记录一下。
列表转换及字符串 joining
List<?> pathCodes = (List<?>) params.get("pathCodes");
String pathCodeLikeWhere = pathCodes
.stream()
.map(obj -> String.format("Ancestor LIKE '%s%%'", obj))
.collect(Collectors.joining(" OR ", "(", ")"));
// 结果:"(Ancestor LIKE 'xxx%' OR Ancestor LIKE 'xxxxx%')"