Commit 4105de81 authored by hanbing's avatar hanbing

运行计划,修复空指针异常

parent 22315b3b
...@@ -18,6 +18,7 @@ public interface CrossLaneLightsMapper { ...@@ -18,6 +18,7 @@ public interface CrossLaneLightsMapper {
void insertBatch(@Param("entities") List<CrossLaneLightsPO> entities); void insertBatch(@Param("entities") List<CrossLaneLightsPO> entities);
// todo 只返回进口车道
String selectLightsCodeByLaneId(@Param("laneId") String laneId); String selectLightsCodeByLaneId(@Param("laneId") String laneId);
Integer selectLightsIdByLaneId(@Param("crossId") String crossId, @Param("laneId") String laneId); Integer selectLightsIdByLaneId(@Param("crossId") String crossId, @Param("laneId") String laneId);
......
...@@ -12,6 +12,7 @@ import java.util.List; ...@@ -12,6 +12,7 @@ import java.util.List;
*/ */
@Repository @Repository
public interface LaneInfoMapper { public interface LaneInfoMapper {
// todo 只返回进口车道
List<LaneInfoPO> selectByCrossIdAndDir(@Param("crossId") String crossId, @Param("dir") Integer dir); List<LaneInfoPO> selectByCrossIdAndDir(@Param("crossId") String crossId, @Param("dir") Integer dir);
void deleteByCrossIdAndDir(@Param("crossId") String crossId, @Param("dir") Integer dir); void deleteByCrossIdAndDir(@Param("crossId") String crossId, @Param("dir") Integer dir);
......
...@@ -180,12 +180,14 @@ public class RunningPlanServiceImpl implements RunningPlanService { ...@@ -180,12 +180,14 @@ public class RunningPlanServiceImpl implements RunningPlanService {
// 根据路口ID和计划名获取计划ID // 根据路口ID和计划名获取计划ID
String planName = execListElement.getPlanName(); String planName = execListElement.getPlanName();
CrossPlanPO crossPlanPO = crossPlanMapper.selectByCrossIdAndName(crossId, planName); CrossPlanPO crossPlanPO = crossPlanMapper.selectByCrossIdAndName(crossId, planName);
if (crossPlanPO != null) {
Integer planId = crossPlanPO.getId(); Integer planId = crossPlanPO.getId();
// 更新调度计划关系表 // 更新调度计划关系表
updateCrossSchedulesPlan(crossId, execListElement, crossSchedulesId, planId); updateCrossSchedulesPlan(crossId, execListElement, crossSchedulesId, planId);
} }
} }
} }
}
private void updateCrossSchedulesPlan(String crossId, RunningPlanDTO.ExecListElement schedulesPlan, private void updateCrossSchedulesPlan(String crossId, RunningPlanDTO.ExecListElement schedulesPlan,
Integer crossSchedulesId, Integer planId) throws ParseException { Integer crossSchedulesId, Integer planId) throws ParseException {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
join t_base_cross_lights t2 join t_base_cross_lights t2
join t_base_lane_info t3 join t_base_lane_info t3
on t1.lane_id = t3.id and t1.lights_id = t2.id on t1.lane_id = t3.id and t1.lights_id = t2.id
where t3.id = #{laneId} where t3.id = #{laneId} and t3.type = 2
</select> </select>
<select id="selectLightsIdByLaneId" resultType="java.lang.Integer"> <select id="selectLightsIdByLaneId" resultType="java.lang.Integer">
......
...@@ -29,14 +29,14 @@ ...@@ -29,14 +29,14 @@
<delete id="deleteByCrossIdAndDir"> <delete id="deleteByCrossIdAndDir">
delete from t_base_lane_info delete from t_base_lane_info
where cross_id = #{crossId} and dir = #{dir} where cross_id = #{crossId} and dir = #{dir} and type = 2
</delete> </delete>
<select id="selectByCrossIdAndDir" resultMap="BaseResultMap"> <select id="selectByCrossIdAndDir" resultMap="BaseResultMap">
select select
id,code,sort,type,dir,turn,category,cross_id,rid,length,width,gmt_create,gmt_modified id,code,sort,type,dir,turn,category,cross_id,rid,length,width,gmt_create,gmt_modified
from t_base_lane_info from t_base_lane_info
where cross_id = #{crossId} and dir = #{dir} where cross_id = #{crossId} and dir = #{dir} and type = 2
</select> </select>
<select id="selectBycrossId" resultMap="BaseResultMap"> <select id="selectBycrossId" resultMap="BaseResultMap">
...@@ -50,13 +50,13 @@ ...@@ -50,13 +50,13 @@
select select
id,code,sort,type,dir,turn,category,cross_id,rid,length,width,gmt_create,gmt_modified id,code,sort,type,dir,turn,category,cross_id,rid,length,width,gmt_create,gmt_modified
from t_base_lane_info from t_base_lane_info
where cross_id = #{crossId} and dir = #{dir} and code = #{code} where cross_id = #{crossId} and dir = #{dir} and code = #{code} and type = 2
</select> </select>
<select id="selectIdByCrossIdDirTurn" resultType="java.lang.String"> <select id="selectIdByCrossIdDirTurn" resultType="java.lang.String">
select id select id
from t_base_lane_info from t_base_lane_info
where cross_id = #{crossId} and dir = #{dir} and turn = #{turn} and category = #{category} where cross_id = #{crossId} and dir = #{dir} and turn = #{turn} and category = #{category} and type = 2
limit 1 limit 1
</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