|
@ -19,6 +19,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@ -94,7 +95,7 @@ public class MysqlExtract {
|
|
|
String result = map.get("result").toString();
|
|
|
String mapKey = keyVal.substring(0, keyVal.length() - 1);
|
|
|
resultMap.put(mapKey, result);
|
|
|
// daySlaveDictMap.put(mapKey, map.get("quotaDate").toString());
|
|
|
daySlaveDictMap.put(mapKey, map.get("quotaDate").toString());
|
|
|
}
|
|
|
TjQuotaDimensionSlave tjQuotaDimensionSlave = new TjQuotaDimensionSlave();
|
|
|
tjQuotaDimensionSlave.setQuotaCode(quotaVo.getCode());
|
|
@ -144,12 +145,15 @@ public class MysqlExtract {
|
|
|
if ( !StringUtils.isEmpty(timeKey)) {
|
|
|
if ("2".equals(dataLevel)) {
|
|
|
whereSql.append( " and " + timeKey + " < '" + endTime + "'");
|
|
|
selectGroupField += " '"+ LocalDate.now().toString() +"' as quotaDate ,";
|
|
|
}else{
|
|
|
if ( !StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) {
|
|
|
whereSql.append(" and " + timeKey + " >= '" + startTime + "'");
|
|
|
whereSql.append( " and " + timeKey + " < '" + endTime + "'");
|
|
|
}
|
|
|
selectGroupField += " DATE_FORMAT(" + timeKey + ",'%Y-%m-%d') as quotaDate ,";
|
|
|
}
|
|
|
whereGroupField += timeKey;
|
|
|
// if ( !StringUtils.isEmpty(esConfig.getFullQuery() ) && esConfig.getFullQuery().equals("true")) {
|
|
|
// whereSql.append( " and " + timeKey + " < '" + endTime + "'");
|
|
|
// selectGroupField += " '"+ LocalDate.now().toString() +"' as quotaDate ,";
|
|
@ -161,8 +165,9 @@ public class MysqlExtract {
|
|
|
// selectGroupField += " DATE_FORMAT(" + timeKey + ",'%Y-%m-%d') as quotaDate ,";
|
|
|
// }
|
|
|
// whereGroupField += timeKey;
|
|
|
}else {
|
|
|
whereGroupField = allField.substring(0,allField.length() - 1);
|
|
|
}
|
|
|
whereGroupField = allField.substring(0,allField.length() - 1);
|
|
|
//拼接整个sql 语法
|
|
|
StringBuffer sql = new StringBuffer();
|
|
|
if(StringUtils.isEmpty(esConfig.getAggregation())){
|