Commit 4105de81 authored by hanbing's avatar hanbing

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

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