Commit 33442974 authored by duanruiming's avatar duanruiming

Merge remote-tracking branch 'origin/master'

parents cd69c1f7 e9d5422e
......@@ -2,27 +2,21 @@ package net.wanji.opt.service.impl;
import com.alibaba.fastjson.JSONObject;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.enums.BaseEnum;
import net.wanji.common.enums.TurnConvertEnum;
import net.wanji.common.framework.Constants;
import net.wanji.common.framework.dubbointerface.impl.BaseDubboInterfaceImpl;
import net.wanji.common.framework.exception.DubboProviderException;
import net.wanji.common.framework.mapper.BaseInterfaceMapper;
import net.wanji.common.gts.Tools;
import net.wanji.common.utils.tool.DateUtil;
import net.wanji.databus.dao.mapper.BaseCrossInfoMapper;
import net.wanji.databus.po.BaseCrossInfoPO;
import net.wanji.databus.po.CrossDataHistPO;
import net.wanji.databus.po.CrossDirDataHistPO;
import net.wanji.databus.po.CrossTurnDataHistPO;
import net.wanji.databus.po.CrossTurnInfoPO;
import net.wanji.databus.po.TBaseCrossInfo;
import net.wanji.opt.bo.BottomMenuBO;
import net.wanji.opt.common.ArithOfBigDecmial;
import net.wanji.opt.common.EsDateIndexUtil;
import net.wanji.opt.common.enums.TimeGranularityEnum;
import net.wanji.opt.constant.ServiceLevelEnum;
import net.wanji.opt.dao.mapper.GreenwaveHistoryMapper;
import net.wanji.opt.dto.report.GreenHistIndexDTO;
......@@ -37,7 +31,6 @@ import org.apache.dubbo.config.annotation.DubboService;
import org.joda.time.DateTime;
import org.joda.time.Seconds;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
......@@ -54,7 +47,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
......@@ -810,7 +802,9 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
params.put("groupType", groupType);
//存放时段
Set<String> sortedSet = EsDateIndexUtil.getTimeGranularityAxis(groupType, startTime, endTime);
//Set<String> sortedSet = EsDateIndexUtil.getTimeGranularityAxis(groupType, startTime, endTime);
//存放时段
List<String> sortedSet = EsDateIndexUtil.getTimeGranularityAxisAll(groupType, startTime, endTime);
//======================================================================================================//
//存放所有数据
List<Map<String, Object>> allList = new ArrayList<>();
......@@ -868,8 +862,9 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
params.put("groupType", groupType);
//存放时段
Set<String> sortedSet = EsDateIndexUtil.getTimeGranularityAxis(groupType, startTime, endTime);
// Set<String> sortedSet = EsDateIndexUtil.getTimeGranularityAxis(groupType, startTime, endTime);
//存放时段
List<String> sortedSet = EsDateIndexUtil.getTimeGranularityAxisAll(groupType, startTime, endTime);
//======================================================================================================//
//存放所有数据
List<Map<String, Object>> allList = new ArrayList<>();
......
......@@ -148,11 +148,12 @@
(
SELECT start_time,
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 15 ) * 15 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=2 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 30 ) * 30 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=3 then DATE_FORMAT(start_time,'%Y-%m-%d %H:00:00' )
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
else DATE_FORMAT(start_time,'%Y-01-01 00:00:00')
end
) unit_time,
cross_id,
......@@ -192,12 +193,12 @@
(
SELECT start_time,
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
else DATE_FORMAT(start_time,'%Y-01-01 00:00:00')
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
else DATE_FORMAT(start_time,'%Y-01-01 00:00:00')
end
) unit_time,
cross_id,
......@@ -239,11 +240,11 @@
(
SELECT start_time,
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 15 ) * 15 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=2 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 30 ) * 30 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=3 then DATE_FORMAT(start_time,'%Y-%m-%d %H:00:00' )
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
end
) unit_time,
cross_id,
......@@ -502,14 +503,15 @@
) t1
left join (
SELECT cross_id,dir_type,start_time,flow,speed,queue_length,stop_times,delay_time,sturation ,traffic_index,
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 15 ) * 15 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=2 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 30 ) * 30 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=3 then DATE_FORMAT(start_time,'%Y-%m-%d %H:00:00' )
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
end
) unit_time
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
else DATE_FORMAT(start_time,'%Y-01-01 00:00:00')
end
) unit_time
from t_cross_dir_data_hist
WHERE start_time >= #{startDate} and start_time &lt; #{endDate}
) t2
......@@ -550,14 +552,15 @@
) t1
left join (
SELECT id as lane_id,cross_id,start_time,flow,speed,queue_length,stop_times,delay_time,sturation ,
(case
when #{groupType}=0 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 5 ) * 5 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=1 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 15 ) * 15 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=2 then DATE_FORMAT(concat( date( start_time ), ' ', HOUR ( start_time ), ':', floor( MINUTE ( start_time ) / 30 ) * 30 ),'%Y-%m-%d %H:%i:00' )
when #{groupType}=3 then DATE_FORMAT(start_time,'%Y-%m-%d %H:00:00' )
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
end
) unit_time
(case
when #{groupType}=0 then start_time
when #{groupType}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt_60min
when #{groupType}=4 then DATE_FORMAT(start_time,'%Y-%m-%d 00:00:00' )
else DATE_FORMAT(start_time,'%Y-01-01 00:00:00')
end
) unit_time
from t_lane_data_hist
WHERE start_time >= #{startDate} and start_time &lt; #{endDate}
) t2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment