Commit 2c4b7468 authored by wangyecheng's avatar wangyecheng

修改方案评价溢出场景空放

parent ac21b3be
......@@ -53,6 +53,8 @@ public class EvaluationInfoController {
@ApiOperation(value = "方案评价-溢出", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiImplicitParams({
@ApiImplicitParam(name = "evenType", value = "事件类型", required = true, dataType = "String"),
@ApiImplicitParam(name = "currentAlgo", value = "事件类型", required = true, dataType = "String"),
@ApiImplicitParam(name = "crossId", value = "路口ID", required = true, dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "分析时段开始时间", required = false, dataType = "string"),
@ApiImplicitParam(name = "endTime", value = "分析时段截止时间", required = false, dataType = "string"),
......@@ -63,10 +65,10 @@ public class EvaluationInfoController {
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = AreaProblemOverview.class),
})
public JsonViewObject summaryEvaluation(String crossId,String startTime, String endTime,String contrastStartTime,String constrastEndTime) {
public JsonViewObject summaryEvaluation(String evenType,String currentAlgo,String crossId,String startTime, String endTime,String contrastStartTime,String constrastEndTime) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
try{
Map<String,Object> resData=evaluationInfoService.summaryEvaluation(crossId,startTime,endTime,contrastStartTime,constrastEndTime);
Map<String,Object> resData=evaluationInfoService.summaryEvaluation( evenType, currentAlgo,crossId,startTime,endTime,contrastStartTime,constrastEndTime);
jsonViewObject.success(resData);
}catch (Exception e){
jsonViewObject.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
......@@ -78,6 +80,8 @@ public class EvaluationInfoController {
@ApiOperation(value = "方案评价-失衡", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiImplicitParams({
@ApiImplicitParam(name = "evenType", value = "事件类型", required = true, dataType = "String"),
@ApiImplicitParam(name = "currentAlgo", value = "事件类型", required = true, dataType = "String"),
@ApiImplicitParam(name = "crossId", value = "路口ID", required = true, dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "分析时段开始时间", required = false, dataType = "string"),
@ApiImplicitParam(name = "endTime", value = "分析时段截止时间", required = false, dataType = "string"),
......@@ -88,10 +92,10 @@ public class EvaluationInfoController {
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = AreaProblemOverview.class),
})
public JsonViewObject unbalanceEvaluation(String crossId,String startTime, String endTime,String contrastStartTime,String constrastEndTime) {
public JsonViewObject unbalanceEvaluation(String evenType,String currentAlgo,String crossId,String startTime, String endTime,String contrastStartTime,String constrastEndTime) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
try{
Map<String,Object> resData=evaluationInfoService.unbalanceEvaluation(crossId,startTime,endTime,contrastStartTime,constrastEndTime);
Map<String,Object> resData=evaluationInfoService.unbalanceEvaluation(evenType,currentAlgo,crossId,startTime,endTime,contrastStartTime,constrastEndTime);
jsonViewObject.success(resData);
}catch (Exception e){
jsonViewObject.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
......@@ -103,6 +107,8 @@ public class EvaluationInfoController {
@ApiOperation(value = "方案评价-空放", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiImplicitParams({
@ApiImplicitParam(name = "evenType", value = "事件类型", required = true, dataType = "String"),
@ApiImplicitParam(name = "currentAlgo", value = "事件类型", required = true, dataType = "String"),
@ApiImplicitParam(name = "crossId", value = "路口ID", required = true, dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "分析时段开始时间", required = false, dataType = "string"),
@ApiImplicitParam(name = "endTime", value = "分析时段截止时间", required = false, dataType = "string"),
......@@ -113,10 +119,10 @@ public class EvaluationInfoController {
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = AreaProblemOverview.class),
})
public JsonViewObject idleEvaluation(String crossId,String startTime, String endTime,String contrastStartTime,String constrastEndTime) {
public JsonViewObject idleEvaluation(String evenType,String currentAlgo,String crossId,String startTime, String endTime,String contrastStartTime,String constrastEndTime) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
try{
Map<String,Object> resData=evaluationInfoService.idleEvaluation(crossId,startTime,endTime,contrastStartTime,constrastEndTime);
Map<String,Object> resData=evaluationInfoService.idleEvaluation(evenType,currentAlgo,crossId,startTime,endTime,contrastStartTime,constrastEndTime);
jsonViewObject.success(resData);
}catch (Exception e){
jsonViewObject.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
......
......@@ -4,6 +4,8 @@ import net.wanji.common.framework.mapper.BaseInterfaceMapper;
import net.wanji.opt.entity.evaluation.EventInfo;
import net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemAndStrategyDay;
import net.wanji.opt.po.trend.EventInfoSimplePo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -20,8 +22,8 @@ public interface CrossProblemEvaluationMapper {
public List<AnalysisProblemAndStrategyDay> findOVerFlowInfo();
List<TEventOptimizeInfo> getOverflow(String crossId, String startTime, String endTime);
List<EventInfoSimplePo> getOverflow(@Param("evenType") String evenType, @Param("currentAlgo")String currentAlgo, @Param("crossId")String crossId, @Param("startTime")String startTime, @Param("endTime")String endTime);
List<TEventOptimizeInfo> getContrastOverflow(String crossId, String contrastStartTime, String constrastEndTime);
List<EventInfoSimplePo> getContrastOverflow(@Param("evenType")String evenType,@Param("currentAlgo")String currentAlgo,@Param("crossId")String crossId,@Param("contrastStartTime") String contrastStartTime, @Param("constrastEndTime")String constrastEndTime);
}
package net.wanji.opt.po.trend;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
......@@ -64,4 +65,12 @@ public class EventInfoSimplePo implements Serializable {
@ApiModelProperty(value = "纵轴日期 格式:(dd/MM)", notes = "")
private List<String> dataTimeList = new ArrayList<>();
//非数据库字段
//事件发生次数
@TableField(exist = false)
private Long eventCount;
//优化次数
@TableField(exist = false)
private Long optimizecount;
}
\ No newline at end of file
......@@ -9,9 +9,9 @@ import java.util.Map;
public interface EvaluationInfoService extends IService<CrossDataHistPO> {
Map<String,Object> getListEvaluationSummarize(String crossId, String startTime, String endTime, String contrastStartTime, String constrastEndTime);
Map<String, Object> summaryEvaluation(String crossId, String startTime, String endTime, String contrastStartTime, String constrastEndTime);
Map<String, Object> summaryEvaluation(String evenType,String currentAlgo,String crossId, String startTime, String endTime, String contrastStartTime, String constrastEndTime);
Map<String, Object> unbalanceEvaluation(String crossId, String startTime, String endTime, String contrastStartTime, String constrastEndTime);
Map<String, Object> unbalanceEvaluation(String evenType,String currentAlgo,String crossId, String startTime, String endTime, String contrastStartTime, String constrastEndTime);
Map<String, Object> idleEvaluation(String crossId, String startTime, String endTime, String contrastStartTime, String constrastEndTime);
Map<String, Object> idleEvaluation(String evenType,String currentAlgo,String crossId, String startTime, String endTime, String contrastStartTime, String constrastEndTime);
}
......@@ -9,36 +9,77 @@
FROM t_event_optimize_info
WHERE 1=1
</select>
<select id="getOverflow" parameterType="net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo" resultType="net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo" >
SELECT
cross_id,duration,opt_status,
event_type,opt_duration
<select id="getOverflow" parameterType="net.wanji.opt.po.trend.EventInfoSimplePo" resultType="net.wanji.opt.po.trend.EventInfoSimplePo" >
SELECT count(*) as event_count,
sum(duration) duration,
count(t2.event_id) as optimizecount
FROM
t_event_optimize_info
(
SELECT t1.cross_id,t1.event_serial_number,t1.type,TIMESTAMPDIFF(SECOND,t1.start_time,t1.end_time) duration from t_event_info t1
Where 1=1
<if test="crossId!=null and crossId!=''">
AND t1.cross_id=#{crossId}
</if>
<if test="startTime!=null and endTime!=null">
AND start_time>=#{startTime} and start_time &lt;=#{endTime}
</if>
<if test="evenType!=null">
AND t1.type=#{evenType}
</if>
) t1
left JOIN
(
SELECT t1.cross_id,t1.event_id from t_strategy_cross_result t1
WHERE
1=1
1=1
<if test="crossId!=null and crossId!=''">
AND cross_id=#{crossId}
AND t1.cross_id=#{crossId}
</if>
<if test="startTime!=null and endTime!=null">
AND issue_time>=#{startTime} and issue_time &lt;=#{endTime}
</if>
<if test="startTime!=null and startTime!='' and endTime!='' and endTime!=null">
AND happen_start_time>=#{startTime} and happen_start_time &lt;=#{endTime}
<if test="currentAlgo!=null">
AND t1.current_algo=#{currentAlgo}
</if>
) t2
on t1.event_serial_number=t2.event_id
GROUP BY t1.cross_id,t1.type
</select>
<select id="getContrastOverflow" parameterType="net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo" resultType="net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo">
SELECT
cross_id,duration,opt_status,
event_type,opt_duration
<select id="getContrastOverflow" parameterType="net.wanji.opt.po.trend.EventInfoSimplePo" resultType="net.wanji.opt.po.trend.EventInfoSimplePo">
SELECT count(*) as event_count,
sum(duration) duration,
count(t2.event_id) as optimizecount
FROM
t_event_optimize_info
(
SELECT t1.cross_id,t1.event_serial_number,t1.type,TIMESTAMPDIFF(SECOND,t1.start_time,t1.end_time) duration from t_event_info t1
Where 1=1
<if test="crossId!=null and crossId!=''">
AND t1.cross_id=#{crossId}
</if>
<if test="contrastStartTime!=null and constrastEndTime!=null">
AND start_time>=#{contrastStartTime} and start_time &lt;=#{constrastEndTime}
</if>
<if test="evenType!=null">
AND t1.type=#{evenType}
</if>
) t1
left JOIN
(
SELECT t1.cross_id,t1.event_id from t_strategy_cross_result t1
WHERE
1=1
<if test="crossId!=null and crossId!=''">
AND cross_id=#{crossId}
AND t1.cross_id=#{crossId}
</if>
<if test="contrastStartTime!=null and contrastStartTime!='' and constrastEndTime!='' and constrastEndTime!=null">
AND happen_start_time>=#{contrastStartTime} and happen_start_time &lt;=#{constrastEndTime}
<if test="contrastStartTime!=null and constrastEndTime!=null">
AND issue_time>=#{contrastStartTime} and issue_time &lt;=#{constrastEndTime}
</if>
<if test="currentAlgo!=null">
AND t1.current_algo=#{currentAlgo}
</if>
) t2
on t1.event_serial_number=t2.event_id
GROUP BY t1.cross_id,t1.type
</select>
......
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