Commit 14ac852a authored by duanruiming's avatar duanruiming

Merge remote-tracking branch 'origin/master'

parents 2d64acde 1352e3f9
......@@ -32,10 +32,6 @@ public class CrossProblemTotalityAnalysisResult extends ParentResult {
@Data
class CrossProblemTotalityResultResponse {
@ApiModelProperty(value = "路口名称", example = "经十路(舜耕路-山大路)",position = 0)
private String crossName;
@ApiModelProperty(value = "本周溢出总次数", example = "20次",position = 1)
private String weekOverFlowCount;
@ApiModelProperty(value = "本周溢出总次数与上周比较情况", example = "增加【减少】10%",position = 2)
......
......@@ -21,4 +21,10 @@ public interface BaseAreaInfoService {
JSONObject getGreenByWkt(Integer areaId, String wkt, Integer type);
void insertAreaInfo(BaseAreaInfoPO baseAreaInfoPO);
void updateAreaNameAndRemark(String name, String remark, Integer id, String roadName,
Integer parentCode, String wkt);
void deleteById(Integer areaId);
}
......@@ -117,6 +117,16 @@ public class BaseAreaInfoServiceImpl implements BaseAreaInfoService {
baseAreaInfoMapper.insertOne(baseAreaInfoPO);
}
@Override
public void updateAreaNameAndRemark(String name, String remark, Integer id, String roadName, Integer parentCode, String wkt) {
baseAreaInfoMapper.updateAreaNameAndRemark(name,remark,id,roadName,parentCode,wkt);
}
@Override
public void deleteById(Integer areaId) {
baseAreaInfoMapper.deleteById(areaId);
}
/**
* 将 POINT 类型的字符串转换为经纬度格式
*
......
......@@ -21,6 +21,7 @@ import net.wanji.opt.servicev2.judgeanalysis.AnalysisProblemCrossDayService;
import net.wanji.opt.servicev2.judgeanalysis.AnalysisProblemGreenDayService;
import net.wanji.opt.synthesis.pojo.TrunkLineCrossProblemEntity;
import net.wanji.opt.vo2.CrossOptAnalysisVO;
import net.wanji.opt.vo2.JudTrunkLineCrossProblemEntityVO;
import net.wanji.opt.vo2.TrunkLineCrossProblemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -166,17 +167,18 @@ public class AnalysisProblemGreenDayController {
@ApiImplicitParams({
@ApiImplicitParam(name = "greenId", value = "绿波ID", required = true, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "startTime", value = "日期,格式:yyyy-MM-dd HH:mm:ss", required = true, dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "日期,格式:yyyy-MM-dd HH:mm:ss", required = true, dataType = "String")
@ApiImplicitParam(name = "endTime", value = "日期,格式:yyyy-MM-dd HH:mm:ss", required = true, dataType = "String"),
@ApiImplicitParam(name = "status", value = "2:缓行 3:拥堵", required = true, dataType = "String")
})
@GetMapping(value = "/getGreenHighFrequencyProblem")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = GreenHighFrequencyProblemReasonResult.class),
})
public JsonViewObject getTrunkLineCrossProblem(Integer greenId, String startTime ,String endTim) {
public JsonViewObject getTrunkLineCrossProblem(Integer greenId, Integer status, String startTime ,String endTime) {
JsonViewObject object = JsonViewObject.newInstance();
try {
List<JudTrunkLineCrossProblemEntityVO> judTrunkLineCrossProblemEntityVOS = analysisProblemCrossDayService.getTrunkLineCrossProblem(greenId,status,startTime,endTime);
object.success(judTrunkLineCrossProblemEntityVOS);
} catch (Exception e) {
log.error("获取干线路口状态失败: ", e);
return JsonViewObject.newInstance().fail("获取干线路口状态失败");
......
......@@ -34,6 +34,42 @@ public class BaseAreaInfoController {
private BaseAreaInfoService baseAreaInfoService;
@ApiOperation(httpMethod="GET",value="区域基础信息-信息更新", notes="")
@GetMapping(value = "/update")
public JsonViewObject updateAreaNameAndRemark(String name,Integer id) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
try {
baseAreaInfoService.updateAreaNameAndRemark(name,null,id,null,null,null);
jsonViewObject.success("更新成功");
} catch (Exception e) {
jsonViewObject.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("{} getAll error", this.getClass().getSimpleName(), e);
}
return jsonViewObject;
}
@ApiOperation(httpMethod="GET",value="区域基础信息-根据区划类型查询对应集合数据", notes="")
@ApiImplicitParams({
@ApiImplicitParam(name = "areaId", value = "区域ID", required = false, dataType = "Integer", defaultValue = ""),
})
@GetMapping(value = "/deleteById")
public JsonViewObject deleteById(Integer areaId) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
try {
BaseAreaInfoPO areaInfoPO = baseAreaInfoService.selectById(areaId);
if (areaInfoPO.getCode() != 99){
return jsonViewObject.fail("非自定义区域不允许删除!");
}
baseAreaInfoService.deleteById(areaId);
jsonViewObject.success("删除成功");
} catch (Exception e) {
jsonViewObject.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("{} getAll error", this.getClass().getSimpleName(), e);
}
return jsonViewObject;
}
@ApiOperation(httpMethod="GET",value="区域基础信息-根据区划类型查询对应集合数据", notes="")
@GetMapping(value = "/byCondition")
......
......@@ -32,10 +32,6 @@ public class CrossProblemTotalityAnalysisResult extends ParentResult {
@Data
class CrossProblemTotalityResultResponse {
@ApiModelProperty(value = "路口名称", example = "经十路(舜耕路-山大路)",position = 0)
private String crossName;
@ApiModelProperty(value = "本周溢出总次数", example = "20次",position = 1)
private String weekOverFlowCount;
@ApiModelProperty(value = "本周溢出总次数与上周比较情况", example = "增加【减少】10%",position = 2)
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDay;
import net.wanji.opt.entity.judgeanalysis.CrossPoint;
import net.wanji.opt.synthesis.pojo.CrossOptAnalysisEntity;
import net.wanji.opt.vo2.GreenwaveCrossResult;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -111,5 +112,7 @@ public interface AnalysisProblemCrossDayMapper extends BaseMapper<AnalysisProble
* 获取路口优化数据
*/
List<CrossOptAnalysisEntity> getCrossOptAnalysis(@Param("greenId") String greenId,@Param("crossID") String crossID, @Param("startTime")String startTime,@Param("endTime")String endTime);
List<GreenwaveCrossResult> getTrunkLineCrossProblem(@Param("greenId") Integer greenId,@Param("status") Integer status,@Param("startTime") String startTime,@Param("endTime") String endTime);
}
......@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface CrossProblemMapper {
List<CrossProblemVO> selectCrossProblem(@Param("crossIdList") List<String> crossIdList,@Param("yearWeek") String yearWeek);
CrossProblemVO selectCrossProblem(@Param("crossIdList") List<String> crossIdList,@Param("yearWeek") String yearWeek);
List<CrossImportProblemDetailVO> selectCrossProblemSeriousDataByType(@Param("crossId") String crossId, @Param("yearWeek") String yearWeek,@Param("eventType") String eventType);
CrossImportProblemDataForQuery selectCrossProblemWorkDayByType(@Param("crossId") String crossId, @Param("yearWeek") String yearWeek, @Param("eventType") String eventType);
List<CrossImportProblemDataForQuery> selectCrossProblemByType(@Param("crossIdList") List<String> crossIdList,@Param("yearWeek") String yearWeek,@Param("eventType") String eventType);
......
......@@ -9,6 +9,8 @@ import java.util.List;
@NoArgsConstructor
@Data
public class DirListElement {
@ApiModelProperty(value = "路段名称", required = true)
private String roadName;
@ApiModelProperty(value = "车道进口方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北", required = true)
private Integer dir;
@ApiModelProperty(value = "交通状态:1畅通;2缓行;3拥堵;4严重拥堵;5未知", required = true)
......
......@@ -3,6 +3,7 @@ package net.wanji.opt.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.PageInfo;
......@@ -24,10 +25,12 @@ import net.wanji.databus.vo.SchemeOptSendVO;
import net.wanji.databus.vo.SchemeSendVO;
import net.wanji.feign.service.UtcFeignClients;
import net.wanji.opt.dao.mapper.CrossSchemeOptLogMapper;
import net.wanji.opt.dao.mapper.base.BaseRidInfoMapper;
import net.wanji.opt.dao.mapper.strategy.SceneMapper;
import net.wanji.opt.dto.*;
import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO;
import net.wanji.opt.dto.strategy.QuerySceneDTO;
import net.wanji.opt.po.base.BaseRidInfo;
import net.wanji.opt.po.base.CrossSchemeOptLogPO;
import net.wanji.opt.po.strategy.ScenePO;
import net.wanji.opt.service.DiagnoService;
......@@ -68,6 +71,9 @@ public class DiagnoServiceImpl implements DiagnoService {
private final CrossDirDataRealtimeMapper crossDirDataRealtimeMapper;
private final BaseCrossLaneLightsMapper baseCrossLaneLightsMapper;
private final BaseCrossLightsMapper baseCrossLightsMapper;
@Resource
BaseRidInfoMapper baseRidInfoMapper;
@Resource
private UtcFeignClients utcFeignClients;
private Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
......@@ -564,13 +570,23 @@ public class DiagnoServiceImpl implements DiagnoService {
private void buildDirList(String crossId, SaveLaneInfoDTO saveLaneInfoDTO) {
saveLaneInfoDTO.setDirList(new ArrayList<>());
QueryWrapper<BaseRidInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("end_cross_id", crossId);
List<BaseRidInfo> ridList = baseRidInfoMapper.selectList(queryWrapper);
Map<Integer, String> roadNameMap = ridList.stream().collect(Collectors.toMap(o->o.getInDir(),o->o.getName()));
List<LaneInfoPO> laneInfoPOList = laneInfoMapper.selectBycrossId(crossId);
Map<Integer, List<LaneInfoPO>> collect = laneInfoPOList.stream()
.collect(Collectors.groupingBy(LaneInfoPO::getDir));
for (Map.Entry<Integer, List<LaneInfoPO>> entry : collect.entrySet()) {
Integer key = entry.getKey();
DirListElement dirListElement = new DirListElement();
dirListElement.setDir(key);
dirListElement.setRoadName(roadNameMap.get(key));
// 查询拥堵状态、排队长度和指数
CrossDirDataRealtimePO crossDirDataRealtimePO =
crossDirDataRealtimeMapper.selectByCrossIdAndDirType(crossId, key);
......@@ -751,4 +767,8 @@ public class DiagnoServiceImpl implements DiagnoService {
phaseOptTimeList.add(phaseOptTime);
}
}
public static void main(String[] args) {
System.out.println(UUID.randomUUID().toString());
}
}
......@@ -494,10 +494,6 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
allList.add(mapList);
}
// BottomMenuBO bo = new BottomMenuBO();
// bo.setCrossId(crossId);
// bo.setScope(objectType);
// List<String> scopeList = mainlineEvaluateService.bottomMenu(bo);
List<String> scopeList = hasDataScopeList.stream().sorted().collect(Collectors.toList());
......@@ -535,12 +531,20 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
allList = allList.stream().filter(o -> Objects.equals(params.get("dir").toString(), o.get("dirType").toString())).collect(Collectors.toList());
}
List<String> timeList = this.getTimeAxisList(groupType,sortedSet);
BottomMenuBO bo = new BottomMenuBO();
bo.setCrossId(crossId);
bo.setScope(objectType);
List<String> scopeListAll = mainlineEvaluateService.bottomMenu(bo);
if (Objects.equals(4,objectType)){
scopeListAll = scopeList;
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("timeList", timeList);
jsonObject.put("dateTimeList", sortedSet);
jsonObject.put("dataList", allList);
jsonObject.put("scopeList", scopeList);
jsonObject.put("scopeList", scopeListAll);
log.info("findCrossObjectIndex总查耗时:{}ms,params:{}",System.currentTimeMillis()-st1,params);
......
......@@ -3,6 +3,7 @@ package net.wanji.opt.servicev2.judgeanalysis;
import com.baomidou.mybatisplus.extension.service.IService;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDay;
import net.wanji.opt.vo2.CrossOptAnalysisVO;
import net.wanji.opt.vo2.JudTrunkLineCrossProblemEntityVO;
import java.text.ParseException;
import java.util.List;
......@@ -74,4 +75,6 @@ public interface AnalysisProblemCrossDayService extends IService<AnalysisProblem
* @param date 日期
*/
CrossOptAnalysisVO getCrossOptAnalysis(String crossID, String startTime,String endTime);
List<JudTrunkLineCrossProblemEntityVO> getTrunkLineCrossProblem(Integer greenId, Integer status, String startTime, String endTime);
}
......@@ -21,4 +21,13 @@ public interface BaseAreaInfoService {
JSONObject getGreenByWkt(Integer areaId, String wkt, Integer type);
void insertAreaInfo(BaseAreaInfoPO baseAreaInfoPO);
void updateAreaNameAndRemark(String name, String remark, Integer id, String roadName,
Integer parentCode, String wkt);
void deleteById(Integer areaId);
BaseAreaInfoPO selectById(Integer id);
}
......@@ -117,6 +117,21 @@ public class BaseAreaInfoServiceImpl implements BaseAreaInfoService {
baseAreaInfoMapper.insertOne(baseAreaInfoPO);
}
@Override
public void updateAreaNameAndRemark(String name, String remark, Integer id, String roadName, Integer parentCode, String wkt) {
baseAreaInfoMapper.updateAreaNameAndRemark(name,remark,id,roadName,parentCode,wkt);
}
@Override
public void deleteById(Integer areaId) {
baseAreaInfoMapper.deleteById(areaId);
}
@Override
public BaseAreaInfoPO selectById(Integer id) {
return baseAreaInfoMapper.selectById(id);
}
/**
* 将 POINT 类型的字符串转换为经纬度格式
*
......
......@@ -9,6 +9,7 @@ import net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDay;
import net.wanji.opt.entity.syslog.SysOptimizeLog;
import net.wanji.opt.servicev2.syslog.SysLogServer;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -78,10 +79,23 @@ public class SysLogServerImpl extends ServiceImpl<SysLogMapper, SysOptimizeLog>
temp.setCommandType("定时任务 - 解除控制指令");
break;
}
break;
default:
temp.setCommandType("其它操作");
break;
}
String operateUser = temp.getOperateUser();
if (StringUtils.isEmpty(operateUser)){
operateUser = temp.getIp();
if ("37.12.182.50".equals(operateUser)){
operateUser = "神思";
}
}
String commandResult = temp.getCommandResult();
if ("停止失败任务解锁".equals(commandResult)){
temp.setCommandResult("失败");
}
temp.setOperateUser(operateUser);
results.add(temp);
}
List<SysOptimizeLog> collect = new ArrayList<>();
......
......@@ -44,7 +44,7 @@ public interface PushStrategyControlService {
* @return
* @throws Exception
*/
Result StartegyPriorityPlanPush(StrategyPriorityPlanPush req) throws Exception;
Result StartegyPriorityPlanPush(List<StrategyPriorityPlanPush> req) throws Exception;
/**
* 策略管理参数配置推送
......@@ -52,6 +52,6 @@ public interface PushStrategyControlService {
* @return
* @throws Exception
*/
Result StartegyPriorityParameterPush(StrategyParameterPush req) throws Exception;
Result StartegyPriorityParameterPush(List<StrategyParameterPush> req) throws Exception;
}
......@@ -101,13 +101,13 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic
* 日计划配置推送
* */
@Override
public Result StartegyPriorityPlanPush(StrategyPriorityPlanPush req) throws Exception {
public Result StartegyPriorityPlanPush(List<StrategyPriorityPlanPush> req) throws Exception {
try {
ObjectMapper mapper = JacksonUtils.getInstance();
System.out.println("req~~"+req);
// 序列化请求参数
String jsonReq = mapper.writeValueAsString(req);
String resultStr = RestTemplateTool.post(switchUrl, jsonReq);
System.out.println("req~~"+jsonReq);
String resultStr = RestTemplateTool.postList(switchUrl, jsonReq);
if (StringUtils.isNotBlank(resultStr)) {
log.info("下发神思策略管理日计划配置推送成功,内容: {}", req);
Result result = mapper.readValue(resultStr, Result.class);
......@@ -129,13 +129,13 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic
* @throws Exception
*/
@Override
public Result StartegyPriorityParameterPush(StrategyParameterPush req) throws Exception {
public Result StartegyPriorityParameterPush(List<StrategyParameterPush> req) throws Exception {
try {
ObjectMapper mapper = JacksonUtils.getInstance();
System.out.println("req~~"+req);
// 序列化请求参数
String jsonReq = mapper.writeValueAsString(req);
String resultStr = RestTemplateTool.post(switchUrl, jsonReq);
System.out.println("req~~"+jsonReq);
String resultStr = RestTemplateTool.postList(switchUrl, jsonReq);
if (StringUtils.isNotBlank(resultStr)) {
log.info("下发神思策略管理参数配置推送成功,内容: {}", req);
Result result = mapper.readValue(resultStr, Result.class);
......
package net.wanji.opt.vo2;
import lombok.Data;
@Data
public class GreenwaveCrossResult {
// 字段映射 SQL 查询中的列
private Integer greenId;
private Integer dirCount; // count(*) AS dir_count
private String crossId; // b.cross_id
private Integer status; // status
private Integer dirType; // dir_type
private Integer inDir; // a.in_dir
private Integer outDir; // a.out_dir
private String name; // c.name
}
\ No newline at end of file
package net.wanji.opt.vo2;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class JudTrunkLineCrossProblemEntityVO {
@ApiModelProperty(value = "干线ID",example = "")
private Integer greenId;
@ApiModelProperty(value = "路口ID",example = "")
private String crossId;
@ApiModelProperty(value = "路口名称",example = "")
private String crossName;
@ApiModelProperty(value = "绿波正向方向:1~8",example = "5")
private Integer inDir;
@ApiModelProperty(value = "绿波反向方向:1~8",example = "1")
private Integer outDir;
@ApiModelProperty(value = "顺序",example = "1")
private Integer sort;
@ApiModelProperty(value = "正向绿波路段状态 1畅通 2缓行 3拥堵",example = "2")
private Integer statusL;
@ApiModelProperty(value = "正向绿波路段状态 1畅通 2缓行 3拥堵",example = "3")
private Integer statusR;
}
\ No newline at end of file
......@@ -10,8 +10,6 @@ import java.util.List;
@Data
@ApiModel(value = "CrossProblemTotalityResult", description = "路口事情信息")
public class CrossProblemTotalityResult {
@ApiModelProperty(value = "路口名称", example = "经十路(舜耕路-山大路)",position = 0)
private String crossName;
@ApiModelProperty(value = "本周溢出总次数", example = "20次",position = 1)
private String weekOverFlowCount;
......
package net.wanji.opt.vo2.report;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class JudTrunkLineCrossProblemEntityDTO {
@ApiModelProperty(value = "干线ID",example = "")
private Integer greenId;
@ApiModelProperty(value = "路口ID",example = "")
private String crossId;
@ApiModelProperty(value = "路口名称",example = "")
private String crossName;
@ApiModelProperty(value = "绿波正向方向:1~8",example = "5")
private Integer inDir;
@ApiModelProperty(value = "绿波反向方向:1~8",example = "1")
private Integer outDir;
@ApiModelProperty(value = "顺序",example = "1")
private Integer sort;
@ApiModelProperty(value = "正向绿波路段状态 1畅通 2缓行 3拥堵",example = "2")
private Integer statusL;
@ApiModelProperty(value = "正向绿波路段状态 1畅通 2缓行 3拥堵",example = "3")
private Integer statusR;
private Integer count;
}
\ No newline at end of file
......@@ -193,10 +193,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}=1 then dt_15min
when #{groupType}=2 then dt_30min
when #{groupType}=3 then dt
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,
......
......@@ -437,16 +437,16 @@
<select id="getListByStartAndEnd" parameterType="java.util.Map" resultType="java.util.Map">
SELECT DATE_FORMAT(start_time,'%Y-%m-%d %H:%i:%s') startTime,
DATE_FORMAT(end_time,'%Y-%m-%d %H:%i:%s') endTime,
ABS(TIMESTAMPDIFF( SECOND, start_time, end_time )) AS duration,
ABS(TIMESTAMPDIFF( SECOND, start_time, ifnull(end_time,now()) )) AS duration,
info.type,
c.label as typeName,
dir
FROM t_event_info info
JOIN t_config_event_category c ON info.type = c.event_type
WHERE cross_id = #{crossId}
and start_time >= #{startTime}
AND end_time &lt; #{endTime}
AND end_time is not null
and start_time BETWEEN #{startTime}
AND start_time AND #{endTime}
<!-- AND end_time is not null -->
ORDER BY
start_time DESC
</select>
......
......@@ -365,6 +365,38 @@
and t.dt >= date_format(#{startTime},'%Y%m%d') and t.dt &lt;= date_format(#{endTime},'%Y%m%d')
group by status
</select>
<select id="getTrunkLineCrossProblem" resultType="net.wanji.opt.vo2.GreenwaveCrossResult">
SELECT
a.green_id,
count(*) AS dir_count,
b.cross_id,
status,
dir_type,
a.in_dir,
a.out_dir,
c.name
FROM
t_greenwave_cross a
LEFT JOIN t_base_cross_info AS c ON a.cross_id = c.id
LEFT JOIN t_cross_dir_data_hist b ON a.cross_id = b.cross_id
WHERE
1=1
<if test="greenId != null">
AND a.green_id = #{greenId}
</if>
<if test="startTime != null and endTime != null">
AND b.start_time BETWEEN #{startTime}
AND #{endTime}
</if>
<if test="status != null">
AND b.status = #{status}
</if>
AND ( a.in_dir = b.dir_type OR a.out_dir = b.dir_type )
GROUP BY
b.cross_id,
dir_type,
status
</select>
</mapper>
......@@ -285,11 +285,13 @@
JOIN t_base_rid_info t3
ON sub_t2.cross_id=t3.end_cross_id
AND sub_t2.dir_type=t3.in_dir
AND t1.in_dir=t3.in_dir
WHERE
1=1
<if test="greenId!=null and greenId!=''">
AND t1.green_id=#{greenId}
</if>
and t1.sort!=1
ORDER BY
sub_t2.traffic_index DESC
limit 1
......
......@@ -31,12 +31,12 @@
</resultMap>
<select id="selectCrossProblem" resultMap="CrossProblemMap">
select t4.cross_id, t4.name, sum(even_number_701) as even_number_701, sum(event_total_time_701) as event_total_time_701,
select sum(even_number_701) as even_number_701, sum(event_total_time_701) as event_total_time_701,
sum(even_number_702) as even_number_702, sum(event_total_time_702) as event_total_time_702,
sum(even_number_703) as even_number_703, sum(event_total_time_703) as event_total_time_703,
sum(even_number_707) as even_number_707, sum(event_total_time_707) as event_total_time_707
from
(select t3.cross_id, t3.name, case t3.event_type when 701 then t3.event_number else 0 end as even_number_701 ,
(select case t3.event_type when 701 then t3.event_number else 0 end as even_number_701 ,
case t3.event_type when 701 then t3.event_total_time else 0 end as event_total_time_701,
case t3.event_type when 702 then t3.event_number else 0 end as even_number_702 ,
case t3.event_type when 702 then t3.event_total_time else 0 end as event_total_time_702,
......@@ -45,27 +45,21 @@
case t3.event_type when 707 then t3.event_number else 0 end as even_number_707 ,
case t3.event_type when 707 then t3.event_total_time else 0 end as event_total_time_707
from
(select t5.cross_id, t5.name,t5.event_type,sum(t5.event_number) as event_number, sum(t5.event_total_time) as event_total_time
from
(select t.id as cross_id, t.name,IFNULL(t1.event_type,701) as event_type,IFNULL(t1.event_number,0) as event_number , IFNULL(t1.event_total_time,0) as event_total_time
from t_base_cross_info t
left join (select cross_id,event_type,event_number,event_total_time from t_analysis_problem_cross_day where 1=1
(select event_type,sum(event_number) as event_number,sum(event_total_time) as event_total_time
from t_analysis_problem_cross_day
where 1=1
<if test="yearWeek != null">
and year_week = #{yearWeek}
</if>
) t1 on t1.cross_id = t.id
where t.is_signal = 1
order by t.id, t.name,t1.event_type) t5
group by t5.cross_id, t5.name,t5.event_type) t3) t4
where 1=1
<if test="crossIdList != null">
and t4.cross_id in
and cross_id in
<foreach collection="crossIdList" item="crossId" open="(" close=")" separator=",">
#{crossId}
</foreach>
</if>
group by t4.cross_id,t4.name
group by event_type
) t3
) t4
</select>
<select id="selectCrossProblemByType" parameterType="String" resultMap="CrossProblemQueryMap">
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>signal-optimize-service</id>
<classpath>
<dir name="D:/workspace/traffic-signal-platform-v2/traffic-signal-platform/signal-optimize-service/target/classes">
</dir>
</classpath>
</application>
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>wj-common</id>
<classpath>
<dir name="D:/workspace/traffic-signal-platform-v2/traffic-signal-platform/wj-common/target/classes">
</dir>
</classpath>
</application>
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>wj-databus</id>
<classpath>
<dir name="D:/workspace/traffic-signal-platform-v2/traffic-signal-platform/wj-databus/target/classes">
</dir>
</classpath>
</application>
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