|
|
@@ -74,33 +74,37 @@ public class TimeConverterUtil {
|
|
|
String timeGroup = "'YYYY-MM-DD'";
|
|
|
String value = null;
|
|
|
//判断时间类型
|
|
|
- if ("halfYear".equals(timeType)){
|
|
|
- String[] str = xdata.split("-");
|
|
|
- if ("H1".equals(str[1])){
|
|
|
- String firstIndex = str[0] + "-01";
|
|
|
- String afterIndex = str[0] + "-06";
|
|
|
- value = showChartsMapper.getTimeValueYear(dataType, yColumn, tableName, xColumn, firstIndex, afterIndex);
|
|
|
- }else {
|
|
|
- String firstIndex = str[0] + "-07";
|
|
|
- String afterIndex = str[0] + "-12";
|
|
|
- value = showChartsMapper.getTimeValueYear(dataType, yColumn, tableName, xColumn, firstIndex, afterIndex);
|
|
|
- }
|
|
|
- }else if ("year".equals(timeType)){
|
|
|
- timeGroup = "'YYYY'";
|
|
|
- value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup,xdata);
|
|
|
- }else if ("month".equals(timeType)){
|
|
|
- timeGroup = "'YYYY-MM'";
|
|
|
- value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup,xdata);
|
|
|
- }else if ("day".equals(timeType) || "".equals(timeType)){
|
|
|
- value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup,xdata);
|
|
|
- }else if ("quarter".equals(timeType)){
|
|
|
- timeGroup = "'YYYY-Q'";
|
|
|
- value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup,xdata);
|
|
|
- }else if ("week".equals(timeType)){
|
|
|
- timeGroup = "'YYYY-WW'";
|
|
|
- value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup,xdata);
|
|
|
+ if (xdata == null || "".equals(xdata)){
|
|
|
+ value = showChartsMapper.getTimeIsNull(dataType, yColumn, tableName, xColumn);
|
|
|
}else {
|
|
|
- value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup,xdata);
|
|
|
+ if ("halfYear".equals(timeType)) {
|
|
|
+ String[] str = xdata.split("-");
|
|
|
+ if ("H1".equals(str[1])) {
|
|
|
+ String firstIndex = str[0] + "-01";
|
|
|
+ String afterIndex = str[0] + "-06";
|
|
|
+ value = showChartsMapper.getTimeValueYear(dataType, yColumn, tableName, xColumn, firstIndex, afterIndex);
|
|
|
+ } else {
|
|
|
+ String firstIndex = str[0] + "-07";
|
|
|
+ String afterIndex = str[0] + "-12";
|
|
|
+ value = showChartsMapper.getTimeValueYear(dataType, yColumn, tableName, xColumn, firstIndex, afterIndex);
|
|
|
+ }
|
|
|
+ } else if ("year".equals(timeType)) {
|
|
|
+ timeGroup = "'YYYY'";
|
|
|
+ value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup, xdata);
|
|
|
+ } else if ("month".equals(timeType)) {
|
|
|
+ timeGroup = "'YYYY-MM'";
|
|
|
+ value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup, xdata);
|
|
|
+ } else if ("day".equals(timeType) || "".equals(timeType)) {
|
|
|
+ value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup, xdata);
|
|
|
+ } else if ("quarter".equals(timeType)) {
|
|
|
+ timeGroup = "'YYYY-Q'";
|
|
|
+ value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup, xdata);
|
|
|
+ } else if ("week".equals(timeType)) {
|
|
|
+ timeGroup = "'YYYY-WW'";
|
|
|
+ value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup, xdata);
|
|
|
+ } else {
|
|
|
+ value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup, xdata);
|
|
|
+ }
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
@@ -110,39 +114,44 @@ public class TimeConverterUtil {
|
|
|
String groupsName, String xColumn, String xAxisDataOne){
|
|
|
String timeGroup = "'YYYY-MM-DD'";
|
|
|
String value = null;
|
|
|
- if ("year".equals(timeType)){
|
|
|
- timeGroup = "'YYYY'";
|
|
|
- value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
- timeGroup, xAxisDataOne);
|
|
|
- }else if ("month".equals(timeType)){
|
|
|
- timeGroup = "'YYYY-MM'";
|
|
|
- value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
+ if(groupsName == null || "".equals(groupsName)){
|
|
|
+ value = showChartsMapper.getGroupsValueTimeIsNull(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
timeGroup, xAxisDataOne);
|
|
|
- }else if ("quarter".equals(timeType)){
|
|
|
- timeGroup = "'YYYY-Q'";
|
|
|
- value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
- timeGroup, xAxisDataOne);
|
|
|
- }else if ("week".equals(timeType)){
|
|
|
- timeGroup = "'YYYY-WW'";
|
|
|
- value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
- timeGroup, xAxisDataOne);
|
|
|
- }else if ("day".equals(timeType) || "".equals(timeType)){
|
|
|
- value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
- timeGroup, xAxisDataOne);
|
|
|
- }else if ("halfYear".equals(timeType)){
|
|
|
- String[] str = xAxisDataOne.split("-");
|
|
|
- if ("上半年".equals(str[1])){
|
|
|
- String firstIndex = str[0] + "-01";
|
|
|
- String afterIndex = str[0] + "-06";
|
|
|
- value = showChartsMapper.getTimeValueHalfYear(dataType, yColumn, tableName, xColumn, firstIndex, afterIndex, groupByName, groupsName);
|
|
|
- }else {
|
|
|
- String firstIndex = str[0] + "-07";
|
|
|
- String afterIndex = str[0] + "-12";
|
|
|
- value = showChartsMapper.getTimeValueHalfYear(dataType, yColumn, tableName, xColumn, firstIndex, afterIndex, groupByName, groupsName);
|
|
|
+ }else {
|
|
|
+ if ("year".equals(timeType)) {
|
|
|
+ timeGroup = "'YYYY'";
|
|
|
+ value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
+ } else if ("month".equals(timeType)) {
|
|
|
+ timeGroup = "'YYYY-MM'";
|
|
|
+ value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
+ } else if ("quarter".equals(timeType)) {
|
|
|
+ timeGroup = "'YYYY-Q'";
|
|
|
+ value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
+ } else if ("week".equals(timeType)) {
|
|
|
+ timeGroup = "'YYYY-WW'";
|
|
|
+ value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
+ } else if ("day".equals(timeType) || "".equals(timeType)) {
|
|
|
+ value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
+ } else if ("halfYear".equals(timeType)) {
|
|
|
+ String[] str = xAxisDataOne.split("-");
|
|
|
+ if ("上半年".equals(str[1])) {
|
|
|
+ String firstIndex = str[0] + "-01";
|
|
|
+ String afterIndex = str[0] + "-06";
|
|
|
+ value = showChartsMapper.getTimeValueHalfYear(dataType, yColumn, tableName, xColumn, firstIndex, afterIndex, groupByName, groupsName);
|
|
|
+ } else {
|
|
|
+ String firstIndex = str[0] + "-07";
|
|
|
+ String afterIndex = str[0] + "-12";
|
|
|
+ value = showChartsMapper.getTimeValueHalfYear(dataType, yColumn, tableName, xColumn, firstIndex, afterIndex, groupByName, groupsName);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
}
|
|
|
- }else{
|
|
|
- value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
- timeGroup, xAxisDataOne);
|
|
|
}
|
|
|
return value;
|
|
|
}
|