Commit 0ed9f9ec authored by hanbing's avatar hanbing

[update] 路口配置,拆分listLaneInfo接口

parent 1b972f6e
......@@ -7,6 +7,9 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import net.wanji.common.dto.CrossIdDTO;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.dao.mapper.CrossLaneLightsMapper;
import net.wanji.databus.dao.mapper.CrossLightsMapper;
import net.wanji.databus.po.CrossLightsPO;
import net.wanji.databus.vo.*;
import net.wanji.feign.service.UtcFeignClients;
import net.wanji.web.dto.*;
......
......@@ -3,24 +3,24 @@ package net.wanji.web.service.scheme.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import net.wanji.common.dto.CrossIdDTO;
import net.wanji.databus.dao.mapper.CrossDataRealtimeMapper;
import net.wanji.databus.dao.mapper.CrossDirDataRealtimeMapper;
import net.wanji.databus.dao.mapper.CrossTurnDataHistMapper;
import net.wanji.databus.po.CrossDataRealtimePO;
import net.wanji.databus.po.CrossDirDataRealtimePO;
import net.wanji.common.enums.LightsAddressEnum;
import net.wanji.databus.dao.mapper.CrossLaneLightsMapper;
import net.wanji.databus.dao.mapper.CrossLightsMapper;
import net.wanji.databus.dao.mapper.LaneInfoMapper;
import net.wanji.databus.po.CrossLaneLightsPO;
import net.wanji.databus.po.CrossLightsPO;
import net.wanji.databus.po.LaneInfoPO;
import net.wanji.web.common.enums.CrossLisghtsLaneDirEnum;
import net.wanji.web.common.enums.LightsAddressEnum;
import net.wanji.web.common.exception.LightLaneConflictException;
import net.wanji.web.common.exception.RidInfoException;
import net.wanji.web.dto.DirListElement;
import net.wanji.web.dto.LaneListElement;
import net.wanji.web.dto.LedConfigListElement;
import net.wanji.web.dto.SaveLaneInfoDTO;
import net.wanji.web.mapper.scheme.*;
import net.wanji.web.mapper.scheme.CrossDirInfoMapper;
import net.wanji.web.mapper.scheme.CrossPhaseLightsMapper;
import net.wanji.web.mapper.scheme.LaneSegmentMapper;
import net.wanji.web.po.scheme.CrossDirInfoPO;
import net.wanji.web.po.scheme.CrossLaneLightsPO;
import net.wanji.web.po.scheme.CrossLightsPO;
import net.wanji.web.po.scheme.LaneInfoPO;
import net.wanji.web.service.scheme.CrossConfigService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -39,7 +39,6 @@ public class CrossConfigServiceImpl implements CrossConfigService {
private final CrossLaneLightsMapper crossLaneLightsMapper;
private final LaneSegmentMapper laneSegmentMapper;
private final CrossLightsMapper crossLightsMapper;
private final CrossDataRealtimeMapper crossDataRealtimeMapper;
// 机动车灯数据库类型与前端类型对应关系
private static final Map<Integer, Integer> MOTOR_VEH_MAP = new HashMap<>(5);
......@@ -61,25 +60,17 @@ public class CrossConfigServiceImpl implements CrossConfigService {
}
private final CrossPhaseLightsMapper crossPhaseLightsMapper;
private final CrossTurnDataHistMapper crossTurnDataHistMapper;
private final CrossDirDataRealtimeMapper crossDirDataRealtimeMapper;
public CrossConfigServiceImpl(CrossDirInfoMapper crossDirInfoMapper, LaneInfoMapper laneInfoMapper,
CrossLaneLightsMapper crossLaneLightsMapper, LaneSegmentMapper laneSegmentMapper,
CrossLightsMapper crossLightsMapper,
CrossDataRealtimeMapper crossDataRealtimeMapper,
CrossPhaseLightsMapper crossPhaseLightsMapper,
CrossTurnDataHistMapper crossTurnDataHistMapper,
CrossDirDataRealtimeMapper crossDirDataRealtimeMapper) {
CrossPhaseLightsMapper crossPhaseLightsMapper) {
this.crossDirInfoMapper = crossDirInfoMapper;
this.laneInfoMapper = laneInfoMapper;
this.crossLaneLightsMapper = crossLaneLightsMapper;
this.laneSegmentMapper = laneSegmentMapper;
this.crossLightsMapper = crossLightsMapper;
this.crossDataRealtimeMapper = crossDataRealtimeMapper;
this.crossPhaseLightsMapper = crossPhaseLightsMapper;
this.crossTurnDataHistMapper = crossTurnDataHistMapper;
this.crossDirDataRealtimeMapper = crossDirDataRealtimeMapper;
}
@Override
......@@ -305,9 +296,6 @@ public class CrossConfigServiceImpl implements CrossConfigService {
String crossId = crossIdDTO.getCrossId();
SaveLaneInfoDTO saveLaneInfoDTO = new SaveLaneInfoDTO();
saveLaneInfoDTO.setCrossId(crossId);
// 路口拥堵指数
CrossDataRealtimePO crossDataRealtimePO = crossDataRealtimeMapper.selectByCrossId(crossId);
saveLaneInfoDTO.setCrossIndex(crossDataRealtimePO.getTrafficIndex());
// 构造dirList
buildDirList(crossId, saveLaneInfoDTO);
// 构造ledConfigList
......@@ -382,16 +370,6 @@ public class CrossConfigServiceImpl implements CrossConfigService {
Integer key = entry.getKey();
DirListElement dirListElement = new DirListElement();
dirListElement.setDir(key);
// 查询拥堵状态、排队长度和指数
CrossDirDataRealtimePO crossDirDataRealtimePO =
crossDirDataRealtimeMapper.selectByCrossIdAndDirType(crossId, key);
if (crossDirDataRealtimePO == null) {
throw new RuntimeException("没有该路口方向实时数据");
}
dirListElement.setStatus(crossDirDataRealtimePO.getStatus());
dirListElement.setTraffic_index(crossDirDataRealtimePO.getTrafficIndex());
dirListElement.setLength(crossDirDataRealtimePO.getLength());
dirListElement.setDuration(crossDirDataRealtimePO.getDuration());
// 获取是否有行人道
CrossDirInfoPO crossDirInfoPO = crossDirInfoMapper.selectByCrossIdAndDirType(crossId, key);
Integer isPedestrian = crossDirInfoPO.getIsPedestrian();
......
......@@ -11,6 +11,20 @@ import net.wanji.web.dto.LightIdDTO;
import net.wanji.web.dto.SaveSchemeConfigDTO;
import net.wanji.web.mapper.scheme.*;
import net.wanji.web.po.scheme.*;
import net.wanji.web.mapper.scheme.CrossAccompanyPhaseMapper;
import net.wanji.databus.dao.mapper.CrossLaneLightsMapper;
import net.wanji.databus.dao.mapper.CrossLightsMapper;
import net.wanji.web.mapper.scheme.CrossPhaseLightsMapper;
import net.wanji.web.mapper.scheme.CrossPhaseMapper;
import net.wanji.web.mapper.scheme.CrossSchemeMapper;
import net.wanji.databus.dao.mapper.LaneInfoMapper;
import net.wanji.web.po.scheme.CrossAccompanyPhasePO;
import net.wanji.databus.po.CrossLaneLightsPO;
import net.wanji.databus.po.CrossLightsPO;
import net.wanji.web.po.scheme.CrossPhaseLightsPO;
import net.wanji.web.po.scheme.CrossPhasePO;
import net.wanji.web.po.scheme.CrossSchemePO;
import net.wanji.databus.po.LaneInfoPO;
import net.wanji.web.service.scheme.SchemeConfigService;
import net.wanji.web.vo.scheme.LaneIdsVO;
import net.wanji.web.vo.scheme.LightIdVO;
......
package net.wanji.web.vo;
import lombok.Data;
import net.wanji.web.po.scheme.CrossLightsPO;
import net.wanji.databus.po.CrossLightsPO;
import net.wanji.web.po.scheme.CrossPhaseLightsPO;
import net.wanji.web.po.scheme.CrossPhasePO;
import net.wanji.web.po.scheme.CrossSchemePO;
......
......@@ -3,7 +3,7 @@ package net.wanji.web.vo.scheme;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wanji.web.po.scheme.LaneInfoPO;
import net.wanji.databus.po.LaneInfoPO;
import java.util.List;
......
......@@ -4,10 +4,13 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.common.annotation.aspect.AspectLog;
import net.wanji.common.dto.CrossIdDTO;
import net.wanji.common.enums.BaseEnum;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.dto.CrossIdAndDirDTO;
import net.wanji.opt.dto.CrossIdAndSchemeIdDTO;
import net.wanji.opt.dto.SaveLaneInfoDTO;
import net.wanji.opt.dto.SendManualDTO;
import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO;
import net.wanji.opt.service.DiagnoService;
......@@ -123,4 +126,17 @@ public class DiagnoController {
OptEffectVO optEffectVO = diagnoService.optEffect(crossIdAndDirDTO);
return JsonViewObject.newInstance().success(optEffectVO);
}
@AspectLog(description = "路口信息", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "路口信息", notes = "路口信息", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/listLaneInfo",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = SaveLaneInfoDTO.class),
})
public JsonViewObject listLaneInfo(@RequestBody @Valid CrossIdDTO crossIdDTO) {
SaveLaneInfoDTO saveLaneInfoDTO = diagnoService.listLaneInfo(crossIdDTO);
return JsonViewObject.newInstance().success(saveLaneInfoDTO);
}
}
\ No newline at end of file
package net.wanji.opt.dao.mapper;
import net.wanji.opt.po.base.CrossDirInfoPO;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -13,4 +14,8 @@ import java.util.List;
public interface CrossDirInfoMapper {
List<Integer> selectInDirsByCrossId(String endCrossId);
CrossDirInfoPO selectByCrossIdAndDirType(String crossId, Integer key);
List<CrossDirInfoPO> selectByCrossId(String crossId);
}
package net.wanji.opt.dao.mapper;
import net.wanji.opt.po.base.CrossLightsPO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author hfx
* @date 2023/1/13 14:43
* @desc CrossLightsMapper
*/
@Repository
public interface CrossLightsMapper {
/**
* 查询灯组基础信息列表
* @return
*/
List<CrossLightsPO> listCrossLights();
}
package net.wanji.opt.dao.mapper;
import net.wanji.opt.po.base.LaneInfoPO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author hfx
* @date 2023/1/13 14:43
* @desc LaneInfoMapper
*/
@Repository
public interface LaneInfoMapper {
/**
* 查询车道基础信息列表
* @return
*/
List<LaneInfoPO> listLaneInfo();
}
package net.wanji.opt.dao.mapper;
import net.wanji.opt.po.base.CrossLightsPO;
import net.wanji.opt.po.base.LaneLightsPO;
import org.springframework.stereotype.Repository;
......
......@@ -2,7 +2,6 @@ package net.wanji.opt.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wanji.opt.po.base.LaneInfoPO;
import java.util.List;
......
package net.wanji.opt.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@NoArgsConstructor
@Data
public class DirListElement {
@ApiModelProperty(value = "车道进口方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北", required = true)
private Integer dir;
@ApiModelProperty(value = "交通状态:1畅通;2缓行;3拥堵;4严重拥堵;5未知", required = true)
private Integer status;
@ApiModelProperty(value = "交通指数", required = true)
private Double traffic_index;
@ApiModelProperty(value = "排队长度", required = true)
private Double length;
@ApiModelProperty(value = "持续时间(单位:分钟)",notes = "")
private Integer duration ;
@ApiModelProperty(value = "是否有行人过街:0否;1是", required = true)
private Integer isPersonCross;
private List<LaneListElement> laneList;
@ApiModelProperty(value = "一次过街:oneCross, 出口二次过街:twiceCrossOut 进口二次过街:twiceCrossIn", required = true)
private String personCrossType;
@ApiModelProperty(value = "一次过街灯组代码", required = true)
private String oneCross;
@ApiModelProperty(value = "出口二次过街灯组代码", required = true)
private String twiceCrossOut;
@ApiModelProperty(value = "进口二次过街灯组代码", required = true)
private String twiceCrossIn;
}
\ No newline at end of file
package net.wanji.opt.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data
public class LaneListElement {
@ApiModelProperty(value = "车道ID(路口ID_方向_车道类型_序号)", required = true)
private String id;
@ApiModelProperty(value = "车道转向:0未知;1左转;2直行;3右转;4掉头;5直左;6直右;7左直右;8左右;9左转掉头;10直行掉头;11右转掉头;12左直掉头;13直右掉头;14左直右掉头;15左右掉头", required = true)
private Integer direction;
@ApiModelProperty(value = "车道代码", required = true)
private String name;
@ApiModelProperty(value = "1机动车;2非机动车;3公交专用;4可变;5潮汐", required = true)
private Integer laneType;
@ApiModelProperty(value = "灯组代码", required = true)
private String ledNum;
}
\ No newline at end of file
package net.wanji.opt.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data
public class LedConfigListElement {
@ApiModelProperty(value = "灯组ID", required = true)
private Integer id;
@ApiModelProperty(value = "灯组代码", required = true)
private String code;
@ApiModelProperty(value = "灯组类型 1机动车;2非机动车;3公交专用;4行人", required = true)
private Integer type;
@ApiModelProperty(value = "信号灯类型: 1:圆饼灯,2: 非机动车灯,3: 左转灯,4: 直行灯,5: 右转灯,6: 掉头灯,7: 公交专用灯,8: 行人灯", required = true)
private Integer signalType;
@ApiModelProperty(value = "灯组位置:1北;2东北;3东;4东南;5南;6西南;7西;8西北;11北一次过街;121北出口二次过街;122北进口二次过街", required = true)
private String address;
@ApiModelProperty(value = "灯组序号", required = true)
private Integer order;
}
\ No newline at end of file
package net.wanji.opt.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@NoArgsConstructor
@Data
public class SaveLaneInfoDTO {
@ApiModelProperty(value = "路口ID", required = true)
private String crossId;
@ApiModelProperty(value = "路口拥堵指数", required = true)
private Double crossIndex;
private List<LedConfigListElement> ledConfigList;
private List<DirListElement> dirList;
}
package net.wanji.opt.po.base;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author hfx
* @date 2023/01/12 13:29:39
* @desc 灯组基础信息
*/
@Data
public class CrossLightsPO {
@ApiModelProperty(name = "灯组ID",notes = "")
private Integer id;
@ApiModelProperty(name = "灯组号",notes = "")
private String lightsNo;
@ApiModelProperty(name = "灯组类型:机动车(1圆饼灯;2左转灯;3直行灯;4右转灯;5掉头灯;);" +
"非机动车(10非机动车灯;11左转灯;12直行灯;13右转灯;14掉头灯);" +
"20行人灯;21行人进口灯;22行人出口灯;" +
"30公交专用灯",notes = "")
private Integer type;
@ApiModelProperty(name = "灯组放行方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北",notes = "")
private Integer dir;
@ApiModelProperty(name = "灯组序号",notes = "")
private Integer sort;
@ApiModelProperty(name = "路口ID",notes = "")
private String crossId;
}
package net.wanji.opt.po.base;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author hfx
* @date 2023/1/13 16:50
* @desc 车道基础信息
*/
@Data
public class LaneInfoPO {
@ApiModelProperty(name = "车道ID",notes = "")
private String id;
@ApiModelProperty(name = "车道代码",notes = "")
private String code;
@ApiModelProperty(name = "车道序号,从左车道开始编号11、12、13...",notes = "")
private Integer sort;
@ApiModelProperty(name = "车道类型:1路段车道;2进口车道;3出口车道;4左转弯待转区;6直行待行区",notes = "")
private Integer type;
@ApiModelProperty(name = "车道方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北",notes = "")
private Integer dir;
@ApiModelProperty(name = "车道转向",notes = "")
private Integer turn;
@ApiModelProperty(name = "车道类别:1机动车;2非机动车;3公交专用;4可变;5潮汐",notes = "")
private Integer category;
@ApiModelProperty(name = "路段编号",notes = "")
private String rid;
@ApiModelProperty(name = "路口ID",notes = "")
private String crossId;
@ApiModelProperty(name = "车道长度",notes = "")
private Double length;
@ApiModelProperty(name = "车道宽度",notes = "")
private Double width;
}
package net.wanji.opt.service;
import net.wanji.opt.dto.CrossLightsDTO;
import net.wanji.opt.po.base.CrossLightsPO;
import java.util.List;
......
......@@ -3,6 +3,7 @@ package net.wanji.opt.service;
import net.wanji.common.dto.CrossIdDTO;
import net.wanji.opt.dto.CrossIdAndDirDTO;
import net.wanji.opt.dto.CrossIdAndSchemeIdDTO;
import net.wanji.opt.dto.SaveLaneInfoDTO;
import net.wanji.opt.dto.SendManualDTO;
import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO;
import net.wanji.opt.vo.CrossIdAndLocationVO;
......@@ -29,4 +30,6 @@ public interface DiagnoService {
void restoreSend(CrossIdDTO crossIdDTO) throws Exception;
OptEffectVO optEffect(CrossIdAndDirDTO crossIdAndDirDTO);
SaveLaneInfoDTO listLaneInfo(CrossIdDTO crossIdDTO);
}
......@@ -2,19 +2,16 @@ package net.wanji.opt.service.impl;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.utils.tool.BeanListUtils;
import net.wanji.opt.dao.mapper.CrossLightsMapper;
import net.wanji.opt.dao.mapper.CrossPhaseLightsMapper;
import net.wanji.databus.dao.mapper.CrossLightsMapper;
import net.wanji.databus.po.CrossLightsPO;
import net.wanji.opt.dto.CrossLightsDTO;
import net.wanji.opt.dto.LaneInfoDTO;
import net.wanji.opt.po.base.CrossLightsPO;
import net.wanji.opt.po.base.CrossPhaseLightsPO;
import net.wanji.opt.service.CrossLightsService;
import net.wanji.opt.service.LaneInfoService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......
......@@ -2,10 +2,10 @@ package net.wanji.opt.service.impl;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.utils.tool.BeanListUtils;
import net.wanji.opt.dao.mapper.LaneInfoMapper;
import net.wanji.databus.dao.mapper.LaneInfoMapper;
import net.wanji.databus.po.LaneInfoPO;
import net.wanji.opt.dao.mapper.LaneLightsMapper;
import net.wanji.opt.dto.LaneInfoDTO;
import net.wanji.opt.po.base.LaneInfoPO;
import net.wanji.opt.po.base.LaneLightsPO;
import net.wanji.opt.query.LaneQuery;
import net.wanji.opt.service.LaneInfoService;
......
......@@ -8,4 +8,18 @@
WHERE cross_id = #{crossId} and in_out_type = 1
</select>
<select id="selectByCrossIdAndDirType" resultType="net.wanji.opt.po.base.CrossDirInfoPO">
select
id,dir_type,in_out_type,cross_id,length,is_pedestrian,gmt_create,gmt_modified
from t_base_cross_dir_info
where cross_id = #{crossId} and dir_type = #{key} and in_out_type = 1
</select>
<select id="selectByCrossId" resultType="net.wanji.opt.po.base.CrossDirInfoPO">
select
id,dir_type,in_out_type,cross_id,length,is_pedestrian,gmt_create,gmt_modified
from t_base_cross_dir_info
where cross_id = #{crossId}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.opt.dao.mapper.CrossLightsMapper">
<!-- 通用查询映射结果 -->
<resultMap type="net.wanji.opt.po.base.CrossLightsPO" id="BaseResultMap">
<result property="id" column="id"/>
<result property="lightsNo" column="lights_no"/>
<result property="type" column="type"/>
<result property="dir" column="dir"/>
<result property="sort" column="sort"/>
<result property="crossId" column="cross_id"/>
</resultMap>
<!-- 查询灯组列表信息 -->
<select id="listCrossLights" resultMap="BaseResultMap">
select
id
,lights_no
,type
,dir
,sort
,cross_id
from
t_base_cross_lights
where 1=1
<if test="crossId != null and crossId != ''">
and cross_id = #{crossId}
</if>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.opt.dao.mapper.LaneInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="net.wanji.opt.po.base.LaneInfoPO">
<result property="id" column="id"/>
<result property="code" column="code"/>
<result property="sort" column="sort"/>
<result property="type" column="type"/>
<result property="dir" column="dir"/>
<result property="turn" column="turn"/>
<result property="category" column="category"/>
<result property="rid" column="rid"/>
<result property="crossId" column="cross_id"/>
<result property="length" column="length"/>
<result property="width" column="width"/>
</resultMap>
<!-- 查询车道基础信息列表 -->
<select id="listLaneInfo" parameterType="String" resultMap="BaseResultMap">
select
id
,code
,sort
,type
,dir
,turn
,category
,rid
,cross_id
,length
,width
from
t_base_lane_info
where 1 = 1
<if test="crossId != null and crossId != '' ">
and cross_id = #{crossId}
</if>
<if test="type != null and type != '' ">
and type = #{type}
</if>
<if test="rid != null and rid != '' ">
and rid = #{rid}
</if>
</select>
</mapper>
......@@ -17,7 +17,12 @@ import net.wanji.utc.po.CrossLightsPO;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.po.hk.request.HKRequest;
import net.wanji.utc.po.hk.request.RealTimeStateInfoQueryPO;
import net.wanji.utc.po.hk.response.*;
import net.wanji.utc.po.hk.response.ChannelStatePO;
import net.wanji.utc.po.hk.response.HKResponse;
import net.wanji.utc.po.hk.response.PhaseInfoPO;
import net.wanji.utc.po.hk.response.RealTimeStateInfoListPO;
import net.wanji.utc.po.hk.response.RealTimeStateInfoPO;
import net.wanji.utc.po.hk.response.RingsPO;
import net.wanji.utc.service.runninginfo.HkLightsStatusService;
import net.wanji.utc.util.PathUtil;
import net.wanji.utc.util.StringUtils;
......@@ -25,7 +30,12 @@ import net.wanji.utc.vo.LightsStatusVO;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author Kent HAN
......
......@@ -5,8 +5,20 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.utc.common.Result;
import net.wanji.utc.mapper.*;
import net.wanji.utc.po.*;
import net.wanji.utc.mapper.CrossLightsMapper;
import net.wanji.utc.mapper.CrossPhaseLightsMapper;
import net.wanji.utc.mapper.CrossPhaseMapper;
import net.wanji.utc.mapper.CrossPlanMapper;
import net.wanji.utc.mapper.CrossSchedulesMapper;
import net.wanji.utc.mapper.CrossSchemeMapper;
import net.wanji.utc.mapper.CrossSectionMapper;
import net.wanji.utc.po.CrossLightsPO;
import net.wanji.utc.po.CrossPhaseLightsPO;
import net.wanji.utc.po.CrossPhasePO;
import net.wanji.utc.po.CrossPlanPO;
import net.wanji.utc.po.CrossSchedulesPO;
import net.wanji.utc.po.CrossSchemePO;
import net.wanji.utc.po.CrossSectionPO;
import net.wanji.utc.service.staticinfo.WanJiCommonStaticInfoService;
import net.wanji.utc.util.HttpRestUtil;
import net.wanji.utc.vo.PlanSectionVO;
......
package net.wanji.web.mapper.scheme;
package net.wanji.databus.dao.mapper;
import net.wanji.web.po.scheme.CrossLaneLightsPO;
import net.wanji.databus.po.CrossLaneLightsPO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......
package net.wanji.web.mapper.scheme;
package net.wanji.databus.dao.mapper;
import net.wanji.web.po.scheme.CrossLightsPO;
import net.wanji.databus.po.CrossLightsPO;
import org.apache.ibatis.annotations.Param;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;
import java.util.Collection;
......@@ -13,6 +14,7 @@ import java.util.List;
* @date : 2023-1-3
*/
@Repository
@Primary
public interface CrossLightsMapper {
void deleteByCrossId(@Param("crossId") String crossId);
......@@ -35,4 +37,9 @@ public interface CrossLightsMapper {
void insertOne(CrossLightsPO crossLightsPO);
List<CrossLightsPO> listCrossLightsPO(@Param("entity") CrossLightsPO entity);
List<CrossLightsPO> listCrossLights();
void deleteOne(@Param("crossId") String crossId,
@Param("elementId") String elementId);
}
package net.wanji.web.mapper.scheme;
package net.wanji.databus.dao.mapper;
import net.wanji.web.po.scheme.LaneInfoPO;
import net.wanji.databus.po.LaneInfoPO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -33,4 +33,6 @@ public interface LaneInfoMapper {
List<LaneInfoPO> selectByLaneIds(@Param("laneIds") List<String> laneIds);
String selectPreId(String crossId, Integer dir);
List<LaneInfoPO> listLaneInfo();
}
package net.wanji.web.po.scheme;
package net.wanji.databus.po;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package net.wanji.web.po.scheme;
package net.wanji.databus.po;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package net.wanji.web.po.scheme;
package net.wanji.databus.po;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.web.mapper.scheme.CrossLaneLightsMapper">
<mapper namespace="net.wanji.databus.dao.mapper.CrossLaneLightsMapper">
<!-- 通用查询映射结果 -->
<resultMap type="net.wanji.web.po.scheme.CrossLaneLightsPO" id="BaseResultMap">
<resultMap type="net.wanji.databus.po.CrossLaneLightsPO" id="BaseResultMap">
<result property="id" column="id"/>
<result property="lightsId" column="lights_id"/>
<result property="laneId" column="lane_id"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.web.mapper.scheme.CrossLightsMapper">
<mapper namespace="net.wanji.databus.dao.mapper.CrossLightsMapper">
<!-- 通用查询映射结果 -->
<resultMap type="net.wanji.web.po.scheme.CrossLightsPO" id="BaseResultMap">
<resultMap type="net.wanji.databus.po.CrossLightsPO" id="BaseResultMap">
<result property="id" column="id"/>
<result property="lightsNo" column="lights_no"/>
<result property="type" column="type"/>
......@@ -18,7 +18,7 @@
id, lights_no,type, dir, sort, cross_id, gmt_create, gmt_modified
</sql>
<select id="listCrossLightsPO" parameterType="net.wanji.web.po.scheme.CrossLightsPO" resultMap="BaseResultMap">
<select id="listCrossLightsPO" parameterType="net.wanji.databus.po.CrossLightsPO" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from t_base_cross_lights
......@@ -64,6 +64,11 @@
where cross_id = #{crossId}
</delete>
<delete id="deleteOne">
delete from t_cross_lights
where cross_id = #{crossId} and name = #{elementId}
</delete>
<select id="selectByCrossIdAndLedNum" resultMap="BaseResultMap">
select id,
lights_no,
......@@ -128,4 +133,20 @@
</foreach>
</select>
<select id="listCrossLights" resultType="net.wanji.databus.po.CrossLightsPO">
select
id
,lights_no
,type
,dir
,sort
,cross_id
from
t_base_cross_lights
where 1=1
<if test="crossId != null and crossId != ''">
and cross_id = #{crossId}
</if>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.web.mapper.scheme.LaneInfoMapper">
<mapper namespace="net.wanji.databus.dao.mapper.LaneInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap type="net.wanji.web.po.scheme.LaneInfoPO" id="BaseResultMap">
<resultMap type="net.wanji.databus.po.LaneInfoPO" id="BaseResultMap">
<result property="id" column="id"/>
<result property="code" column="code"/>
<result property="sort" column="sort"/>
......@@ -76,4 +76,32 @@
WHERE end_cross_id = #{crossId} and in_dir = #{dir}
</select>
<!-- 查询车道基础信息列表 -->
<select id="listLaneInfo" parameterType="String" resultMap="BaseResultMap">
select
id
,code
,sort
,type
,dir
,turn
,category
,rid
,cross_id
,length
,width
from
t_base_lane_info
where 1 = 1
<if test="crossId != null and crossId != '' ">
and cross_id = #{crossId}
</if>
<if test="type != null and type != '' ">
and type = #{type}
</if>
<if test="rid != null and rid != '' ">
and rid = #{rid}
</if>
</select>
</mapper>
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