|
|
@@ -17,28 +17,28 @@ public class TimeConverterUtil {
|
|
|
ShowChartsMapper showChartsMapper;
|
|
|
|
|
|
//x轴时间类型
|
|
|
- public List<String> timeConverter(String xColumnName, String tableName, String timeType){
|
|
|
+ public List<String> timeConverter(String xColumnName, String tableName, String timeType, String screen){
|
|
|
String timeGroup = "'YYYY-MM-DD'";
|
|
|
List<String> value = new ArrayList<String>();
|
|
|
if ("year".equals(timeType)){
|
|
|
timeGroup = "'YYYY'";
|
|
|
- value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup);
|
|
|
+ value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup, screen);
|
|
|
}else if ("month".equals(timeType)){
|
|
|
timeGroup = "'YYYY-MM'";
|
|
|
- value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup);
|
|
|
+ value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup, screen);
|
|
|
}else if ("day".equals(timeType) || "".equals(timeType)){
|
|
|
- value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup);
|
|
|
+ value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup, screen);
|
|
|
}else if ("quarter".equals(timeType)){
|
|
|
timeGroup = "'YYYY-Q'";
|
|
|
- value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup);
|
|
|
+ value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup, screen);
|
|
|
}else if ("week".equals(timeType)){
|
|
|
timeGroup = "'YYYY-WW'";
|
|
|
- value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup);
|
|
|
+ value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup, screen);
|
|
|
}else if ("halfYear".equals(timeType)){
|
|
|
- value = showChartsMapper.getTimeYear(xColumnName, tableName);
|
|
|
+ value = showChartsMapper.getTimeYear(xColumnName, tableName, screen);
|
|
|
}else {
|
|
|
timeGroup = "'YYYY-MM-DD'";
|
|
|
- value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup);
|
|
|
+ value = showChartsMapper.getTimeDate(xColumnName, tableName, timeGroup, screen);
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
@@ -50,6 +50,9 @@ public class TimeConverterUtil {
|
|
|
Iterator isDataList = dataList.iterator();
|
|
|
while (isDataList.hasNext()){
|
|
|
String data = (String) isDataList.next();
|
|
|
+ if (data == null || "".equals(data)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
if ("quarter".equals(timeType)){
|
|
|
String[] str = data.split("-");
|
|
|
dataLast = str[0] + "-Q" + str[1];
|
|
|
@@ -66,7 +69,7 @@ public class TimeConverterUtil {
|
|
|
}
|
|
|
|
|
|
//无分组时间值
|
|
|
- public String getTimeValueConverter(String yColumn, String xColumn, String tableName, String dataType, String timeType, String xdata, String screen){
|
|
|
+ public String getTimeValueConverter(String yColumn, String xColumn, String tableName, String dataType, String timeType, String xdata){
|
|
|
|
|
|
String timeGroup = "'YYYY-MM-DD'";
|
|
|
String value = null;
|
|
|
@@ -76,70 +79,70 @@ public class TimeConverterUtil {
|
|
|
if ("H1".equals(str[1])){
|
|
|
String firstIndex = str[0] + "-01";
|
|
|
String afterIndex = str[0] + "-06";
|
|
|
- value = showChartsMapper.getTimeValueYear(dataType, yColumn, tableName, xColumn, firstIndex, afterIndex, screen);
|
|
|
+ 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, screen);
|
|
|
+ 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,screen);
|
|
|
+ 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,screen);
|
|
|
+ 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,screen);
|
|
|
+ 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,screen);
|
|
|
+ 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,screen);
|
|
|
+ value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup,xdata);
|
|
|
}else {
|
|
|
- value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup,xdata,screen);
|
|
|
+ value = showChartsMapper.getTimeValue(dataType, yColumn, tableName, xColumn, timeGroup,xdata);
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
|
|
|
//有分组时间类型值处理
|
|
|
public String getGroupTimeConverter(String dataType, String yColumn, String tableName, String groupByName, String timeType,
|
|
|
- String groupsName, String xColumn, String xAxisDataOne, String screen){
|
|
|
+ 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, screen);
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
}else if ("month".equals(timeType)){
|
|
|
timeGroup = "'YYYY-MM'";
|
|
|
value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
- timeGroup, xAxisDataOne ,screen);
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
}else if ("quarter".equals(timeType)){
|
|
|
timeGroup = "'YYYY-Q'";
|
|
|
value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
- timeGroup, xAxisDataOne, screen);
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
}else if ("week".equals(timeType)){
|
|
|
timeGroup = "'YYYY-WW'";
|
|
|
value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
- timeGroup, xAxisDataOne, screen);
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
}else if ("day".equals(timeType) || "".equals(timeType)){
|
|
|
value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
- timeGroup, xAxisDataOne, screen);
|
|
|
+ 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, screen);
|
|
|
+ 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, screen);
|
|
|
+ value = showChartsMapper.getTimeValueHalfYear(dataType, yColumn, tableName, xColumn, firstIndex, afterIndex, groupByName, groupsName);
|
|
|
}
|
|
|
}else{
|
|
|
value = showChartsMapper.getGroupsValueTime(dataType, yColumn, tableName, groupByName, groupsName, xColumn,
|
|
|
- timeGroup, xAxisDataOne, screen);
|
|
|
+ timeGroup, xAxisDataOne);
|
|
|
}
|
|
|
return value;
|
|
|
}
|