| | |
| | | if (indItem == null) { |
| | | return result; |
| | | } |
| | | result.setIndItemAtom(indItem); |
| | | IndDataSetDTO dataSet = indDataSetService.getDet(indItem.getDataSet()); |
| | | if (dataSet == null) { |
| | | return result; |
| | |
| | | |
| | | // 拼接SELECT |
| | | StringBuilder selectSql = new StringBuilder(); |
| | | if (StringUtils.isNotBlank(indItem.getDimension())){ |
| | | if (StringUtils.isNotBlank(indItem.getDimension()) && StringUtils.isNotBlank(result.getIndItemAtom().getStatFunc())){ |
| | | selectSql.append(indItem.getDimension()); |
| | | selectSql.append(", "); |
| | | selectSql.append(result.getSelectSql()); |
| | | }else{ |
| | | } |
| | | else if(StringUtils.isBlank(indItem.getDimension()) && StringUtils.isNotBlank(result.getIndItemAtom().getStatFunc())){ |
| | | selectSql.append(result.getSelectSql()); |
| | | } |
| | | else{ |
| | | selectSql.append(result.getSelectSql()); |
| | | selectSql.append(", "); |
| | | selectSql.append(indItem.getTimeLabel()); |
| | |
| | | whereSql.append(indItem.getTimeLabel()); |
| | | whereSql.append(" <= '"); |
| | | whereSql.append(DateUtils.format(indItem.getTimeEnd(), PATTERN_MON)); |
| | | whereSql.append("' AND '"); |
| | | whereSql.append("' AND "); |
| | | whereSql.append(indItem.getTimeLabel()); |
| | | whereSql.append("' >= '"); |
| | | whereSql.append(" >= '"); |
| | | whereSql.append(DateUtils.format(indItem.getTimeStart(), PATTERN_MON)); |
| | | whereSql.append("'"); |
| | | break; |