Browse Source

柱状图取数调整

chenw 6 years ago
parent
commit
76b0d7d9e3

+ 1 - 1
bi-server/src/main/java/com/usoftchina/bi/server/dao/chart/ShowChartsMapper.java

@@ -145,7 +145,7 @@ public interface ShowChartsMapper {
     );
 
     //查询时间类型分组的值->优化后(柱状图)
-    @Select("select ${dataType}(${yAxisName}) from ${tableName} where ${groupsColumn}=#{groupsIndex} GROUP BY TO_CHAR(${xColumn},${timeType}) GROUP BY TO_CHAR(${xColumn},${timeType})")
+    @Select("select ${dataType}(${yAxisName}) from ${tableName} where ${groupsColumn}=#{groupsIndex} GROUP BY TO_CHAR(${xColumn},${timeType}) ORDER BY TO_CHAR(${xColumn},${timeType})")
     List<Double> getHistogramTimeValueGroupValuesTime(@Param("dataType") String dataType, @Param("yAxisName") String yAxisName, @Param("tableName") String tableName,
                                                       @Param("groupsColumn") String groupsColumn, @Param("groupsIndex") String groupsIndex,
                                                       @Param("xColumn") String xColumn, @Param("timeType") String timeType);

+ 3 - 2
bi-server/src/main/java/com/usoftchina/bi/server/service/chart/ShowHistogramService.java

@@ -177,8 +177,8 @@ public class ShowHistogramService {
                             double groupsValueOne = 0;
                             String groupsValueOnes = null;
                             if ("time".equals(xColumnType)){
-                                groupsValue = timeConverterUtil.getHistogramGroupTime(yAxisType, yColumn, tableName, groupByName, xAxisType,
-                                        groupsName, xColumn, xAxisData, screenToColumnS);
+                                groupsValueOnes = timeConverterUtil.getGroupTimeConverter(yAxisType, yColumn, tableName, groupByName, xAxisType,
+                                        groupsName, xColumn, xAxisDataOne, screenToColumnS);
                             }else {
                                 String xColumnKey = "";
                                 if (xAxisDataOne == null || "".equals(xAxisDataOne)){
@@ -201,6 +201,7 @@ public class ShowHistogramService {
                             }else{
                                 groupsValueOne = Double.parseDouble(groupsValueOnes);
                             }
+
                             groupsValue.add(groupsValueOne);
                         }
                         ne.setValue(groupsValue);