|
|
@@ -29,10 +29,16 @@ public interface ShowChartsMapper {
|
|
|
|
|
|
//x轴数据
|
|
|
@Select("select ${dataType}(${yAxisName}) from ${tableName} where ${xColumn} = #{xdata} ${screen}")
|
|
|
- String getValues(@Param("yAxisName") String yAxisName, @Param("xColumn") String xColumn,
|
|
|
+ String getXValue(@Param("yAxisName") String yAxisName, @Param("xColumn") String xColumn,
|
|
|
@Param("tableName") String tableName, @Param("dataType") String dataType,
|
|
|
@Param("xdata") String xdata, @Param("screen") String screen);
|
|
|
|
|
|
+ //x轴数据 -> 优化后
|
|
|
+ @Select("select ${dataType}(${yAxisName}) from ${tableName} where 1=1 ${screen} GROUP BY ${xColumn}")
|
|
|
+ List<Double> getValues(@Param("yAxisName") String yAxisName, @Param("xColumn") String xColumn,
|
|
|
+ @Param("tableName") String tableName, @Param("dataType") String dataType,
|
|
|
+ @Param("screen") String screen);
|
|
|
+
|
|
|
//x轴为空时的数据
|
|
|
@Select("select ${dataType}(${yAxisName}) from ${tableName} where ${xColumn} is null ${screen}")
|
|
|
String getValuesIsNull(@Param("yAxisName") String yAxisName, @Param("xColumn") String xColumn,
|
|
|
@@ -42,7 +48,7 @@ public interface ShowChartsMapper {
|
|
|
|
|
|
|
|
|
//查询分组系列
|
|
|
- @Select("select ${groupsBy} from ${tableName} where 1=1 ${screen} and rownum<=#{count} group by ${groupsBy}")
|
|
|
+ @Select("SELECT * FROM (select ${groupsBy} from ${tableName} where ${groupsBy} is not null ${screen} group by ${groupsBy}) WHERE rownum<=#{count}")
|
|
|
List<String> getGroups(@Param("groupsBy") String groupsBy, @Param("tableName") String tableName, @Param("screen") String screen, @Param("count") int count);
|
|
|
|
|
|
//查询分组系列个数
|
|
|
@@ -57,6 +63,10 @@ public interface ShowChartsMapper {
|
|
|
@Param("xColumn") String xColumn,
|
|
|
@Param("screen") String screen);
|
|
|
|
|
|
+ //查询分组的值(柱状图)->优化后
|
|
|
+ @Select("select ${dataType}(${yAxisName}) from ${tableName} where ${groupsColumn} and ${xColumn} ${screen}")
|
|
|
+ List<Double> getGroupsValues(@Param("dataType") String dataType, @Param("yAxisName") String yAxisName, @Param("tableName") String tableName,
|
|
|
+ @Param("groupsColumn") String groupsColumn, @Param("xColumn") String xColumn, @Param("screen") String screen);
|
|
|
|
|
|
//时间类型的X轴
|
|
|
@Select("select distinct to_char(${xAxisName},${timeType})time from ${tableName} ${screen} ORDER by to_char(${xAxisName},${timeType}) ASC")
|
|
|
@@ -70,7 +80,7 @@ public interface ShowChartsMapper {
|
|
|
|
|
|
//半年
|
|
|
@Select("select distinct case when to_char(${xAxisName},'MM')<=6 then to_char(${xAxisName},'YYYY')|| '-H1'" +
|
|
|
- "else to_char(${xAxisName},'YYYY')||'-H2' end time from ${tableName} ${screen} order by time")
|
|
|
+ "else to_char(${xAxisName},'YYYY')||'-H2' end time from ${tableName} ${screen} and ${xAxisName} is not null order by time")
|
|
|
List<String> getTimeYear(@Param("xAxisName") String xAxisName, @Param("tableName") String tableName, @Param("screen") String screen);
|
|
|
|
|
|
//无分组时间类型值
|
|
|
@@ -86,12 +96,33 @@ public interface ShowChartsMapper {
|
|
|
@Param("tableName") String tableName, @Param("xAxisName") String xAxisName,
|
|
|
@Param("screen") String screen);
|
|
|
|
|
|
+ //无分组时间类型值(柱状图)->优化后
|
|
|
+ @Select("select ${dataType}(${yAxisName}) from ${tableName} WHERE 1=1 ${screen} GROUP BY (to_char(${xAxisName},${timeType})) ORDER BY (to_char(${xAxisName},${timeType}))")
|
|
|
+ List<Double> getHistogramTimeValue(@Param("dataType") String dataType, @Param("yAxisName") String yAxisName,
|
|
|
+ @Param("tableName") String tableName, @Param("xAxisName") String xAxisName,
|
|
|
+ @Param("timeType") String timeType, @Param("screen") String screen);
|
|
|
+
|
|
|
//无分组半年时间值
|
|
|
@Select("select ${dataType}(${yAxisName}) from ${tableName} where TO_CHAR(${xAxisName},'YYYY-MM') between #{firstIndex} and #{afterIndex} ${screen}")
|
|
|
String getTimeValueYear(@Param("dataType") String dataType, @Param("yAxisName") String yAxisName, @Param("tableName") String tableName,
|
|
|
@Param("xAxisName") String xAxisName, @Param("firstIndex") String firstIndex,
|
|
|
@Param("afterIndex") String afterIndex, @Param("screen") String screen);
|
|
|
|
|
|
+ /**
|
|
|
+ * 无分组半年时间值(柱状图)
|
|
|
+ * @param dataType
|
|
|
+ * @param yAxisName
|
|
|
+ * @param tableName
|
|
|
+ * @param xAxisName
|
|
|
+ * @param firstIndex
|
|
|
+ * @param afterIndex
|
|
|
+ * @param screen
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Select("select ${dataType}(${yAxisName}) from ${tableName} where TO_CHAR(${xAxisName},'YYYY-MM') between #{firstIndex} and #{afterIndex} ${screen}")
|
|
|
+ Double getHistogramTimeValueYear(@Param("dataType") String dataType, @Param("yAxisName") String yAxisName, @Param("tableName") String tableName,
|
|
|
+ @Param("xAxisName") String xAxisName, @Param("firstIndex") String firstIndex,
|
|
|
+ @Param("afterIndex") String afterIndex, @Param("screen") String screen);
|
|
|
//时间为空时间值
|
|
|
@Select("select ${dataType}(${yAxisName}) from ${tableName} where ${xAxisName} is null ${screen}")
|
|
|
String getTimeIsNull(@Param("dataType") String dataType, @Param("yAxisName") String yAxisName, @Param("tableName") String tableName,
|
|
|
@@ -105,13 +136,19 @@ public interface ShowChartsMapper {
|
|
|
@Param("xColumn") String xColumn, @Param("timeType") String timeType, @Param("xColumnIndex") String xColumnIndex
|
|
|
);
|
|
|
|
|
|
- //查询时间类型分组的值->优化后
|
|
|
+ //查询时间类型分组的值->优化后(折线图)
|
|
|
@Select("select ${dataType}(${yAxisName}) as \"value\",TO_CHAR(${xColumn},${timeType}) as \"date\" from ${tableName} where ${groupsColumn}=#{groupsIndex} GROUP BY TO_CHAR(${xColumn},${timeType}) ")
|
|
|
List<LineSeriesMap> getGroupValuesTime(@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
|
|
|
);
|
|
|
|
|
|
+ //查询时间类型分组的值->优化后(柱状图)
|
|
|
+ @Select("select ${dataType}(${yAxisName}) from ${tableName} where ${groupsColumn}=#{groupsIndex} GROUP BY TO_CHAR(${xColumn},${timeType}) GROUP 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);
|
|
|
+
|
|
|
//查询时间类型分组的值->优化后
|
|
|
@Select("select ${dataType}(${yAxisName}) as \"value\",TO_CHAR(${xColumn},${timeType}) as \"date\",${groupsColumn} as \"group\" from ${tableName} where ${groupsColumn} IN (SELECT ${groupsColumn} FROM ${tableName} GROUP BY ${groupsColumn}) GROUP BY TO_CHAR(${xColumn},${timeType}),${groupsColumn} ")
|
|
|
List<LineSeriesGroupMap> getGroupsValuesTime(@Param("dataType") String dataType, @Param("yAxisName") String yAxisName, @Param("tableName") String tableName,
|
|
|
@@ -135,6 +172,12 @@ public interface ShowChartsMapper {
|
|
|
@Param("xAxisName") String xAxisName, @Param("firstIndex") String firstIndex, @Param("afterIndex") String afterIndex,
|
|
|
@Param("groupsColumn") String groupsColumn, @Param("groupsIndex") String groupsIndex, @Param("screen") String screen);
|
|
|
|
|
|
+ //查询分组的值(时间类型半年) 柱状图
|
|
|
+ //分组半年时间值
|
|
|
+ @Select("select ${dataType}(${yAxisName}) from ${tableName} where TO_CHAR(${xAxisName},'YYYY-MM') between #{firstIndex} and #{afterIndex} and ${groupsColumn}=#{groupsIndex} ${screen}")
|
|
|
+ Double getHistogramTimeValueHalfYear (@Param("dataType") String dataType, @Param("yAxisName") String yAxisName, @Param("tableName") String tableName,
|
|
|
+ @Param("xAxisName") String xAxisName, @Param("firstIndex") String firstIndex, @Param("afterIndex") String afterIndex,
|
|
|
+ @Param("groupsColumn") String groupsColumn, @Param("groupsIndex") String groupsIndex, @Param("screen") String screen);
|
|
|
|
|
|
/*
|
|
|
总体未分组
|