Commit f2b629eb authored by zhoushiguang's avatar zhoushiguang

查询上周优化记录

parent 8af2465f
......@@ -17,40 +17,52 @@ public class StrategyGreenOptHistDTO {
@TableField("green_id")
private Integer greenId;
@TableField("length")
private Double length;
@TableField("cycle")
private Integer cycle;
@TableField("control_time")
private String controlTime;
@TableField("control_duration")
private Integer controlDuration;
@TableField("control_method")
private Integer controlMethod;
@TableField("type")
private Integer type;
@TableField("dynamic")
private Integer dynamic;
@TableField("dir_type")
private Integer dirType;
@TableField("dir")
private String dir;
@TableField("max_speed")
private Double maxSpeed;
@TableField("min_speed")
private Double minSpeed;
@TableField("green_width_time")
private Double greenWidthTime;
@TableField("cross_green_detail")
private String crossGreenDetail;
@TableField("key_cross")
private String keyCross;
@TableField("create_time")
private Date createTime;
@TableField("modify_time")
private Date modifyTime;
@TableField("response_code")
private Integer responseCode;
@TableField("response_content")
private String responseContent;
......
......@@ -15,6 +15,7 @@ import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Comparator;
......@@ -49,7 +50,7 @@ public class OptimizeStatisticTask {
/**
* 干线策略优化时长计算
*/
// @Scheduled(cron = "0 40 1 ? * 1")
// @Scheduled(cron查询上周优化记录
public void optimizeGreenWaveDurationCal() {
long st = System.currentTimeMillis();
try {
......
......@@ -52,12 +52,14 @@
a.control_method,
min(DATE_SUB(CURDATE(), INTERVAL (WEEKDAY(CURDATE()) + 7) DAY)) week_start_day,
max(DATE_SUB(CURDATE(), INTERVAL (WEEKDAY(CURDATE()) ) +1 DAY)) week_end_day,
weekday
(week(control_time)+1) year_week,
(WEEKDAY(control_time)+1) week_day
FROM t_strategy_green_opt_hist a
WHERE control_time >= DATE_SUB(CURDATE(), INTERVAL (WEEKDAY(CURDATE()) + 7) DAY)
and control_time < DATE_SUB(CURDATE(), INTERVAL (WEEKDAY(CURDATE()) ) DAY)
and control_method in (-1, 1)
group by green_id, control_time, control_duration, control_method
ORDER BY green_id,control_time
</select>
</mapper>
\ No newline at end of file
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