Commit b6b4ddc0 authored by zhoushiguang's avatar zhoushiguang
parents 33595041 28ad6ef9
...@@ -50,4 +50,13 @@ public enum GreenBeltDirEnum { ...@@ -50,4 +50,13 @@ public enum GreenBeltDirEnum {
} }
return ""; return "";
} }
public static String getCode(Integer dir) {
for (GreenBeltDirEnum value : GreenBeltDirEnum.values()) {
if (Objects.equals(dir, value.getInDir())) {
return value.getCode();
}
}
return "";
}
} }
...@@ -33,6 +33,6 @@ public enum RoadLevelEnum { ...@@ -33,6 +33,6 @@ public enum RoadLevelEnum {
return value.desc; return value.desc;
} }
} }
return ""; return URBAN_SECONDARY_ROAD.desc;
} }
} }
...@@ -50,6 +50,8 @@ class GreenReportProblemOverallAnalysisResponse { ...@@ -50,6 +50,8 @@ class GreenReportProblemOverallAnalysisResponse {
@Data @Data
class GreenReportProblemOverallData { class GreenReportProblemOverallData {
@ApiModelProperty(value = "排序", example = "")
private String sort;
@ApiModelProperty(value = "干线ID", example = "") @ApiModelProperty(value = "干线ID", example = "")
private String greenId; private String greenId;
@ApiModelProperty(value = "干线名称", example = "经十路(舜耕路-山大路)") @ApiModelProperty(value = "干线名称", example = "经十路(舜耕路-山大路)")
......
...@@ -9,6 +9,8 @@ import java.util.List; ...@@ -9,6 +9,8 @@ import java.util.List;
@Data @Data
public class GreenReportProblemOverallDataVO { public class GreenReportProblemOverallDataVO {
@ApiModelProperty(value = "排序", example = "")
private String sort;
@ApiModelProperty(value = "干线ID", example = "") @ApiModelProperty(value = "干线ID", example = "")
private String greenId; private String greenId;
@ApiModelProperty(value = "干线名称", example = "经十路(舜耕路-山大路)") @ApiModelProperty(value = "干线名称", example = "经十路(舜耕路-山大路)")
......
...@@ -2,6 +2,7 @@ package net.wanji.opt.dao.mapper.judgeanalysis; ...@@ -2,6 +2,7 @@ package net.wanji.opt.dao.mapper.judgeanalysis;
import net.wanji.opt.controllerv2.report.vo.AnalysisGreenCongestionPeriodVO; import net.wanji.opt.controllerv2.report.vo.AnalysisGreenCongestionPeriodVO;
import net.wanji.opt.entity.judgeanalysis.AnalysisGreenCongestionPeriod; import net.wanji.opt.entity.judgeanalysis.AnalysisGreenCongestionPeriod;
import net.wanji.opt.entity.judgeanalysis.laneDataHist;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -10,6 +11,10 @@ import java.util.Map; ...@@ -10,6 +11,10 @@ import java.util.Map;
public interface AnalysisGreenCongestionPeriodMapper { public interface AnalysisGreenCongestionPeriodMapper {
List<AnalysisGreenCongestionPeriod> selectGreenDataHist(@Param("date") String date); List<AnalysisGreenCongestionPeriod> selectGreenDataHist(@Param("date") String date);
void insertGreenCongestionPeriodData(Map<String, Object> map); void insertGreenCongestionPeriodData(Map<String, Object> map);
List<laneDataHist> selectGreenTrafficHist(@Param("date") String date);
List<laneDataHist> selectGreenTrafficThreshold(@Param("date") String date,@Param("greenId") String greenId,@Param("roadDirection") String roadDirection);
List<laneDataHist> selectCrossFlow(@Param("date") String date,@Param("crossId") String crossId,@Param("startTime") String startTime,@Param("endTime") String endTime);
void insertLaneDataHist(Map<String, Object> map);
List<AnalysisGreenCongestionPeriodVO> selectListByWeek(@Param("yearWeek") Integer yearWeek); List<AnalysisGreenCongestionPeriodVO> selectListByWeek(@Param("yearWeek") Integer yearWeek);
} }
package net.wanji.opt.entity.judgeanalysis;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "laneDataHist", description = "")
public class laneDataHist {
@ApiModelProperty(value = "干线ID")
private String greenId;
@ApiModelProperty(value = "车道ID")
private String id;
@ApiModelProperty(value = "路口ID")
private String crossId;
@ApiModelProperty(value = "交通指数阈值")
private Double trafficThreshold;
@ApiModelProperty(value = "交通指数")
private Double trafficIndex;
@ApiModelProperty(value = "方向")
private String dir;
@ApiModelProperty(value = "转向")
private String turn;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "流量")
private Integer flow;
@ApiModelProperty(value = "小时流量")
private Integer flowHour;
@ApiModelProperty(value = "干线道路方向")
private String roadDirection;
}
...@@ -42,20 +42,14 @@ public class StrategyPriorityDailyInfo implements Serializable { ...@@ -42,20 +42,14 @@ public class StrategyPriorityDailyInfo implements Serializable {
* 路口编号 * 路口编号
*/ */
private String crossId; private String crossId;
//非数据库字段 //非数据库字段
/** /**
* 干线名称 * 干线名称 (路由列表返回用)
*/ */
private String waveName; private String waveName;
/** /**
* 路口名称 * 路口名称 (路由列表返回用)
*/ */
private String crossName; private String crossName;
/**
* 时间数组
*/
private List<String> times;
} }
package net.wanji.opt.entity.strategy;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.util.List;
/*
策略日计划配置详情
*/
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
public class StrategyPriorityPlanDetails {
/**
* 主键
*/
private Long id;
/**
* 开始时间前端用
*/
private String start;
/**
* 结束时间前端用
*/
private String end;
/**
* 开始结束时间
*/
private List<String> times;
/**
* 组ID
*/
private Integer groupId;
/**
* 场景
*/
private String content;
}
...@@ -22,7 +22,8 @@ public class StrategyPriorityGroup { ...@@ -22,7 +22,8 @@ public class StrategyPriorityGroup {
private String label; private String label;
//路口Id //路口Id
private String crossId; private String crossId;
//路口Id
private List<String> crossIds;
//执行时间 //执行时间
private String weekExecute; private String weekExecute;
//日计划编号 //日计划编号
...@@ -31,8 +32,8 @@ public class StrategyPriorityGroup { ...@@ -31,8 +32,8 @@ public class StrategyPriorityGroup {
private String strategyNo; private String strategyNo;
//优先级的配置信息 //优先级的配置信息
private List<StrategyPriorityConfig> data; private List<StrategyPriorityConfig> data;
//计划表的配置信息 //计划表的配置信息日计划详情
private Object dailyPlanDetails; private List<StrategyPriorityPlanDetails> dailyPlanDetails;
// 参数配置表的配置信息 // 参数配置表的配置信息
private List<StrategyPriorityParamter> parameterConfigList; private List<StrategyPriorityParamter> parameterConfigList;
// 调度配置表的配置信息 // 调度配置表的配置信息
......
...@@ -277,10 +277,20 @@ public class AnalysisGreenCongestionPeriodServiceImpl implements AnalysisGreenCo ...@@ -277,10 +277,20 @@ public class AnalysisGreenCongestionPeriodServiceImpl implements AnalysisGreenCo
congestHeavyGreenWave = congestHeavyGreenWave + "、" + greenInfoList.get(0).getGreenwaveName(); congestHeavyGreenWave = congestHeavyGreenWave + "、" + greenInfoList.get(0).getGreenwaveName();
} }
} }
List<GreenReportProblemOverallDataVO> overallDataVOS = greenList.stream().sorted(Comparator.comparing(x -> {
double congestIndexAll = 0;
for (GreenWaveDirProblemDataVO dataVO : x.getList()) {
congestIndexAll += dataVO.getCongestIndex();
}
return congestIndexAll;
})).collect(Collectors.toList());
for (int i = 0; i < overallDataVOS.size(); i++) {
overallDataVOS.get(i).setSort(String.valueOf(i+1));
}
greenReportProblemOverallAnalysisResult.setCongestHeavyGreenWave(congestHeavyGreenWave); greenReportProblemOverallAnalysisResult.setCongestHeavyGreenWave(congestHeavyGreenWave);
greenReportProblemOverallAnalysisResult.setTotalCongestCount(String.valueOf(voList.size())+"次"); greenReportProblemOverallAnalysisResult.setTotalCongestCount(String.valueOf(voList.size())+"次");
greenReportProblemOverallAnalysisResult.setTotalCongestDuration(String.valueOf(countTime / 60 / 60 / 1000.0)+"小时"); greenReportProblemOverallAnalysisResult.setTotalCongestDuration(String.valueOf(countTime / 60 / 60 / 1000.0)+"小时");
greenReportProblemOverallAnalysisResult.setDataList(greenList); greenReportProblemOverallAnalysisResult.setDataList(overallDataVOS);
return greenReportProblemOverallAnalysisResult; return greenReportProblemOverallAnalysisResult;
} }
......
...@@ -50,4 +50,6 @@ public interface AnalysisGreenWaveOptimizeWeekService extends IService<AnalysisG ...@@ -50,4 +50,6 @@ public interface AnalysisGreenWaveOptimizeWeekService extends IService<AnalysisG
* @return * @return
*/ */
void removes(List<Long> ids); void removes(List<Long> ids);
void getTotalityData(Integer year, Integer week, String ids);
} }
package net.wanji.opt.servicev2.report.impl; package net.wanji.opt.servicev2.report.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import net.wanji.databus.dao.entity.GreenwaveInfoPO;
import net.wanji.databus.dao.mapper.GreenwaveInfoMapper;
import net.wanji.opt.entity.report.AnalysisGreenWaveOptimizeWeek; import net.wanji.opt.entity.report.AnalysisGreenWaveOptimizeWeek;
import net.wanji.opt.dao.mapper.report.AnalysisGreenWaveOptimizeWeekMapper; import net.wanji.opt.dao.mapper.report.AnalysisGreenWaveOptimizeWeekMapper;
import net.wanji.opt.servicev2.report.AnalysisGreenWaveOptimizeWeekService; import net.wanji.opt.servicev2.report.AnalysisGreenWaveOptimizeWeekService;
...@@ -8,9 +11,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -8,9 +11,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* <p> * <p>
...@@ -25,7 +32,8 @@ import java.util.List; ...@@ -25,7 +32,8 @@ import java.util.List;
@Resource @Resource
private AnalysisGreenWaveOptimizeWeekMapper analysisGreenWaveOptimizeWeekMapper; private AnalysisGreenWaveOptimizeWeekMapper analysisGreenWaveOptimizeWeekMapper;
@Autowired
private GreenwaveInfoMapper greenwaveInfoMapper;
/** /**
* 详情 * 详情
...@@ -80,4 +88,25 @@ import java.util.List; ...@@ -80,4 +88,25 @@ import java.util.List;
removeByIds(ids); removeByIds(ids);
} }
@Override
public void getTotalityData(Integer year, Integer week, String ids) {
Integer yearWeek = Integer.valueOf(year + "" + week);
List<Integer> greenIdList = new ArrayList<>();
if(ObjectUtils.isEmpty(ids)){
List<GreenwaveInfoPO> greenwaveInfoPOList = greenwaveInfoMapper.selectAll();
greenIdList = greenwaveInfoPOList.stream().map(GreenwaveInfoPO::getId).collect(Collectors.toList());
}else {
greenIdList = Arrays.stream(ids.split(","))
.map(String::trim) // 去除可能的空格
.filter(s -> !s.isEmpty()) // 过滤掉空字符串
.map(Integer::parseInt) // 转换为整数
.collect(Collectors.toList());
}
LambdaQueryWrapper<AnalysisGreenWaveOptimizeWeek> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AnalysisGreenWaveOptimizeWeek::getYearWeek,yearWeek);
queryWrapper.in(AnalysisGreenWaveOptimizeWeek::getGreenId,greenIdList);
List<AnalysisGreenWaveOptimizeWeek> analysisGreenWaveOptimizeWeeks = analysisGreenWaveOptimizeWeekMapper.selectList(queryWrapper);
} }
}
...@@ -141,7 +141,9 @@ import java.util.*; ...@@ -141,7 +141,9 @@ import java.util.*;
String label = group.getLabel(); String label = group.getLabel();
Integer labelCode = group.getLabelCode(); Integer labelCode = group.getLabelCode();
//路口id //路口id
String crossId = group.getCrossId(); List<String> crossList = group.getCrossIds();
//选中多个路口存多条数据
for (String crossId : crossList) {
//先判断表里有没有数据,有的话删除t_strategy_priority_config //先判断表里有没有数据,有的话删除t_strategy_priority_config
List<StrategyPriorityConfig> priorityConfig = strategyPriorityMapper.selectPriorityTable(crossId); List<StrategyPriorityConfig> priorityConfig = strategyPriorityMapper.selectPriorityTable(crossId);
if (priorityConfig.size() > 0) { if (priorityConfig.size() > 0) {
...@@ -165,7 +167,7 @@ import java.util.*; ...@@ -165,7 +167,7 @@ import java.util.*;
} }
} }
} }
}
strategyPriorityMapper.savePriorityInsert(saveList); strategyPriorityMapper.savePriorityInsert(saveList);
} catch (Exception e) { } catch (Exception e) {
log.error("{} savePriority", this.getClass().getSimpleName(), e); log.error("{} savePriority", this.getClass().getSimpleName(), e);
...@@ -200,9 +202,11 @@ import java.util.*; ...@@ -200,9 +202,11 @@ import java.util.*;
List<StrategyPriorityDailyInfo> savePlanList = new ArrayList<>(); List<StrategyPriorityDailyInfo> savePlanList = new ArrayList<>();
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
for (StrategyPriorityGroup group : dailyPlanDetails) { for (StrategyPriorityGroup group : dailyPlanDetails) {
StrategyPriorityDailyInfo strategyPriorityDailyInfo = new StrategyPriorityDailyInfo();
//路口ID //路口ID
String crossId = group.getCrossId(); List<String> crossList = group.getCrossIds();
//选中多个路口存多条数据
for (String crossId : crossList) {
StrategyPriorityDailyInfo strategyPriorityDailyInfo = new StrategyPriorityDailyInfo();
strategyPriorityDailyInfo.setCrossId(crossId); strategyPriorityDailyInfo.setCrossId(crossId);
//日计划编号 //日计划编号
Integer dailyPlanId = group.getDailyPlanId(); Integer dailyPlanId = group.getDailyPlanId();
...@@ -216,20 +220,14 @@ import java.util.*; ...@@ -216,20 +220,14 @@ import java.util.*;
strategyPriorityMapper.deletePlanConfig(crossId); strategyPriorityMapper.deletePlanConfig(crossId);
} }
Object dailyPlanDetails1 = group.getDailyPlanDetails(); //取出日计划详情
// 如果是数组,转换为字符串化的 JSON List<StrategyPriorityPlanDetails> dailyPlanDetails1 = group.getDailyPlanDetails();
if (dailyPlanDetails instanceof List) { String dailyPlanDetailsJson = JSON.toJSONString(dailyPlanDetails1);
String serializedDailyPlanDetails = objectMapper.writeValueAsString(dailyPlanDetails1); strategyPriorityDailyInfo.setDailyPlanDetails(dailyPlanDetailsJson);
group.setDailyPlanDetails(serializedDailyPlanDetails); // 转换为字符串
log.debug("Converted dailyPlanDetails to JSON string: {}", serializedDailyPlanDetails);
//存储
strategyPriorityDailyInfo.setDailyPlanDetails(serializedDailyPlanDetails);
}else{
strategyPriorityDailyInfo.setDailyPlanDetails(JSONObject.toJSONString(group.getDailyPlanDetails()));
}
savePlanList.add(strategyPriorityDailyInfo); savePlanList.add(strategyPriorityDailyInfo);
} }
}
strategyPriorityMapper.savePlanConfig(savePlanList); strategyPriorityMapper.savePlanConfig(savePlanList);
}catch (Exception e){ }catch (Exception e){
log.error("{} savePlanConfig", this.getClass().getSimpleName(), e); log.error("{} savePlanConfig", this.getClass().getSimpleName(), e);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
end as status_cn end as status_cn
from from
t_event_info a t_event_info a
where a.green_id = 1 where a.green_id = #{greenID}
and a.type in (705,706) and a.type in (705,706)
<if test="time == '' "> <if test="time == '' ">
and a.end_time is null and a.end_time is null
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<select id="getTrunkLineRealTimeAlarm" parameterType="map" resultMap="tlRealTimeAlarmsResultMap"> <select id="getTrunkLineRealTimeAlarm" parameterType="map" resultMap="tlRealTimeAlarmsResultMap">
select a.type , a.start_time as startTime , SUBSTR(a.dir, 2, length(a.dir)-2) as dir select a.type , a.start_time as startTime , SUBSTR(a.dir, 2, length(a.dir)-2) as dir
from t_event_info a from t_event_info a
where a.start_time = (select MAX(start_time) from t_event_info where cross_id = #{greenID} where a.start_time = (select MAX(start_time) from t_event_info where green_id = #{greenID}
and start_time <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s') and start_time >= DATE_FORMAT(DATE_SUB(#{time},INTERVAL 5 MINUTE), '%Y-%m-%d %H:%i:%s') and start_time <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s') and start_time >= DATE_FORMAT(DATE_SUB(#{time},INTERVAL 5 MINUTE), '%Y-%m-%d %H:%i:%s')
and dt = DATE_FORMAT(#{time}, '%Y%m%d') ) and dt = DATE_FORMAT(#{time}, '%Y%m%d') )
and a.type in (705, 706) and a.type in (705, 706)
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
AND opt_duration >= #{startOptDuration} AND opt_duration >= #{startOptDuration}
AND opt_duration &lt;=#{endOptDuration} AND opt_duration &lt;=#{endOptDuration}
</if> </if>
ORDER BY happen_start_time desc
</select> </select>
<select id="selectPageWithCrossIdAndGreenId" parameterType="map" resultType="net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo"> <select id="selectPageWithCrossIdAndGreenId" parameterType="map" resultType="net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo">
SELECT * SELECT *
......
...@@ -9,6 +9,17 @@ ...@@ -9,6 +9,17 @@
<result column="status" property="status"/> <result column="status" property="status"/>
</resultMap> </resultMap>
<resultMap id="AnalysisLaneDataHistMap" type="net.wanji.opt.entity.judgeanalysis.laneDataHist">
<result column="green_id" property="greenId"/>
<result column="road_direction" property="roadDirection"/>
<result column="start_time" property="startTime"/>
<result column="cross_id" property="crossId"/>
<result column="dir" property="dir"/>
<result column="turn" property="turn"/>
<result column="traffic_index" property="trafficIndex"/>
<result column="flow" property="flow"/>
</resultMap>
<select id="selectGreenDataHist" parameterType="String" resultMap="AnalysisGreenCongestionPeriodMap"> <select id="selectGreenDataHist" parameterType="String" resultMap="AnalysisGreenCongestionPeriodMap">
SELECT a.green_id,a.road_direction,a.start_time,a.status FROM t_greenwave_hist a SELECT a.green_id,a.road_direction,a.start_time,a.status FROM t_greenwave_hist a
where a.start_time between DATE_FORMAT(#{date},'%Y-%m-%d 00:00:00') and DATE_FORMAT(#{date},'%Y-%m-%d 23:59:59') where a.start_time between DATE_FORMAT(#{date},'%Y-%m-%d 00:00:00') and DATE_FORMAT(#{date},'%Y-%m-%d 23:59:59')
...@@ -31,4 +42,50 @@ ...@@ -31,4 +42,50 @@
and a.road_direction = #{roadDirection} and a.road_direction = #{roadDirection}
</insert> </insert>
<select id="selectGreenTrafficHist" parameterType="String" resultMap="AnalysisLaneDataHistMap">
select t.green_id,t1.key_cross_id as cross_id, t1.road_direction,t1.dir,t1.turn,t.start_time,t.traffic_index
from t_greenwave_hist t
left join t_greenwave_key_cross_lane t1 on t.green_id = t1.green_id and t.road_direction = t1.road_direction
where t.start_time BETWEEN DATE_FORMAT(#{date},'%Y-%m-%d 00:00:00') and DATE_FORMAT(#{date},'%Y-%m-%d 23:59:59')
and t1.dir is not null
order by t.green_id,t1.road_direction,t1.dir,t1.turn,t.start_time
</select>
<select id="selectGreenTrafficThreshold" parameterType="String" resultMap="AnalysisLaneDataHistMap">
select t.green_id,t.traffic_index
from t_greenwave_hist t
where t.start_time BETWEEN DATE_FORMAT(#{date},'%Y-%m-%d 09:00:00') and DATE_FORMAT(#{date},'%Y-%m-%d 16:30:10')
and t.green_id = #{greenId}
and t.road_direction = #{roadDirection}
order by t.traffic_index desc
</select>
<select id="selectCrossFlow" parameterType="String" resultMap="AnalysisLaneDataHistMap">
select t4.cross_id,t4.start_time,sum(t4.flow) as flow from
(select t2.id , t3.key_cross_id as cross_id , t2.start_time , t2.flow from t_lane_data_hist t2
left join
(select t.id , t1.key_cross_id from t_base_lane_info t
left join t_greenwave_key_cross_lane t1 on t1.key_cross_id = t.cross_id and t1.dir = t.dir
where t1.key_cross_id is not null and t.type = 2) t3 on t2.id = t3.id
where t3.key_cross_id is not null and dt = #{date} ) t4
where t4.cross_id = #{crossId}
and t4.start_time between DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 10 MINUTE),'%Y-%m-%d %H:%i:00') and DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s')
group by t4.cross_id,t4.start_time
</select>
<insert id="insertLaneDataHist" parameterType="map">
insert into t_analysis_green_wave_peak_detail (green_id,road_direction,week_day,peak_start_time,peak_end_time,
traffic_index,travel_time,speed,flow,max_flow,peak_type,year_week,week_start_time,week_end_time,insert_time,traffic_threshold )
select a.green_id,a.road_direction,#{weekDay} as week_day,DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s') as peak_start_time,
DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s') as peak_end_time, AVG(traffic_index),CEIL(AVG(trval_time)),AVG(speed),
#{avgFlow} as flow,#{maxFlow} as max_flow,#{peakType} as peak_type,#{weekNumber} as year_week,DATE_FORMAT(#{weekStartTime},'%Y-%m-%d') as week_start_time,
DATE_FORMAT(#{weekEndTime},'%Y-%m-%d') as week_end_time,now(),#{trafficThreshold} as traffic_threshold
from t_greenwave_hist a
where DATE_FORMAT(a.start_time,'%Y-%m-%d %H:%i:00') between DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(DATE_SUB(#{endTime},INTERVAL 5 MINUTE),'%Y-%m-%d %H:%i:%s')
and a.green_id = #{greenId}
and a.road_direction = #{roadDirection}
</insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -116,10 +116,11 @@ ...@@ -116,10 +116,11 @@
t4.`name` as waveName, t3.`name` as crossName, t4.`name` as waveName, t3.`name` as crossName,
t3.id as crossId, t2.daily_plan_details as dailyPlanDetails t3.id as crossId, t2.daily_plan_details as dailyPlanDetails
FROM FROM
t_strategy_priority_config t1 t_base_cross_info t3
LEFT JOIN t_strategy_priority_daily_info t2 on t1.cross_id = t2.cross_id LEFT JOIN t_strategy_priority_daily_info t2 on t3.id = t2.cross_id
LEFT JOIN t_base_cross_info t3 on t1.cross_id = t3.id LEFT JOIN t_strategy_priority_config t1 on t3.id=t1.cross_id
LEFT JOIN t_greenwave_info t4 on t4.id = t1.green_id LEFT JOIN t_greenwave_info t4 on t4.id = t1.green_id
WHERE t3.is_signal='1'
</select> </select>
<select id="getStrategyList" parameterType="map" resultType="net.wanji.opt.synthesis.pojo.StrategyFactoryEntity"> <select id="getStrategyList" parameterType="map" resultType="net.wanji.opt.synthesis.pojo.StrategyFactoryEntity">
SELECT 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