Commit 74e083d5 authored by yanzg's avatar yanzg

压缩视频

parent 5f2e30c0
......@@ -575,14 +575,18 @@ public abstract class BaseDaoSql {
// 正则表达式匹配代码片段,并根据代码片段获取数组进行增加
String regex = "\\{.*?\\}";
Pattern p = Pattern.compile(regex);
do {
Matcher m = p.matcher(sql);
if (!m.find()) {
break;
}
// 寻找到的代码片段 不包含分括号
while (m.find()) {
String name = m.group();
List<String> codes = codeMap.containsKey(name) ? codeMap.get(name) : new ArrayList<>();
String code = String.format(" %s ", String.join(" ", codes));
sql = sql.replace(name, code);
}
} while (true);
sql = sql.replaceAll("\\s+", " ");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment