feat(视图):为日期维度,增加日期显示与格式转换功能

This commit is contained in:
junjie 2021-06-01 16:09:51 +08:00
parent 196c003445
commit 3a49628b62
2 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ public class DorisQueryProvider extends QueryProvider {
stringBuilder.append("unix_timestamp(").append(x.getDataeaseName()).append(")*1000 as ").append(x.getDataeaseName());
} else if (x.getDeType() == 1) {
String format = transDateFormat(x.getDateStyle(), x.getDatePattern());
stringBuilder.append("DATE_FORMAT(").append(x.getDataeaseName()).append(",'").append(format).append("')");
stringBuilder.append("DATE_FORMAT(").append(x.getDataeaseName()).append(",'").append(format).append("') as ").append(x.getDataeaseName());
} else {
stringBuilder.append(x.getDataeaseName());
}

View File

@ -140,7 +140,7 @@ public class MysqlQueryProvider extends QueryProvider {
stringBuilder.append("unix_timestamp(").append(x.getDataeaseName()).append(")*1000 as ").append(x.getDataeaseName());
} else if (x.getDeType() == 1) {
String format = transDateFormat(x.getDateStyle(), x.getDatePattern());
stringBuilder.append("DATE_FORMAT(").append(x.getDataeaseName()).append(",'").append(format).append("')");
stringBuilder.append("DATE_FORMAT(").append(x.getDataeaseName()).append(",'").append(format).append("') as ").append(x.getDataeaseName());
} else {
stringBuilder.append(x.getDataeaseName());
}