From ea74a2639a394567d04e03ccd0bbee908b13de70 Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 4 Jun 2021 15:47:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E9=9B=86):=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E8=BD=AC=E6=95=B0=E5=80=BC=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/provider/mysql/MysqlQueryProvider.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java b/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java index 9e78fe9863..095a8ecb5b 100644 --- a/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/mysql/MysqlQueryProvider.java @@ -82,6 +82,14 @@ public class MysqlQueryProvider extends QueryProvider { } else { stringBuilder.append(f.getOriginName()); } + } else if (f.getDeExtractType() == 0) { + if (f.getDeType() == 2) { + stringBuilder.append("cast(").append(f.getOriginName()).append(" as decimal(20,0)) as ").append(f.getOriginName()); + } else if (f.getDeType() == 3) { + stringBuilder.append("cast(").append(f.getOriginName()).append(" as decimal(20,2)) as ").append(f.getOriginName()); + } else { + stringBuilder.append(f.getOriginName()); + } } else { if (f.getDeType() == 1) { stringBuilder.append("FROM_UNIXTIME(cast(").append(f.getOriginName()).append(" as decimal(20,0))/1000,'%Y-%m-%d %H:%i:%S') as ").append(f.getOriginName());