mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 13:32:18 +08:00
Merge pull request #13839 from dataease/pr@dev-v2@fixds
fix: 过滤器查询支持换行符
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user