xieshengjie 3 yıl önce
ebeveyn
işleme
c74dd3a581
100 değiştirilmiş dosya ile 11463 ekleme ve 0 silme
  1. 33 0
      benchmarking-hive/.gitignore
  2. 118 0
      benchmarking-hive/.mvn/wrapper/MavenWrapperDownloader.java
  3. BIN
      benchmarking-hive/.mvn/wrapper/maven-wrapper.jar
  4. 2 0
      benchmarking-hive/.mvn/wrapper/maven-wrapper.properties
  5. 310 0
      benchmarking-hive/mvnw
  6. 182 0
      benchmarking-hive/mvnw.cmd
  7. 214 0
      benchmarking-hive/pom.xml
  8. 15 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/BenchmarkingHiveApplication.java
  9. 87 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/CharsetKit.java
  10. 1015 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/Convert.java
  11. 7 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/DNAStatVal.java
  12. 6 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/DNAVal.java
  13. 55 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/PointData.java
  14. 94 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/StrFormatter.java
  15. 448 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/StringUtils.java
  16. 104 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/AjaxResult.java
  17. 144 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/GeneratorCodeConfig.java
  18. 55 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/HiveDruidConfig.java
  19. 23 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/MybatisPlusConfig.java
  20. 71 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/R.java
  21. 12 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/ResultCode.java
  22. 88 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/ResultInfo.java
  23. 37 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/Status.java
  24. 14 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/contant/Contant.java
  25. 264 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/controller/BenchmarkingController.java
  26. 23 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/controller/TestController.java
  27. 101 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/init/CacheContext.java
  28. 38 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Equipmentdaydetailed.java
  29. 32 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Equipmentdayinfo.java
  30. 28 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Line.java
  31. 31 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Project.java
  32. 87 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Windpowerstation.java
  33. 76 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Windpowerstationtestingpoint2.java
  34. 67 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Windturbine.java
  35. 82 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Windturbinetestingpointai2.java
  36. 27 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/vo/FjjxbVo.java
  37. 34 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/vo/FjjxbmxVo.java
  38. 47 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/vo/WxsslVo.java
  39. 751 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/BenchmarkingService.java
  40. 19 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/GenericService.java
  41. 40 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/LineService.java
  42. 45 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/ProjectService.java
  43. 56 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/WindpowerstationService.java
  44. 54 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/WindturbineService.java
  45. 23 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/WindturbineTestingAi2Service.java
  46. 42 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/task/SaticScheduleTask.java
  47. 90 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/AutoRowMapper.java
  48. 125 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/BatchUpdateUtils.java
  49. 238 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/BigDecimalUtils.java
  50. 920 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/DateUtils.java
  51. 12 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/RefUtls.java
  52. 93 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/ScriptJava.java
  53. 345 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/SortUtils.java
  54. 48 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/ApiGolden.java
  55. 1270 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/EdosUtil.java
  56. 27 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/GoldenConfig.java
  57. 236 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/IEdosUtil.java
  58. 34 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/StringUtil.java
  59. 28 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BaseTsQuery.java
  60. 38 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BasicTsData.java
  61. 29 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BasicTsPoint.java
  62. 24 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BlobTsData.java
  63. 22 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BlobWriteTsData.java
  64. 24 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BooleanTsData.java
  65. 19 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BooleanWriteTsData.java
  66. 18 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/Coordinate.java
  67. 26 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/CoordinateTsData.java
  68. 21 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/CoordinateWriteTsData.java
  69. 30 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/DoubleStatData.java
  70. 25 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/DoubleTsData.java
  71. 19 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/DoubleWriteTsData.java
  72. 41 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/ErrorRequest.java
  73. 27 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/GeneralTsData.java
  74. 8 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/Interpolation.java
  75. 204 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/JsonObjectHelper.java
  76. 24 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/LongTsData.java
  77. 20 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/LongWriteTsData.java
  78. 24 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/StringTsData.java
  79. 34 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/StringUtil.java
  80. 20 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/StringWriteTsData.java
  81. 15 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsData.java
  82. 15 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsDataType.java
  83. 12 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsPoint.java
  84. 36 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsPointData.java
  85. 23 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsPointDataList.java
  86. 17 0
      benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsQuery.java
  87. 31 0
      benchmarking-hive/src/main/resources/application.yaml
  88. BIN
      benchmarking-hive/src/main/resources/lib/ImpalaJDBC41.jar
  89. 54 0
      benchmarking-hive/src/test/java/com/gyee/benchmarkinghive/BenchmarkingHiveApplicationTests.java
  90. 33 0
      benchmarking-impala/.gitignore
  91. 118 0
      benchmarking-impala/.mvn/wrapper/MavenWrapperDownloader.java
  92. BIN
      benchmarking-impala/.mvn/wrapper/maven-wrapper.jar
  93. 2 0
      benchmarking-impala/.mvn/wrapper/maven-wrapper.properties
  94. 310 0
      benchmarking-impala/mvnw
  95. 182 0
      benchmarking-impala/mvnw.cmd
  96. 234 0
      benchmarking-impala/pom.xml
  97. 15 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/BenchmarkingImpalaApplication.java
  98. 87 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/common/CharsetKit.java
  99. 1015 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/common/Convert.java
  100. 0 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/common/DNAStatVal.java

+ 33 - 0
benchmarking-hive/.gitignore

@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/

+ 118 - 0
benchmarking-hive/.mvn/wrapper/MavenWrapperDownloader.java

@@ -0,0 +1,118 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+    private static final String WRAPPER_VERSION = "0.5.6";
+    /**
+     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+     */
+    private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+            + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+    /**
+     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+     * use instead of the default one.
+     */
+    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+            ".mvn/wrapper/maven-wrapper.properties";
+
+    /**
+     * Path where the maven-wrapper.jar will be saved to.
+     */
+    private static final String MAVEN_WRAPPER_JAR_PATH =
+            ".mvn/wrapper/maven-wrapper.jar";
+
+    /**
+     * Name of the property which should be used to override the default download url for the wrapper.
+     */
+    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+    public static void main(String args[]) {
+        System.out.println("- Downloader started");
+        File baseDirectory = new File(args[0]);
+        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+        // If the maven-wrapper.properties exists, read it and check if it contains a custom
+        // wrapperUrl parameter.
+        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+        String url = DEFAULT_DOWNLOAD_URL;
+        if (mavenWrapperPropertyFile.exists()) {
+            FileInputStream mavenWrapperPropertyFileInputStream = null;
+            try {
+                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+                Properties mavenWrapperProperties = new Properties();
+                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+            } catch (IOException e) {
+                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+            } finally {
+                try {
+                    if (mavenWrapperPropertyFileInputStream != null) {
+                        mavenWrapperPropertyFileInputStream.close();
+                    }
+                } catch (IOException e) {
+                    // Ignore ...
+                }
+            }
+        }
+        System.out.println("- Downloading from: " + url);
+
+        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+        if (!outputFile.getParentFile().exists()) {
+            if (!outputFile.getParentFile().mkdirs()) {
+                System.out.println(
+                        "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+            }
+        }
+        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+        try {
+            downloadFileFromURL(url, outputFile);
+            System.out.println("Done");
+            System.exit(0);
+        } catch (Throwable e) {
+            System.out.println("- Error downloading");
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+        if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+            String username = System.getenv("MVNW_USERNAME");
+            char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+            Authenticator.setDefault(new Authenticator() {
+                @Override
+                protected PasswordAuthentication getPasswordAuthentication() {
+                    return new PasswordAuthentication(username, password);
+                }
+            });
+        }
+        URL website = new URL(urlString);
+        ReadableByteChannel rbc;
+        rbc = Channels.newChannel(website.openStream());
+        FileOutputStream fos = new FileOutputStream(destination);
+        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+        fos.close();
+        rbc.close();
+    }
+
+}

BIN
benchmarking-hive/.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
benchmarking-hive/.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

+ 310 - 0
benchmarking-hive/mvnw

@@ -0,0 +1,310 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+#   JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+#   M2_HOME - location of maven2's installed home dir
+#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
+#     e.g. to debug Maven itself, use
+#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+  if [ -f /etc/mavenrc ] ; then
+    . /etc/mavenrc
+  fi
+
+  if [ -f "$HOME/.mavenrc" ] ; then
+    . "$HOME/.mavenrc"
+  fi
+
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  MINGW*) mingw=true;;
+  Darwin*) darwin=true
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+    if [ -z "$JAVA_HOME" ]; then
+      if [ -x "/usr/libexec/java_home" ]; then
+        export JAVA_HOME="`/usr/libexec/java_home`"
+      else
+        export JAVA_HOME="/Library/Java/Home"
+      fi
+    fi
+    ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+  fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+  ## resolve links - $0 may be a link to maven's home
+  PRG="$0"
+
+  # need this for relative symlinks
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+      PRG="$link"
+    else
+      PRG="`dirname "$PRG"`/$link"
+    fi
+  done
+
+  saveddir=`pwd`
+
+  M2_HOME=`dirname "$PRG"`/..
+
+  # make it fully qualified
+  M2_HOME=`cd "$M2_HOME" && pwd`
+
+  cd "$saveddir"
+  # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --unix "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME="`(cd "$M2_HOME"; pwd)`"
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+  javaExecutable="`which javac`"
+  if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+    # readlink(1) is not available as standard on Solaris 10.
+    readLink=`which readlink`
+    if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+      if $darwin ; then
+        javaHome="`dirname \"$javaExecutable\"`"
+        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+      else
+        javaExecutable="`readlink -f \"$javaExecutable\"`"
+      fi
+      javaHome="`dirname \"$javaExecutable\"`"
+      javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+      JAVA_HOME="$javaHome"
+      export JAVA_HOME
+    fi
+  fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD="`which java`"
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly." >&2
+  echo "  We cannot execute $JAVACMD" >&2
+  exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+  if [ -z "$1" ]
+  then
+    echo "Path not specified to find_maven_basedir"
+    return 1
+  fi
+
+  basedir="$1"
+  wdir="$1"
+  while [ "$wdir" != '/' ] ; do
+    if [ -d "$wdir"/.mvn ] ; then
+      basedir=$wdir
+      break
+    fi
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+    if [ -d "${wdir}" ]; then
+      wdir=`cd "$wdir/.."; pwd`
+    fi
+    # end of workaround
+  done
+  echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    echo "$(tr -s '\n' ' ' < "$1")"
+  fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+  exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Found .mvn/wrapper/maven-wrapper.jar"
+    fi
+else
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+    fi
+    if [ -n "$MVNW_REPOURL" ]; then
+      jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    else
+      jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    fi
+    while IFS="=" read key value; do
+      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+      esac
+    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Downloading from: $jarUrl"
+    fi
+    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+    if $cygwin; then
+      wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+    fi
+
+    if command -v wget > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found wget ... using wget"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            wget "$jarUrl" -O "$wrapperJarPath"
+        else
+            wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+        fi
+    elif command -v curl > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found curl ... using curl"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            curl -o "$wrapperJarPath" "$jarUrl" -f
+        else
+            curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+        fi
+
+    else
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Falling back to using Java to download"
+        fi
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        # For Cygwin, switch paths to Windows format before running javac
+        if $cygwin; then
+          javaClass=`cygpath --path --windows "$javaClass"`
+        fi
+        if [ -e "$javaClass" ]; then
+            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Compiling MavenWrapperDownloader.java ..."
+                fi
+                # Compiling the Java class
+                ("$JAVA_HOME/bin/javac" "$javaClass")
+            fi
+            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                # Running the downloader
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Running MavenWrapperDownloader.java ..."
+                fi
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+            fi
+        fi
+    fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+  echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+    MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+  $MAVEN_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 182 - 0
benchmarking-hive/mvnw.cmd

@@ -0,0 +1,182 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements.  See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership.  The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License.  You may obtain a copy of the License at
+@REM
+@REM    https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied.  See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM     e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Found %WRAPPER_JAR%
+    )
+) else (
+    if not "%MVNW_REPOURL%" == "" (
+        SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    )
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Couldn't find %WRAPPER_JAR%, downloading it ...
+        echo Downloading from: %DOWNLOAD_URL%
+    )
+
+    powershell -Command "&{"^
+		"$webclient = new-object System.Net.WebClient;"^
+		"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+		"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+		"}"^
+		"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+		"}"
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Finished downloading %WRAPPER_JAR%
+    )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%

+ 214 - 0
benchmarking-hive/pom.xml

@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>sis-background</artifactId>
+        <groupId>com.gyee</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <groupId>com.gyee</groupId>
+    <artifactId>benchmarking-hive</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>benchmarking-hive</name>
+    <description>对标管理hive版本</description>
+    <properties>
+        <java.version>1.8</java.version>
+        <hive.version>1.1.0</hive.version>
+        <hadoop.version>2.6.0</hadoop.version>
+    </properties>
+    <dependencies>
+        <!-- SpringBoot Web容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+<!--        <dependency>-->
+<!--            <groupId>mysql</groupId>-->
+<!--            <artifactId>mysql-connector-java</artifactId>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>com.oracle</groupId>-->
+<!--            <artifactId>ojdbc6</artifactId>-->
+<!--            <version>11.2.0.3</version>-->
+<!--        </dependency>-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jdbc</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <!--常用工具类 -->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.4</version>
+        </dependency>
+        <!-- 热部署 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <!-- 配置文件读取 -->
+        <dependency>
+            <groupId>commons-configuration</groupId>
+            <artifactId>commons-configuration</artifactId>
+            <version>1.10</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.9</version>
+        </dependency>
+        <!--quartz依赖-->
+        <dependency>
+            <groupId>org.quartz-scheduler</groupId>
+            <artifactId>quartz</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>3.3.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+            <version>2.3.28</version>
+        </dependency>
+
+        <!-- 添加swagger2 -->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.7.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-mapper-asl</artifactId>
+            <version>1.9.13</version>
+        </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>org.apache.hive</groupId>-->
+<!--            <artifactId>hive-jdbc</artifactId>-->
+<!--            <version>${hive.version}</version>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>org.apache.hadoop</groupId>-->
+<!--            <artifactId>hadoop-common</artifactId>-->
+<!--            <version>${hadoop.version}</version>-->
+<!--        </dependency>-->
+        <dependency>
+            <groupId>ImpalaJDBC</groupId>
+            <artifactId>ImpalaJDBC</artifactId>
+            <version>41</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/resources/lib/ImpalaJDBC41.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>3.9</version>
+            <scope>compile</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <!-- 使用maven-jar-plugin和maven-dependency-plugin插件打包 -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>3.0.2</version>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <addClasspath>true</addClasspath>
+                            <classpathPrefix>lib/</classpathPrefix>
+                            <mainClass>com.gyee.benchmarkinghive.BenchmarkingHiveApplication</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>3.0.2</version>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <fork>true</fork>
+                    <!--增加jvm参数-->
+                    <jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 15 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/BenchmarkingHiveApplication.java

@@ -0,0 +1,15 @@
+package com.gyee.benchmarkinghive;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+
+@SpringBootApplication
+public class BenchmarkingHiveApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(BenchmarkingHiveApplication.class, args);
+    }
+
+}

+ 87 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/CharsetKit.java

@@ -0,0 +1,87 @@
+package com.gyee.benchmarkinghive.common;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 字符集工具类
+ * 
+ * @author fc
+ *
+ */
+public class CharsetKit
+{
+    /** ISO-8859-1 */
+    public static final String ISO_8859_1 = "ISO-8859-1";
+    /** UTF-8 */
+    public static final String UTF_8 = "UTF-8";
+    /** GBK */
+    public static final String GBK = "GBK";
+
+    /** ISO-8859-1 */
+    public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
+    /** UTF-8 */
+    public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
+    /** GBK */
+    public static final Charset CHARSET_GBK = Charset.forName(GBK);
+
+    /**
+     * 转换为Charset对象
+     * 
+     * @param charset 字符集,为空则返回默认字符集
+     * @return Charset
+     */
+    public static Charset charset(String charset)
+    {
+        return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
+    }
+
+    /**
+     * 转换字符串的字符集编码
+     * 
+     * @param source 字符串
+     * @param srcCharset 源字符集,默认ISO-8859-1
+     * @param destCharset 目标字符集,默认UTF-8
+     * @return 转换后的字符集
+     */
+    public static String convert(String source, String srcCharset, String destCharset)
+    {
+        return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
+    }
+
+    /**
+     * 转换字符串的字符集编码
+     * 
+     * @param source 字符串
+     * @param srcCharset 源字符集,默认ISO-8859-1
+     * @param destCharset 目标字符集,默认UTF-8
+     * @return 转换后的字符集
+     */
+    public static String convert(String source, Charset srcCharset, Charset destCharset)
+    {
+        if (null == srcCharset)
+        {
+            srcCharset = StandardCharsets.ISO_8859_1;
+        }
+
+        if (null == destCharset)
+        {
+            srcCharset = StandardCharsets.UTF_8;
+        }
+
+        if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
+        {
+            return source;
+        }
+        return new String(source.getBytes(srcCharset), destCharset);
+    }
+
+    /**
+     * @return 系统字符集编码
+     */
+    public static String systemCharset()
+    {
+        return Charset.defaultCharset().name();
+    }
+
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1015 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/Convert.java


+ 7 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/DNAStatVal.java

@@ -0,0 +1,7 @@
+package com.gyee.benchmarkinghive.common;
+
+public class DNAStatVal {
+	public DNAVal avg = new DNAVal();
+	public DNAVal max = new DNAVal();
+	public DNAVal min = new DNAVal();
+}

+ 6 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/DNAVal.java

@@ -0,0 +1,6 @@
+package com.gyee.benchmarkinghive.common;
+public class DNAVal {
+	public double DValue;
+	public int Time;
+	public short Status;
+}

+ 55 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/PointData.java

@@ -0,0 +1,55 @@
+package com.gyee.benchmarkinghive.common;
+
+public class PointData {
+
+	private double pointValueInDouble;
+
+	private Long pointTime;
+
+	private String pointValue;
+
+	private String pointName;// z自定义名称
+
+	private String ednaId;// edna全局id
+
+	public String getEdnaId() {
+		return ednaId;
+	}
+
+	public String getPointName() {
+		return pointName;
+	}
+
+	public Long getPointTime() {
+		return pointTime;
+	}
+
+	public String getPointValue() {
+		return pointValue;
+	}
+
+	public double getPointValueInDouble() {
+		return pointValueInDouble;
+	}
+
+	public void setEdnaId(String ednaId) {
+		this.ednaId = ednaId;
+	}
+
+	public void setPointName(String pointName) {
+		this.pointName = pointName;
+	}
+
+	public void setPointTime(Long pointTime) {
+		this.pointTime = pointTime;
+	}
+
+	public void setPointValue(String pointValue) {
+		this.pointValue = pointValue;
+	}
+
+	public void setPointValueInDouble(double pointValueInDouble) {
+		this.pointValueInDouble = pointValueInDouble;
+	}
+
+}

+ 94 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/StrFormatter.java

@@ -0,0 +1,94 @@
+package com.gyee.benchmarkinghive.common;
+
+
+/**
+ * 字符串格式化
+ * 
+ * @author fc
+ */
+public class StrFormatter
+{
+
+    public static final String EMPTY_JSON = "{}";
+    public static final char C_BACKSLASH = '\\';
+    public static final char C_DELIM_START = '{';
+    public static final char C_DELIM_END = '}';
+
+    /**
+     * 格式化字符串<br>
+     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
+     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
+     * 例:<br>
+     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
+     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
+     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
+     * 
+     * @param strPattern 字符串模板
+     * @param argArray 参数列表
+     * @return 结果
+     */
+    public static String format(final String strPattern, final Object... argArray)
+    {
+        if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray))
+        {
+            return strPattern;
+        }
+        final int strPatternLength = strPattern.length();
+
+        // 初始化定义好的长度以获得更好的性能
+        StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
+
+        int handledPosition = 0;
+        int delimIndex;// 占位符所在位置
+        for (int argIndex = 0; argIndex < argArray.length; argIndex++)
+        {
+            delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
+            if (delimIndex == -1)
+            {
+                if (handledPosition == 0)
+                {
+                    return strPattern;
+                }
+                else
+                { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
+                    sbuf.append(strPattern, handledPosition, strPatternLength);
+                    return sbuf.toString();
+                }
+            }
+            else
+            {
+                if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH)
+                {
+                    if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH)
+                    {
+                        // 转义符之前还有一个转义符,占位符依旧有效
+                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
+                        sbuf.append(Convert.utf8Str(argArray[argIndex]));
+                        handledPosition = delimIndex + 2;
+                    }
+                    else
+                    {
+                        // 占位符被转义
+                        argIndex--;
+                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
+                        sbuf.append(C_DELIM_START);
+                        handledPosition = delimIndex + 1;
+                    }
+                }
+                else
+                {
+                    // 正常占位符
+                    sbuf.append(strPattern, handledPosition, delimIndex);
+                    sbuf.append(Convert.utf8Str(argArray[argIndex]));
+                    handledPosition = delimIndex + 2;
+                }
+            }
+        }
+        // append the characters following the last {} pair.
+        // 加入最后一个占位符后所有的字符
+        sbuf.append(strPattern, handledPosition, strPattern.length());
+
+        return sbuf.toString();
+    }
+
+}

+ 448 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/common/StringUtils.java

@@ -0,0 +1,448 @@
+package com.gyee.benchmarkinghive.common;
+
+import org.apache.commons.lang.WordUtils;
+import org.apache.commons.lang.text.StrBuilder;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Collection;
+import java.util.Map;
+import java.util.UUID;
+
+
+/**
+ * 字符串工具类
+ * 
+ * @author fc
+ */
+public class StringUtils extends org.apache.commons.lang3.StringUtils
+{
+    /** 空字符串 */
+    private static final String NULLSTR = "";
+
+    /** 下划线 */
+    private static final char SEPARATOR = '_';
+
+    /**
+     * 获取参数不为空值
+     * 
+     * @param value defaultValue 要判断的value
+     * @return value 返回值
+     */
+    public static <T> T nvl(T value, T defaultValue)
+    {
+        return value != null ? value : defaultValue;
+    }
+
+    /**
+     * * 判断一个Collection是否为空, 包含List,Set,Queue
+     * 
+     * @param coll 要判断的Collection
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Collection<?> coll)
+    {
+        return isNull(coll) || coll.isEmpty();
+    }
+
+    /**
+     * * 判断一个Collection是否非空,包含List,Set,Queue
+     * 
+     * @param coll 要判断的Collection
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Collection<?> coll)
+    {
+        return !isEmpty(coll);
+    }
+
+    /**
+     * * 判断一个对象数组是否为空
+     * 
+     * @param objects 要判断的对象数组
+     ** @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Object[] objects)
+    {
+        return isNull(objects) || (objects.length == 0);
+    }
+
+    /**
+     * * 判断一个对象数组是否非空
+     * 
+     * @param objects 要判断的对象数组
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Object[] objects)
+    {
+        return !isEmpty(objects);
+    }
+
+    /**
+     * * 判断一个Map是否为空
+     * 
+     * @param map 要判断的Map
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Map<?, ?> map)
+    {
+        return isNull(map) || map.isEmpty();
+    }
+
+    /**
+     * * 判断一个Map是否为空
+     * 
+     * @param map 要判断的Map
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Map<?, ?> map)
+    {
+        return !isEmpty(map);
+    }
+
+    /**
+     * * 判断一个字符串是否为空串
+     * 
+     * @param str String
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(String str)
+    {
+        return isNull(str) || NULLSTR.equals(str.trim());
+    }
+
+    /**
+     * * 判断一个字符串是否为非空串
+     * 
+     * @param str String
+     * @return true:非空串 false:空串
+     */
+    public static boolean isNotEmpty(String str)
+    {
+        return !isEmpty(str);
+    }
+
+    /**
+     * * 判断一个对象是否为空
+     * 
+     * @param object Object
+     * @return true:为空 false:非空
+     */
+    public static boolean isNull(Object object)
+    {
+        return object == null;
+    }
+
+    /**
+     * * 判断一个对象是否非空
+     * 
+     * @param object Object
+     * @return true:非空 false:空
+     */
+    public static boolean isNotNull(Object object)
+    {
+        return !isNull(object);
+    }
+
+    /**
+     * * 判断一个对象是否是数组类型(Java基本型别的数组)
+     * 
+     * @param object 对象
+     * @return true:是数组 false:不是数组
+     */
+    public static boolean isArray(Object object)
+    {
+        return isNotNull(object) && object.getClass().isArray();
+    }
+
+    /**
+     * 去空格
+     */
+    public static String trim(String str)
+    {
+        return (str == null ? "" : str.trim());
+    }
+
+    /**
+     * 截取字符串
+     * 
+     * @param str 字符串
+     * @param start 开始
+     * @return 结果
+     */
+    public static String substring(final String str, int start)
+    {
+        if (str == null)
+        {
+            return NULLSTR;
+        }
+
+        if (start < 0)
+        {
+            start = str.length() + start;
+        }
+
+        if (start < 0)
+        {
+            start = 0;
+        }
+        if (start > str.length())
+        {
+            return NULLSTR;
+        }
+
+        return str.substring(start);
+    }
+
+    /**
+     * 截取字符串
+     * 
+     * @param str 字符串
+     * @param start 开始
+     * @param end 结束
+     * @return 结果
+     */
+    public static String substring(final String str, int start, int end)
+    {
+        if (str == null)
+        {
+            return NULLSTR;
+        }
+
+        if (end < 0)
+        {
+            end = str.length() + end;
+        }
+        if (start < 0)
+        {
+            start = str.length() + start;
+        }
+
+        if (end > str.length())
+        {
+            end = str.length();
+        }
+
+        if (start > end)
+        {
+            return NULLSTR;
+        }
+
+        if (start < 0)
+        {
+            start = 0;
+        }
+        if (end < 0)
+        {
+            end = 0;
+        }
+
+        return str.substring(start, end);
+    }
+
+    /**
+     * 格式化文本, {} 表示占位符<br>
+     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
+     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
+     * 例:<br>
+     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
+     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
+     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
+     * 
+     * @param template 文本模板,被替换的部分用 {} 表示
+     * @param params 参数值
+     * @return 格式化后的文本
+     */
+    public static String format(String template, Object... params)
+    {
+        if (isEmpty(params) || isEmpty(template))
+        {
+            return template;
+        }
+        return StrFormatter.format(template, params);
+    }
+
+    /**
+     * 驼峰首字符小写 NameVc>>nameVc
+     */
+    public static String uncapitalize(String str)
+    {
+        int strLen;
+        if (str == null || (strLen = str.length()) == 0)
+        {
+            return str;
+        }
+        return new StrBuilder(strLen).append(Character.toLowerCase(str.charAt(0))).append(str.substring(1)).toString();
+    }
+    
+
+    /**
+     * 下划线转驼峰命名 nameVc>>name_vc
+     */
+    public static String toUnderScoreCase(String s)
+    {
+        if (s == null)
+        {
+            return null;
+        }
+        StringBuilder sb = new StringBuilder();
+        boolean upperCase = false;
+        for (int i = 0; i < s.length(); i++)
+        {
+            char c = s.charAt(i);
+
+            boolean nextUpperCase = true;
+
+            if (i < (s.length() - 1))
+            {
+                nextUpperCase = Character.isUpperCase(s.charAt(i + 1));
+            }
+
+            if ((i > 0) && Character.isUpperCase(c))
+            {
+                if (!upperCase || !nextUpperCase)
+                {
+                    sb.append(SEPARATOR);
+                }
+                upperCase = true;
+            }
+            else
+            {
+                upperCase = false;
+            }
+
+            sb.append(Character.toLowerCase(c));
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * 是否包含字符串
+     * 
+     * @param str 验证字符串
+     * @param strs 字符串组
+     * @return 包含返回true
+     */
+    public static boolean inStringIgnoreCase(String str, String... strs)
+    {
+        if (str != null && strs != null)
+        {
+            for (String s : strs)
+            {
+                if (str.equalsIgnoreCase(trim(s)))
+                {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+    
+    /**
+     * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
+     * 
+     * @param name 转换前的下划线大写方式命名的字符串
+     * @return 转换后的驼峰式命名的字符串
+     */
+    public static String convertToCamelCase(String name)
+    {
+        StringBuilder result = new StringBuilder();
+        // 快速检查
+        if (name == null || name.isEmpty())
+        {
+            // 没必要转换
+            return "";
+        }
+        else if (!name.contains("_"))
+        {
+            // 不含下划线,仅将首字母大写
+            return name.substring(0, 1).toUpperCase() + name.substring(1);
+        }
+        // 用下划线将原始字符串分割
+        String[] camels = name.split("_");
+        for (String camel : camels)
+        {
+            // 跳过原始字符串中开头、结尾的下换线或双重下划线
+            if (camel.isEmpty())
+            {
+                continue;
+            }
+            // 首字母大写
+            result.append(camel.substring(0, 1).toUpperCase());
+            result.append(camel.substring(1).toLowerCase());
+        }
+        return result.toString();
+    }
+    /**
+     * 首字母大写
+     *
+     * @param name
+     * @return
+     */
+    public static String firstUpperCase(String name) {
+        name = name.substring(0, 1).toUpperCase() + name.substring(1);
+        return name;
+    }
+    /**
+     * 首字母小写
+     *
+     * @param name
+     * @return
+     */
+    public static String firstLowerCase(String name) {
+        name = name.substring(0, 1).toLowerCase() + name.substring(1);
+        return name;
+
+    }
+    
+    /**
+     * 将下划线转化为大写
+     *
+     * @param name
+     * @param firstCase 首字母是否大写 true:大写 false;小写
+     * @return
+     */
+    public static String upperCase_(String name, boolean firstCase) {
+        if(isEmpty(name)){
+            return "";
+        }
+        String[] s = name.split("_");
+        StringBuffer stringBuffer = new StringBuffer();
+        for (String s1 : s) {
+            stringBuffer.append(s1.substring(0, 1).toUpperCase() + s1.substring(1));
+        }
+        if(!firstCase){
+            return firstLowerCase(stringBuffer.toString());
+        }
+        return stringBuffer.toString();
+    }
+
+    
+
+    /**
+     * 列名转换成Java属性名
+     */
+    public static String columnToJava(String columnName) {
+        return WordUtils.capitalizeFully(columnName, new char[]{'_'}).replace("_", "" );
+    }
+    /**
+     * 表名转换成Java类名
+     */
+    public static String tableToJava(String tableName, String tablePrefix) {
+        if (StringUtils.isNotBlank(tablePrefix)) {
+            tableName = tableName.replaceFirst(tablePrefix, "" );
+        }
+        return columnToJava(tableName);
+    }
+
+    public static double round(double num, int digit) {
+
+        return new BigDecimal(num).setScale(digit, RoundingMode.HALF_UP).doubleValue();
+    }
+
+    public static String getUUID(){
+        String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
+        return uuid;
+    }
+}

+ 104 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/AjaxResult.java

@@ -0,0 +1,104 @@
+package com.gyee.benchmarkinghive.config;
+
+import java.util.HashMap;
+
+/**
+* @ClassName: AjaxResult
+* @Description: ajax操作消息提醒
+* @author gyee
+* @date 2018年8月18日
+*
+ */
+public class AjaxResult extends HashMap<String, Object>
+{
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 初始化一个新创建的 Message 对象
+     */
+    public AjaxResult()
+    {
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @return 错误消息
+     */
+    public static AjaxResult error()
+    {
+        return error(1, "操作失败");
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @param msg 内容
+     * @return 错误消息
+     */
+    public static AjaxResult error(String msg)
+    {
+        return error(500, msg);
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @param code 错误码
+     * @param msg 内容
+     * @return 错误消息
+     */
+    public static AjaxResult error(int code, String msg)
+    {
+        AjaxResult json = new AjaxResult();
+        json.put("code", code);
+        json.put("msg", msg);
+        return json;
+    }
+
+    /**
+     * 返回成功消息
+     * 
+     * @param msg 内容
+     * @return 成功消息
+     */
+    public static AjaxResult success(String msg)
+    {
+        AjaxResult json = new AjaxResult();
+        json.put("msg", msg);
+        json.put("code", 200);
+        return json;
+    }
+    
+    /**
+     * 返回成功消息
+     * 
+     * @return 成功消息
+     */
+    public static AjaxResult success()
+    {
+        return AjaxResult.success("操作成功");
+    }
+    
+    public static AjaxResult successData(int code, Object value){
+    	 AjaxResult json = new AjaxResult();
+    	 json.put("code", code);
+         json.put("data", value);
+         return json;
+    }
+   
+    
+    /**
+     * 返回成功消息
+     * 
+     * @param key 键值
+     * @param value 内容
+     * @return 成功消息
+     */
+    @Override
+    public AjaxResult put(String key, Object value)
+    {
+        super.put(key, value);
+        return this;
+    }
+}

+ 144 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/GeneratorCodeConfig.java

@@ -0,0 +1,144 @@
+package com.gyee.benchmarkinghive.config;
+
+
+import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
+
+import java.util.Scanner;
+
+/**
+ *@ClassName GeneratorCodeConfig
+ *@Description 自动生成mybatisplus的相关代码
+ *@Author 谢生杰
+ *@Date 2020/9/25 18:26
+ *@Version 1.0
+ **/
+public class GeneratorCodeConfig {
+    public static String scanner(String tip) {
+        Scanner scanner = new Scanner(System.in);
+        StringBuilder help = new StringBuilder();
+        help.append("请输入" + tip + ":");
+        System.out.println(help.toString());
+        if (scanner.hasNext()) {
+            String ipt = scanner.next();
+            if (StringUtils.isNotEmpty(ipt)) {
+                return ipt;
+            }
+        }
+        throw new MybatisPlusException("请输入正确的" + tip + "!");
+    }
+
+    public static void main(String[] args) {
+        // 代码生成器
+        AutoGenerator mpg = new AutoGenerator();
+
+        // 全局配置
+        GlobalConfig gc = new GlobalConfig();
+        String projectPath = System.getProperty("user.dir");
+        gc.setOutputDir(projectPath + "/src/main/java");
+        gc.setAuthor("谢生杰");
+        gc.setOpen(false);
+        //实体属性 Swagger2 注解
+        gc.setSwagger2(false);
+        mpg.setGlobalConfig(gc);
+
+        // 数据源配置
+        DataSourceConfig dsc = new DataSourceConfig();
+        /*dsc.setUrl("jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true");
+        dsc.setDriverName("com.mysql.jdbc.Driver");
+        dsc.setUsername("root");
+        dsc.setPassword("root");
+        mpg.setDataSource(dsc);*/
+        dsc.setDriverName("oracle.jdbc.driver.OracleDriver");
+        dsc.setUsername("nxfdprod");
+        dsc.setPassword("gdnxfd123");
+        dsc.setUrl("jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd");
+
+        mpg.setDataSource(dsc);
+
+
+
+        // 包配置
+        PackageConfig pc = new PackageConfig();
+//        pc.setModuleName(scanner("模块名"));
+        pc.setParent("com.gyee.datacenter");
+        pc.setEntity("model.auto");
+        pc.setMapper("mapper.auto");
+        pc.setService("service.auto");
+        pc.setServiceImpl("service.auto.impl");
+        mpg.setPackageInfo(pc);
+
+        // 自定义配置
+//        InjectionConfig cfg = new InjectionConfig() {
+//            @Override
+//            public void initMap() {
+//                // to do nothing
+//            }
+//        };
+
+        // 如果模板引擎是 freemarker
+//        String templatePath = "/templates/mapper.xml.ftl";
+        // 如果模板引擎是 velocity
+        // String templatePath = "/templates/mapper.xml.vm";
+
+        // 自定义输出配置
+//        List<FileOutConfig> focList = new ArrayList<>();
+        // 自定义配置会被优先输出
+//        focList.add(new FileOutConfig(templatePath) {
+//            @Override
+//            public String outputFile(TableInfo tableInfo) {
+//                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
+//                return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
+//                        + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
+//            }
+//        });
+        /*
+        cfg.setFileCreate(new IFileCreate() {
+            @Override
+            public boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) {
+                // 判断自定义文件夹是否需要创建
+                checkDir("调用默认方法创建的目录");
+                return false;
+            }
+        });
+        */
+//        cfg.setFileOutConfigList(focList);
+//        mpg.setCfg(cfg);
+
+        // 配置模板
+        TemplateConfig templateConfig = new TemplateConfig();
+
+        // 配置自定义输出模板
+        //指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
+        // templateConfig.setEntity("templates/entity2.java");
+        // templateConfig.setService();
+        // templateConfig.setController();
+
+        templateConfig.setXml(null);
+        mpg.setTemplate(templateConfig);
+
+        // 策略配置
+        StrategyConfig strategy = new StrategyConfig();
+        strategy.setNaming(NamingStrategy.underline_to_camel);
+        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
+        strategy.setSuperEntityClass("com.baomidou.mybatisplus.extension.activerecord.Model");
+        strategy.setEntityLombokModel(true);
+        strategy.setRestControllerStyle(true);
+
+        strategy.setEntityLombokModel(true);
+        // 公共父类
+//        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
+        // 写于父类中的公共字段
+//        strategy.setSuperEntityColumns("id");
+        strategy.setInclude(scanner("表名,多个英文逗号分割").split(","));
+        strategy.setControllerMappingHyphenStyle(true);
+        strategy.setTablePrefix(pc.getModuleName() + "_");
+        mpg.setStrategy(strategy);
+        mpg.setTemplateEngine(new FreemarkerTemplateEngine());
+        mpg.execute();
+    }
+}

+ 55 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/HiveDruidConfig.java

@@ -0,0 +1,55 @@
+package com.gyee.benchmarkinghive.config;
+
+import com.alibaba.druid.pool.DruidDataSource;
+import com.zaxxer.hikari.HikariDataSource;
+import lombok.Data;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.jdbc.DataSourceBuilder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+import javax.sql.DataSource;
+
+
+/**
+ * @ClassName : HiveDruidConfig
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 9:57
+ * @Description : hive数据库配置
+ */
+@Configuration
+@EnableTransactionManagement
+public class HiveDruidConfig {
+    @Primary
+    @Bean(name = "impalaDataSource")
+    @Qualifier(value = "impalaDataSource")
+    @ConfigurationProperties(prefix = "spring.datasource.impala")
+    public DataSource primaryDataSource() {
+        return DataSourceBuilder.create().type(HikariDataSource.class).build();
+    }
+
+    @Bean(name = "jdbcTemplateImpala")
+    public JdbcTemplate jdbcTemplateImpala(@Qualifier("impalaDataSource") DataSource dataSource) {
+        return new JdbcTemplate(dataSource);
+    }
+
+    @Bean(name = "namedJdbcTemplateImpala")
+    public NamedParameterJdbcTemplate namedJdbcTemplateImpala(
+            @Qualifier("impalaDataSource") DataSource dataSource) {
+        return new NamedParameterJdbcTemplate(dataSource);
+    }
+
+
+
+}

+ 23 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/MybatisPlusConfig.java

@@ -0,0 +1,23 @@
+package com.gyee.benchmarkinghive.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ *@ClassName MybatisPlusConfig
+ *@Description 配置分页插件
+ *@Author 谢生杰
+ *@Date 2020/9/25 18:24
+ *@Version 1.0
+ **/
+@Configuration
+public class MybatisPlusConfig {
+    /**
+     * 分页插件
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        return new PaginationInterceptor();
+    }
+}

+ 71 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/R.java

@@ -0,0 +1,71 @@
+package com.gyee.benchmarkinghive.config;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @ClassName : R
+ * @Author : xieshengjie
+ * @Date: 2021/5/16 16:59
+ * @Description : 结果集
+ */
+@Data
+public class R {
+    @ApiModelProperty(value = "是否成功")
+    private Boolean success;
+    @ApiModelProperty(value = "返回码")
+    private Integer code;
+    @ApiModelProperty(value = "返回消息")
+    private String message;
+    @ApiModelProperty(value = "总数量")
+    private Long count;
+    @ApiModelProperty(value = "返回数据")
+    private Object data = new Object();
+    private R(){}
+    public static R ok(){
+        R r = new R();
+        r.setSuccess(true);
+        r.setCode(ResultCode.SUCCESS);
+        r.setMessage("成功");
+        return r;
+    }
+    public static R ok(Long count){
+        R r = new R();
+        r.setSuccess(true);
+        r.setCode(ResultCode.SUCCESS);
+        r.setMessage("成功");
+        r.setCount(count);
+        return r;
+    }
+    public static R error(){
+        R r = new R();
+        r.setSuccess(false);
+        r.setCode(ResultCode.ERROR);
+        r.setMessage("失败");
+        return r;
+    }
+    public R success(Boolean success){
+        this.setSuccess(success);
+        return this;
+    }
+    public R message(String message){
+        this.setMessage(message);
+        return this;
+    }
+    public R code(Integer code){
+        this.setCode(code);
+        return this;
+    }
+//    public R data(String key, Object value){
+//        this.data.put(key, value);
+//        return this;
+//    }
+//    public R data(Map<String, Object> map){
+//        this.setData(map);
+//        return this;
+//    }
+    public R data(Object value){
+        this.setData(value);
+        return this;
+    }
+}

+ 12 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/ResultCode.java

@@ -0,0 +1,12 @@
+package com.gyee.benchmarkinghive.config;
+
+/**
+ * @ClassName : ResultCode
+ * @Author : xieshengjie
+ * @Date: 2021/5/16 17:01
+ * @Description : 结果状态
+ */
+public class ResultCode {
+    public static Integer SUCCESS = 200;
+    public static Integer ERROR = 500;
+}

+ 88 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/ResultInfo.java

@@ -0,0 +1,88 @@
+package com.gyee.benchmarkinghive.config;
+
+import lombok.Data;
+
+/**
+ *@ClassName ResultInfo
+ *@Description 返回结果类统一封装
+ *@Author 谢生杰
+ *@Date 2020/9/25 18:53
+ *@Version 1.0
+ **/
+@Data
+public class ResultInfo {
+    // 状态码
+    private Integer code;
+    // 消息
+    private String message;
+    // 数据对象
+    private Object result;
+
+    private Integer total;
+
+    /**
+     * 无参构造器
+     */
+    public ResultInfo() {
+        super();
+    }
+
+    public ResultInfo(Status status) {
+        super();
+        this.code = status.code;
+        this.message = status.message;
+    }
+
+
+    public ResultInfo result(Object result) {
+        this.result = result;
+        return this;
+    }
+
+    public ResultInfo message(String message) {
+        this.message = message;
+        return this;
+    }
+    public ResultInfo total(Integer total) {
+        this.total = total;
+        return this;
+    }
+
+    /**
+     * 只返回状态,状态码,消息
+     *
+     * @param code
+     * @param message
+     */
+    public ResultInfo(Integer code, String message) {
+        super();
+        this.code = code;
+        this.message = message;
+    }
+
+    /**
+     * 只返回状态,状态码,数据对象
+     *
+     * @param code
+     * @param result
+     */
+    public ResultInfo(Integer code, Object result) {
+        super();
+        this.code = code;
+        this.result = result;
+    }
+
+    /**
+     * 返回全部信息即状态,状态码,消息,数据对象
+     *
+     * @param code
+     * @param message
+     * @param result
+     */
+    public ResultInfo(Integer code, String message, Object result) {
+        super();
+        this.code = code;
+        this.message = message;
+        this.result = result;
+    }
+}

+ 37 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/config/Status.java

@@ -0,0 +1,37 @@
+package com.gyee.benchmarkinghive.config;
+/**
+ *@ClassName Status
+ *@Description 枚举类对象
+ *@Author 谢生杰
+ *@Date 2020/9/25 18:54
+ *@Version 1.0
+ **/
+public enum Status {
+    // 公共
+    SUCCESS(2000, "成功"),
+    UNKNOWN_ERROR(9998,"未知异常"),
+    SYSTEM_ERROR(9999, "系统异常"),
+
+
+    INSUFFICIENT_PERMISSION(4003, "权限不足"),
+
+    WARN(9000, "失败"),
+    REQUEST_PARAMETER_ERROR(1002, "请求参数错误"),
+
+    // 登录
+    LOGIN_EXPIRE(2001, "未登录或者登录失效"),
+    LOGIN_CODE_ERROR(2002, "登录验证码错误"),
+    LOGIN_ERROR(2003, "用户名不存在或密码错误"),
+    LOGIN_USER_STATUS_ERROR(2004, "用户状态不正确"),
+    LOGOUT_ERROR(2005, "退出失败,token不存在"),
+    LOGIN_USER_NOT_EXIST(2006, "该用户不存在"),
+    LOGIN_USER_EXIST(2007, "该用户已存在");
+
+    public int code;
+    public String message;
+
+    Status(int code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+}

+ 14 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/contant/Contant.java

@@ -0,0 +1,14 @@
+package com.gyee.benchmarkinghive.contant;
+
+/**
+ * @ClassName : Contant
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 22:28
+ * @Description : 常量类
+ */
+
+public class Contant {
+
+    public static String WXSS = "RFDL,AI022,RDJSSDL-ZS,RSTSSDL-ZS,RXNSSDL-ZS,RQXSSDL-ZS,RGZSSDL-ZS,NSZSSDL-ZS,RJXSSDL-ZS,RLZSSDL-ZS,RQFSSDL-ZS,RXDSSDL-ZS,RWZSSDL-ZS,RTZSSDL-ZS";
+
+}

+ 264 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/controller/BenchmarkingController.java

@@ -0,0 +1,264 @@
+package com.gyee.benchmarkinghive.controller;
+
+import com.gyee.benchmarkinghive.common.StringUtils;
+import com.gyee.benchmarkinghive.config.R;
+import com.gyee.benchmarkinghive.init.CacheContext;
+import com.gyee.benchmarkinghive.model.auto.Line;
+import com.gyee.benchmarkinghive.model.auto.Project;
+import com.gyee.benchmarkinghive.model.auto.Windpowerstation;
+import com.gyee.benchmarkinghive.model.vo.FjjxbVo;
+import com.gyee.benchmarkinghive.model.vo.FjjxbmxVo;
+import com.gyee.benchmarkinghive.model.vo.WxsslVo;
+import com.gyee.benchmarkinghive.service.BenchmarkingService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : BenchmarkingController
+ * @Author : xieshengjie
+ * @Date: 2021/6/16 10:27
+ * @Description : 对标管理controller
+ */
+@RestController
+@RequestMapping("//benchmarking")
+public class BenchmarkingController {
+    @Autowired
+    private BenchmarkingService benchmarkingService;
+
+    /**
+     * 场站列表
+     * @return
+     */
+    @GetMapping("/wplist")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R wplist(){
+        List<Windpowerstation> resultList = benchmarkingService.wplist();
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok().data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+    /**
+     * 根据场站查询
+     * 项目列表
+     * @return
+     */
+    @GetMapping("/projectList")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R projectList(@RequestParam(value = "wpid",required = true) String wpids){
+        List<Project> resultList = benchmarkingService.projectList(wpids);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok().data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    /**
+     * 根据项目查询
+     * 线路列表
+     * @return
+     */
+    @GetMapping("/lineList")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R lineList(@RequestParam(value = "project",required = true) String projects){
+        List<Line> resultList = benchmarkingService.lineList(projects);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok().data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    /**
+     * 风机绩效榜
+     * @param wpids
+     * @param projectids
+     * @param lineids
+     * @param beginDate
+     * @param endDate
+     * @param type
+     * @return
+     */
+    @GetMapping("/fjjxb")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R fjjxb(@RequestParam(value = "wpids",required = true) String wpids,
+                   @RequestParam(value = "projectids",required = true) String projectids,
+                   @RequestParam(value = "lineids",required = true) String lineids,
+                   @RequestParam(value = "beginDate",required = true) String beginDate,
+                   @RequestParam(value = "endDate",required = true) String endDate,
+                   @RequestParam(value = "type",required = false) String type
+                   ){
+        List<FjjxbVo> resultList = benchmarkingService.fjjxb(wpids,projectids,lineids,beginDate,endDate,type);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok().data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+    /**
+     * 风机绩效榜明细
+     * @param wpids
+     * @param projectids
+     * @param lineids
+     * @param beginDate
+     * @param endDate
+     * @param type
+     * @return
+     */
+    @GetMapping("/fjjxbmx")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R fjjxbmx(@RequestParam(value = "wpids",required = true) String wpids,
+                   @RequestParam(value = "projectids",required = true) String projectids,
+                   @RequestParam(value = "lineids",required = true) String lineids,
+                   @RequestParam(value = "beginDate",required = true) String beginDate,
+                   @RequestParam(value = "endDate",required = true) String endDate,
+                   @RequestParam(value = "type",required = false) String type
+    ){
+        List<FjjxbmxVo> resultList = benchmarkingService.fjjxbmx(wpids,projectids,lineids,beginDate,endDate,type);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok().data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    /**
+     * 五项损失率
+     * @param wpids
+     * @param projectids
+     * @param lineids
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    @GetMapping("/wxssl")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R wxssl(@RequestParam(value = "wpids",required = true) String wpids,
+                     @RequestParam(value = "projectids",required = true) String projectids,
+                     @RequestParam(value = "lineids",required = true) String lineids,
+                     @RequestParam(value = "beginDate",required = true) String beginDate,
+                     @RequestParam(value = "endDate",required = true) String endDate
+    ){
+        List<WxsslVo> resultList = benchmarkingService.wxssl(wpids,projectids,lineids,beginDate,endDate);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok().data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    /**
+     * 场内对标
+     * @param wpid
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    @GetMapping("/cndb")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R cndb(@RequestParam(value = "wpid",required = true) String wpid,
+                   @RequestParam(value = "beginDate",required = true) String beginDate,
+                   @RequestParam(value = "endDate",required = true) String endDate
+    ){
+        List<WxsslVo> resultList = benchmarkingService.cndb(wpid,beginDate,endDate);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok().data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    /**
+     * 场际对标
+     * @param wpids
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    @GetMapping("/cjdb")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R cjdb(@RequestParam(value = "wpids",required = true) String wpids,
+                  @RequestParam(value = "beginDate",required = true) String beginDate,
+                  @RequestParam(value = "endDate",required = true) String endDate
+    ){
+        List<WxsslVo> resultList = benchmarkingService.cjdb(wpids,beginDate,endDate);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok().data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    /**
+     * 项目对标
+     * @param wpids
+     * @param projectids
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    @GetMapping("/xmdb")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R xmdb(@RequestParam(value = "wpids",required = true) String wpids,
+                  @RequestParam(value = "projectids",required = true) String projectids,
+                  @RequestParam(value = "beginDate",required = true) String beginDate,
+                  @RequestParam(value = "endDate",required = true) String endDate
+    ){
+        List<WxsslVo> resultList = benchmarkingService.xmdb(wpids,projectids,beginDate,endDate);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok().data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    /**
+     * 线路对标
+     * @param wpids
+     * @param projectids
+     * @param lineids
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    @GetMapping("/xldb")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R xldb(@RequestParam(value = "wpids",required = true) String wpids,
+                  @RequestParam(value = "projectids",required = true) String projectids,
+                  @RequestParam(value = "lineids",required = true) String lineids,
+                  @RequestParam(value = "beginDate",required = true) String beginDate,
+                  @RequestParam(value = "endDate",required = true) String endDate
+    ){
+        List<WxsslVo> resultList = benchmarkingService.xldb(wpids,projectids,lineids,beginDate,endDate);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok().data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+}

+ 23 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/controller/TestController.java

@@ -0,0 +1,23 @@
+package com.gyee.benchmarkinghive.controller;
+
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @ClassName : TestController
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 10:34
+ * @Description : 测试
+ */
+@RestController
+public class TestController {
+    public static final Logger logger = LoggerFactory.getLogger(TestController.class);
+
+    @RequestMapping("/table/show")
+    public void showtables() {
+    }
+
+}

+ 101 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/init/CacheContext.java

@@ -0,0 +1,101 @@
+package com.gyee.benchmarkinghive.init;
+
+
+import com.gyee.benchmarkinghive.model.auto.*;
+import com.gyee.benchmarkinghive.service.*;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : CacheContext
+ * @Author : xieshengjie
+ * @Date: 2021/5/18 9:35
+ * @Description : 缓存
+ */
+@Component
+public class CacheContext implements CommandLineRunner {
+
+    private static final Logger log = LoggerFactory.getLogger(CacheContext.class);
+
+    @Autowired
+    private WindturbineService windturbineService;
+    @Autowired
+    private WindpowerstationService windpowerstationService;
+    @Autowired
+    private ProjectService projectService;
+    @Autowired
+    private LineService lineService;
+    @Autowired
+    private WindturbineTestingAi2Service windturbineTestingAi2Service;
+
+    public static Map<String, List<Windturbine>> wtmap = new HashMap<>();
+
+    public static Map<String,Windturbine> wmap = new HashMap<>();
+
+    public static Map<String, Windpowerstation> wpmap = new HashMap<>();
+
+    public static List<Windpowerstation> wplist = new ArrayList<>();
+
+    public static List<Windturbine> wtls = new ArrayList<>();
+
+    public static Map<String, Map<String, Windturbinetestingpointai2>> wtpAimap = new HashMap<String, Map<String, Windturbinetestingpointai2>>();// 风电机测点AI表
+
+    public static List<Project> projects = new ArrayList<>();
+
+    public static List<Line> lines = new ArrayList<>();
+
+
+    @Override
+    public void run(String... args) throws Exception {
+
+        log.info("-------------------------------缓存开始--------------------------------------");
+
+        wplist = windpowerstationService.wpList();
+        wplist.stream().filter(i->i.getId().endsWith("FDC")).forEach(i->{
+            wpmap.put(i.getId(),i);
+        });
+
+        projects = projectService.projectList();
+
+        lines = lineService.lineList();
+
+        wtls = windturbineService.wtlist();
+        wtls.stream().forEach(wt->{
+            wmap.put(wt.getId(),wt);
+            if (wtmap.containsKey(wt.getWindpowerstationid())){
+                wtmap.get(wt.getWindpowerstationid()).add(wt);
+            }else{
+                List<Windturbine> wts = new ArrayList<>();
+                wts.add(wt);
+                wtmap.put(wt.getWindpowerstationid(),wts);
+            }
+        });
+
+        List<Windturbinetestingpointai2> windturbinetestingpointai2List = windturbineTestingAi2Service.windturbinetestingpointai2List();
+        Map<String, Windturbinetestingpointai2> map = null;
+
+        if(windturbinetestingpointai2List != null && !windturbinetestingpointai2List.isEmpty()){
+            for(Windturbinetestingpointai2 mp : windturbinetestingpointai2List){
+                if(wtpAimap.containsKey(mp.getWindturbineid())){
+                    map = wtpAimap.get(mp.getWindturbineid());
+                    map.put(mp.getUniformcode(), mp);
+                }else{
+                    map = new HashMap<String, Windturbinetestingpointai2>();
+                    map.put(mp.getUniformcode(), mp);
+                    wtpAimap.put(mp.getWindturbineid(), map);
+                }
+            }
+        }
+
+        log.info("-------------------------------缓存结束--------------------------------------");
+    }
+}

+ 38 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Equipmentdaydetailed.java

@@ -0,0 +1,38 @@
+package com.gyee.benchmarkinghive.model.auto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName : Equipmentdaydetailed
+ * @Author : xieshengjie
+ * @Date: 2021/6/16 9:36
+ * @Description : 明细po
+ */
+@Data
+public class Equipmentdaydetailed implements Serializable {
+    private static final long serialVersionUID = 8964390482423451823L;
+
+    private String id;
+    private String windturbineid;
+    private String projectid;
+    private String lineid;
+    private String windpowerstationid;
+    private String recorddate;
+    private Double genecapacity;
+    private Double therogenecapacity;
+    private Double speed;
+    private Double daynhwhssdl1;
+    private Double daynhwhssdl2;
+    private Double daynhgzssdl1;
+    private Double daynhgzssdl2;
+    private Double daynhxdssdl1;
+    private Double daynhxdssdl2;
+    private Double daynhqfdl1;
+    private Double daynhqfdl2;
+    private Double daynhqfdl3;
+    private Double daynhqfdl4;
+    private Double daynhcfdl1;
+    private Double daynhcfdl2;
+}

+ 32 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Equipmentdayinfo.java

@@ -0,0 +1,32 @@
+package com.gyee.benchmarkinghive.model.auto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName : Equipmentdayinfo
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 23:14
+ * @Description : 对标日信息
+ */
+@Data
+public class Equipmentdayinfo implements Serializable {
+
+    private static final long serialVersionUID = -587171516949915299L;
+
+    private String id;
+    private String windturbineid;
+    private String projectid;
+    private String lineid;
+    private String windpowerstationid;
+    private String recorddate;
+    private Double genecapacity;
+    private Double therogenecapacity;
+    private Double speed;
+    private Double daynhwhssdl;
+    private Double daynhgzssdl;
+    private Double daynhxdssdl;
+    private Double daynhqfdl;
+    private Double daynhcfdl;
+}

+ 28 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Line.java

@@ -0,0 +1,28 @@
+package com.gyee.benchmarkinghive.model.auto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName : Line
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 18:07
+ * @Description : 线路
+ */
+@Data
+public class Line implements Serializable {
+    private static final long serialVersionUID = -2161997673420964694L;
+
+
+    private String id;
+    private String code;
+    private String name;
+    private String aname;
+    private String projectid;
+    private Integer ordernum;
+    private Double capacity;
+    private String capacityunit;
+    private Integer quantity;
+
+}

+ 31 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Project.java

@@ -0,0 +1,31 @@
+package com.gyee.benchmarkinghive.model.auto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName : Project
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 17:51
+ * @Description : 项目
+ */
+@Data
+public class Project implements Serializable {
+
+    private static final long serialVersionUID = 2862281169480251325L;
+    private String id;
+    private String code;
+    private String name;
+    private String aname;
+    private String windpowerstationid;
+    private Double capacity;
+    private String capacityunit;
+    private Integer quantity;
+    private String model;
+    private String commissiondate;
+    private String masterphone;
+    private String shiftforeman;
+    private String shiftforemanphone;
+    private Integer ordernum;
+}

+ 87 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Windpowerstation.java

@@ -0,0 +1,87 @@
+package com.gyee.benchmarkinghive.model.auto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2021-06-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WINDPOWERSTATION")
+public class Windpowerstation extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("ID")
+    private String id;
+
+    @TableField("CODE")
+    private String code;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("ADDRESS")
+    private String address;
+
+    @TableField("TELEPHONE")
+    private String telephone;
+
+    @TableField("CAPACITY")
+    private Double capacity;
+
+    @TableField("CAPACITYUNIT")
+    private String capacityunit;
+
+    @TableField("QUANTITY")
+    private Double quantity;
+
+    @TableField("ANAME")
+    private String aname;
+
+    @TableField("LONGITUDE")
+    private Double longitude;
+
+    @TableField("LATITUDE")
+    private Double latitude;
+
+    @TableField("PHOTO")
+    private String photo;
+
+    @TableField("COMPANYID")
+    private String companyid;
+
+    @TableField("SYSTEMMANUFACT")
+    private String systemmanufact;
+
+    @TableField("HEADFARM")
+    private String headfarm;
+
+    @TableField("HEADFARMPHONE")
+    private String headfarmphone;
+
+    @TableField("MODEL")
+    private String model;
+
+    @TableField("ORDERNUM")
+    private Double ordernum;
+
+    @TableField("ALTITUDE")
+    private Double altitude;
+
+    @TableField("HEIGHT")
+    private Double height;
+
+
+}

+ 76 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Windpowerstationtestingpoint2.java

@@ -0,0 +1,76 @@
+package com.gyee.benchmarkinghive.model.auto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2021-05-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("Windpowerstationtestingpoint2")
+public class Windpowerstationtestingpoint2 extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("CODE")
+    private String code;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("MODEL")
+    private String model;
+
+    @TableField("VALUEUNIT")
+    private String valueunit;
+
+    @TableField("ENGLISHNAME")
+    private String englishname;
+
+    @TableField("TYPEID")
+    private String typeid;
+
+    @TableField("MODELID")
+    private String modelid;
+
+    @TableField("MAXVAL")
+    private BigDecimal maxval;
+
+    @TableField("MINVAL")
+    private BigDecimal minval;
+
+    @TableField("REASONABLEMAXVAL")
+    private BigDecimal reasonablemaxval;
+
+    @TableField("REASONABLEMINVAL")
+    private BigDecimal reasonableminval;
+
+    @TableField("UNIFORMCODE")
+    private String uniformcode;
+
+    @TableField("SHORTID")
+    private String shortid;
+
+    @TableField("LONGID")
+    private String longid;
+
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationid;
+
+    @TableField("REALTIMEID")
+    private String realtimeid;
+
+
+}

+ 67 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Windturbine.java

@@ -0,0 +1,67 @@
+package com.gyee.benchmarkinghive.model.auto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2021-05-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WINDTURBINE")
+public class Windturbine extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("ID")
+    private String id;
+
+    @TableField("CODE")
+    private String code;
+
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationid;
+
+    @TableField("LONGITUDE")
+    private Double longitude;
+
+    @TableField("LATITUDE")
+    private Double latitude;
+
+    @TableField("MODELID")
+    private String modelid;
+
+    @TableField("STATUS")
+    private String status;
+
+    @TableField("PROJECTID")
+    private String projectid;
+
+    @TableField("LINEID")
+    private String lineid;
+
+    @TableField("FIRSTINTEGRATEDTIME")
+    private String firstintegratedtime;
+
+    @TableField("PHOTO")
+    private String photo;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("STANDARDID")
+    private String standardid;
+
+
+}

+ 82 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/auto/Windturbinetestingpointai2.java

@@ -0,0 +1,82 @@
+package com.gyee.benchmarkinghive.model.auto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2021-05-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WINDTURBINETESTINGPOINTAI2")
+public class Windturbinetestingpointai2 extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("ID")
+    private String id;
+
+    @TableField("CODE")
+    private String code;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("MODEL")
+    private String model;
+
+    @TableField("VALUEUNIT")
+    private String valueunit;
+
+    @TableField("ENGLISHNAME")
+    private String englishname;
+
+    @TableField("TYPEID")
+    private String typeid;
+
+    @TableField("MODELID")
+    private String modelid;
+
+    @TableField("MAXVAL")
+    private BigDecimal maxval;
+
+    @TableField("MINVAL")
+    private BigDecimal minval;
+
+    @TableField("REASONABLEMAXVAL")
+    private BigDecimal reasonablemaxval;
+
+    @TableField("REASONABLEMINVAL")
+    private BigDecimal reasonableminval;
+
+    @TableField("WINDTURBINEID")
+    private String windturbineid;
+
+    @TableField("UNIFORMCODE")
+    private String uniformcode;
+
+    @TableField("SHORTID")
+    private String shortid;
+
+    @TableField("LONGID")
+    private String longid;
+
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationid;
+
+    @TableField("REALTIMEID")
+    private String realtimeid;
+
+
+}

+ 27 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/vo/FjjxbVo.java

@@ -0,0 +1,27 @@
+package com.gyee.benchmarkinghive.model.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName : FjjxbVo
+ * @Author : xieshengjie
+ * @Date: 2021/6/16 10:55
+ * @Description : 风机绩效榜vo
+ */
+@Data
+public class FjjxbVo implements Serializable {
+    private static final long serialVersionUID = -8275715166269543409L;
+
+    private String name;
+    private Double llfdl;
+    private Double sjfdl;
+    private Double speed;
+    private Double fjhjx;
+    private Double jhjx;
+    private Double sl;
+    private Double xd;
+    private Double xn;
+    private Double fnlly;
+}

+ 34 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/vo/FjjxbmxVo.java

@@ -0,0 +1,34 @@
+package com.gyee.benchmarkinghive.model.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName : FjjxbmxVo
+ * @Author : xieshengjie
+ * @Date: 2021/6/16 14:19
+ * @Description : 风机绩效榜明细vo
+ */
+@Data
+public class FjjxbmxVo implements Serializable {
+    private static final long serialVersionUID = 4129930226114546977L;
+
+    private String name;
+    private Double llfdl;
+    private Double sjfdl;
+    private Double speed;
+    private Double fjhjx1;
+    private Double fjhjx2;
+    private Double jhjx1;
+    private Double jhjx2;
+    private Double sl1;
+    private Double sl2;
+    private Double xd1;
+    private Double xd2;
+    private Double xn1;
+    private Double xn2;
+    private Double xn3;
+    private Double xn4;
+    private Double fnlly;
+}

+ 47 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/model/vo/WxsslVo.java

@@ -0,0 +1,47 @@
+package com.gyee.benchmarkinghive.model.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName : WxsslVo
+ * @Author : xieshengjie
+ * @Date: 2021/6/16 16:00
+ * @Description : 五项损失率vo
+ */
+@Data
+public class WxsslVo implements Serializable {
+
+    private static final long serialVersionUID = -2799942539856503365L;
+    private String name;
+    private Date date;
+    private Integer zhpm;
+    private Integer fdlpm;
+    private Double fdl;
+    private Double llfdl;
+    private Integer gzssdlpm;
+    private Double gzssdl;
+    private Integer jxssdlpm;
+    private Double jxssdl;
+    private Integer xnssdlpm;
+    private Double xnssdl;
+    private Integer xdssdlpm;
+    private Double xdssdl;
+    private Integer slssdlpm;
+    private Double slssdl;
+    private Integer fnlylpm;
+    private Double fnlyl;
+    private Integer gzsslpm;
+    private Double gzssl;
+    private Integer jxsslpm;
+    private Double jxssl;
+    private Integer qflpm;
+    private Double qfl;
+    private Integer xnsslpm;
+    private Double xnssl;
+    private Double zssdl;
+    private Double slssl;
+    private Integer slsslpm;
+}

+ 751 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/BenchmarkingService.java

@@ -0,0 +1,751 @@
+package com.gyee.benchmarkinghive.service;
+
+import com.gyee.benchmarkinghive.common.PointData;
+import com.gyee.benchmarkinghive.common.StringUtils;
+import com.gyee.benchmarkinghive.contant.Contant;
+import com.gyee.benchmarkinghive.init.CacheContext;
+import com.gyee.benchmarkinghive.model.auto.*;
+import com.gyee.benchmarkinghive.model.vo.FjjxbVo;
+import com.gyee.benchmarkinghive.model.vo.FjjxbmxVo;
+import com.gyee.benchmarkinghive.model.vo.WxsslVo;
+import com.gyee.benchmarkinghive.util.BatchUpdateUtils;
+import com.gyee.benchmarkinghive.util.DateUtils;
+import com.gyee.benchmarkinghive.util.SortUtils;
+import com.gyee.benchmarkinghive.util.taos.EdosUtil;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.stereotype.Service;
+
+import javax.swing.text.StyledEditorKit;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : BenchmarkingService
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 17:46
+ * @Description : 对标管理service
+ */
+@Service
+public class BenchmarkingService extends GenericService {
+    private EdosUtil edosUtil = new EdosUtil();
+
+    /**
+     * 保存日信息表
+     * @param beginDate
+     * @param endDate
+     */
+    public void saveEquipmentdayinfo(String beginDate,String endDate){
+        Map<String, Map<String, Windturbinetestingpointai2>> wtpAimap = CacheContext.wtpAimap;
+        List<Windturbine> wtls = CacheContext.wtls;
+        String[] uniformcodes = Contant.WXSS.split(",");
+        List<String> days = getDays(beginDate, endDate);
+        for (String d : days) {
+            String delSql = "delete from gyee_test.equipmentdayinfo where recorddate='"+d+"'";
+            jdbcTemplate.execute(delSql);
+            List<Equipmentdayinfo> resultList = new ArrayList<>();
+            Date date = DateUtils.parseDate(d);
+            Date begin = DateUtils.getStartDate(date);
+            Date end = DateUtils.getFinallyDate(date);
+            wtls.stream().filter(i->i.getWindpowerstationid().endsWith("FDC")).forEach(wt->{
+                Map<String,Double> wtDataMap = new HashMap<>();
+                Map<String, Windturbinetestingpointai2> nmap = wtpAimap.get(wt.getId());
+                Arrays.stream(uniformcodes).forEach(u->{
+                    try {
+                        Windturbinetestingpointai2 windturbinetestingpointai2 = nmap.get(u);
+                        List<PointData> pointDatas = edosUtil.getHistStat(windturbinetestingpointai2, begin.getTime() / 1000, end.getTime() / 1000, 1l, 86400l, 0);
+                        Optional<PointData> first = pointDatas.stream().findFirst();
+                        Double value = first.isPresent()?first.get().getPointValueInDouble():0;
+                        wtDataMap.put(wt.getId()+"_"+uniformcodes,value);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                });
+                Equipmentdayinfo equipmentdayinfo = new Equipmentdayinfo();
+                equipmentdayinfo.setId(StringUtils.getUUID());
+                equipmentdayinfo.setWindturbineid(wt.getId());
+                equipmentdayinfo.setLineid(wt.getLineid());
+                equipmentdayinfo.setProjectid(wt.getProjectid());
+                equipmentdayinfo.setWindpowerstationid(wt.getWindpowerstationid());
+                equipmentdayinfo.setRecorddate(d);
+                equipmentdayinfo.setGenecapacity(wtDataMap.get(wt.getId()+"_RFDL"));
+                equipmentdayinfo.setSpeed(wtDataMap.get(wt.getId()+"_AI022"));
+                //维护:RJXSSDL-ZS,RLZSSDL-ZS
+                equipmentdayinfo.setDaynhwhssdl(wtDataMap.get(wt.getId()+"_RJXSSDL-ZS") + wtDataMap.get(wt.getId()+"_RLZSSDL-ZS"));
+                //故障:RGZSSDL-ZS,NSZSSDL-ZS
+                equipmentdayinfo.setDaynhgzssdl(wtDataMap.get(wt.getId()+"_RGZSSDL-ZS") + wtDataMap.get(wt.getId()+"_NSZSSDL-ZS"));
+                //限电:RQFSSDL-ZS,RXDSSDL-ZS
+                equipmentdayinfo.setDaynhxdssdl(wtDataMap.get(wt.getId()+"_RQFSSDL-ZS") + wtDataMap.get(wt.getId()+"_RXDSSDL-ZS"));
+                //性能:RDJSSDL-ZS,RSTSSDL-ZS,RXNSSDL-ZS,RQXSSDL-ZS
+                equipmentdayinfo.setDaynhqfdl(wtDataMap.get(wt.getId()+"_RDJSSDL-ZS") + wtDataMap.get(wt.getId()+"_RSTSSDL-ZS") + wtDataMap.get(wt.getId()+"_RXNSSDL-ZS") + wtDataMap.get(wt.getId()+"_RQXSSDL-ZS"));
+                //受累:RWZSSDL-ZS,RTZSSDL-ZS
+                equipmentdayinfo.setDaynhcfdl(wtDataMap.get(wt.getId()+"_RWZSSDL-ZS") + wtDataMap.get(wt.getId()+"_RTZSSDL-ZS"));
+                equipmentdayinfo.setTherogenecapacity(equipmentdayinfo.getGenecapacity()+equipmentdayinfo.getDaynhwhssdl()+equipmentdayinfo.getDaynhgzssdl()+equipmentdayinfo.getDaynhxdssdl()+equipmentdayinfo.getDaynhqfdl()+equipmentdayinfo.getDaynhcfdl());
+                resultList.add(equipmentdayinfo);
+            });
+            BatchUpdateUtils batchUpdateUtils = new BatchUpdateUtils();
+            batchUpdateUtils.batchEquipmentinfoInsert(resultList);
+        }
+    }
+
+    /**
+     * 保存日信息明细
+     * @param beginDate
+     * @param endDate
+     */
+    public void saveEquipmentdaydetailed(String beginDate,String endDate){
+        Map<String, Map<String, Windturbinetestingpointai2>> wtpAimap = CacheContext.wtpAimap;
+        List<Windturbine> wtls = CacheContext.wtls;
+        String[] uniformcodes = Contant.WXSS.split(",");
+        List<String> days = getDays(beginDate, endDate);
+        for (String d : days) {
+            String delSql = "delete from gyee_test.equipmentdaydetailed where recorddate='"+d+"'";
+            jdbcTemplate.execute(delSql);
+            List<Equipmentdaydetailed> resultList = new ArrayList<>();
+            Date date = DateUtils.parseDate(d);
+            Date begin = DateUtils.getStartDate(date);
+            Date end = DateUtils.getFinallyDate(date);
+            wtls.stream().filter(i->i.getWindpowerstationid().endsWith("FDC")).forEach(wt->{
+                Map<String,Double> wtDataMap = new HashMap<>();
+                Map<String, Windturbinetestingpointai2> nmap = wtpAimap.get(wt.getId());
+                Arrays.stream(uniformcodes).forEach(u->{
+                    try {
+                        Windturbinetestingpointai2 windturbinetestingpointai2 = nmap.get(u);
+                        List<PointData> pointDatas = edosUtil.getHistStat(windturbinetestingpointai2, begin.getTime() / 1000, end.getTime() / 1000, 1l, 86400l, 0);
+                        Optional<PointData> first = pointDatas.stream().findFirst();
+                        Double value = first.isPresent()?first.get().getPointValueInDouble():0;
+                        wtDataMap.put(wt.getId()+"_"+uniformcodes,value);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                });
+                Equipmentdaydetailed equipmentdayinfo = new Equipmentdaydetailed();
+                equipmentdayinfo.setId(StringUtils.getUUID());
+                equipmentdayinfo.setWindturbineid(wt.getId());
+                equipmentdayinfo.setLineid(wt.getLineid());
+                equipmentdayinfo.setProjectid(wt.getProjectid());
+                equipmentdayinfo.setWindpowerstationid(wt.getWindpowerstationid());
+                equipmentdayinfo.setRecorddate(d);
+                equipmentdayinfo.setGenecapacity(wtDataMap.get(wt.getId()+"_RFDL"));
+                equipmentdayinfo.setSpeed(wtDataMap.get(wt.getId()+"_AI022"));
+                //维护:RJXSSDL-ZS,RLZSSDL-ZS
+                equipmentdayinfo.setDaynhwhssdl1(wtDataMap.get(wt.getId()+"_RJXSSDL-ZS"));
+                equipmentdayinfo.setDaynhwhssdl2(wtDataMap.get(wt.getId()+"_RLZSSDL-ZS"));
+                //故障:RGZSSDL-ZS,NSZSSDL-ZS
+                equipmentdayinfo.setDaynhgzssdl1(wtDataMap.get(wt.getId()+"_RGZSSDL-ZS"));
+                equipmentdayinfo.setDaynhgzssdl2(wtDataMap.get(wt.getId()+"_NSZSSDL-ZS"));
+                //限电:RQFSSDL-ZS,RXDSSDL-ZS
+                equipmentdayinfo.setDaynhxdssdl1(wtDataMap.get(wt.getId()+"_RQFSSDL-ZS"));
+                equipmentdayinfo.setDaynhxdssdl2(wtDataMap.get(wt.getId()+"_RXDSSDL-ZS"));
+                //性能:RDJSSDL-ZS,RSTSSDL-ZS,RXNSSDL-ZS,RQXSSDL-ZS
+                equipmentdayinfo.setDaynhqfdl1(wtDataMap.get(wt.getId()+"_RDJSSDL-ZS"));
+                equipmentdayinfo.setDaynhqfdl2(wtDataMap.get(wt.getId()+"_RSTSSDL-ZS"));
+                equipmentdayinfo.setDaynhqfdl3(wtDataMap.get(wt.getId()+"_RXNSSDL-ZS"));
+                equipmentdayinfo.setDaynhqfdl4(wtDataMap.get(wt.getId()+"_RQXSSDL-ZS"));
+                //受累:RWZSSDL-ZS,RTZSSDL-ZS
+                equipmentdayinfo.setDaynhcfdl1(wtDataMap.get(wt.getId()+"_RWZSSDL-ZS"));
+                equipmentdayinfo.setDaynhcfdl2(wtDataMap.get(wt.getId()+"_RTZSSDL-ZS"));
+
+                equipmentdayinfo.setTherogenecapacity(equipmentdayinfo.getGenecapacity()+equipmentdayinfo.getDaynhwhssdl1()+equipmentdayinfo.getDaynhwhssdl2()
+                        +equipmentdayinfo.getDaynhgzssdl1()+equipmentdayinfo.getDaynhgzssdl2()
+                        +equipmentdayinfo.getDaynhxdssdl1()+equipmentdayinfo.getDaynhxdssdl2()
+                        +equipmentdayinfo.getDaynhqfdl1()+equipmentdayinfo.getDaynhqfdl2()+equipmentdayinfo.getDaynhqfdl3()+equipmentdayinfo.getDaynhqfdl4()
+                        +equipmentdayinfo.getDaynhcfdl1()+equipmentdayinfo.getDaynhcfdl2());
+                resultList.add(equipmentdayinfo);
+            });
+            BatchUpdateUtils batchUpdateUtils = new BatchUpdateUtils();
+            batchUpdateUtils.batchEquipmentdetailedInsert(resultList);
+        }
+    }
+
+    /**
+     * 获取两日期间日期list
+     *
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    public static List<String> getDays(String beginDate, String endDate) {
+        List<String> days = null;
+        if (StringUtils.isNotEmpty(beginDate) && StringUtils.isNotEmpty(endDate)) {
+            days = DateUtils.getDays(beginDate, endDate);
+        } else {
+            days = new ArrayList<>();
+            days.add(DateUtils.getYesterdayStr("yyyy-MM-dd"));
+        }
+        return days;
+    }
+
+    /**
+     * 风机绩效榜
+     * @param wpids
+     * @param projectids
+     * @param lineids
+     * @param beginDate
+     * @param endDate
+     * @param type
+     * @return
+     */
+    public List<FjjxbVo> fjjxb(String wpids, String projectids, String lineids, String beginDate, String endDate, String type) {
+       StringBuilder sb = new StringBuilder();
+        if (type.equals("1") ){
+            sb.append("select windpowerstationid as name, ");
+        }else if (type.equals("2")){
+            sb.append("select projectid as name, ");
+        } else if (type.equals("3")){
+            sb.append("select lineid as name, ");
+        }else {
+            sb.append("select windturbineid as name, ");
+        }
+       sb.append("sum(genecapacity) sjfdl,sum(therogenecapacity) llfdl,sum(speed) speed,sum(daynhwhssdl) jhjx,sum(daynhgzssdl) fjhjx,sum(daynhxdssdl) xd,sum(daynhqfdl) xn,sum(daynhcfdl) sl " +
+               " from gyee_test.equipmentdayinfo where recorddate>=to_date('");
+       sb.append(beginDate).append("','yyyy-MM-dd') and recorddate<=to_date('");
+       sb.append(endDate).append("','yyyy-MM-dd') ");
+       if (StringUtils.isNotEmpty(wpids)){
+           sb.append(" and (");
+           String[] wpArray = wpids.split(",");
+           for (String s : wpArray) {
+               sb.append(" windpowerstationid = '").append(s).append("' or");
+           }
+           sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+           sb.append(")");
+       }
+        if (StringUtils.isNotEmpty(projectids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" projectid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        if (StringUtils.isNotEmpty(lineids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" lineid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+       if (type.equals("1")){
+           sb.append(" group by windpowerstationid");
+       }else if(type.equals("2")){
+           sb.append(" group by projectid");
+       }else if(type.equals("3")){
+           sb.append(" group by lineid");
+       }else{
+           sb.append(" group by windturbineid");
+       }
+        List<FjjxbVo> list = jdbcTemplate.query(String.valueOf(sb), new BeanPropertyRowMapper(FjjxbVo.class));
+       AtomicReference<Double> llfdl = new AtomicReference<>((double) 0);
+       AtomicReference<Double> sjfdl = new AtomicReference<>((double) 0);
+       AtomicReference<Double> pjfs = new AtomicReference<>((double) 0);
+       AtomicReference<Double> wh = new AtomicReference<>((double) 0);
+       AtomicReference<Double> gz = new AtomicReference<>((double) 0);
+       AtomicReference<Double> xd = new AtomicReference<>((double) 0);
+       AtomicReference<Double> xn = new AtomicReference<>((double) 0);
+       AtomicReference<Double> sl = new AtomicReference<>((double) 0);
+       list.stream().forEach(i->{
+            i.setFnlly(i.getLlfdl()!=0?i.getSjfdl()/i.getLlfdl()*100:0);
+           llfdl.updateAndGet(v -> new Double((double) (v + i.getLlfdl())));
+           sjfdl.updateAndGet(v -> new Double((double) (v + i.getSjfdl())));
+           pjfs.updateAndGet(v -> new Double((double) (v + i.getSpeed())));
+           wh.updateAndGet(v -> new Double((double) (v + i.getJhjx())));
+           gz.updateAndGet(v -> new Double((double) (v + i.getFjhjx())));
+           xd.updateAndGet(v -> new Double((double) (v + i.getXd())));
+           xn.updateAndGet(v -> new Double((double) (v + i.getXn())));
+           sl.updateAndGet(v -> new Double((double) (v + i.getSl())));
+       });
+        FjjxbVo vo = new FjjxbVo();
+        vo.setName("合计");
+        vo.setSjfdl(sjfdl.get().doubleValue());
+        vo.setLlfdl(llfdl.get().doubleValue());
+        vo.setSpeed(list.size()!=0?pjfs.get().doubleValue()/list.size():0);
+        vo.setJhjx(wh.get().doubleValue());
+        vo.setFjhjx(gz.get().doubleValue());
+        vo.setXd(xd.get().doubleValue());
+        vo.setXn(xn.get().doubleValue());
+        vo.setSl(sl.get().doubleValue());
+        vo.setFnlly(vo.getLlfdl()!=0?vo.getSjfdl()/vo.getLlfdl()*100:0);
+        list.add(vo);
+        return list;
+    }
+
+    /**
+     * 风机绩效榜明细
+     * @param wpids
+     * @param projectids
+     * @param lineids
+     * @param beginDate
+     * @param endDate
+     * @param type
+     * @return
+     */
+    public List<FjjxbmxVo> fjjxbmx(String wpids, String projectids, String lineids, String beginDate, String endDate, String type) {
+        StringBuilder sb = new StringBuilder();
+        if (type.equals("1") ){
+            sb.append("select windpowerstationid as name, ");
+        }else if (type.equals("2")){
+            sb.append("select projectid as name, ");
+        } else if (type.equals("3")){
+            sb.append("select lineid as name, ");
+        }else {
+            sb.append("select windturbineid as name, ");
+        }
+        sb.append("sum(genecapacity) sjfdl,sum(therogenecapacity) llfdl,sum(speed) speed,sum(daynhwhssdl) jhjx1,sum(daynhwhssdl) jhjx2," +
+                "sum(daynhgzssdl1) fjhjx1,sum(daynhgzssdl2) fjhjx2," +
+                "sum(daynhxdssdl1) xd1,sum(daynhxdssdl2) xd2," +
+                "sum(daynhqfdl1) xn1,sum(daynhqfdl2) xn2,sum(daynhqfdl3) xn3,sum(daynhqfdl4) xn4," +
+                "sum(daynhcfdl1) sl1,sum(daynhcfdl2) sl2 " +
+                " from gyee_test.equipmentdayinfo where recorddate>=to_date('");
+        sb.append(beginDate).append("','yyyy-MM-dd') and recorddate<=to_date('");
+        sb.append(endDate).append("','yyyy-MM-dd') ");
+        if (StringUtils.isNotEmpty(wpids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" windpowerstationid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        if (StringUtils.isNotEmpty(projectids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" projectid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        if (StringUtils.isNotEmpty(lineids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" lineid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        if (type.equals("1")){
+            sb.append(" group by windpowerstationid");
+        }else if(type.equals("2")){
+            sb.append(" group by projectid");
+        }else if(type.equals("3")){
+            sb.append(" group by lineid");
+        }else{
+            sb.append(" group by windturbineid");
+        }
+        List<FjjxbmxVo> list = jdbcTemplate.query(String.valueOf(sb), new BeanPropertyRowMapper(FjjxbmxVo.class));
+        AtomicReference<Double> llfdl = new AtomicReference<>((double) 0);
+        AtomicReference<Double> sjfdl = new AtomicReference<>((double) 0);
+        AtomicReference<Double> pjfs = new AtomicReference<>((double) 0);
+        AtomicReference<Double> wh1 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> wh2 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> gz1 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> gz2 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xd1 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xd2 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xn1 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xn2 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xn3 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xn4 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> sl1 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> sl2 = new AtomicReference<>((double) 0);
+        list.stream().forEach(i->{
+            i.setFnlly(i.getLlfdl()!=0?i.getSjfdl()/i.getLlfdl()*100:0);
+            llfdl.updateAndGet(v -> new Double((double) (v + i.getLlfdl())));
+            sjfdl.updateAndGet(v -> new Double((double) (v + i.getSjfdl())));
+            pjfs.updateAndGet(v -> new Double((double) (v + i.getSpeed())));
+            wh1.updateAndGet(v -> new Double((double) (v + i.getJhjx1())));
+            wh2.updateAndGet(v -> new Double((double) (v + i.getJhjx2())));
+            gz1.updateAndGet(v -> new Double((double) (v + i.getFjhjx1())));
+            gz2.updateAndGet(v -> new Double((double) (v + i.getFjhjx2())));
+            xd1.updateAndGet(v -> new Double((double) (v + i.getXd1())));
+            xd2.updateAndGet(v -> new Double((double) (v + i.getXd2())));
+            xn1.updateAndGet(v -> new Double((double) (v + i.getXn1())));
+            xn2.updateAndGet(v -> new Double((double) (v + i.getXn2())));
+            xn3.updateAndGet(v -> new Double((double) (v + i.getXn3())));
+            xn4.updateAndGet(v -> new Double((double) (v + i.getXn4())));
+            sl1.updateAndGet(v -> new Double((double) (v + i.getSl1())));
+            sl2.updateAndGet(v -> new Double((double) (v + i.getSl2())));
+        });
+        FjjxbmxVo vo = new FjjxbmxVo();
+        vo.setName("合计");
+        vo.setSjfdl(sjfdl.get().doubleValue());
+        vo.setLlfdl(llfdl.get().doubleValue());
+        vo.setSpeed(list.size()!=0?pjfs.get().doubleValue()/list.size():0);
+        vo.setJhjx1(wh1.get().doubleValue());
+        vo.setJhjx2(wh2.get().doubleValue());
+        vo.setFjhjx1(gz1.get().doubleValue());
+        vo.setFjhjx2(gz2.get().doubleValue());
+        vo.setXd1(xd1.get().doubleValue());
+        vo.setXd2(xd2.get().doubleValue());
+        vo.setXn1(xn1.get().doubleValue());
+        vo.setXn2(xn2.get().doubleValue());
+        vo.setXn3(xn3.get().doubleValue());
+        vo.setXn4(xn4.get().doubleValue());
+        vo.setSl1(sl1.get().doubleValue());
+        vo.setSl2(sl2.get().doubleValue());
+        vo.setFnlly(vo.getLlfdl()!=0?vo.getSjfdl()/vo.getLlfdl()*100:0);
+        list.add(vo);
+        return list;
+    }
+
+    /**
+     * 场站列表
+     * @return
+     */
+    public List<Windpowerstation> wplist() {
+
+        List<Windpowerstation> wplist = CacheContext.wplist.stream().filter(i->i.getId().equals("FDC")).collect(Collectors.toList());
+        return wplist;
+
+    }
+
+    /**
+     * 根据场站查询项目列表
+     * @param wpids
+     * @return
+     */
+    public List<Project> projectList(String wpids) {
+        List<Project> projects = CacheContext.projects.stream().filter(i -> wpids.contains(i.getWindpowerstationid())).collect(Collectors.toList());
+        return projects;
+    }
+    /**
+     * 根据项目查询线路列表
+     * @param projects
+     * @return
+     */
+    public List<Line> lineList(String projects) {
+        List<Line> lines = CacheContext.lines.stream().filter(i -> projects.contains(i.getProjectid())).collect(Collectors.toList());
+        return lines;
+    }
+
+    /**
+     * 五项损失率
+     * @param wpids
+     * @param projectids
+     * @param lineids
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    public List<WxsslVo> wxssl(String wpids, String projectids, String lineids, String beginDate, String endDate) {
+        StringBuilder sb = new StringBuilder();
+        if (StringUtils.isNotEmpty(wpids) && StringUtils.isEmpty(projectids) && StringUtils.isEmpty(lineids)){
+            sb.append("select windpowerstationid as name, ");
+        }else if (StringUtils.isNotEmpty(wpids) && StringUtils.isNotEmpty(projectids) && StringUtils.isEmpty(lineids)){
+            sb.append("select projectid as name, ");
+        } else if (StringUtils.isNotEmpty(wpids) && StringUtils.isNotEmpty(projectids) && StringUtils.isNotEmpty(lineids)){
+            sb.append("select lineid as name, ");
+        }else {
+            sb.append("select windpowerstationid as name, ");
+        }
+        sb.append("sum(genecapacity) fdl,sum(therogenecapacity) llfdl,sum(daynhwhssdl) jxssdl,sum(daynhgzssdl) gzssdl,sum(daynhxdssdl) xdssdl,sum(daynhqfdl) xnssdl,sum(daynhcfdl) slssdl " +
+                " from gyee_test.equipmentdayinfo where recorddate>=to_date('");
+        sb.append(beginDate).append("','yyyy-MM-dd') and recorddate<=to_date('");
+        sb.append(endDate).append("','yyyy-MM-dd') ");
+
+        if (StringUtils.isNotEmpty(wpids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" windpowerstationid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        if (StringUtils.isNotEmpty(projectids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" projectid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        if (StringUtils.isNotEmpty(lineids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" lineid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+
+        if (StringUtils.isNotEmpty(wpids) && StringUtils.isEmpty(projectids) && StringUtils.isEmpty(lineids)){
+            sb.append(" group by windpowerstationid ");
+        }else if (StringUtils.isNotEmpty(wpids) && StringUtils.isNotEmpty(projectids) && StringUtils.isEmpty(lineids)){
+            sb.append(" group by projectid");
+        } else if (StringUtils.isNotEmpty(wpids) && StringUtils.isNotEmpty(projectids) && StringUtils.isNotEmpty(lineids)){
+            sb.append(" group by lineid");
+        }else {
+            sb.append(" group by windpowerstationid ");
+        }
+
+        List<WxsslVo> wxsslVoList = jdbcTemplate.query(String.valueOf(sb), new BeanPropertyRowMapper(WxsslVo.class));
+        wxsslVoList.stream().forEach(i->{
+            i.setZssdl(i.getGzssdl()+i.getJxssdl()+i.getXdssdl()+i.getXnssdl()+i.getSlssdl());
+            i.setGzssl(i.getLlfdl()!=0?i.getGzssdl()/i.getLlfdl()*100:0);
+            i.setJxssl(i.getLlfdl()!=0?i.getJxssdl()/i.getLlfdl()*100:0);
+            i.setQfl(i.getLlfdl()!=0?i.getXdssdl()/i.getLlfdl()*100:0);
+            i.setXnssl(i.getLlfdl()!=0?i.getXnssdl()/i.getLlfdl()*100:0);
+            i.setSlssl(i.getLlfdl()!=0?i.getSlssdl()/i.getLlfdl()*100:0);
+        });
+        SortUtils.sort(wxsslVoList,"zssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setZhpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"gzssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setGzssdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"gzssl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setGzsslpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"jxssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setJxssdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"jxssl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setJxsslpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"xdssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setXdssdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"qfl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setQflpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"xnssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setXnssdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"xnssl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setXnsslpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"slssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setSlssdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"slssl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setSlsslpm(i+1);
+        }
+        return wxsslVoList;
+
+    }
+
+    /**
+     * 场内对标
+     * @param wpid
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    public List<WxsslVo> cndb(String wpid, String beginDate, String endDate) {
+        StringBuilder sb = new StringBuilder();
+        sb.append("select recorddate,sum(genecapacity) fdl,sum(therogenecapacity) llfdl,sum(daynhwhssdl) jxssdl,sum(daynhgzssdl) gzssdl,sum(daynhxdssdl) xdssdl,sum(daynhqfdl) xnssdl,sum(daynhcfdl) slssdl " +
+                " from gyee_test.equipmentdayinfo where recorddate>=to_date('");
+        sb.append(beginDate).append("','yyyy-MM-dd') and recorddate<=to_date('");
+        sb.append(endDate).append("','yyyy-MM-dd') ");
+        if (StringUtils.isNotEmpty(wpid)){
+            sb.append(" and windpowerstationid='").append(wpid).append("'");
+        }
+        sb.append(" group by recorddate");
+        List<WxsslVo> wxsslVoList = getWxsslSortVos(sb);
+        return wxsslVoList;
+
+    }
+
+
+
+    /**
+     * 场际对标
+     * @param wpids
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    public List<WxsslVo> cjdb(String wpids, String beginDate, String endDate) {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append("select windpowerstationid as name ,sum(genecapacity) fdl,sum(therogenecapacity) llfdl,sum(daynhwhssdl) jxssdl,sum(daynhgzssdl) gzssdl,sum(daynhxdssdl) xdssdl,sum(daynhqfdl) xnssdl,sum(daynhcfdl) slssdl " +
+                " from gyee_test.equipmentdayinfo where recorddate>=to_date('");
+        sb.append(beginDate).append("','yyyy-MM-dd') and recorddate<=to_date('");
+        sb.append(endDate).append("','yyyy-MM-dd') ");
+        if (StringUtils.isNotEmpty(wpids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" windpowerstationid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        sb.append(" group by windpowerstationid");
+        List<WxsslVo> wxsslVoList = getWxsslSortVos(sb);
+        return wxsslVoList;
+    }
+
+    /**
+     * 项目对标
+     * @param wpids
+     * @param projectids
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    public List<WxsslVo> xmdb(String wpids, String projectids, String beginDate, String endDate) {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append("select projectid as name ,sum(genecapacity) fdl,sum(therogenecapacity) llfdl,sum(daynhwhssdl) jxssdl,sum(daynhgzssdl) gzssdl,sum(daynhxdssdl) xdssdl,sum(daynhqfdl) xnssdl,sum(daynhcfdl) slssdl " +
+                " from gyee_test.equipmentdayinfo where recorddate>=to_date('");
+        sb.append(beginDate).append("','yyyy-MM-dd') and recorddate<=to_date('");
+        sb.append(endDate).append("','yyyy-MM-dd') ");
+        if (StringUtils.isNotEmpty(wpids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" windpowerstationid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        if (StringUtils.isNotEmpty(projectids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" projectid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        sb.append(" group by projectid");
+        List<WxsslVo> wxsslVoList = getWxsslSortVos(sb);
+        return wxsslVoList;
+    }
+
+    /**
+     * 线路对标
+     * @param wpids
+     * @param projectids
+     * @param lineids
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    public List<WxsslVo> xldb(String wpids, String projectids, String lineids, String beginDate, String endDate) {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append("select lineid as name ,sum(genecapacity) fdl,sum(therogenecapacity) llfdl,sum(daynhwhssdl) jxssdl,sum(daynhgzssdl) gzssdl,sum(daynhxdssdl) xdssdl,sum(daynhqfdl) xnssdl,sum(daynhcfdl) slssdl " +
+                " from gyee_test.equipmentdayinfo where recorddate>=to_date('");
+        sb.append(beginDate).append("','yyyy-MM-dd') and recorddate<=to_date('");
+        sb.append(endDate).append("','yyyy-MM-dd') ");
+        if (StringUtils.isNotEmpty(wpids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" windpowerstationid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        if (StringUtils.isNotEmpty(projectids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" projectid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        if (StringUtils.isNotEmpty(lineids)){
+            sb.append(" and (");
+            String[] wpArray = wpids.split(",");
+            for (String s : wpArray) {
+                sb.append(" lineid = '").append(s).append("' or");
+            }
+            sb = new StringBuilder(sb.substring(0, sb.length() - 2));
+            sb.append(")");
+        }
+        sb.append(" group by lineid");
+        List<WxsslVo> wxsslVoList = getWxsslSortVos(sb);
+        return wxsslVoList;
+    }
+
+    private List<WxsslVo> getWxsslSortVos(StringBuilder sb) {
+        List<WxsslVo> wxsslVoList = jdbcTemplate.query(String.valueOf(sb), new BeanPropertyRowMapper(WxsslVo.class));
+        wxsslVoList.stream().forEach(i->{
+            i.setFnlyl(i.getLlfdl()!=0?i.getFdl()/i.getLlfdl()*100:0);
+            i.setGzssl(i.getLlfdl()!=0?i.getGzssdl()/i.getLlfdl()*100:0);
+            i.setJxssl(i.getLlfdl()!=0?i.getJxssdl()/i.getLlfdl()*100:0);
+            i.setQfl(i.getLlfdl()!=0?i.getXdssdl()/i.getLlfdl()*100:0);
+            i.setXnssl(i.getLlfdl()!=0?i.getXnssdl()/i.getLlfdl()*100:0);
+            i.setSlssl(i.getLlfdl()!=0?i.getSlssdl()/i.getLlfdl()*100:0);
+        });
+        SortUtils.sort(wxsslVoList,"llfdl",SortUtils.DESC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setZhpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"fdl",SortUtils.DESC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setFdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"fnlyl",SortUtils.DESC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setFnlylpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"gzssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setGzssdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"gzssl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setGzsslpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"jxssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setJxssdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"jxssl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setJxsslpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"xdssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setXdssdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"qfl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setQflpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"xnssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setXnssdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"xnssl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setXnsslpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"slssdl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setSlssdlpm(i+1);
+        }
+        SortUtils.sort(wxsslVoList,"slssl",SortUtils.ASC);
+        for (int i=0;i<wxsslVoList.size();i++){
+            wxsslVoList.get(i).setSlsslpm(i+1);
+        }
+        return wxsslVoList;
+    }
+
+
+
+}

+ 19 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/GenericService.java

@@ -0,0 +1,19 @@
+package com.gyee.benchmarkinghive.service;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Service;
+
+/**
+ * @ClassName : GenericService
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 17:49
+ * @Description : 共用service
+ */
+@Service
+public class GenericService {
+    @Autowired
+    protected JdbcTemplate jdbcTemplate;
+
+
+}

+ 40 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/LineService.java

@@ -0,0 +1,40 @@
+package com.gyee.benchmarkinghive.service;
+
+import com.gyee.benchmarkinghive.model.auto.Line;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.stereotype.Service;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+
+/**
+ * @ClassName : LineService
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 18:08
+ * @Description : 线路service
+ */
+@Service
+public class LineService extends GenericService {
+
+    public List<Line> lineList(){
+        List<Line> lineList = jdbcTemplate.query("select * from gyee_test.line", new RowMapper<Line>() {
+            @Override
+            public Line mapRow(ResultSet rs, int rowNum) throws SQLException {
+                Line line = new Line();
+                line.setId(rs.getString("id"));
+                line.setCode(rs.getString("code"));
+                line.setName(rs.getString("name"));
+                line.setAname(rs.getString("aname"));
+                line.setProjectid(rs.getString("projectid"));
+                line.setOrdernum(rs.getInt("ordernum"));
+                line.setCapacity(rs.getDouble("capacity"));
+                line.setCapacityunit(rs.getString("capacityunit"));
+                line.setQuantity(rs.getInt("quantity"));
+                return line;
+            }
+        });
+        return lineList;
+    }
+}

+ 45 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/ProjectService.java

@@ -0,0 +1,45 @@
+package com.gyee.benchmarkinghive.service;
+
+import com.gyee.benchmarkinghive.model.auto.Project;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.stereotype.Service;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+
+/**
+ * @ClassName : ProjectService
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 17:48
+ * @Description : 项目service
+ */
+@Service
+public class ProjectService extends GenericService{
+
+
+    public List<Project> projectList(){
+        List<Project> projectList = jdbcTemplate.query("select * from gyee_test.project", new RowMapper<Project>() {
+            @Override
+            public Project mapRow(ResultSet rs, int rowNum) throws SQLException {
+                Project project = new Project();
+                project.setId(rs.getString("id"));
+                project.setName(rs.getString("name"));
+                project.setAname(rs.getString("aname"));
+                project.setWindpowerstationid(rs.getString("windpowerstationid"));
+                project.setCapacity(rs.getDouble("capacity"));
+                project.setCapacityunit(rs.getString("capacityunit"));
+                project.setQuantity(rs.getInt("quantity"));
+                project.setModel(rs.getString("model"));
+                project.setCommissiondate(rs.getString("commissiondate"));
+                project.setMasterphone(rs.getString("masterphone"));
+                project.setShiftforeman(rs.getString("shiftforeman"));
+                project.setShiftforemanphone(rs.getString("shiftforemanphone"));
+                project.setOrdernum(rs.getInt("ordernum"));
+                return project;
+            }
+        });
+        return projectList;
+    }
+}

+ 56 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/WindpowerstationService.java

@@ -0,0 +1,56 @@
+package com.gyee.benchmarkinghive.service;
+
+import com.gyee.benchmarkinghive.model.auto.Windpowerstation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.stereotype.Service;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : WindpowerstationService
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 15:59
+ * @Description : 场站service
+ */
+@Service
+public class WindpowerstationService {
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+
+    public List<Windpowerstation> wpList(){
+        List<Windpowerstation> wplist = jdbcTemplate.query("select *  from gyee_test.windpowerstation", new RowMapper<Windpowerstation>() {
+            @Override
+            public Windpowerstation mapRow(ResultSet rs, int rowNum) throws SQLException {
+                Windpowerstation windpowerstation = new Windpowerstation();
+                windpowerstation.setId(rs.getString("id"));
+                windpowerstation.setCode(rs.getString("code"));
+                windpowerstation.setName(rs.getString("name"));
+                windpowerstation.setAddress(rs.getString("address"));
+                windpowerstation.setTelephone(rs.getString("telephone"));
+                windpowerstation.setCapacity(rs.getDouble("capacity"));
+                windpowerstation.setCapacityunit(rs.getString("capacityunit"));
+                windpowerstation.setQuantity(rs.getDouble("quantity"));
+                windpowerstation.setAname(rs.getString("aname"));
+                windpowerstation.setLongitude(rs.getDouble("longitude"));
+                windpowerstation.setLatitude(rs.getDouble("latitude"));
+                windpowerstation.setPhoto(rs.getString("photo"));
+                windpowerstation.setCompanyid(rs.getString("companyid"));
+                windpowerstation.setSystemmanufact(rs.getString("systemmanufact"));
+                windpowerstation.setHeadfarm(rs.getString("headfarm"));
+                windpowerstation.setHeadfarmphone(rs.getString("headfarmphone"));
+                windpowerstation.setModel(rs.getString("model"));
+                windpowerstation.setOrdernum(rs.getDouble("ordernum"));
+                windpowerstation.setAltitude(rs.getDouble("altitude"));
+                windpowerstation.setHeight(rs.getDouble("height"));
+                return windpowerstation;
+            }
+        });
+        return wplist;
+    }
+
+}

+ 54 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/WindturbineService.java

@@ -0,0 +1,54 @@
+package com.gyee.benchmarkinghive.service;
+
+import com.gyee.benchmarkinghive.model.auto.Windturbine;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.stereotype.Service;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+
+/**
+ * @ClassName : WindturbineService
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 17:35
+ * @Description : 风机service
+ */
+@Service
+public class WindturbineService {
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+
+    public List<Windturbine> wtlist1(){
+        List<Windturbine> wtlist = jdbcTemplate.query("select * from windturbine", new RowMapper<Windturbine>() {
+            @Override
+            public Windturbine mapRow(ResultSet rs, int rowNum) throws SQLException {
+                Windturbine windturbine = new Windturbine();
+                windturbine.setId(rs.getString("id"));
+                windturbine.setCode(rs.getString("code"));
+                windturbine.setWindpowerstationid(rs.getString("windpowerstationid"));
+                windturbine.setLongitude(rs.getDouble("longitude"));
+                windturbine.setLatitude(rs.getDouble("latitude"));
+                windturbine.setModelid(rs.getString("modelid"));
+                windturbine.setStatus(rs.getString("status"));
+                windturbine.setProjectid(rs.getString("projectid"));
+                windturbine.setLineid(rs.getString("lineid"));
+                windturbine.setFirstintegratedtime(rs.getString("firstintegratedtime"));
+                windturbine.setPhoto(rs.getString("photo"));
+                windturbine.setName(rs.getString("name"));
+                windturbine.setStandardid(rs.getString("standardid"));
+                return windturbine;
+            }
+        });
+        return wtlist;
+    }
+
+
+    public List<Windturbine> wtlist(){
+        List<Windturbine> wtlist = jdbcTemplate.query("select * from gyee_test.windturbine", new BeanPropertyRowMapper(Windturbine.class));
+        return wtlist;
+    }
+}

+ 23 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/service/WindturbineTestingAi2Service.java

@@ -0,0 +1,23 @@
+package com.gyee.benchmarkinghive.service;
+
+import com.gyee.benchmarkinghive.model.auto.Windturbine;
+import com.gyee.benchmarkinghive.model.auto.Windturbinetestingpointai2;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @ClassName : WindturbineTestingAi2Service
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 19:16
+ * @Description : 风机测点Service
+ */
+@Service
+public class WindturbineTestingAi2Service extends GenericService {
+
+    public List<Windturbinetestingpointai2> windturbinetestingpointai2List(){
+        List<Windturbinetestingpointai2> windturbinetestingpointai2List = jdbcTemplate.query("select * from gyee_test.windturbinetestingpoingai2", new BeanPropertyRowMapper(Windturbinetestingpointai2.class));
+        return windturbinetestingpointai2List;
+    }
+}

+ 42 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/task/SaticScheduleTask.java

@@ -0,0 +1,42 @@
+package com.gyee.benchmarkinghive.task;
+
+
+import com.gyee.benchmarkinghive.service.BenchmarkingService;
+import com.gyee.benchmarkinghive.util.DateUtils;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+
+import java.util.Date;
+
+/**
+ * @ClassName : SaticScheduleTask
+ * @Author : xieshengjie
+ * @Date: 2021/1/21 19:43
+ * @Description : 调度
+ */
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+public class SaticScheduleTask {
+    @Autowired
+    private BenchmarkingService benchmarkingService;
+
+    //3.添加定时任务
+    /**
+     * 对标管理调度
+     */
+    @Scheduled(cron = "0 0 1 * * ?")
+    //或直接指定时间间隔,例如:5秒
+    //@Scheduled(fixedRate=5000)
+    private void configureTasks1() {
+        Date yestday = DateUtils.getYestday(new Date());
+        String date = DateUtils.toDate1(yestday);
+        benchmarkingService.saveEquipmentdayinfo(date,date);
+        benchmarkingService.saveEquipmentdaydetailed(date,date);
+    }
+
+
+
+}

+ 90 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/AutoRowMapper.java

@@ -0,0 +1,90 @@
+package com.gyee.benchmarkinghive.util;
+
+
+
+import org.springframework.jdbc.core.RowMapper;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : AutoRowMapper
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 16:10
+ * @Description : 自动封装rowmapper
+ */
+public class AutoRowMapper<T> implements RowMapper<T> {
+    private static Map<String, Field[]> fields = new HashMap<>();
+
+    private Class clazz;
+
+    public AutoRowMapper(Class clazz) {
+        this.clazz = clazz;
+    }
+
+
+
+    @Override
+    public T mapRow(ResultSet rs, int rowNum) {
+        try {
+            T t = (T) clazz.newInstance();
+            Field[] fs = getFields();
+            for (int i = 0; i < fs.length; i++) {
+                setValue(t, fs[i], rs.getObject(fs[i].getName()));
+            }
+            return t;
+        } catch (InstantiationException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+
+
+        return null;
+    }
+
+    Field[] getFields() {
+        if (null != fields.get(clazz.getName())) {
+            return fields.get(clazz.getName());
+        }
+        List<Field> list = new ArrayList<>();
+        Class c = clazz;
+        while (c != Object.class) {
+            Field[] declaredFields = c.getDeclaredFields();
+            for (int i = 0; i < declaredFields.length; i++) {
+                list.add(declaredFields[i]);
+            }
+            c = c.getSuperclass();
+        }
+        fields.put(clazz.getName(), list.toArray(new Field[list.size()]));
+        return getFields();
+
+    }
+
+    void setValue(Object object, Field field, Object value) {
+        String name = field.getName();
+        try {
+            Method method = clazz.getMethod(getMethodName(name), field.getType());
+            method.invoke(object, value);
+        } catch (NoSuchMethodException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        } catch (InvocationTargetException e) {
+            e.printStackTrace();
+        }
+    }
+
+    String getMethodName(String field) {
+        return "set" + field.substring(0, 1).toUpperCase() + field.substring(1);
+    }
+}

+ 125 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/BatchUpdateUtils.java

@@ -0,0 +1,125 @@
+package com.gyee.benchmarkinghive.util;
+
+import com.gyee.benchmarkinghive.model.auto.Equipmentdaydetailed;
+import com.gyee.benchmarkinghive.model.auto.Equipmentdayinfo;
+import com.gyee.benchmarkinghive.service.GenericService;
+import org.springframework.jdbc.core.JdbcOperations;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassName : BatchUpdateUtils
+ * @Author : xieshengjie
+ * @Date: 2021/6/15 23:47
+ * @Description : 批量保存工具类
+ */
+public class BatchUpdateUtils extends GenericService {
+    private static final Integer BATCH_SIZE = 100;
+    private JdbcOperations jdbcTemplate;
+
+    public  void batchEquipmentinfoInsert(List<Equipmentdayinfo> list) {
+
+        String sql =" INSERT INTO gyee_test.equipmentdayinfo (id, windturbineid, projectid, lineid, windpowerstationid, " +
+                " recorddate, genecapacity, therogenecapacity, speed, daynhwhssdl, daynhgzssdl, " +
+                " daynhxdssdl, daynhqfdl, daynhcfdl) " +
+                " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ";
+        List<Object[]> args = transformFlowCarReportDayBoToObjects(list);
+        int fromIndex = 0; int toIndex = BATCH_SIZE;
+        while (fromIndex != args.size()) {
+            if (toIndex > args.size()) {
+                toIndex = args.size();
+            }
+            jdbcTemplate.batchUpdate(sql,args.subList(fromIndex, toIndex));
+            fromIndex = toIndex;
+            toIndex += BATCH_SIZE;
+            if (toIndex > args.size())
+                toIndex = args.size();
+        }
+
+    }
+
+    private  List<Object[]> transformFlowCarReportDayBoToObjects(List<Equipmentdayinfo> equipmentdayinfoList) {
+
+        List<Object[]> list = new ArrayList<>();
+
+        Object[] object = null;
+        for(Equipmentdayinfo equipmentdayinfo :equipmentdayinfoList){
+            object = new Object[]{
+                    equipmentdayinfo.getId(),
+                    equipmentdayinfo.getWindturbineid(),
+                    equipmentdayinfo.getProjectid(),
+                    equipmentdayinfo.getLineid(),
+                    equipmentdayinfo.getWindpowerstationid(),
+                    equipmentdayinfo.getRecorddate(),
+                    equipmentdayinfo.getGenecapacity(),
+                    equipmentdayinfo.getTherogenecapacity(),
+                    equipmentdayinfo.getSpeed(),
+                    equipmentdayinfo.getDaynhwhssdl(),
+                    equipmentdayinfo.getDaynhgzssdl(),
+                    equipmentdayinfo.getDaynhxdssdl(),
+                    equipmentdayinfo.getDaynhqfdl(),
+                    equipmentdayinfo.getDaynhcfdl()
+            };
+            list.add(object);
+        }
+
+        return list ;
+    }
+
+
+
+    public  void batchEquipmentdetailedInsert(List<Equipmentdaydetailed> list) {
+
+        String sql =" INSERT INTO gyee_test.equipmentdaydetailed (id, windturbineid, projectid, lineid, windpowerstationid, " +
+                " recorddate, genecapacity, therogenecapacity, speed, daynhwhssdl1, daynhwhssdl2,daynhgzssdl1,daynhgzssdl2, " +
+                " daynhxdssdl1, daynhxdssdl2,daynhqfdl1, daynhqfdl12,daynhqfdl3,daynhqfdl4, daynhcfdl1,daynhcfdl2 ) " +
+                " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ";
+        List<Object[]> args = transformFlowCarReportDetailedBoToObjects(list);
+        int fromIndex = 0; int toIndex = BATCH_SIZE;
+        while (fromIndex != args.size()) {
+            if (toIndex > args.size()) {
+                toIndex = args.size();
+            }
+            jdbcTemplate.batchUpdate(sql,args.subList(fromIndex, toIndex));
+            fromIndex = toIndex;
+            toIndex += BATCH_SIZE;
+            if (toIndex > args.size())
+                toIndex = args.size();
+        }
+
+    }
+
+    private  List<Object[]> transformFlowCarReportDetailedBoToObjects(List<Equipmentdaydetailed> equipmentdayinfoList) {
+
+        List<Object[]> list = new ArrayList<>();
+
+        Object[] object = null;
+        for(Equipmentdaydetailed equipmentdayinfo :equipmentdayinfoList){
+            object = new Object[]{
+                    equipmentdayinfo.getId(),
+                    equipmentdayinfo.getWindturbineid(),
+                    equipmentdayinfo.getProjectid(),
+                    equipmentdayinfo.getLineid(),
+                    equipmentdayinfo.getWindpowerstationid(),
+                    equipmentdayinfo.getRecorddate(),
+                    equipmentdayinfo.getGenecapacity(),
+                    equipmentdayinfo.getTherogenecapacity(),
+                    equipmentdayinfo.getSpeed(),
+                    equipmentdayinfo.getDaynhwhssdl1(),
+                    equipmentdayinfo.getDaynhwhssdl2(),
+                    equipmentdayinfo.getDaynhgzssdl1(),
+                    equipmentdayinfo.getDaynhgzssdl2(),
+                    equipmentdayinfo.getDaynhxdssdl1(),
+                    equipmentdayinfo.getDaynhxdssdl2(),
+                    equipmentdayinfo.getDaynhqfdl1(),
+                    equipmentdayinfo.getDaynhqfdl2(),
+                    equipmentdayinfo.getDaynhcfdl1(),
+                    equipmentdayinfo.getDaynhcfdl2()
+            };
+            list.add(object);
+        }
+
+        return list ;
+    }
+}

+ 238 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/BigDecimalUtils.java

@@ -0,0 +1,238 @@
+package com.gyee.benchmarkinghive.util;
+
+import java.math.BigDecimal;
+import java.text.NumberFormat;
+
+/**
+ * @ClassName : BigDecimalUtils
+ * @Author : xieshengjie
+ * @Date: 2021/6/4 9:54
+ * @Description : 运算工具类
+ */
+public class BigDecimalUtils {
+
+    //默认除法运算精度
+    private static final int DEF_DIV_SCALE = 2;
+
+    //建立货币格式化引用
+    private static final NumberFormat currency = NumberFormat.getCurrencyInstance();
+
+    //建立百分比格式化引用
+    private static final NumberFormat percent = NumberFormat.getPercentInstance();
+
+    /**
+     * 加法
+     * @param num
+     * @param num1
+     * @return
+     */
+    public static BigDecimal add(BigDecimal num, BigDecimal num1) {
+        return num.add(num1);
+    }
+
+
+    /**
+     * 提供精确的加法运算(默认四舍五入,根据scale保留小数位数)
+     * @param num
+     * @param num1
+     * @param scale
+     * @return
+     */
+    public static BigDecimal add(BigDecimal num, BigDecimal num1, int scale) {
+        return num.add(num1).setScale(scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+
+    /**
+     * 提供精确的加法运算(默认四舍五入,根据scale保留小数位数)
+     * @param add
+     * @param add1
+     * @param scale
+     * @return
+     */
+    public static BigDecimal add(String add, String add1, int scale) {
+        BigDecimal num = new BigDecimal(add);
+        BigDecimal num1 = new BigDecimal(add1);
+        return num.add(num1).setScale(scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+
+    /**
+     * 减法
+     * @param num
+     * @param num1
+     * @return
+     */
+    public static BigDecimal sub(BigDecimal num, BigDecimal num1) {
+        return num.subtract(num1);
+    }
+
+
+    /**
+     * 提供精确的减法运算(默认四舍五入,根据scale保留小数位数)
+     * @param num
+     * @param num1
+     * @param scale
+     * @return
+     */
+    public static BigDecimal sub(BigDecimal num, BigDecimal num1, int scale) {
+        return num.subtract(num1).setScale(scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+
+    /**
+     * 提供精确的减法运算(默认四舍五入,根据scale保留小数位数)
+     * @param minus
+     * @param minus1
+     * @return
+     */
+    public static BigDecimal sub(String minus, String minus1, int scale) {
+        BigDecimal num = new BigDecimal(minus);
+        BigDecimal num1 = new BigDecimal(minus1);
+        return sub(num, num1, scale);
+    }
+
+
+    /**
+     * 乘法
+     * @param num
+     * @param num1
+     * @return
+     */
+    public static BigDecimal multiply(BigDecimal num, BigDecimal num1) {
+        return num.multiply(num1);
+    }
+
+
+    /**
+     * 提供精确的乘法运算(默认四舍五入,保留小数位数根据scale决定)
+     * @param num
+     * @param num1
+     * @param scale
+     * @return
+     */
+    public static BigDecimal multiply(String num, String num1, int scale) {
+        BigDecimal mul = new BigDecimal(num);
+        BigDecimal mul1 = new BigDecimal(num1);
+        return multiply(mul, mul1, scale);
+    }
+
+
+    /**
+     * 提供精确的乘法运算(默认四舍五入,保留小数位数根据scale确定)
+     * @param num
+     * @param num1
+     * @param scale
+     * @return
+     */
+    public static BigDecimal multiply(BigDecimal num, BigDecimal num1, int scale) {
+        return num.multiply(num1).setScale(scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+
+    /**
+     * 除法(除法除不尽会抛异常)
+     * @param num
+     * @param num1
+     * @return
+     */
+    public static BigDecimal divide(BigDecimal num, BigDecimal num1) {
+        return num.divide(num1, DEF_DIV_SCALE);
+    }
+
+
+    /**
+     * 提供精确的除法运算(默认四舍五入保留两位小数)
+     * @param dividend
+     * @param divisor
+     * @return
+     */
+    public static BigDecimal divide(BigDecimal dividend, BigDecimal divisor, int scale) {
+        return dividend.divide(divisor, scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+
+    /**
+     * 提供精确的除法运算(默认四舍五入,保留小数位数根据scale决定)
+     * @param dividend
+     * @param divisor
+     * @param scale
+     * @return
+     */
+    public static BigDecimal divide(String dividend, String divisor, int scale) {
+        BigDecimal num = new BigDecimal(dividend);
+        BigDecimal num1 = new BigDecimal(divisor);
+        return divide(num, num1, scale);
+    }
+
+
+    /**
+     * 提供精确的取余数运算(小数保留位数根据scale决定)
+     * @param dividend
+     * @param divisor
+     * @param scale
+     * @return
+     */
+    public static BigDecimal balance(BigDecimal dividend, BigDecimal divisor, int scale) {
+        return dividend.remainder(divisor).setScale(scale);
+    }
+
+
+    /**
+     * 提供精确的取余数运算(默认保留两位小数)
+     * @param dividend
+     * @param divisor
+     * @param scale
+     * @return
+     */
+    public static BigDecimal balance(BigDecimal dividend, BigDecimal divisor) {
+        return dividend.remainder(divisor).setScale(DEF_DIV_SCALE);
+    }
+
+
+    /**
+     * 比较BigDecimal,相等返回0,num>num1返回1,num<num1返回-1
+     * @param num
+     * @param num1
+     * @return
+     */
+    public static int compareTo(BigDecimal num, BigDecimal num1) {
+        return num.compareTo(num1);
+    }
+
+
+    /**
+     * BigDecimal货币格式化
+     * @param money
+     * @return
+     */
+    public static String currencyFormat(BigDecimal money) {
+        return currency.format(money);
+    }
+
+
+    /**
+     * BigDecimal百分比格式化
+     * @param rate
+     * @return
+     */
+    public static String rateFormat(BigDecimal rate) {
+        return percent.format(rate);
+    }
+
+
+    public static void main(String[] args) {
+        BigDecimal divide = divide("12", "11", 2);
+        System.out.println(divide.doubleValue());
+
+        BigDecimal num1 = new BigDecimal("121");
+        BigDecimal num2 = new BigDecimal("122");
+        System.out.println(compareTo(num1, num2));
+
+        String currencyFormat = currencyFormat(num2);
+        System.out.println(currencyFormat);
+
+        String rateFormat = rateFormat(num2);
+        System.out.println(rateFormat);
+    }
+}

+ 920 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/DateUtils.java

@@ -0,0 +1,920 @@
+package com.gyee.benchmarkinghive.util;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @ClassName : DateUtils
+ * @Author : xieshengjie
+ * @Date: 2021/6/5 10:35
+ * @Description : 日期工具类
+ */
+public class DateUtils {
+    private static final String format = "yyyy-MM-dd";
+    private static final String format1 = "yyyy-MM-dd HH:mm:ss";
+    private static final String format2 = "MM/dd/yyyy HH:mm:ss";
+    private static final String format3 = "yyyy-MM";
+    // 第一次调用get将返回null
+
+    private static ThreadLocal<SimpleDateFormat> threadLocal = new ThreadLocal<SimpleDateFormat>();
+
+    /**
+     * 得到指定日期的一天的的最后时刻23:59:59
+     *
+     * @param date
+     * @return
+     */
+    public static Date getFinallyDate(Date date) {
+        String temp = getFormat().format(date);
+        temp += " 23:59:59";
+
+        try {
+            return getFormat1().parse(temp);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    /**
+     * 得到指定日期的一天的开始时刻00:00:00
+     *
+     * @param date
+     * @return
+     */
+    public static Date getStartDate(Date date) {
+        String temp = getFormat().format(date);
+        temp += " 00:00:00";
+
+        try {
+            return getFormat1().parse(temp);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    // 获取线程的变量副本,如果不覆盖initialValue,第一次get返回null,故需要初始化一个SimpleDateFormat,并set到threadLocal中
+
+    public static SimpleDateFormat getFormat() {
+
+        SimpleDateFormat df = (SimpleDateFormat) threadLocal.get();
+
+        if (df == null) {
+            df = new SimpleDateFormat(format);
+            threadLocal.set(df);
+        }
+
+        return df;
+
+    }
+
+    public static SimpleDateFormat getFormat1() {
+
+        SimpleDateFormat df1 = (SimpleDateFormat) threadLocal.get();
+
+        if (df1 == null) {
+            df1 = new SimpleDateFormat(format1);
+            threadLocal.set(df1);
+        }
+
+        return df1;
+
+    }
+
+    public static SimpleDateFormat getFormat2() {
+
+        SimpleDateFormat df2 = (SimpleDateFormat) threadLocal.get();
+
+        if (df2 == null) {
+            df2 = new SimpleDateFormat(format2);
+            threadLocal.set(df2);
+        }
+
+        return df2;
+
+    }
+
+    public static SimpleDateFormat getFormat3() {
+
+        SimpleDateFormat df3 = (SimpleDateFormat) threadLocal.get();
+
+        if (df3 == null) {
+            df3 = new SimpleDateFormat(format3);
+            threadLocal.set(df3);
+        }
+
+        return df3;
+
+    }
+
+    private DateUtils() {
+    }
+
+    /**
+     * 获取系统日期(无时分秒毫秒)
+     *
+     * @return
+     */
+    public static Date today() {
+        return truncate(now());
+    }
+
+    /**
+     * 获取系统时间
+     *
+     * @return
+     */
+    public static Date now() {
+        return new Date();
+    }
+
+    /**
+     * 根据年月日生成日期对象
+     *
+     * @param y
+     * @param m
+     * @param d
+     * @return
+     */
+    public static Date cons(int y, int m, int d) {
+        Calendar cal = Calendar.getInstance();
+        cal.set(y, m, d, 0, 0, 0);
+        return cal.getTime();
+    }
+
+    public static String toDate(Date date) {
+        return getFormat1().format(date);
+    }
+
+    public static String toDate2(Date date) {
+        return getFormat2().format(date);
+    }
+
+    public static String toDate1(Date date) {
+        return getFormat().format(date);
+    }
+
+    /**
+     * 根据年月日时分秒生成日期对象
+     *
+     * @param y
+     * @param m
+     * @param d
+     * @param h
+     * @param mi
+     * @param s
+     * @return
+     */
+    public static Date cons(int y, int m, int d, int h, int mi, int s) {
+        Calendar cal = Calendar.getInstance();
+        cal.set(y, m, d, h, mi, s);
+        return cal.getTime();
+    }
+
+    /**
+     * 将指定时间转化为 Calendar
+     *
+     * @param date
+     * @return
+     */
+    public static Calendar getCal(Date date) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        return cal;
+    }
+
+    /**
+     * 获取当年年份
+     * @return
+     */
+    public static Integer getCurrentYear() {
+        Calendar date = Calendar.getInstance();
+        int year = date.get(Calendar.YEAR);
+        return year;
+
+    }
+    /**
+     * 将时间的时分秒毫秒字段去掉
+     *
+     * @param date
+     * @return
+     */
+    public static Date truncate(Date date) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        return cal.getTime();
+    }
+
+    /**
+     * 去掉日期中日及下级字段
+     *
+     * @param date
+     * @return
+     */
+    public static Date truncDay(Date date) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.set(Calendar.DAY_OF_MONTH, 1);
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        return cal.getTime();
+    }
+
+    /**
+     * 去掉日期中的月及下级字段
+     *
+     * @param date
+     * @return
+     */
+    public static Date truncMonth(Date date) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.set(Calendar.MONTH, 0);
+        cal.set(Calendar.DAY_OF_MONTH, 1);
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        return cal.getTime();
+    }
+
+    /**
+     * 在指定时间上加指定的天数
+     *
+     * @param date
+     * @param day
+     * @return
+     */
+    public static Date addDays(Date date, int day) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.DAY_OF_MONTH, day);
+        return cal.getTime();
+    }
+
+    /**
+     * 在指定的时间上加指定的月数
+     *
+     * @param date
+     * @param month
+     * @return
+     */
+    public static Date addMonths(Date date, int month) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.MONTH, month);
+        return cal.getTime();
+    }
+
+    /**
+     * 在指定的时间上加指定的月数
+     *
+     * @param date
+     * @param year
+     * @return
+     */
+    public static Date addYears(Date date, int year) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.YEAR, year);
+        return cal.getTime();
+    }
+
+    /**
+     * 在指定时间上加指定的小时
+     *
+     * @param date
+     * @param hour
+     * @return
+     */
+    public static Date addHours(Date date, int hour) {
+        return new Date(date.getTime() + hour * 3600 * 1000);
+    }
+
+    /**
+     * 在指定时间上加指定的分钟
+     *
+     * @param date
+     * @param m
+     * @return
+     */
+    public static Date addMinutes(Date date, int m) {
+        return new Date(date.getTime() + m * 60 * 1000);
+    }
+
+    /**
+     * 在指定时间上加指定的秒
+     *
+     * @param date
+     * @param s
+     * @return
+     */
+    public static Date addSeconds(Date date, int s) {
+        return new Date(date.getTime() + s * 1000);
+    }
+
+    /**
+     * 计算两个时间之间差的天数(取整后)
+     *
+     * @param d1
+     * @param d2
+     * @return
+     */
+    public static int daysDiff(Date d1, Date d2) {
+        return (int) Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (60 * 60 * 24 * 1000));
+    }
+
+    /**
+     * 计算两个时间之间差的小时数(取整后)
+     *
+     * @param d1
+     * @param d2
+     * @return
+     */
+    public static int hoursDiff(Date d1, Date d2) {
+        return (int) Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (60 * 60 * 1000));
+    }
+
+    public static double hoursDiff1(Date d1, Date d2) {
+        return Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (double) (60 * 60 * 1000));
+    }
+
+    public static double hoursDiff2(Date d1, Date d2) {
+        return Math.abs((d1.getTime() - d2.getTime())) / (double) (60 * 60 * 1000);
+    }
+
+    /**
+     * 计算两个时间之间差的分钟数(取整后)
+     *
+     * @param d1
+     * @param d2
+     * @return
+     */
+    public static int minutesDiff(Date d1, Date d2) {
+        return (int) Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (60 * 1000));
+    }
+
+    /**
+     * 计算两个时间之间差的分钟数(取整后)
+     *
+     * @param d1
+     * @param d2
+     * @return
+     */
+    public static double minutesDiff2(Date d1, Date d2) {
+        return Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (60 * 1000));
+    }
+
+    /**
+     * 计算两个时间之间差的毫秒数(取整后)
+     *
+     * @param d1
+     * @param d2
+     * @return
+     */
+    public static long millisecondDiff(Date d1, Date d2) {
+        return Math.abs(d1.getTime() - d2.getTime());
+    }
+
+    /**
+     * 计算两个时间之间差的秒数(取整后)
+     *
+     * @param d1
+     * @param d2
+     * @return
+     */
+    public static int secondsDiff(Date d1, Date d2) {
+        return (int) Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (1000));
+    }
+
+    /**
+     * 计算两个时间之间的月差
+     *
+     * @param d1
+     * @param d2
+     * @return
+     */
+    public static int monthsDiff(Date d1, Date d2) {
+        Calendar cal1 = Calendar.getInstance();
+        Calendar cal2 = Calendar.getInstance();
+        cal1.setTime(d1);
+        cal2.setTime(d2);
+
+        return (int) Math.abs((cal1.get(Calendar.YEAR) - cal2.get(Calendar.YEAR)) * 12 + cal1.get(Calendar.MONTH) - cal2.get(Calendar.MONTH));
+
+    }
+
+    /**
+     * 获得指定时间的月数
+     *
+     * @param date
+     * @return
+     */
+    public static int getMonth(Date date) {
+        Calendar cd = Calendar.getInstance();
+        cd.setTime(date);
+        return cd.get(Calendar.MONTH)+1;
+    }
+
+    /**
+     * 获得指定时间的年数
+     *
+     * @param date
+     * @return
+     */
+    public static int getYear(Date date) {
+        Calendar cd = Calendar.getInstance();
+        cd.setTime(date);
+        return cd.get(Calendar.YEAR);
+    }
+
+    /**
+     * 获取指定时间的天数
+     *
+     * @param date
+     * @return
+     */
+    public static int getDay(Date date) {
+        Calendar cd = Calendar.getInstance();
+        cd.setTime(date);
+        return cd.get(Calendar.DAY_OF_MONTH);
+    }
+
+    public static int getCurrentMonthLastDay() {
+        Calendar a = Calendar.getInstance();
+        a.set(Calendar.DATE, 1);
+        a.roll(Calendar.DATE, -1);
+        int maxDate = a.get(Calendar.DATE);
+        return maxDate;
+    }
+
+    public static int getMonthDays(Date date) {
+        Calendar cal = Calendar.getInstance();
+        cal.set(DateUtils.getYear(date), DateUtils.getMonth(date), DateUtils.getDay(date));
+        int dayst = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
+        return dayst;
+    }
+
+    /**
+     * 获取某年第一天日期
+     *
+     * @param year
+     *            年份
+     * @return Date
+     */
+    public static Date getYearFirst(int year) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.clear();
+        calendar.set(Calendar.YEAR, year);
+        Date currYearFirst = calendar.getTime();
+        return currYearFirst;
+    }
+
+    /**
+     * 获取当前日期
+     *
+     * @param
+     * @return Date
+     */
+    public static Date getCurrentDate() {
+        Calendar calendar = Calendar.getInstance();
+        Date date = calendar.getTime();
+        return date;
+    }
+
+    /**
+     * 获取某日期的当月最后一天
+     *
+     * @param date
+     *
+     * @return Date
+     */
+    public static Date getMonthLast(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.clear();
+        int month = getMonth(date);
+        int year = getYear(date);
+        calendar.set(Calendar.YEAR, year);
+        calendar.set(Calendar.MONTH, month);
+        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
+        Date currYearFirst = calendar.getTime();
+        return currYearFirst;
+    }
+
+    /**
+     * 获取当前月的第一天
+     *
+     * @return
+     */
+    public static String getCurrtenFirstDay() {
+
+        Calendar c = Calendar.getInstance();
+        // c.add(Calendar.MONTH, 0);
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        return getFormat().format(c.getTime());
+    }
+
+    /**
+     * 获取当前月的最后一天
+     *
+     * @return
+     */
+    public static String getCurrtenLastDay() {
+
+        Calendar ca = Calendar.getInstance();
+        ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
+        return getFormat().format(ca.getTime());
+    }
+
+    /**
+     * 获取当前月的第一天
+     *
+     * @return
+     */
+    public static Date getCurrtenFirstDate() {
+
+        Calendar c = Calendar.getInstance();
+        c.set(Calendar.DAY_OF_MONTH, c.getActualMinimum(Calendar.DAY_OF_MONTH));
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 1);
+        return c.getTime();
+    }
+
+    /**
+     * 获取当前月的最后一天
+     *
+     * @return
+     */
+    public static Date getCurrtenLastDate() {
+
+        Calendar c = Calendar.getInstance();
+        c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
+        c.set(Calendar.HOUR_OF_DAY, 23);
+        c.set(Calendar.MINUTE, 59);
+        c.set(Calendar.SECOND, 59);
+        return c.getTime();
+    }
+
+    public static Date parseDate(String date) {
+        try {
+            return getFormat().parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static Date parseDate1(String date) {
+        try {
+            return getFormat1().parse(date);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static Date parseDate2(String date) {
+        try {
+            return getFormat2().parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static Date parseDate3(String date) {
+        try {
+            return getFormat3().parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static Date parseLongToDate(long time) {
+        return new Date(time);
+    }
+
+
+
+    public static List<Date> getBetweenDates(Date start, Date end) {
+        List<Date> result = new ArrayList<Date>();
+        Calendar tempStart = Calendar.getInstance();
+        tempStart.setTime(start);
+        //tempStart.add(Calendar.DAY_OF_YEAR, 1);
+
+        Calendar tempEnd = Calendar.getInstance();
+        tempEnd.add(Calendar.DATE, +1);
+        tempEnd.setTime(end);
+
+        while (tempStart.before(tempEnd)) {
+            result.add(tempStart.getTime());
+            tempStart.add(Calendar.DAY_OF_YEAR, 1);
+        }
+        return result;
+    }
+
+    /**
+     * z获取上月最后一天
+     * @return
+     */
+    public static Date getYestmonthLastday(Date date){
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.MONTH, -1);
+        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
+        return calendar.getTime();
+
+    }
+
+
+
+    /**
+     * 转换Edna时间格式为标准格式
+     *
+     * @param pointTime
+     * @return
+     */
+    public static String convertEdnaTime2(String pointTime, Boolean isNoSec) {
+        StringBuffer sb = new StringBuffer();
+        String[] dt = pointTime.split(" ");
+        String[] ymd = dt[0].split("-");
+        String[] hms = dt[1].split(":");
+        sb.append(ymd[0]).append("-");
+        if (ymd[1].length() == 1) {
+            sb.append("0").append(ymd[1]);
+        } else {
+            sb.append(ymd[1]);
+        }
+        if (ymd[2].length() == 1) {
+            sb.append("-").append("0").append(ymd[2]);
+        } else {
+            sb.append("-").append(ymd[2]);
+        }
+        if (hms[0].length() == 1) {
+            sb.append(" ").append("0").append(hms[0]);
+        } else {
+            sb.append(" ").append(hms[0]);
+        }
+        if (hms[1].length() == 1) {
+            sb.append(":").append("0").append(hms[1]);
+        } else {
+            sb.append(":").append(hms[1]);
+        }
+
+        if (isNoSec) {
+            sb.append(":").append("00");
+        } else {
+            if (hms[2].length() == 1) {
+                sb.append(":").append("0").append(hms[2]);
+            } else {
+                sb.append(":").append(hms[2]);
+            }
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * 转换Edna时间格式为标准格式
+     *
+     * @param pointTime
+     * @return
+     */
+    public static String convertEdnaTime(String pointTime, Boolean isNoSec) {
+        String date = getFormat().format(new Date());
+        StringBuffer sb = new StringBuffer();
+        String[] dt = pointTime.split(" ");
+        String[] ymd = dt[0].split("/");
+        String[] hms = dt[1].split(":");
+        if (ymd[2].length() == 2) {
+            sb.append(date.substring(0, 2)).append(ymd[2]).append("-");
+        }
+        if (ymd[0].length() == 1) {
+            sb.append("0").append(ymd[0]);
+        } else {
+            sb.append(ymd[0]);
+        }
+        if (ymd[1].length() == 1) {
+            sb.append("-").append("0").append(ymd[1]);
+        } else {
+            sb.append("-").append(ymd[1]);
+        }
+        if (hms[0].length() == 1) {
+            sb.append(" ").append("0").append(hms[0]);
+        } else {
+            sb.append(" ").append(hms[0]);
+        }
+        if (hms[1].length() == 1) {
+            sb.append(":").append("0").append(hms[1]);
+        } else {
+            sb.append(":").append(hms[1]);
+        }
+
+        if (isNoSec) {
+            sb.append(":").append("00");
+        } else {
+            if (hms[2].length() == 1) {
+                sb.append(":").append("0").append(hms[2]);
+            } else {
+                sb.append(":").append(hms[2]);
+            }
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * 获取两个日期之间的所有日期(字符串格式, 按天计算)
+     *
+     * @param startTime String 开始时间 yyyy-MM-dd
+     * @param endTime  String 结束时间 yyyy-MM-dd
+     * @return
+     */
+    public static List<String> getBetweenDays(String startTime, String endTime) throws ParseException {
+
+        //1、定义转换格式
+        SimpleDateFormat df  = new SimpleDateFormat("yyyy-MM-dd");
+
+        Date start = df.parse(startTime);
+        Date end = df.parse(endTime);
+
+        List<String> result = new ArrayList<String>();
+
+        Calendar tempStart = Calendar.getInstance();
+        tempStart.setTime(start);
+
+        tempStart.add(Calendar.DAY_OF_YEAR, 1);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar tempEnd = Calendar.getInstance();
+        tempEnd.setTime(end);
+        result.add(sdf.format(start));
+        while (tempStart.before(tempEnd)) {
+            result.add(sdf.format(tempStart.getTime()));
+            tempStart.add(Calendar.DAY_OF_YEAR, 1);
+        }
+        return result;
+    }
+    public static String convertEdnaTime(String pointTime) {
+        return convertEdnaTime2(pointTime, false);
+    }
+
+    /**
+     * 获取昨天凌晨时间
+     * @return
+     */
+    public static Date getYesterdayStart () throws ParseException {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        Date date = new Date();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(calendar.DATE, -1);
+
+        date = calendar.getTime();
+
+        SimpleDateFormat format = getDateFormat("yyyy-MM-dd");
+
+        StringBuffer time = new StringBuffer();
+
+        String dateString  = format.format(date);
+
+        time.append(dateString).append(" ").append("00:00:00");
+
+        return sdf.parse(time.toString());
+
+    }
+    /**
+     * 时间减去一年
+     * @return
+     */
+    public static Date subOneYear (Date date) throws ParseException {
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.YEAR, -1);//当前时间减去一年,即一年前的时间
+        return calendar.getTime();
+
+    }
+
+    /**
+     * 获取昨天最后时间
+     * @return
+     */
+    public static Date getYesterdayEnd () throws ParseException {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = new Date();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(calendar.DATE, -1);
+
+        date = calendar.getTime();
+
+        SimpleDateFormat format = getDateFormat("yyyy-MM-dd");
+
+        StringBuffer time = new StringBuffer();
+
+        String dateString  = format.format(date);
+
+        time.append(dateString).append(" ").append("23:59:59");
+
+        return sdf.parse(time.toString());
+    }
+    /**
+     * 获取SimpleDateFormat
+     * @param parttern 日期格式
+     * @return SimpleDateFormat对象
+     * @throws RuntimeException 异常:非法日期格式
+     */
+    public static SimpleDateFormat getDateFormat(String parttern) throws RuntimeException {
+        return new SimpleDateFormat(parttern);
+    }
+
+    /**
+     * 获取昨天日期
+     * @param format
+     * @return
+     */
+    public static String getYesterdayStr(String format) {
+        Calendar cal = Calendar.getInstance();
+        cal.add(Calendar.DATE, -1);
+        return new SimpleDateFormat(format).format(cal.getTime());
+    }
+
+    /**
+     * z获取前一天
+     * @return
+     */
+    public static Date getYestday(Date date){
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.DATE, -1);
+        return calendar.getTime();
+
+    }
+
+
+    // 获得某天最大时间 2020-02-19 23:59:59
+    public static Date getEndOfDay(Date date) {
+        LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(date.getTime()), ZoneId.systemDefault());;
+        LocalDateTime endOfDay = localDateTime.with(LocalTime.MAX);
+        return Date.from(endOfDay.atZone(ZoneId.systemDefault()).toInstant());
+    }
+
+    // 获得某天最小时间 2020-02-17 00:00:00
+    public static Date getStartOfDay(Date date) {
+        LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(date.getTime()), ZoneId.systemDefault());
+        LocalDateTime startOfDay = localDateTime.with(LocalTime.MIN);
+        return Date.from(startOfDay.atZone(ZoneId.systemDefault()).toInstant());
+    }
+    public static void main(String[] args) {
+        System.out.println(DateUtils.getMonthDays(DateUtils.today()));
+    }
+
+    /**
+     * 获取连个日期间的所有日期
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    public static List<String> getDays(String startTime, String endTime) {
+        // 返回的日期集合
+        List<String> days = new ArrayList<String>();
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        try {
+            Date start = dateFormat.parse(startTime);
+            Date end = dateFormat.parse(endTime);
+            Calendar tempStart = Calendar.getInstance();
+            tempStart.setTime(start);
+            Calendar tempEnd = Calendar.getInstance();
+            tempEnd.setTime(end);
+            tempEnd.add(Calendar.DATE, +1);// 日期加1(包含结束)
+            while (tempStart.before(tempEnd)) {
+                days.add(dateFormat.format(tempStart.getTime()));
+                tempStart.add(Calendar.DAY_OF_YEAR, 1);
+            }
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return days;
+    }
+
+
+
+
+}

+ 12 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/RefUtls.java

@@ -0,0 +1,12 @@
+package com.gyee.benchmarkinghive.util;
+
+/**
+ * @ClassName : RefUtls
+ * @Author : xieshengjie
+ * @Date: 2021/6/5 18:50
+ * @Description :
+ */
+public class RefUtls {
+
+
+}

+ 93 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/ScriptJava.java

@@ -0,0 +1,93 @@
+package com.gyee.benchmarkinghive.util;
+
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+import javax.script.ScriptException;
+import javax.script.SimpleBindings;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * @ClassName : ScriptJava
+ * @Author : xieshengjie
+ * @Date: 2021/6/5 20:50
+ * @Description : 计算工具类
+ */
+public class ScriptJava {
+    public String getCalValue(String str) throws ScriptException {
+
+        ScriptEngineManager manager = new ScriptEngineManager();
+        ScriptEngine engine = manager.getEngineByName("javascript");
+        StringBuffer sb = new StringBuffer();
+        sb.append("isFinite(");
+        sb.append(str);
+        sb.append(")");
+        Object result = engine.eval(String.valueOf(sb));
+        if ((Boolean) result) {
+            result = engine.eval(str);
+        } else {
+            return "0.0";
+        }
+        return String.valueOf(result);
+
+    }
+    public String getCalValue(String str,Map<String, Object> input) throws ScriptException {
+
+        ScriptEngineManager manager = new ScriptEngineManager();
+        ScriptEngine engine = manager.getEngineByName("javascript");
+        StringBuffer sb = new StringBuffer();
+        sb.append("isFinite(");
+        sb.append(str);
+        sb.append(")");
+
+        Object result = engine.eval(String.valueOf(sb),new SimpleBindings(input));
+        if ((Boolean) result) {
+            result = engine.eval(str,new SimpleBindings(input));
+        } else {
+            return null;
+        }
+        return String.valueOf(result);
+
+    }
+    public static void test1() throws ScriptException {
+        String str = "(a >= 0 && a <= 5)";
+        ScriptEngineManager manager = new ScriptEngineManager();
+        ScriptEngine engine = manager.getEngineByName("js");
+        engine.put("a", 4);
+        Object result = engine.eval(str);
+        System.out.println("结果类型:" + result.getClass().getName() + ",计算结果:" + result);
+    }
+
+    public static void test2() throws ScriptException {
+        String str = "isFinite(-1.2+43*(2 + 1.4)+2*32/(0))";
+        ScriptEngineManager manager = new ScriptEngineManager();
+        ScriptEngine engine = manager.getEngineByName("js");
+        Object result = engine.eval(str);
+
+        System.out.println("结果类型:" + result.getClass().getName() + ",计算结果:" + result);
+    }
+    public static void test3() throws ScriptException {
+        String str = "1/0";
+        ScriptEngineManager manager = new ScriptEngineManager();
+        ScriptEngine engine = manager.getEngineByName("js");
+        Object result = engine.eval(str);
+
+        System.out.println("结果类型:" + result.getClass().getName() + ",计算结果:" + result);
+    }
+    //java将变量导入js脚本
+    public static void putValue() throws Exception{
+        String str="target0001*target0002/target0003";
+        Map<String, Object> input=new TreeMap<>();
+        ScriptEngineManager manager = new ScriptEngineManager();
+        ScriptEngine engine = manager.getEngineByName("js");
+        input.put("target0001",2);
+        input.put("target0002",3);
+        input.put("target0004",2);
+        input.put("target0005",3);
+        input.put("target0003",1);
+        System.out.println(engine.eval(str,new SimpleBindings(input)));
+    }
+    public static void main(String[] args) throws Exception {
+        putValue();
+    }
+}

+ 345 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/SortUtils.java

@@ -0,0 +1,345 @@
+package com.gyee.benchmarkinghive.util;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @ClassName : SortUtils
+ * @Author : xieshengjie
+ * @Date: 2021/6/5 20:06
+ * @Description : 排序
+ */
+public class SortUtils {
+    public static final String DESC = "desc";
+    public static final String ASC = "asc";
+
+    /**
+     * 对list中的元素按升序排列.
+     *
+     * @param list
+     *            排序集合
+     * @param field
+     *            排序字段
+     * @return
+     */
+    public static List<?> sort(List<?> list, final String field) {
+        return sort(list, field, null);
+    }
+
+    /**
+     * 对list中的元素进行排序.
+     *
+     * @param list
+     *            排序集合
+     * @param field
+     *            排序字段
+     * @param sort
+     *            排序方式: SortListUtil.DESC(降序) SortListUtil.ASC(升序).
+     * @return
+     */
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    public static List<?> sort(List<?> list, final String field,
+                               final String sort) {
+        Collections.sort(list, new Comparator() {
+            public int compare(Object a, Object b) {
+                int ret = 0;
+                try {
+                    Field f = a.getClass().getDeclaredField(field);
+                    f.setAccessible(true);
+                    Class<?> type = f.getType();
+
+                    if (type == int.class) {
+                        ret = ((Integer) f.getInt(a)).compareTo((Integer) f
+                                .getInt(b));
+                    } else if (type == double.class) {
+                        ret = ((Double) f.getDouble(a)).compareTo((Double) f
+                                .getDouble(b));
+                    } else if (type == long.class) {
+                        ret = ((Long) f.getLong(a)).compareTo((Long) f
+                                .getLong(b));
+                    } else if (type == float.class) {
+                        ret = ((Float) f.getFloat(a)).compareTo((Float) f
+                                .getFloat(b));
+                    } else if (type == Date.class) {
+                        ret = ((Date) f.get(a)).compareTo((Date) f.get(b));
+                    } else if (isImplementsOf(type, Comparable.class)) {
+                        ret = ((Comparable) f.get(a)).compareTo((Comparable) f
+                                .get(b));
+                    } else {
+                        ret = String.valueOf(f.get(a)).compareTo(
+                                String.valueOf(f.get(b)));
+                    }
+
+                } catch (SecurityException e) {
+                    e.printStackTrace();
+                } catch (NoSuchFieldException e) {
+                    e.printStackTrace();
+                } catch (IllegalArgumentException e) {
+                    e.printStackTrace();
+                } catch (IllegalAccessException e) {
+                    e.printStackTrace();
+                }
+                if (sort != null && sort.toLowerCase().equals(DESC)) {
+                    return -ret;
+                } else {
+                    return ret;
+                }
+
+            }
+        });
+        return list;
+    }
+
+    /**
+     * 对list中的元素按fields和sorts进行排序,
+     * fields[i]指定排序字段,sorts[i]指定排序方式.如果sorts[i]为空则默认按升序排列.
+     *
+     * @param list
+     *            排序集合
+     * @param fields
+     *            排序字段-数组(一个或多个)
+     * @param sorts
+     *            排序规则-数组(一个或多个)
+     * @return
+     */
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    public static List<?> sort(List<?> list, String[] fields, String[] sorts) {
+        if (fields != null && fields.length > 0) {
+            for (int i = fields.length - 1; i >= 0; i--) {
+                final String field = fields[i];
+                String tmpSort = ASC;
+                if (sorts != null && sorts.length > i && sorts[i] != null) {
+                    tmpSort = sorts[i];
+                }
+                final String sort = tmpSort;
+                Collections.sort(list, new Comparator() {
+                    public int compare(Object a, Object b) {
+                        int ret = 0;
+                        try {
+                            Field f = a.getClass().getDeclaredField(field);
+                            f.setAccessible(true);
+                            Class<?> type = f.getType();
+                            if (type == int.class) {
+                                ret = ((Integer) f.getInt(a))
+                                        .compareTo((Integer) f.getInt(b));
+                            } else if (type == double.class) {
+                                ret = ((Double) f.getDouble(a))
+                                        .compareTo((Double) f.getDouble(b));
+                            } else if (type == long.class) {
+                                ret = ((Long) f.getLong(a)).compareTo((Long) f
+                                        .getLong(b));
+                            } else if (type == float.class) {
+                                ret = ((Float) f.getFloat(a))
+                                        .compareTo((Float) f.getFloat(b));
+                            } else if (type == Date.class) {
+                                ret = ((Date) f.get(a)).compareTo((Date) f
+                                        .get(b));
+                            } else if (isImplementsOf(type, Comparable.class)) {
+                                ret = ((Comparable) f.get(a))
+                                        .compareTo((Comparable) f.get(b));
+                            } else {
+                                ret = String.valueOf(f.get(a)).compareTo(
+                                        String.valueOf(f.get(b)));
+                            }
+
+                        } catch (SecurityException e) {
+                            e.printStackTrace();
+                        } catch (NoSuchFieldException e) {
+                            e.printStackTrace();
+                        } catch (IllegalArgumentException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        }
+
+                        if (sort != null && sort.toLowerCase().equals(DESC)) {
+                            return -ret;
+                        } else {
+                            return ret;
+                        }
+                    }
+                });
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 默认按正序排列
+     *
+     * @param list
+     *            排序集合
+     * @param method
+     *            排序方法 "getXxx()"
+     * @return
+     */
+    public static List<?> sortByMethod(List<?> list, final String method) {
+        return sortByMethod(list, method, null);
+    }
+
+    /**
+     * 集合排序
+     *
+     * @param list
+     *            排序集合
+     * @param method
+     *            排序方法 "getXxx()"
+     * @param sort
+     *            排序方式: SortListUtil.DESC(降序) SortListUtil.ASC(升序).
+     * @return
+     */
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    public static List<?> sortByMethod(List<?> list, final String method,
+                                       final String sort) {
+        Collections.sort(list, new Comparator() {
+            public int compare(Object a, Object b) {
+                int ret = 0;
+                try {
+                    Method m = a.getClass().getMethod(method, null);
+                    m.setAccessible(true);
+                    Class<?> type = m.getReturnType();
+                    if (type == int.class) {
+                        ret = ((Integer) m.invoke(a, null))
+                                .compareTo((Integer) m.invoke(b, null));
+                    } else if (type == double.class) {
+                        ret = ((Double) m.invoke(a, null)).compareTo((Double) m
+                                .invoke(b, null));
+                    } else if (type == long.class) {
+                        ret = ((Long) m.invoke(a, null)).compareTo((Long) m
+                                .invoke(b, null));
+                    } else if (type == float.class) {
+                        ret = ((Float) m.invoke(a, null)).compareTo((Float) m
+                                .invoke(b, null));
+                    } else if (type == Date.class) {
+                        ret = ((Date) m.invoke(a, null)).compareTo((Date) m
+                                .invoke(b, null));
+                    } else if (isImplementsOf(type, Comparable.class)) {
+                        ret = ((Comparable) m.invoke(a, null))
+                                .compareTo((Comparable) m.invoke(b, null));
+                    } else {
+                        ret = String.valueOf(m.invoke(a, null)).compareTo(
+                                String.valueOf(m.invoke(b, null)));
+                    }
+
+                    if (isImplementsOf(type, Comparable.class)) {
+                        ret = ((Comparable) m.invoke(a, null))
+                                .compareTo((Comparable) m.invoke(b, null));
+                    } else {
+                        ret = String.valueOf(m.invoke(a, null)).compareTo(
+                                String.valueOf(m.invoke(b, null)));
+                    }
+
+                } catch (NoSuchMethodException ne) {
+                    System.out.println(ne);
+                } catch (IllegalAccessException ie) {
+                    System.out.println(ie);
+                } catch (InvocationTargetException it) {
+                    System.out.println(it);
+                }
+
+                if (sort != null && sort.toLowerCase().equals(DESC)) {
+                    return -ret;
+                } else {
+                    return ret;
+                }
+            }
+        });
+        return list;
+    }
+
+    @SuppressWarnings("unchecked")
+    public static List<?> sortByMethod(List<?> list, final String methods[],
+                                       final String sorts[]) {
+        if (methods != null && methods.length > 0) {
+            for (int i = methods.length - 1; i >= 0; i--) {
+                final String method = methods[i];
+                String tmpSort = ASC;
+                if (sorts != null && sorts.length > i && sorts[i] != null) {
+                    tmpSort = sorts[i];
+                }
+                final String sort = tmpSort;
+                Collections.sort(list, new Comparator() {
+                    public int compare(Object a, Object b) {
+                        int ret = 0;
+                        try {
+                            Method m = a.getClass().getMethod(method, null);
+                            m.setAccessible(true);
+                            Class<?> type = m.getReturnType();
+                            if (type == int.class) {
+                                ret = ((Integer) m.invoke(a, null))
+                                        .compareTo((Integer) m.invoke(b, null));
+                            } else if (type == double.class) {
+                                ret = ((Double) m.invoke(a, null))
+                                        .compareTo((Double) m.invoke(b, null));
+                            } else if (type == long.class) {
+                                ret = ((Long) m.invoke(a, null))
+                                        .compareTo((Long) m.invoke(b, null));
+                            } else if (type == float.class) {
+                                ret = ((Float) m.invoke(a, null))
+                                        .compareTo((Float) m.invoke(b, null));
+                            } else if (type == Date.class) {
+                                ret = ((Date) m.invoke(a, null))
+                                        .compareTo((Date) m.invoke(b, null));
+                            } else if (isImplementsOf(type, Comparable.class)) {
+                                ret = ((Comparable) m.invoke(a, null))
+                                        .compareTo((Comparable) m.invoke(b,
+                                                null));
+                            } else {
+                                ret = String.valueOf(m.invoke(a, null))
+                                        .compareTo(
+                                                String.valueOf(m
+                                                        .invoke(b, null)));
+                            }
+
+                        } catch (NoSuchMethodException ne) {
+                            System.out.println(ne);
+                        } catch (IllegalAccessException ie) {
+                            System.out.println(ie);
+                        } catch (InvocationTargetException it) {
+                            System.out.println(it);
+                        }
+
+                        if (sort != null && sort.toLowerCase().equals(DESC)) {
+                            return -ret;
+                        } else {
+                            return ret;
+                        }
+                    }
+                });
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 判断对象实现的所有接口中是否包含szInterface
+     *
+     * @param clazz
+     * @param szInterface
+     * @return
+     */
+    public static boolean isImplementsOf(Class<?> clazz, Class<?> szInterface) {
+        boolean flag = false;
+
+        Class<?>[] face = clazz.getInterfaces();
+        for (Class<?> c : face) {
+            if (c == szInterface) {
+                flag = true;
+            } else {
+                flag = isImplementsOf(c, szInterface);
+            }
+        }
+
+        if (!flag && null != clazz.getSuperclass()) {
+            return isImplementsOf(clazz.getSuperclass(), szInterface);
+        }
+
+        return flag;
+    }
+
+}

+ 48 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/ApiGolden.java

@@ -0,0 +1,48 @@
+/** 
+ * Project Name:nxfd2 
+ * File Name:ApiEdos.java 
+ * Package Name:com.gyee.frame.util
+ * Date:2016-7-25下午12:26:14 
+ * Copyright (c) 2016, chenzhou1025@126.com All Rights Reserved. 
+ * 
+ */
+
+package com.gyee.benchmarkinghive.util.taos;
+
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * ClassName:ApiEdos <br/>
+ * Function: TODO ADD FUNCTION. <br/>
+ * Reason: TODO ADD REASON. <br/>
+ * Date: 2016-7-25 下午12:26:14 <br/>
+ * 
+ * @author 石林
+ * @version
+ * @since JDK 1.6
+ * @see
+ */
+public class ApiGolden {
+
+    private static RestTemplate restTemplate = null;
+
+  
+    private ApiGolden() {
+
+    }
+
+    public static RestTemplate getInstance() {
+    	
+    	
+
+        if (restTemplate == null) {
+        	
+        	restTemplate = new RestTemplate();
+
+        }
+
+        return restTemplate;
+
+    }
+
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1270 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/EdosUtil.java


+ 27 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/GoldenConfig.java

@@ -0,0 +1,27 @@
+package com.gyee.benchmarkinghive.util.taos;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 读取项目相关配置
+ * 
+ * @author gyee
+ */
+
+@Configuration
+@ConfigurationProperties(prefix = "golden")
+public class GoldenConfig
+{
+    private static String baseURL;
+
+    public static String getBaseurl() {
+        return baseURL;
+    }
+
+    public  void setBaseurl(String baseURL) {
+        GoldenConfig.baseURL = baseURL;
+    }
+}
+
+

+ 236 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/IEdosUtil.java

@@ -0,0 +1,236 @@
+package com.gyee.benchmarkinghive.util.taos;
+
+
+
+
+
+import com.gyee.benchmarkinghive.common.DNAStatVal;
+import com.gyee.benchmarkinghive.common.DNAVal;
+import com.gyee.benchmarkinghive.common.PointData;
+import com.gyee.benchmarkinghive.model.auto.Windpowerstationtestingpoint2;
+import com.gyee.benchmarkinghive.model.auto.Windturbinetestingpointai2;
+
+import java.util.List;
+import java.util.Map;
+
+
+public interface IEdosUtil {
+
+	/**
+	 * 通过风场测点获得测点实时数据
+	 * @param point 只是用了code字段,作为唯一标识
+	 * @return
+	 * @throws Exception
+	 */
+    public PointData getRealData(Windpowerstationtestingpoint2 point) throws Exception;
+
+    /**
+     * 通过风场测点获得测点历史快照数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @param beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(Windpowerstationtestingpoint2 point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+
+    /**
+     * 通过风场测点获得测点历史存储数据,存多少取多少
+     * @param point 只是用了code字段,作为唯一标识
+     * @param beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasRaw(Windpowerstationtestingpoint2 point, Long beginDate, Long endDate) throws Exception;
+
+    /**
+     * 通过风机测点获得测点实时数据
+     * @param point 只是用了id字段,作为唯一标识
+     * @return
+     * @throws Exception
+     */
+    public PointData getRealData(Windturbinetestingpointai2 point) throws Exception;
+
+    /**
+     * 通过风机测点获得历史快照
+     * @param point  只是用了id字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(Windturbinetestingpointai2 point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+
+    /**
+     * 通过风机测点获得测点历史存储数据,存多少取多少
+     * @param point 只是用了id字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasRaw(Windturbinetestingpointai2 point, Long beginDate, Long endDate) throws Exception;
+
+
+    /**
+     * 通过风机测点获得测点实时数据
+     * @param pointid 测点编号
+     * @return
+     * @throws Exception
+     */
+    public PointData getRealData(String pointid) throws Exception;
+
+    /**
+     * 通过全局点名获得测点实时数据 读取多个点
+     * @param pointids 测点的数组
+     * @return 列表集合
+     * @throws Exception
+     */
+    public List<PointData> getRealData(String... pointids) throws Exception;
+    /**
+     * 通过全局点名获得测点实时数据 读取多个点
+     * @param pointids 测点的列表
+     * @return 列表集合
+     * @throws Exception
+     */
+    public List<PointData> getRealData(List<String> pointids) throws Exception;
+    /**
+     * 通过全局点名获得测点实时数据 读取多个点
+     * @param pointids 测点的数组
+     * @return Map集合
+     * @throws Exception
+     */
+    public Map<String,Double> getRealDataMap(String... pointids) throws Exception;
+
+    /**
+     * 通过全局点名获得历史数据快照
+     * @param pointid  全局点名
+     * @param beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+
+    /**
+     * 通过风机测点获得测点历史存储数据,存多少取多少
+     * @param pointid 全局点名
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasRaw(String pointid, Long beginDate, Long endDate) throws Exception;
+
+
+    /**
+     * 通过风机测点获得测点指定时间周期的统计数据
+     * @param point 只是用了id字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @type 0、最大值。1、最小值。、平均值
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistStat(Windturbinetestingpointai2 point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+
+    /**
+     * 通过风场测点获得测点指定时间周期的统计数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @type 0、最大值。1、最小值。、平均值
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistStat(Windpowerstationtestingpoint2 point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+
+    /**
+     * 通过全局点名获得测点指定时间周期的统计数据
+     * @param pointid 全局点名
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @type 0、最大值。1、最小值。、平均值
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistStat(String pointid, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+
+    /**
+     * 通过全局点名获得测点指定时间周期的统计数据 同时返回max、min、avg数据
+     * @param point 全局点名
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public DNAStatVal[] getHistStat(String point, Long beginDate, Long endDate, Integer pried) throws Exception;
+    /**
+     * 补录单点历史数据
+     * @param point 测点对象
+     * @return
+     * @throws Exception
+     */
+    public void updatePoint(PointData point) throws Exception;
+
+    /**
+     * 批量查询实时数据
+     * @param tagNames 测点字符串数组
+     * @return
+     * @throws Exception
+     */
+
+    public DNAVal[] getRealtimeTagValues(String... tagNames) throws Exception;
+
+    /**
+     * 批量插入历史数据
+     * @param pointls 测点对象集合
+     * @throws Exception
+     */
+    public void updatePoint(List<PointData> pointls) throws Exception;
+
+    /**
+     * 单点写入实时数据
+     * @param point 测点对象
+     * @throws Exception
+     */
+    public void sendSinglePoint(PointData point) throws Exception ;
+    /**
+     * 批量写入实时数据
+     * @param pointls 测点对象列表
+     * @throws Exception
+     */
+    public void sendMultiPoint(List<PointData> pointls) throws Exception ;
+
+    /**
+     * 通过两个字符串数组对象批量写入实时数据
+     * @param realvalue 插入值字符串数组
+     * @param pointls 存储对象数组对象
+     * @throws Exception
+     */
+
+    public void sendMultiPoint(String[] realvalue,DNAVal[] pointls) throws Exception;
+    /**
+     *
+     * @param nameList 测点名称列表集合
+     * @param tTime  时间点(秒级)
+     * @return
+     * @throws Exception
+     */
+    public DNAVal[] getHistMatrix(String[] nameList, int tTime) throws Exception;
+
+}

+ 34 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/StringUtil.java

@@ -0,0 +1,34 @@
+package com.gyee.benchmarkinghive.util.taos;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * String辅助类
+ * 
+ */
+public class StringUtil extends StringUtils {
+	
+	/**
+	 * 非空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isNotBlank(Object obj) {
+		return !isBlank(obj);
+	}
+
+	/**
+	 * 为空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isBlank(Object obj) {
+		if (obj == null || StringUtils.isBlank(obj.toString())) {
+			return true;
+		}
+		return false;
+	}
+
+}

+ 28 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BaseTsQuery.java

@@ -0,0 +1,28 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import lombok.Data;
+
+@Data
+public class BaseTsQuery implements TsQuery {
+
+    private final TsPoint tsPoint;
+    private final long startTs;
+    private final long endTs;
+    private final int interval;
+    private final int limit;
+    private final Interpolation interpolation;
+
+    public BaseTsQuery(TsPoint tsPoint, long startTs, long endTs, int interval, int limit, Interpolation interpolation) {
+        this.tsPoint = tsPoint;
+        this.startTs = startTs;
+        this.endTs = endTs;
+        this.interval = interval;
+        this.limit = limit;
+        this.interpolation = interpolation;
+    }
+
+    public BaseTsQuery(TsPoint tsPoint, long startTs, long endTs) {
+        this(tsPoint, startTs, endTs, 1, 1, Interpolation.RAW);
+    }
+
+}

+ 38 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BasicTsData.java

@@ -0,0 +1,38 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public abstract class BasicTsData implements TsData, Comparable<BasicTsData>{
+
+    private final long ts;
+
+    private final short status;
+
+    public BasicTsData(long ts, short status) {
+        this.ts = ts;
+        this.status = status;
+    }
+
+    public long getTs() {
+        return ts;
+    }
+
+    public short getStatus() {
+        return status;
+    }
+
+    @Override
+    public int compareTo(BasicTsData o) {
+        return Long.compare(ts, o.ts);
+    }
+
+    @Override
+    public String toString() {
+        return "BasicTsData{ts='" + ts +
+                "', status='" + this.getStatus() +
+                "'}";
+    }
+
+}
+

+ 29 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BasicTsPoint.java

@@ -0,0 +1,29 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class BasicTsPoint implements TsPoint{
+
+    private final String id;
+
+    private final TsDataType tsDataType;
+
+    public BasicTsPoint(String id,  TsDataType tsDataType) {
+        this.id = id;
+        this.tsDataType = tsDataType;
+    }
+
+    public String getId() { return id; }
+
+    public TsDataType getTsDataType() {return tsDataType; }
+
+    @Override
+    public String toString() {
+        return "BasicTsPoint{id='" + id +
+                "', dataType='" + this.getTsDataType() +
+                "'}";
+    }
+
+}
+

+ 24 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BlobTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import java.util.Base64;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class BlobTsData extends BasicTsData {
+
+    private final byte[] blob;
+
+    public BlobTsData(long ts, short status, byte[] blob) {
+        super(ts, status);
+        this.blob = blob;
+    }
+
+    //public byte[] getBlob() { return  blob ;}
+
+    public String getBlobValue() {
+        return Base64.getEncoder().encodeToString(blob);
+    }
+
+}
+

+ 22 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BlobWriteTsData.java

@@ -0,0 +1,22 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import lombok.Data;
+
+import java.util.Base64;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class BlobWriteTsData {
+    private String tagName;
+    private long ts;
+    private  byte[]blob;
+
+    public String getValue() {
+        return Base64.getEncoder().encodeToString(blob);
+    }
+
+}

+ 24 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BooleanTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class BooleanTsData extends BasicTsData {
+
+    private final boolean actualValue;
+
+    public BooleanTsData(long ts, short status, boolean actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+//    public boolean getActualValue() {
+//        return actualValue;
+//    }
+
+    public String getBooleanValue() {
+        return Boolean.toString(actualValue);
+    }
+
+}
+

+ 19 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/BooleanWriteTsData.java

@@ -0,0 +1,19 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class BooleanWriteTsData  {
+    private String tagName;
+    private long ts;
+    private boolean actualValue;
+
+    public boolean getValue() {
+        return this.actualValue;
+    }
+}

+ 18 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/Coordinate.java

@@ -0,0 +1,18 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+public class Coordinate {
+
+    private double latitude;
+
+    private double longitude;
+
+}
+

+ 26 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/CoordinateTsData.java

@@ -0,0 +1,26 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class CoordinateTsData extends BasicTsData {
+
+    private final Coordinate coordinate;
+
+    public CoordinateTsData(long ts, short status, double latitude, double longitude) {
+        super(ts, status);
+        this.coordinate = new Coordinate(latitude, longitude);
+    }
+
+    public CoordinateTsData(long ts, short status, Coordinate coordinate) {
+        super(ts, status);
+        this.coordinate = coordinate;
+    }
+
+    public Coordinate getCoordinateValue() {
+        return coordinate;
+        //return String.format("{\"longitude\":%f,\"latitude\":\"%f\"}", longitude, latitude);
+    }
+
+}
+

+ 21 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/CoordinateWriteTsData.java

@@ -0,0 +1,21 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class CoordinateWriteTsData  {
+
+    private String tagName;
+    private long ts;
+    private  double latitude;
+    private  double longitude;
+
+    public double getLatitude() { return  latitude ;}
+    public double getLongitude() {return  longitude; }
+
+}

+ 30 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/DoubleStatData.java

@@ -0,0 +1,30 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class DoubleStatData {
+
+    private DoubleTsData avg;
+    private DoubleTsData max;
+    private DoubleTsData min;
+
+    public DoubleStatData(DoubleTsData avg, DoubleTsData max, DoubleTsData min) {
+        this.avg = avg;
+        this.max = max;
+        this.min = min;
+    }
+
+    public DoubleTsData getAvg() {
+        return avg;
+    }
+
+    public DoubleTsData getMax() {
+        return max;
+    }
+
+    public DoubleTsData getMin() {
+        return min;
+    }
+}
+

+ 25 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/DoubleTsData.java

@@ -0,0 +1,25 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class DoubleTsData extends BasicTsData {
+
+    private final double actualValue;
+
+    public DoubleTsData(long ts, short status, double actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+
+    public double getDoubleValue() {
+        return actualValue;
+    }
+
+//    public String getValue() {
+//        return Double.toString(actualValue);
+//    }
+
+}
+

+ 19 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/DoubleWriteTsData.java

@@ -0,0 +1,19 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class DoubleWriteTsData  {
+    private String tagName;
+    private long ts;
+    private double actualValue;
+
+    public double getValue() {
+        return this.actualValue;
+    }
+}

+ 41 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/ErrorRequest.java

@@ -0,0 +1,41 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+
+
+
+import com.gyee.benchmarkinghive.common.PointData;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @descrition:接口请求失败返回操作类
+ * @author:Wanghs
+ * @date:2018-05-21
+ */
+public class ErrorRequest {
+
+    public static List<PointData> RequestListError(String pointId) {
+        List<PointData> dataList = new ArrayList<>();
+        return dataList;
+    }
+
+    public static List<PointData> RequestListError(String... pointId) {
+        List<PointData> dataList = new ArrayList<>();
+        return dataList;
+    }
+
+    public static PointData RequestError(String pointId) {
+        PointData data = new PointData();
+        data.setPointValueInDouble(0);
+        data.setPointName("0");
+        return data;
+    }
+
+    public static Map<String, Double> RequestMapError() {
+        Map<String, Double> resultMap = new HashMap();
+        return resultMap;
+    }
+}

+ 27 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/GeneralTsData.java

@@ -0,0 +1,27 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Optional;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class GeneralTsData implements TsData {
+
+    private long ts;
+    private short status;
+    private Optional<Double> doubleValue;
+    private Optional<Long> longValue;
+    private Optional<Boolean> booleanValue;
+    private Optional<String> stringValue;
+    private Optional<String> blobValue;
+    private Optional<Coordinate> coordinateValue;
+
+}
+

+ 8 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/Interpolation.java

@@ -0,0 +1,8 @@
+
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+public enum Interpolation {
+    SNAP,   // 历史快照数据
+    INTERPOLATION, //插值
+    RAW    //原始数据
+}

+ 204 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/JsonObjectHelper.java

@@ -0,0 +1,204 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.gyee.benchmarkinghive.common.DNAStatVal;
+import com.gyee.benchmarkinghive.common.DNAVal;
+import com.gyee.benchmarkinghive.common.PointData;
+
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+
+/**
+ * @descrition:JSONObject转实体辅助类
+ * @author:Wanghs
+ * @date:2018-05-10
+ */
+public class JsonObjectHelper {
+    public static List<PointData> phrasePointData(JSONArray jsonArray, String tagName) {
+        List<PointData> result = new ArrayList<>();
+
+        for (int i = 0; i < jsonArray.size(); i++) {
+            JSONObject tsData = jsonArray.getJSONObject(i);
+
+            Long ts = tsData.getLong("ts");
+            String pointValue = null;
+            if (tsData.containsKey("doubleValue")) {
+                pointValue = tsData.getString("doubleValue");
+            } else if (tsData.containsKey("booleanValue")) {
+                pointValue = tsData.getString("booleanValue");
+            } else if (tsData.containsKey("longValue")) {
+                pointValue = tsData.getString("longValue");
+            } else if (tsData.containsKey("stringValue")) {
+                pointValue = tsData.getString("stringValue");
+            }
+            PointData pointData = new PointData();
+            pointData.setEdnaId(tagName);
+            pointData.setPointName("1");
+            pointData.setPointTime(ts / 1000);
+            pointData.setPointValue(pointValue);
+            pointData.setPointValueInDouble(Double.parseDouble(pointValue));
+            //System.out.println("key= " + tagName + ", ts = " + ts + ", value = " + pointValue);
+            result.add(pointData);
+        }
+        return result;
+    }
+
+
+    public static List<PointData> phrasePointData(JSONObject jsonObject) {
+        List<PointData> result = new ArrayList<>();
+        Iterator<String> sIterator = jsonObject.keySet().iterator();
+        while (sIterator.hasNext()) {
+            // 获得key
+            String key = sIterator.next();
+            // 根据key获得value, value也可以是JSONObject,JSONArray,使用对应的参数接收即可
+            JSONObject jsonData = jsonObject.getJSONObject(key);
+            Long ts = jsonData.getLong("ts");
+            String pointValue = null;
+            if (jsonData.containsKey("doubleValue")) {
+                pointValue = jsonData.getString("doubleValue");
+            } else if (jsonData.containsKey("booleanValue")) {
+                pointValue = jsonData.getString("booleanValue");
+            } else if (jsonData.containsKey("longValue")) {
+                pointValue = jsonData.getString("longValue");
+            } else if (jsonData.containsKey("stringValue")) {
+                pointValue = jsonData.getString("stringValue");
+            }
+
+            PointData pointData = new PointData();
+            pointData.setEdnaId(key);
+            pointData.setPointName("1");
+            pointData.setPointValue(pointValue);
+            pointData.setPointTime(ts/1000);
+            if(pointValue.equals("false")  )
+            {
+            	pointData.setPointValueInDouble(0.0);
+            }else  if(pointValue.equals("true") )
+            {
+            	pointData.setPointValueInDouble(1.0);
+            }else
+            {
+                pointData.setPointValueInDouble(Double.parseDouble(pointValue));
+            }
+
+         //  System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
+            result.add(pointData);
+        }
+        return result;
+    }
+    /**
+     * @param arry    DoubleStatData集合
+     * @param tagName 标签点名
+     * @param type    0、最大值。1、最小值。2、平均值
+     */
+    public static List<PointData> GeneralTsDataToPointDataByStat(JSONArray arry, String tagName, int type) {
+        List<PointData> result = new ArrayList<>();
+        for (int i = 0; i < arry.size(); i++) {
+            JSONObject jsonData = arry.getJSONObject(i);
+            PointData data = new PointData();
+            data.setEdnaId(tagName);
+            data.setPointName("1");
+            JSONObject avgData = null;
+            JSONObject maxData = null;
+            JSONObject minData = null;
+            if (jsonData.containsKey("avg")) {
+                avgData = jsonData.getJSONObject("avg");
+            }
+            if (jsonData.containsKey("max")) {
+                maxData = jsonData.getJSONObject("max");
+            }
+            if (jsonData.containsKey("min")) {
+                minData = jsonData.getJSONObject("min");
+            }
+            switch (type) {
+                case 0:
+                    data.setPointValue(String.valueOf(maxData.getString("doubleValue")));
+                    data.setPointValueInDouble(Double.valueOf(maxData.getString("doubleValue")));
+                    data.setPointTime(Long.valueOf(maxData.getString("ts")) / 1000);
+                    break;
+                case 1:
+                    data.setPointValue(String.valueOf(minData.getString("doubleValue")));
+                    data.setPointValueInDouble(Double.valueOf(minData.getString("doubleValue")));
+                    data.setPointTime(Long.valueOf(minData.getString("ts")) / 1000);
+                    break;
+                case 2:
+                    data.setPointValue(String.valueOf(avgData.getString("doubleValue")));
+                    data.setPointValueInDouble(Double.valueOf(avgData.getString("doubleValue")));
+                    data.setPointTime(Long.valueOf(avgData.getString("ts")) / 1000);
+                    break;
+                default:
+                    break;
+            }
+            result.add(data);
+        }
+        return result;
+    }
+
+    public static DNAVal[] phraseDNAVal(JSONObject jsonObject, String[] tagName) {
+        DNAVal[] arr = new DNAVal[jsonObject.size()];
+        List<DNAVal> list = new ArrayList<>();
+        Iterator<String> sIterator = jsonObject.keySet().iterator();
+
+        for (int i = 0; i < tagName.length; i++) {
+            // 获得key
+            String key = tagName[i];
+            // 根据key获得value, value也可以是JSONObject,JSONArray,使用对应的参数接收即可
+            JSONObject jsonData = jsonObject.getJSONObject(key);
+            DNAVal data = new DNAVal();
+            data.Time = Integer.parseInt(String.valueOf(Long.valueOf(jsonData.getString("ts")) / 1000));
+            data.Status = (short) jsonData.getShortValue("status");
+            data.DValue = (Double.valueOf(jsonData.getDoubleValue("doubleValue")));
+            list.add(data);
+        }
+
+        return list.toArray(arr);
+    }
+
+    public static DNAStatVal[] phraseDNAVal(JSONArray jsonArray) {
+
+        DNAStatVal[] arr = new DNAStatVal[jsonArray.size()];
+        List<DNAStatVal> list = new ArrayList<>();
+        for (int i = 0; i < jsonArray.size(); i++) {
+            JSONObject jsonData = jsonArray.getJSONObject(i);
+            JSONObject avgData = null;
+            JSONObject maxData = null;
+            JSONObject minData = null;
+            if (jsonData.containsKey("avg")) {
+                avgData = jsonData.getJSONObject("avg");
+            }
+            if (jsonData.containsKey("max")) {
+                maxData = jsonData.getJSONObject("max");
+            }
+            if (jsonData.containsKey("min")) {
+                minData = jsonData.getJSONObject("min");
+            }
+            DNAStatVal statVal = new DNAStatVal();
+
+            DNAVal avgVal = new DNAVal();
+            DNAVal maxVal = new DNAVal();
+            DNAVal minVal = new DNAVal();
+
+            avgVal.Time = Integer.valueOf(String.valueOf(Long.valueOf(avgData.getString("ts")) / 1000));
+            avgVal.DValue = Double.valueOf(avgData.getString("doubleValue"));
+
+            maxVal.Time =  Integer.valueOf(String.valueOf(Long.valueOf(maxData.getString("ts")) / 1000));
+            maxVal.DValue = Double.valueOf(maxData.getString("doubleValue"));
+
+            minVal.Time =  Integer.valueOf(String.valueOf(Long.valueOf(minData.getString("ts")) / 1000));
+            minVal.DValue = Double.valueOf(minData.getString("doubleValue"));
+
+            statVal.max = maxVal;
+            statVal.min = minVal;
+            statVal.avg = avgVal;
+
+            list.add(statVal);
+        }
+
+        return list.toArray(arr);
+    }
+
+}

+ 24 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/LongTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class LongTsData extends BasicTsData {
+
+    private final long actualValue;
+
+    public LongTsData(long ts, short status, long actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+    public long getLongValue() {
+        return actualValue;
+    }
+
+//    public String getValue() {
+//        return Long.toString(actualValue);
+//    }
+
+}
+

+ 20 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/LongWriteTsData.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class LongWriteTsData  {
+
+    private String tagName;
+    private long ts;
+    private long actualValue;
+
+    public long getValue() {
+        return this.actualValue;
+    }
+}

+ 24 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/StringTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class StringTsData extends BasicTsData {
+
+    private final String actualValue;
+
+    public StringTsData(long ts, short status, String actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+//    public String getActualValue() {
+//        return actualValue;
+//    }
+
+    public String getStringValue() {
+        return actualValue;
+    }
+
+}
+

+ 34 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/StringUtil.java

@@ -0,0 +1,34 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * String辅助类
+ * 
+ */
+public class StringUtil extends StringUtils {
+	
+	/**
+	 * 非空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isNotBlank(Object obj) {
+		return !isBlank(obj);
+	}
+
+	/**
+	 * 为空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isBlank(Object obj) {
+		if (obj == null || StringUtils.isBlank(obj.toString())) {
+			return true;
+		}
+		return false;
+	}
+
+}

+ 20 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/StringWriteTsData.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:String类型写入实体类
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class StringWriteTsData  {
+    private String tagName;
+    private long ts;
+    private String actualValue;
+
+    public String getValue() {
+        return this.actualValue;
+    }
+
+}

+ 15 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsData.java

@@ -0,0 +1,15 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public interface TsData {
+
+    long getTs();
+
+    short getStatus();
+
+    //double getValue();
+
+}
+

+ 15 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsDataType.java

@@ -0,0 +1,15 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public enum TsDataType {
+    LONG,
+    DOUBLE,
+    BOOLEAN,
+    STRING,
+    BLOB,
+    COORDINATE
+
+}
+

+ 12 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsPoint.java

@@ -0,0 +1,12 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public interface TsPoint {
+
+    String getId();
+
+    TsDataType getTsDataType();
+}
+

+ 36 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsPointData.java

@@ -0,0 +1,36 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TsPointData {
+
+    private String tagName;
+    private GeneralTsData tsData;
+
+    public TsDataType findDataType() {
+        if (tsData.getDoubleValue().isPresent())
+            return TsDataType.DOUBLE;
+        else if (tsData.getBooleanValue().isPresent())
+            return TsDataType.BOOLEAN;
+        else if (tsData.getLongValue().isPresent())
+            return TsDataType.LONG;
+        else if (tsData.getStringValue().isPresent())
+            return TsDataType.STRING;
+        else if (tsData.getBlobValue().isPresent())
+            return TsDataType.BLOB;
+        else if (tsData.getCoordinateValue().isPresent())
+            return TsDataType.COORDINATE;
+
+        return TsDataType.DOUBLE;
+    }
+}
+

+ 23 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsPointDataList.java

@@ -0,0 +1,23 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TsPointDataList {
+
+    private String tagName;
+
+    private List<GeneralTsData> tsDataList;
+
+}
+

+ 17 - 0
benchmarking-hive/src/main/java/com/gyee/benchmarkinghive/util/taos/timeseries/TsQuery.java

@@ -0,0 +1,17 @@
+package com.gyee.benchmarkinghive.util.taos.timeseries;
+
+public interface TsQuery {
+
+    TsPoint getTsPoint();
+
+    long getStartTs();
+
+    long getEndTs();
+
+    int getInterval();
+
+    int getLimit();
+
+    Interpolation getInterpolation();
+
+}

+ 31 - 0
benchmarking-hive/src/main/resources/application.yaml

@@ -0,0 +1,31 @@
+server:
+  port: 7001
+spring:
+  profiles:
+    active: dev
+logback:
+  name: template
+
+---
+# developer enviroment
+spring:
+  profiles: dev
+  datasource:
+    impala:
+      driver-class-name: com.cloudera.impala.jdbc41.Driver
+      jdbc-url: jdbc:impala://192.168.1.67:21050/default
+
+---
+# developer enviroment
+spring:
+  profiles: test
+  datasource:
+    impala:
+      driver-class-name: com.cloudera.impala.jdbc41.Driver
+      jdbc-url: jdbc:impala://192.168.1.67:21050/default
+    oracle:
+      first:
+        driver-class-name: oracle.jdbc.OracleDriver
+        jdbc-url: jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd
+        username: nxfdprod
+        password: gdnxfd123

BIN
benchmarking-hive/src/main/resources/lib/ImpalaJDBC41.jar


+ 54 - 0
benchmarking-hive/src/test/java/com/gyee/benchmarkinghive/BenchmarkingHiveApplicationTests.java

@@ -0,0 +1,54 @@
+package com.gyee.benchmarkinghive;
+
+import com.gyee.benchmarkinghive.model.auto.Windpowerstation;
+import com.gyee.benchmarkinghive.service.WindpowerstationService;
+import com.gyee.benchmarkinghive.util.taos.EdosUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@SpringBootTest
+@RunWith(SpringRunner.class)
+@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
+class BenchmarkingHiveApplicationTests {
+
+    private EdosUtil edosUtil = new EdosUtil();
+
+    @Autowired
+    private JdbcTemplate jdbcTemplateImpala;
+    @Autowired
+    private WindpowerstationService windpowerstationService;
+
+    @Test
+    public void testImpalaJdbcTemplate() {
+        log.info("impala jdbctemplate connection start:");
+        String sql = "select * from scada_history.gdnxfd_sbq where  tagname = 'SBQFJ.NX_GD_SBQF_FJ_P1_L1_001_DI0008' and point_time >= '2021-04-12 00:00:04' and point_time <= '2021-04-18 00:00:04';";
+        List<Map<String, Object>> maps = jdbcTemplateImpala.queryForList(sql);
+        log.info("impalaJdbcTemplate query result :\t" + maps);
+    }
+
+    @Test
+    public void testTaosTemplate() throws Exception {
+        log.info("testTaos connection start:");
+        double pointValueInDouble = edosUtil.getRealData("SBQFJ.NX_GD_SBQF_FJ_P1_L1_001_AI0009").getPointValueInDouble();
+        log.info("testTaos query result :\t" + pointValueInDouble);
+    }
+
+
+    @Test
+    public void test1() throws Exception {
+        List<Windpowerstation> windpowerstations = windpowerstationService.wpList();
+        log.info("testTaos query result :\t" + windpowerstations);
+    }
+}

+ 33 - 0
benchmarking-impala/.gitignore

@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/

+ 118 - 0
benchmarking-impala/.mvn/wrapper/MavenWrapperDownloader.java

@@ -0,0 +1,118 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+    private static final String WRAPPER_VERSION = "0.5.6";
+    /**
+     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+     */
+    private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+            + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+    /**
+     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+     * use instead of the default one.
+     */
+    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+            ".mvn/wrapper/maven-wrapper.properties";
+
+    /**
+     * Path where the maven-wrapper.jar will be saved to.
+     */
+    private static final String MAVEN_WRAPPER_JAR_PATH =
+            ".mvn/wrapper/maven-wrapper.jar";
+
+    /**
+     * Name of the property which should be used to override the default download url for the wrapper.
+     */
+    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+    public static void main(String args[]) {
+        System.out.println("- Downloader started");
+        File baseDirectory = new File(args[0]);
+        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+        // If the maven-wrapper.properties exists, read it and check if it contains a custom
+        // wrapperUrl parameter.
+        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+        String url = DEFAULT_DOWNLOAD_URL;
+        if (mavenWrapperPropertyFile.exists()) {
+            FileInputStream mavenWrapperPropertyFileInputStream = null;
+            try {
+                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+                Properties mavenWrapperProperties = new Properties();
+                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+            } catch (IOException e) {
+                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+            } finally {
+                try {
+                    if (mavenWrapperPropertyFileInputStream != null) {
+                        mavenWrapperPropertyFileInputStream.close();
+                    }
+                } catch (IOException e) {
+                    // Ignore ...
+                }
+            }
+        }
+        System.out.println("- Downloading from: " + url);
+
+        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+        if (!outputFile.getParentFile().exists()) {
+            if (!outputFile.getParentFile().mkdirs()) {
+                System.out.println(
+                        "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+            }
+        }
+        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+        try {
+            downloadFileFromURL(url, outputFile);
+            System.out.println("Done");
+            System.exit(0);
+        } catch (Throwable e) {
+            System.out.println("- Error downloading");
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+        if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+            String username = System.getenv("MVNW_USERNAME");
+            char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+            Authenticator.setDefault(new Authenticator() {
+                @Override
+                protected PasswordAuthentication getPasswordAuthentication() {
+                    return new PasswordAuthentication(username, password);
+                }
+            });
+        }
+        URL website = new URL(urlString);
+        ReadableByteChannel rbc;
+        rbc = Channels.newChannel(website.openStream());
+        FileOutputStream fos = new FileOutputStream(destination);
+        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+        fos.close();
+        rbc.close();
+    }
+
+}

BIN
benchmarking-impala/.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
benchmarking-impala/.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

+ 310 - 0
benchmarking-impala/mvnw

@@ -0,0 +1,310 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+#   JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+#   M2_HOME - location of maven2's installed home dir
+#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
+#     e.g. to debug Maven itself, use
+#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+  if [ -f /etc/mavenrc ] ; then
+    . /etc/mavenrc
+  fi
+
+  if [ -f "$HOME/.mavenrc" ] ; then
+    . "$HOME/.mavenrc"
+  fi
+
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  MINGW*) mingw=true;;
+  Darwin*) darwin=true
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+    if [ -z "$JAVA_HOME" ]; then
+      if [ -x "/usr/libexec/java_home" ]; then
+        export JAVA_HOME="`/usr/libexec/java_home`"
+      else
+        export JAVA_HOME="/Library/Java/Home"
+      fi
+    fi
+    ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+  fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+  ## resolve links - $0 may be a link to maven's home
+  PRG="$0"
+
+  # need this for relative symlinks
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+      PRG="$link"
+    else
+      PRG="`dirname "$PRG"`/$link"
+    fi
+  done
+
+  saveddir=`pwd`
+
+  M2_HOME=`dirname "$PRG"`/..
+
+  # make it fully qualified
+  M2_HOME=`cd "$M2_HOME" && pwd`
+
+  cd "$saveddir"
+  # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --unix "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME="`(cd "$M2_HOME"; pwd)`"
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+  javaExecutable="`which javac`"
+  if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+    # readlink(1) is not available as standard on Solaris 10.
+    readLink=`which readlink`
+    if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+      if $darwin ; then
+        javaHome="`dirname \"$javaExecutable\"`"
+        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+      else
+        javaExecutable="`readlink -f \"$javaExecutable\"`"
+      fi
+      javaHome="`dirname \"$javaExecutable\"`"
+      javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+      JAVA_HOME="$javaHome"
+      export JAVA_HOME
+    fi
+  fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD="`which java`"
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly." >&2
+  echo "  We cannot execute $JAVACMD" >&2
+  exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+  if [ -z "$1" ]
+  then
+    echo "Path not specified to find_maven_basedir"
+    return 1
+  fi
+
+  basedir="$1"
+  wdir="$1"
+  while [ "$wdir" != '/' ] ; do
+    if [ -d "$wdir"/.mvn ] ; then
+      basedir=$wdir
+      break
+    fi
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+    if [ -d "${wdir}" ]; then
+      wdir=`cd "$wdir/.."; pwd`
+    fi
+    # end of workaround
+  done
+  echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    echo "$(tr -s '\n' ' ' < "$1")"
+  fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+  exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Found .mvn/wrapper/maven-wrapper.jar"
+    fi
+else
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+    fi
+    if [ -n "$MVNW_REPOURL" ]; then
+      jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    else
+      jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    fi
+    while IFS="=" read key value; do
+      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+      esac
+    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Downloading from: $jarUrl"
+    fi
+    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+    if $cygwin; then
+      wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+    fi
+
+    if command -v wget > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found wget ... using wget"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            wget "$jarUrl" -O "$wrapperJarPath"
+        else
+            wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+        fi
+    elif command -v curl > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found curl ... using curl"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            curl -o "$wrapperJarPath" "$jarUrl" -f
+        else
+            curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+        fi
+
+    else
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Falling back to using Java to download"
+        fi
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        # For Cygwin, switch paths to Windows format before running javac
+        if $cygwin; then
+          javaClass=`cygpath --path --windows "$javaClass"`
+        fi
+        if [ -e "$javaClass" ]; then
+            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Compiling MavenWrapperDownloader.java ..."
+                fi
+                # Compiling the Java class
+                ("$JAVA_HOME/bin/javac" "$javaClass")
+            fi
+            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                # Running the downloader
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Running MavenWrapperDownloader.java ..."
+                fi
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+            fi
+        fi
+    fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+  echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+    MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+  $MAVEN_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 182 - 0
benchmarking-impala/mvnw.cmd

@@ -0,0 +1,182 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements.  See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership.  The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License.  You may obtain a copy of the License at
+@REM
+@REM    https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied.  See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM     e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Found %WRAPPER_JAR%
+    )
+) else (
+    if not "%MVNW_REPOURL%" == "" (
+        SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    )
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Couldn't find %WRAPPER_JAR%, downloading it ...
+        echo Downloading from: %DOWNLOAD_URL%
+    )
+
+    powershell -Command "&{"^
+		"$webclient = new-object System.Net.WebClient;"^
+		"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+		"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+		"}"^
+		"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+		"}"
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Finished downloading %WRAPPER_JAR%
+    )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%

+ 234 - 0
benchmarking-impala/pom.xml

@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>sis-background</artifactId>
+        <groupId>com.gyee</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <groupId>com.gyee</groupId>
+    <artifactId>benchmarking-impala</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>benchmarking-impala</name>
+    <description>Demo project for Spring Boot</description>
+    <properties>
+        <java.version>1.8</java.version>
+        <hive.version>1.1.0</hive.version>
+        <hadoop.version>2.6.0</hadoop.version>
+    </properties>
+    <dependencies>
+        <!-- SpringBoot Web容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.oracle</groupId>
+            <artifactId>ojdbc6</artifactId>
+            <version>11.2.0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jdbc</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <!--常用工具类 -->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.4</version>
+        </dependency>
+        <!-- 热部署 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <!-- 配置文件读取 -->
+        <dependency>
+            <groupId>commons-configuration</groupId>
+            <artifactId>commons-configuration</artifactId>
+            <version>1.10</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.9</version>
+        </dependency>
+        <!--quartz依赖-->
+        <dependency>
+            <groupId>org.quartz-scheduler</groupId>
+            <artifactId>quartz</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>3.3.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+            <version>2.3.28</version>
+        </dependency>
+
+        <!-- 添加swagger2 -->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.7.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-mapper-asl</artifactId>
+            <version>1.9.13</version>
+        </dependency>
+
+        <!--        <dependency>-->
+        <!--            <groupId>org.apache.hive</groupId>-->
+        <!--            <artifactId>hive-jdbc</artifactId>-->
+        <!--            <version>${hive.version}</version>-->
+        <!--        </dependency>-->
+        <!--        <dependency>-->
+        <!--            <groupId>org.apache.hadoop</groupId>-->
+        <!--            <artifactId>hadoop-common</artifactId>-->
+        <!--            <version>${hadoop.version}</version>-->
+        <!--        </dependency>-->
+        <dependency>
+            <groupId>ImpalaJDBC</groupId>
+            <artifactId>ImpalaJDBC</artifactId>
+            <version>41</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/resources/lib/ImpalaJDBC41.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>3.9</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <!-- 使用maven-jar-plugin和maven-dependency-plugin插件打包 -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>3.0.2</version>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <addClasspath>true</addClasspath>
+                            <classpathPrefix>lib/</classpathPrefix>
+                            <mainClass>com.gyee.benchmarkingimpala.BenchmarkingImpalaApplication</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>3.0.2</version>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <fork>true</fork>
+                    <!--增加jvm参数-->
+                    <jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <version>1.6.0</version>
+                <!--                <executions>-->
+                <!--                    <execution>-->
+                <!--                        <goals>-->
+                <!--                            <goal>java</goal>-->
+                <!--                        </goals>-->
+                <!--                    </execution>-->
+                <!--                </executions>-->
+                <configuration>
+                    <classpathScope>test</classpathScope>
+                    <!--                    <mainClass>com.itheima.test.MybatisTest</mainClass>-->
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 15 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/BenchmarkingImpalaApplication.java

@@ -0,0 +1,15 @@
+package com.gyee.benchmarkingimpala;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@MapperScan("com.gyee.benchmarkingimpala.mapper")
+public class BenchmarkingImpalaApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(BenchmarkingImpalaApplication.class, args);
+    }
+
+}

+ 87 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/common/CharsetKit.java

@@ -0,0 +1,87 @@
+package com.gyee.benchmarkingimpala.common;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 字符集工具类
+ * 
+ * @author fc
+ *
+ */
+public class CharsetKit
+{
+    /** ISO-8859-1 */
+    public static final String ISO_8859_1 = "ISO-8859-1";
+    /** UTF-8 */
+    public static final String UTF_8 = "UTF-8";
+    /** GBK */
+    public static final String GBK = "GBK";
+
+    /** ISO-8859-1 */
+    public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
+    /** UTF-8 */
+    public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
+    /** GBK */
+    public static final Charset CHARSET_GBK = Charset.forName(GBK);
+
+    /**
+     * 转换为Charset对象
+     * 
+     * @param charset 字符集,为空则返回默认字符集
+     * @return Charset
+     */
+    public static Charset charset(String charset)
+    {
+        return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
+    }
+
+    /**
+     * 转换字符串的字符集编码
+     * 
+     * @param source 字符串
+     * @param srcCharset 源字符集,默认ISO-8859-1
+     * @param destCharset 目标字符集,默认UTF-8
+     * @return 转换后的字符集
+     */
+    public static String convert(String source, String srcCharset, String destCharset)
+    {
+        return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
+    }
+
+    /**
+     * 转换字符串的字符集编码
+     * 
+     * @param source 字符串
+     * @param srcCharset 源字符集,默认ISO-8859-1
+     * @param destCharset 目标字符集,默认UTF-8
+     * @return 转换后的字符集
+     */
+    public static String convert(String source, Charset srcCharset, Charset destCharset)
+    {
+        if (null == srcCharset)
+        {
+            srcCharset = StandardCharsets.ISO_8859_1;
+        }
+
+        if (null == destCharset)
+        {
+            srcCharset = StandardCharsets.UTF_8;
+        }
+
+        if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
+        {
+            return source;
+        }
+        return new String(source.getBytes(srcCharset), destCharset);
+    }
+
+    /**
+     * @return 系统字符集编码
+     */
+    public static String systemCharset()
+    {
+        return Charset.defaultCharset().name();
+    }
+
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1015 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/common/Convert.java


+ 0 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/common/DNAStatVal.java


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor