Merge pull request #13839 from dataease/pr@dev-v2@fixds

fix: 过滤器查询支持换行符
This commit is contained in:
taojinlong
2024-12-04 18:10:17 +08:00
committed by GitHub
2 changed files with 1 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ import java.util.Optional;
*/
public class SQLUtils {
public static String transKeyword(String value) {
return Optional.ofNullable(value).orElse("").replaceAll("'", "''").replaceAll("\\\\","\\\\\\\\");
return Optional.ofNullable(value).orElse("").replaceAll("'", "''").replaceAll("\\\\","\\\\\\\\").replace("\n", "\\n");
}
public static String buildOriginPreviewSql(String sql, int limit, int offset) {

View File

@@ -27,15 +27,4 @@ public class ChartExtFilterDTO {
private List<String> originValue;
private int filterType;// 0-过滤组件1-下钻2-联动,外部参数
public List<String> getValue() {
if (CollectionUtils.isNotEmpty(value)) {
List<String> values = new ArrayList<>();
value.forEach(v -> {
values.add(v.replace("\n", "\\n"));
});
return values;
}
return value;
}
}