夜得朦胧 il y a 1 an
Parent
commit
c914bfd62e

+ 3 - 3
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/impl/MultiSimulationProjectServiceImpl.java

@@ -381,10 +381,10 @@ public class MultiSimulationProjectServiceImpl implements MultiSimulationProject
 //        PageHelper.clearPage();
         if (!CollectionUtils.isEmpty(multiSimulationSceneVOS)) {
             for (MultiSimulationSceneVO scene : multiSimulationSceneVOS) {
-                String sceneId = scene.getSceneId();
-                int i = sceneCarMapper.selectSceneCarNumsBySceneId(sceneId);
-                scene.setCarNums(i);
+                String sceneId = scene.getId();
                 String mapId = scene.getMapId();
+                int i = sceneCarMapper.selectSceneCarNumsBySceneIdAndMapId(sceneId, mapId);
+                scene.setCarNums(i);
                 if (StringUtils.isBlank(mapId)) {
                     continue;
                 }

+ 2 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/server/infra/db/mysql/mapper/MultiSimulationSceneCarMapper.java

@@ -15,8 +15,8 @@ public interface MultiSimulationSceneCarMapper {
         "(#{sceneCarId},#{sceneId},#{carId},#{algorithmId},#{algorithmType},#{mapId},#{pathId},#{pathStartStr},#{pathEndStr},#{carSort},#{isSimulationCar})")
     int addMultiSimulationSceneCar(MultiSimulationSceneCarParam param);
 
-    @Select("select count(*) from multi_simulation_scene_car where scene_id = #{sceneId} and deleted = 0")
-    int selectSceneCarNumsBySceneId(@Param("sceneId") String sceneId);
+    @Select("select count(*) from multi_simulation_scene_car where scene_id = #{sceneId} and map_id = #{mapId} and deleted = 0")
+    int selectSceneCarNumsBySceneIdAndMapId(@Param("sceneId") String sceneId, @Param("mapId") String mapId);
 
 
     @Update("<script>" +