Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

martin 3 tahun lalu
induk
melakukan
cc04f4a876
26 mengubah file dengan 1893 tambahan dan 217 penghapusan
  1. 3 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneAccidentParam.java
  2. 0 1
      api-common/src/main/java/api/common/pojo/param/scene/SceneNaturalNewParam.java
  3. 5 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneNaturalParam.java
  4. 3 6
      api-common/src/main/java/api/common/pojo/param/scene/StandardsRegulationsParam.java
  5. 24 0
      api-common/src/main/java/api/common/pojo/po/scene/SystemUserScenePO.java
  6. 18 0
      api-common/src/main/java/api/common/pojo/vo/project/CombineCoordVo.java
  7. 3 0
      api-common/src/main/java/api/common/pojo/vo/project/DropDownVo.java
  8. 3 0
      api-common/src/main/java/api/common/pojo/vo/project/SimulationManualProjectSingleVo.java
  9. 15 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/ConfigCtrl.java
  10. 3 3
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/VehicleTempService.java
  11. 366 46
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java
  12. 3 3
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectMapper.java
  13. 36 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SyetemUserSceneController.java
  14. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneAccidentMapper.java
  15. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneNaturalMapper.java
  16. 1 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/StandardsRegulationsMapper.java
  17. 26 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemUserSceneMapper.java
  18. 35 4
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneAccidentService.java
  19. 50 85
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java
  20. 30 49
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/StandardsRegulationsService.java
  21. 71 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SystemUserSceneService.java
  22. 16 7
      simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml
  23. 149 2
      simulation-resource-server/src/main/resources/mapper/scene/SceneAccidentMapper.xml
  24. 893 0
      simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml
  25. 50 11
      simulation-resource-server/src/main/resources/mapper/scene/StandardsRegulationsMapper.xml
  26. 85 0
      simulation-resource-server/src/main/resources/mapper/scene/SystemUserSceneMapper.xml

+ 3 - 0
api-common/src/main/java/api/common/pojo/param/scene/SceneAccidentParam.java

@@ -35,7 +35,10 @@ public class SceneAccidentParam extends PageVO implements Serializable {
     private String cutIn;//切入
     private String driveCurve;//沿弯道行驶
     private String carConflict;//机动车-机动车冲突
+    private List<String> AllIds ; //权限集合
 
+    private String  xlk="0";//判断下拉框是否为空 0为空  1为有值
+    private Integer  bq=0;//判断标签是否为空 0为空  1为有值
 
 
 }

+ 0 - 1
api-common/src/main/java/api/common/pojo/param/scene/SceneNaturalNewParam.java

@@ -35,5 +35,4 @@ public class SceneNaturalNewParam extends PageVO implements Serializable {
     private String[][] turnAround;//掉头
 
 
-
 }

+ 5 - 0
api-common/src/main/java/api/common/pojo/param/scene/SceneNaturalParam.java

@@ -64,5 +64,10 @@ public class SceneNaturalParam extends PageVO implements Serializable {
     private String videoPreview;//视频预览地址
     private String[] ids ; //回显数组
     private String createUserId ; //创建人id
+    private List<String> AllIds ; //权限集合
+
+
+    private String  xlk="0";//判断下拉框是否为空 0为空  1为有值
+    private String  bq="0";//判断标签是否为空 0为空  1为有值
 
 }

+ 3 - 6
api-common/src/main/java/api/common/pojo/param/scene/StandardsRegulationsParam.java

@@ -29,13 +29,10 @@ public class StandardsRegulationsParam extends PageVO implements Serializable {
     private String jsonAddress ; //
     private String videoPreview;//视频预览地址
     private String[] ids ; //回显数组
-
-/*    private String ISO;
-    private String GB;
-    private String CNCAP;
-    private String ENCAP;*/
-
     private List<String> label;  //法规类型
+    private List<String> AllIds ; //权限集合
 
+    private String  xlk="0";//判断下拉框是否为空 0为空  1为有值
+    private String  bq="0";//判断标签是否为空 0为空  1为有值
 
 }

+ 24 - 0
api-common/src/main/java/api/common/pojo/po/scene/SystemUserScenePO.java

@@ -0,0 +1,24 @@
+package api.common.pojo.po.scene;
+
+import api.common.pojo.common.CommonPO;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 用户场景关联表。
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class SystemUserScenePO extends CommonPO implements Serializable {
+    private String id;              // 主键
+    private String userId;        // 用户id
+    private String sceneId;          // 场景id
+    private String sceneType;          // 场景类型
+}

+ 18 - 0
api-common/src/main/java/api/common/pojo/vo/project/CombineCoordVo.java

@@ -0,0 +1,18 @@
+package api.common.pojo.vo.project;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 合并信息
+ */
+@Getter
+@Setter
+public class CombineCoordVo {
+
+    //坐标
+    private String coord;
+
+    //合并值
+    private int repetitionNum;
+}

+ 3 - 0
api-common/src/main/java/api/common/pojo/vo/project/DropDownVo.java

@@ -19,4 +19,7 @@ public class DropDownVo {
 
     //传感器
     private String sensor;
+
+    //描述
+    private String description;
 }

+ 3 - 0
api-common/src/main/java/api/common/pojo/vo/project/SimulationManualProjectSingleVo.java

@@ -20,6 +20,9 @@ public class SimulationManualProjectSingleVo {
     //算法
     private String algorithm;
 
+    //算法类型
+    private String algorithmType;
+
     //车辆
     private String vehicle;
 

+ 15 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/ConfigCtrl.java

@@ -4,6 +4,7 @@ package com.css.simulation.resource.model.ctrl;
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.param.model.ConfigPageParam;
 import api.common.pojo.po.model.ConfigPO;
+import api.common.pojo.vo.model.ConfigSensorVO;
 import api.common.pojo.vo.model.ConfigVO;
 import api.common.util.ObjectUtil;
 import com.css.simulation.resource.model.service.ConfigService;
@@ -15,6 +16,9 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
+import java.util.List;
+import java.util.Map;
+
 @Controller
 @RequestMapping("/config")
 public class ConfigCtrl {
@@ -54,6 +58,17 @@ public class ConfigCtrl {
         if(ObjectUtil.isNull(configVO)){
             return new ResponseBodyVO(false, 500, "参数必传!",null);
         }
+        //端口重复校验
+        Map<String, List<ConfigSensorVO>> configSensors = configVO.getConfigSensors();
+        if(ObjectUtil.isNotNull(configSensors)){
+            List<ConfigSensorVO> configSensorVOS = configSensors.get("ogt");//完美传感器
+            if(ObjectUtil.isNotNull(configSensorVOS)){
+                long count = configSensorVOS.stream().mapToInt(ConfigSensorVO::getSensorPort).distinct().count();
+                if(configSensorVOS.size() != count){
+                    return new ResponseBodyVO(false, 500, "端口重复!",null);
+                }
+            }
+        }
         ResponseBodyVO<ConfigPO> response = new ResponseBodyVO<ConfigPO>(ResponseBodyVO.Response.SUCCESS);
         ConfigPO po = configService.saveConfig(configVO);
         if(ObjectUtil.isNull(po.getId())){

+ 3 - 3
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/VehicleTempService.java

@@ -17,7 +17,7 @@ public class VehicleTempService {
     @Autowired
     VehicleTempMapper vehicleTempMapper;
 
-    public Object getVehicleTempTree() {
+    public List getVehicleTempTree() {
         List<VehicleTempVO> list = vehicleTempMapper.getVehicleTempTree();
         List<Map> treeList = new ArrayList<>();
         Map<String, List<VehicleTempVO>> typeCollect = list.stream().collect(Collectors.groupingBy(VehicleTempVO::getVehicleType,LinkedHashMap::new, Collectors.toList()));
@@ -25,13 +25,13 @@ public class VehicleTempService {
             Map typeMap = new HashMap();
             typeMap.put("code",typeKey);
             typeMap.put("name",typeValue.get(0).getVehicleName());
-            List<Object> modelList = new LinkedList();
+            List<Map> modelList = new LinkedList();
             Map<String, List<VehicleTempVO>> modelCollect = typeValue.stream().collect(Collectors.groupingBy(VehicleTempVO::getVehicleModel,LinkedHashMap::new, Collectors.toList()));
             modelCollect.forEach((modelKey,modelValue)->{
                 Map modelMap = new HashMap();
                 modelMap.put("code",modelKey);
                 modelMap.put("name",modelKey);
-                List<Object> colourList = new LinkedList();
+                List<Map> colourList = new LinkedList();
                 modelValue.forEach(vo->{
                     Map colourMap = new HashMap();
                     colourMap.put("code",vo.getVehicleColour());

+ 366 - 46
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -220,10 +220,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
         String[] idArr = ids.split(",");
 
-        //执行中的不允许删除
+        //未执行和已中止的可以删除
         List<SimulationManualProjectPo> pos = simulationProjectMapper.selectProjectNowRunState(idArr);
         for(SimulationManualProjectPo p : pos){
-            if(!isEmpty(p.getNowRunState()) && !ProjectRunStateEnum.NOT_START.getCode().equals(p.getNowRunState())){
+            if(!isEmpty(p.getNowRunState()) && !ProjectRunStateEnum.NOT_START.getCode().equals(p.getNowRunState()) && !ProjectRunStateEnum.DISCONTINUE.getCode().equals(p.getNowRunState())){
                 return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"数据不支持删除");
             }
         }
@@ -306,16 +306,22 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         String s = getEvaluationLevel(po);
 
         //算法配置
-        String algorithmId = po.getAlgorithm();
-        AlgorithmPO algorithmBaseInfoVo = simulationProjectMapper.selectAlgorithmBaseInfoById(algorithmId).get(0);
+        AlgorithmPO algorithmBaseInfoVo = getAlgorithmInfo(po);
 
         //车辆配置
         VehiclePO vehicleBaseInfoVo = null;
         String vehicleConfigId = po.getVehicle();
-        List<ConfigPO> configVehicleVOS = simulationProjectMapper.selectConfigVehicle(vehicleConfigId);
+
+        ConfigPO configPO = new ConfigPO();
+        configPO.setId(vehicleConfigId);
+        List<ConfigPO> configVehicleVOS = simulationProjectMapper.selectConfigVehicle(configPO);
         if(!isEmpty(configVehicleVOS)){
             ConfigPO configVehicleVO = configVehicleVOS.get(0);
-            vehicleBaseInfoVo = simulationProjectMapper.selectVehicleBaseInfoById(configVehicleVO.getVehicleId()).get(0);
+            List<VehiclePO> vehiclePOS = simulationProjectMapper.selectVehicleBaseInfoById(configVehicleVO.getVehicleId());
+            if(!isEmpty(vehiclePOS)){
+                vehicleBaseInfoVo = vehiclePOS.get(0);
+            }
+
         }
         /*String vehicleImage = vehicleBaseInfoVo.getVehicleImage();
         if(!isEmpty(vehicleImage)){
@@ -506,9 +512,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
         }
         //算法配置
-        String algorithmId = po.getAlgorithm();
-        AlgorithmPO algorithmBaseInfoVo = simulationProjectMapper.selectAlgorithmBaseInfoById(algorithmId).get(0);
-
+        AlgorithmPO algorithmBaseInfoVo = getAlgorithmInfo(po);
 
         ProjectReportVo projectReportVo = new ProjectReportVo();
         projectReportVo.setAlgorithmName(algorithmBaseInfoVo.getAlgorithmName());
@@ -618,7 +622,32 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, projectReportVo);
     }
 
+    private AlgorithmPO getAlgorithmInfo(SimulationManualProjectPo po){
+        AlgorithmPO algorithmBaseInfoVo = null;
+        String algorithmId = po.getAlgorithm();
+        String algorithmType = po.getAlgorithmType();
+        //第三方算法平台
+        if("3".equals(algorithmType)){
+            String sort = "algorithmId-desc";
+            Integer page = 1;
+            Integer size = 1;//全部
+
+            String urlParam = "&algorithmId"+algorithmId+"&page=" + page+ "&size=" + size+ "&sort=" + sort;
+            List<DropDownVo> otherAlgorithmInfo = getOtherAlgorithmInfo(urlParam);
+            if(StringUtil.isNotEmpty(otherAlgorithmInfo)){
+                DropDownVo dropDownVo = otherAlgorithmInfo.get(0);
+                algorithmBaseInfoVo = new AlgorithmPO();
+                algorithmBaseInfoVo.setAlgorithmName(dropDownVo.getName());
+                algorithmBaseInfoVo.setDescription(dropDownVo.getDescription());
+            }
 
+        }else{
+            AlgorithmPO algorithmPO = new AlgorithmPO();
+            algorithmPO.setId(algorithmId);
+            algorithmBaseInfoVo = simulationProjectMapper.selectAlgorithmBaseInfoById(algorithmPO).get(0);
+        }
+        return algorithmBaseInfoVo;
+    }
 
 
     @Override
@@ -813,30 +842,18 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             Integer size = 999;//全部
 
             String urlParam = "&page=" + page+ "&size=" + size+ "&sort=" + sort;
-            ResponseBodyVO algorithmBody = algoPlatformService.getAlgorithmList(urlParam);
-
-            //解析数据
-            Map jsonMap = JsonUtil.jsonToMap((String) algorithmBody.getInfo());
-            Map<String, Object> dataMap = (Map<String, Object>) jsonMap.get("data");
-            List<Map<String, String>> contentList = (List<Map<String, String>>) dataMap.get("content");
-            Integer totalElements = (Integer) dataMap.get("totalElements");
-            if(totalElements > 0){
-                for (Map<String, String> content: contentList) {
-                    DropDownVo dropDownVo = new DropDownVo();
-                    dropDownVo.setId(content.get("algorithmId"));
-                    dropDownVo.setName(content.get("algorithmName"));
-                    algorithmList.add(dropDownVo);
-                }
-            }
-
+            algorithmList = getOtherAlgorithmInfo(urlParam);
 
         }else{
-            List<AlgorithmPO> algorithmBaseInfoVo = simulationProjectMapper.selectAlgorithmBaseInfoById(null);
+            AlgorithmPO algorithmPO = new AlgorithmPO();
+            algorithmPO.setCreateUserId(AuthUtil.getCurrentUserId());
+            List<AlgorithmPO> algorithmBaseInfoVo = simulationProjectMapper.selectAlgorithmBaseInfoById(algorithmPO);
 
             for(AlgorithmPO v : algorithmBaseInfoVo){
                 DropDownVo dropDownVo = new DropDownVo();
                 dropDownVo.setId(v.getId());
                 dropDownVo.setName(v.getAlgorithmName());
+                dropDownVo.setDescription(v.getDescription());
                 algorithmList.add(dropDownVo);
             }
 
@@ -847,14 +864,46 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         result.add(algorithmDropDown);
 
     }
+
+    /**
+     * 获取第三方算法信息
+     * @return
+     */
+    private List<DropDownVo> getOtherAlgorithmInfo(String query){
+
+        List<DropDownVo> algorithmList = new ArrayList<>();
+
+        ResponseBodyVO algorithmBody = algoPlatformService.getAlgorithmList(query);
+
+        //解析数据
+        Map jsonMap = JsonUtil.jsonToMap((String) algorithmBody.getInfo());
+        Map<String, Object> dataMap = (Map<String, Object>) jsonMap.get("data");
+        List<Map<String, String>> contentList = (List<Map<String, String>>) dataMap.get("content");
+        Integer totalElements = (Integer) dataMap.get("totalElements");
+        if(totalElements > 0){
+            for (Map<String, String> content: contentList) {
+                DropDownVo dropDownVo = new DropDownVo();
+                dropDownVo.setId(content.get("algorithmId"));
+                dropDownVo.setName(content.get("algorithmName"));
+                dropDownVo.setDescription(content.get("description"));
+                algorithmList.add(dropDownVo);
+            }
+        }
+        return algorithmList;
+
+
+    }
+
     private void setVehicleDropDown(List<DropDownTypeVo> result){
-        List<ConfigPO> vehicleBaseInfoVo = simulationProjectMapper.selectConfigVehicle(null);
+        ConfigPO configPO = new ConfigPO();
+        configPO.setCreateUserId(AuthUtil.getCurrentUserId());
+        List<ConfigPO> vehicleBaseInfoVo = simulationProjectMapper.selectConfigVehicle(configPO);
         List<DropDownVo> vehicleList = new ArrayList<>();
         for(ConfigPO v : vehicleBaseInfoVo){
             DropDownVo dropDownVo = new DropDownVo();
             dropDownVo.setId(v.getId());
             dropDownVo.setName(v.getConfigName());
-
+            dropDownVo.setDescription(v.getDescription());
             //获取传感器信息
             List<ConfigSensorPO> configSensorVos = simulationProjectMapper.selectConfigSensor(v.getId());
             String sensor = "";
@@ -877,7 +926,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         result.add(vehicleDropDown);
     }
     private void setScenePackageDropDown(List<DropDownTypeVo> result){
-        List<ScenePackagePO> scenePackageBaseVo = simulationProjectMapper.selectScenePackageBaseById(null);
+        ScenePackagePO scenePackagePO = new ScenePackagePO();
+        scenePackagePO.setCreateUserId(AuthUtil.getCurrentUserId());
+        List<ScenePackagePO> scenePackageBaseVo = simulationProjectMapper.selectScenePackageBaseById(scenePackagePO);
         List<DropDownVo> scenePackageList = new ArrayList<>();
         for(ScenePackagePO v : scenePackageBaseVo){
             DropDownVo dropDownVo = new DropDownVo();
@@ -916,7 +967,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         Date createTime = vo.getCreateTime();
         vo.setCreateTimeFmt(getRqStr(createTime, 2));
         String algorithm = vo.getAlgorithm();
-        List<AlgorithmPO> algorithmBaseInfoVos = simulationProjectMapper.selectAlgorithmBaseInfoById(algorithm);
+
+        AlgorithmPO algorithmPO = new AlgorithmPO();
+        algorithmPO.setId(algorithm);
+        List<AlgorithmPO> algorithmBaseInfoVos = simulationProjectMapper.selectAlgorithmBaseInfoById(algorithmPO);
         if(!isEmpty(algorithmBaseInfoVos)){
             AlgorithmPO algorithmBaseInfoVo = algorithmBaseInfoVos.get(0);
             vo.setAlgorithm(algorithmBaseInfoVo.getAlgorithmName());
@@ -931,6 +985,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         vo.setProjectName(po.getProjectName());
         vo.setProjectDescribe(po.getProjectDescribe());
         vo.setAlgorithm(po.getAlgorithm());
+        vo.setAlgorithmType(po.getAlgorithmType());
         vo.setVehicle(po.getVehicle());
         vo.setScene(po.getScene());
         vo.setMaxSimulationTime(po.getMaxSimulationTime());
@@ -1985,7 +2040,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
             List<SubScListVo> subListScoreLi = vo.getSubListScoreLi();
 
-
+//            Map<String, Integer> m = new LinkedHashMap<>();
+            List<String[]> list = new ArrayList<>();
             for(SubScListVo slv : subListScoreLi){
                 String[] slsi = new String[size];
                 for(int i=0;i<size;i++){
@@ -1994,17 +2050,35 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 //目前最多支持到6级指标
                 for(int i=0; i<size-4; i++){
                     if(i==0){
-                        slsi[i] = slv.getSublistName1();
+                        if(slv.getSublistName1() != null){
+                            slsi[i] = slv.getSublistName1();
+                        }
+
                     }else if(i==1){
-                        slsi[i] = slv.getSublistName2();
+                        if(slv.getSublistName2() != null){
+                            slsi[i] = slv.getSublistName2();
+                        }
+
                     }else if(i==2){
-                        slsi[i] = slv.getSublistName3();
+                        if(slv.getSublistName3() != null){
+                            slsi[i] = slv.getSublistName3();
+                        }
+
                     }else if(i==3){
-                        slsi[i] = slv.getSublistName4();
+                        if(slv.getSublistName4() != null){
+                            slsi[i] = slv.getSublistName4();
+                        }
+
                     }else if(i==4){
-                        slsi[i] = slv.getSublistName5();
+                        if(slv.getSublistName5() != null){
+                            slsi[i] = slv.getSublistName5();
+                        }
+
                     }else if(i==5){
-                        slsi[i] = slv.getSublistName6();
+                        if(slv.getSublistName6() != null){
+                            slsi[i] = slv.getSublistName6();
+                        }
+
                     }
                 }
                 slsi[size-4] = slv.getSceneNum();
@@ -2012,8 +2086,82 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 slsi[size-2] = slv.getLastScore();
                 slsi[size-1] = slv.getFirstScore();
 
-                addDataList(pdfPTable2, font, slsi);
+/*                //合并计数
+                if(m.get(slv.getSublistName1()) == null){
+                    m.put(slv.getSublistName1(), 1);
+                }else{
+                    m.put(slv.getSublistName1(), m.get(slv.getSublistName1())+1);
+                }*/
+                list.add(slsi);
+
+//                addDataList(pdfPTable2, font, slsi);
+            }
+
+
+
+
+/*            //添加数据(合并单元格)
+            int rowIndex=0;//行坐标
+            for(int i=0; i<list.size();i++){
+                String[] strings = list.get(i);
+                for(int j=0; j<strings.length; j++){
+                    //rowIndex,0 合并操作
+                    if(i == rowIndex && j ==0 ){
+                        PdfPCell pdfPCell = new PdfPCell(new Paragraph(strings[j],defaultFont(font)));
+                        Integer integer = m.get(strings[j]);//合并行数
+                        pdfPCell.setRowspan(integer);
+                        rowIndex += integer;//定位到下一次合并行坐标之前
+                        pdfPTable2.addCell(pdfPCell);
+
+                    }
+                    //未到下一次合并行,不加第一列
+                    else if(i<rowIndex && j !=0){
+
+                        PdfPCell pdfPCell = new PdfPCell(new Paragraph(strings[j],defaultFont(font)));
+                        pdfPTable2.addCell(pdfPCell);
+                    }
+
+
+                }
+
+            }*/
+
+            Map map = getSceneScListCombineCoord(subListScoreLi, size);
+
+            List<CombineCoordVo> combineCoordList = (List<CombineCoordVo>) map.get("combineCoordList");
+            List<String> skipCoordList = (List<String>) map.get("skipCoordList");
+
+            boolean b = false;
+            int num = 0;
+            for(int i=0; i<list.size();i++){
+                String[] strings = list.get(i);
+                for(int j=0; j<strings.length; j++){
+                    String coord = i+","+j;
+
+                    //是否要跳过
+                    boolean contains = skipCoordList.contains(coord);
+                    if(contains){
+                        continue;
+                    }
+                    PdfPCell pdfPCell = new PdfPCell(new Paragraph(strings[j],defaultFont(font)));
+                    //是否要合并
+                    for(CombineCoordVo v : combineCoordList){
+                        if(coord.equals(v.getCoord())){
+                            b = true;
+                            num = v.getRepetitionNum();
+                            break;
+                        }
+                    }
+                    if(b){
+                        pdfPCell.setRowspan(num);
+                    }
+
+                    pdfPTable2.addCell(pdfPCell);
+
+
+                }
             }
+
             document.add(pdfPTable2);
 
             /*
@@ -2047,17 +2195,35 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 //目前最多支持到6级指标
                 for(int i=0; i<size2-5; i++){
                     if(i==0){
-                        ssli[i] = sslv.getSublistName1();
+                        if(sslv.getSublistName1() != null){
+                            ssli[i] = sslv.getSublistName1();
+                        }
+
                     }else if(i==1){
-                        ssli[i] = sslv.getSublistName2();
+                        if(sslv.getSublistName2() != null){
+                            ssli[i] = sslv.getSublistName2();
+                        }
+
                     }else if(i==2){
-                        ssli[i] = sslv.getSublistName3();
+                        if(sslv.getSublistName3() != null){
+                            ssli[i] = sslv.getSublistName3();
+                        }
+
                     }else if(i==3){
-                        ssli[i] = sslv.getSublistName4();
+                        if(sslv.getSublistName4() != null){
+                            ssli[i] = sslv.getSublistName4();
+                        }
+
                     }else if(i==4){
-                        ssli[i] = sslv.getSublistName5();
+                        if(sslv.getSublistName5() != null){
+                            ssli[i] = sslv.getSublistName5();
+                        }
+
                     }else if(i==5){
-                        ssli[i] = sslv.getSublistName6();
+                        if(sslv.getSublistName6() != null){
+                            ssli[i] = sslv.getSublistName6();
+                        }
+
                     }
                 }
                 ssli[size2-5] = sslv.getSceneId();
@@ -2078,6 +2244,160 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
     }
 
+
+    /**
+     * 获取所有要合并的下标、每个下标索要合并的行数、要跳过创建表格的下标
+     */
+    private Map getSceneScListCombineCoord(List<SubScListVo> voList, int size){
+        int sublistNameSize = size-4;//指标最大级数
+        HashMap<String, Object> resultMap = new HashMap<>();
+        Map<String, CombineCoordVo> map = new HashMap<>();
+        List<String>  skipCoordList= new ArrayList<>(); //要跳过的格子下标
+
+        for(int i=0; i<voList.size(); i++){
+            SubScListVo vo = voList.get(i);
+            if(sublistNameSize == 1){
+                //一级
+                String sublistName1 = vo.getSublistName1();
+                if(!isEmpty(sublistName1)){
+                    setCoord(map, sublistName1,i+",0", skipCoordList);
+                }
+
+            }else if(sublistNameSize == 2){
+                //二级
+                String sublistName1 = vo.getSublistName1();
+                String sublistName2 = vo.getSublistName2();
+
+                if(!isEmpty(sublistName1)){
+                    setCoord(map, sublistName1,i+",0", skipCoordList);
+                }
+                if(!isEmpty(sublistName2)){
+                    setCoord(map, sublistName2,i+",1", skipCoordList);
+                }
+
+            }else if(sublistNameSize == 3){
+                //三级
+                String sublistName1 = vo.getSublistName1();
+                String sublistName2 = vo.getSublistName2();
+                String sublistName3 = vo.getSublistName3();
+
+                if(!isEmpty(sublistName1)){
+                    setCoord(map, sublistName1,i+",0", skipCoordList);
+                }
+                if(!isEmpty(sublistName2)){
+                    setCoord(map, sublistName2,i+",1", skipCoordList);
+                }
+                if(!isEmpty(sublistName3)){
+                    setCoord(map, sublistName3,i+",2", skipCoordList);
+                }
+            }else if(sublistNameSize == 4){
+                //四级
+                String sublistName1 = vo.getSublistName1();
+                String sublistName2 = vo.getSublistName2();
+                String sublistName3 = vo.getSublistName3();
+                String sublistName4 = vo.getSublistName4();
+
+                if(!isEmpty(sublistName1)){
+                    setCoord(map, sublistName1,i+",0", skipCoordList);
+                }
+                if(!isEmpty(sublistName2)){
+                    setCoord(map, sublistName2,i+",1", skipCoordList);
+                }
+                if(!isEmpty(sublistName3)){
+                    setCoord(map, sublistName3,i+",2", skipCoordList);
+                }
+                if(!isEmpty(sublistName4)){
+                    setCoord(map, sublistName4,i+",3", skipCoordList);
+                }
+
+
+            }else if(sublistNameSize == 5){
+                //五级
+                String sublistName1 = vo.getSublistName1();
+                String sublistName2 = vo.getSublistName2();
+                String sublistName3 = vo.getSublistName3();
+                String sublistName4 = vo.getSublistName4();
+                String sublistName5 = vo.getSublistName5();
+
+                if(!isEmpty(sublistName1)){
+                    setCoord(map, sublistName1,i+",0", skipCoordList);
+                }
+                if(!isEmpty(sublistName2)){
+                    setCoord(map, sublistName2,i+",1", skipCoordList);
+                }
+                if(!isEmpty(sublistName3)){
+                    setCoord(map, sublistName3,i+",2", skipCoordList);
+                }
+                if(!isEmpty(sublistName4)){
+                    setCoord(map, sublistName4,i+",3", skipCoordList);
+                }
+                if(!isEmpty(sublistName5)){
+                    setCoord(map, sublistName5,i+",4", skipCoordList);
+                }
+
+
+            }else if(sublistNameSize == 6){
+                //六级
+                String sublistName1 = vo.getSublistName1();
+                String sublistName2 = vo.getSublistName2();
+                String sublistName3 = vo.getSublistName3();
+                String sublistName4 = vo.getSublistName4();
+                String sublistName5 = vo.getSublistName5();
+                String sublistName6 = vo.getSublistName6();
+
+                if(!isEmpty(sublistName1)){
+                    setCoord(map, sublistName1,i+",0", skipCoordList);
+                }
+                if(!isEmpty(sublistName2)){
+                    setCoord(map, sublistName2,i+",1", skipCoordList);
+                }
+                if(!isEmpty(sublistName3)){
+                    setCoord(map, sublistName3,i+",2", skipCoordList);
+                }
+                if(!isEmpty(sublistName4)){
+                    setCoord(map, sublistName4,i+",3", skipCoordList);
+                }
+                if(!isEmpty(sublistName5)){
+                    setCoord(map, sublistName5,i+",4", skipCoordList);
+                }
+                if(!isEmpty(sublistName6)){
+                    setCoord(map, sublistName6,i+",5", skipCoordList);
+                }
+
+            }
+
+        }
+
+        List<CombineCoordVo> combineCoordVoList = new ArrayList<>();
+
+        for(String k : map.keySet()){
+            combineCoordVoList.add(map.get(k));
+        }
+
+        resultMap.put("combineCoordList", combineCoordVoList);
+        resultMap.put("skipCoordList", skipCoordList);
+
+        return resultMap;
+
+    }
+
+
+    private void setCoord(Map<String, CombineCoordVo> map, String key, String coord, List<String>  skipCoordList){
+        CombineCoordVo value = map.get(key);
+        if(value != null){
+            //坐标不变,合并行数+1
+            value.setRepetitionNum(value.getRepetitionNum()+1);
+            skipCoordList.add(coord);
+        }else{
+            //新增
+            CombineCoordVo combineCoordVo = new CombineCoordVo();
+            combineCoordVo.setCoord(coord);
+            combineCoordVo.setRepetitionNum(1);
+            map.put(key,combineCoordVo);
+
+        }
+    }
+
     @Override
     public String selectProjectReportIdByAlgorithmId(String algorithmId) {
         SimulationManualProjectPo po = simulationProjectMapper.selectProjectReportIdByAlgorithmId(algorithmId);
@@ -2138,8 +2458,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
      * @param dataList
      */
     private void addDataList(PdfPTable pdfPTable, BaseFont font, String[] dataList){
-        for(String title : dataList){
-            PdfPCell pdfPCell = new PdfPCell(new Paragraph(title,defaultFont(font)));
+        for(String data : dataList){
+            PdfPCell pdfPCell = new PdfPCell(new Paragraph(data,defaultFont(font)));
             pdfPTable.addCell(pdfPCell);
 
         }

+ 3 - 3
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectMapper.java

@@ -41,11 +41,11 @@ public interface SimulationProjectMapper {
 
     int updateProjectNowRunState(SimulationManualProjectParam param);
 
-    List<AlgorithmPO> selectAlgorithmBaseInfoById(String id);
+    List<AlgorithmPO> selectAlgorithmBaseInfoById(AlgorithmPO algorithmPO);
 
     List<VehiclePO> selectVehicleBaseInfoById(String id);
 
-    List<ScenePackagePO> selectScenePackageBaseById(String id);
+    List<ScenePackagePO> selectScenePackageBaseById(ScenePackagePO scenePackagePO);
 
     List<ConfigSensorPO> selectVehicleSensor(String id);
 
@@ -79,7 +79,7 @@ public interface SimulationProjectMapper {
 
     SystemUserVo selectUserById(String id);
 
-    List<ConfigPO> selectConfigVehicle(String id);
+    List<ConfigPO> selectConfigVehicle(ConfigPO configPO);
 
     List<ConfigSensorPO> selectConfigSensor(String id);
 

+ 36 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SyetemUserSceneController.java

@@ -0,0 +1,36 @@
+package com.css.simulation.resource.scene.ctrl;
+
+import api.common.pojo.common.ResponseBodyVO;
+import api.common.pojo.po.scene.SystemUserScenePO;
+import com.css.simulation.resource.scene.service.SystemUserSceneService;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import java.util.List;
+
+//人员场景关联
+@RestController
+@RequestMapping("/SyetemUserScene")
+public class SyetemUserSceneController {
+
+    @Resource
+    SystemUserSceneService systemUserSceneService;
+
+    //查询列表
+    @PostMapping("/querySystemUserScene")
+    @ResponseBody
+    public ResponseBodyVO<List<SystemUserScenePO>> querySystemUserSceneList() {
+
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, null);
+    }
+
+    //新增用户关联场景
+    @PostMapping("/saveSceneNatural")
+    @ResponseBody
+    public ResponseBodyVO<String> saveSystemUserScene(@RequestBody List<SystemUserScenePO> list) {
+
+        systemUserSceneService.saveSystemUserScene(list);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+    }
+
+
+}

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneAccidentMapper.java

@@ -13,6 +13,8 @@ public interface SceneAccidentMapper {
     void saveSceneAccident(SceneAccidentPO params);
 
     List<SceneAccidentPO> querySceneAccidentList(SceneAccidentParam params);
+    List<SceneAccidentPO> querySceneAccidentListByXlk(SceneAccidentParam params);
+    List<SceneAccidentPO> querySceneAccidentListByBq(SceneAccidentParam params);
 
     void deleteSceneAccidentList(SceneAccidentPO params);
 

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneNaturalMapper.java

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+import java.util.Map;
 
 @Mapper
 @Repository
@@ -14,6 +15,8 @@ public interface SceneNaturalMapper {
     void saveSceneNatural(SceneNaturalPO params);
 
     List<SceneNaturalPO> querySceneNaturalList(SceneNaturalParam params);
+    List<SceneNaturalPO> querySceneNaturalListByBqAndXlk(Map<String,SceneNaturalParam> map);
+    List<SceneNaturalPO> querySceneNaturalListByBq(Map<String,SceneNaturalParam> map);
 
     void deleteSceneNatural(SceneNaturalPO params);
 

+ 1 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/StandardsRegulationsMapper.java

@@ -14,6 +14,7 @@ public interface StandardsRegulationsMapper {
     void saveStandardsRegulations(StandardsRegulationsPO params);
 
     List<StandardsRegulationsPO> queryStandardsRegulationsList(StandardsRegulationsParam params);
+    List<StandardsRegulationsPO> queryStandardsRegulationsListByBq(StandardsRegulationsParam params);
 
     void deleteStandardsRegulations(StandardsRegulationsPO params);
 

+ 26 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemUserSceneMapper.java

@@ -0,0 +1,26 @@
+package com.css.simulation.resource.scene.mapper;
+
+import api.common.pojo.po.scene.SystemUserScenePO;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Mapper
+@Repository
+public interface SystemUserSceneMapper {
+
+    void saveSystemUserScene(List<SystemUserScenePO> list);
+
+    List<SystemUserScenePO> querySystemUserScene(SystemUserScenePO po);
+
+    //场景列表展示时使用
+    List<String> querySystemUserSceneByType(SystemUserScenePO po);
+
+    //根据用户id删除
+    void deleteSystemUserSceneByUserId(SystemUserScenePO po);
+    //场景删除时关联删除关系表
+    void deleteSystemUserSceneBySceneId(SystemUserScenePO po);
+
+}

+ 35 - 4
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneAccidentService.java

@@ -15,6 +15,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import feign.Response;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.io.File;
@@ -31,6 +32,8 @@ public class SceneAccidentService {
 
     @Resource
     private FileDownService fileDownService;
+    @Resource
+    private SystemUserSceneService systemUserSceneService;
 
     /**
      * 获取交通事故场景数据:
@@ -43,7 +46,8 @@ public class SceneAccidentService {
         Response download = fileDownService.download(MI);
         // -------------------------------- label.json --------------------------------
         String json = download.body().toString();
-        ;
+       /* byte[] bytes=json.getBytes("UTF-8");
+        json=new String(bytes,3,bytes.length-3);*/
         ObjectMapper objMap = new ObjectMapper();
         JsonNode root = objMap.readTree(json);
         //判断场景名称唯一
@@ -163,8 +167,24 @@ public class SceneAccidentService {
     }
 
     public List<SceneAccidentPO> querySceneAccidentList(SceneAccidentParam params) {
+        if(ObjectUtil.isNotNull(params.getSceneName()) || (params.getSelfDriving()!=null&&params.getSelfDriving().size()>0)||(params.getTargetDriving()!=null&&params.getTargetDriving().size()>0)
+        || (params.getSelfReaction()!=null&&params.getSelfReaction().size()>0)||(params.getConflictType()!=null&&params.getConflictType().size()>0)||(params.getConflictBehavior()!=null&&params.getConflictBehavior().size()>0)||(params.getIds()!=null&&params.getIds().length>0)){
+            params.setXlk("1");
+        }
+        if(ObjectUtil.isNotNull(params.getRearEndCollision()) ||ObjectUtil.isNotNull(params.getCutIn()) ||ObjectUtil.isNotNull(params.getDriveCurve()) ||ObjectUtil.isNotNull(params.getCarConflict())){
+            params.setBq(1);
+        }
+        List<SceneAccidentPO> list = null;
+        if((params.getXlk().equals("1")&&params.getBq().equals(1))||(params.getXlk().equals("0")&&params.getBq().equals(0))||(params.getXlk().equals("1")&&params.getBq().equals(0))){
+            list = SceneAccidentMapper.querySceneAccidentList(params);
+        }/*else if(params.getXlk().equals("1")&&params.getBq().equals("0")){
+            list = SceneAccidentMapper.querySceneAccidentListByXlk(params);
+        }*/else if(params.getXlk().equals("0")&&params.getBq().equals(1)){
+            list = SceneAccidentMapper.querySceneAccidentListByBq(params);
+        }
+
         //追尾
-        if(ObjectUtil.isNotNull(params.getRearEndCollision())){
+       /* if(ObjectUtil.isNotNull(params.getRearEndCollision())){
             if(params.getConflictBehavior()!=null&&params.getConflictBehavior().size()>0){
                 List<String> ConflictBehavior= params.getConflictBehavior();
                 ConflictBehavior.add(params.getRearEndCollision());
@@ -207,8 +227,18 @@ public class SceneAccidentService {
                 conflictType.add(params.getCarConflict());
                 params.setConflictType(conflictType);
             }
-        }
-        List<SceneAccidentPO> list = SceneAccidentMapper.querySceneAccidentList(params);
+        }*/
+
+        //获取权限并赋值
+        /*List<String> listType=  systemUserSceneService.querySystemUserSceneByType(DictConstants.SCENE_ACCIDENT);
+        if(listType!=null&&listType.size()>0){
+            params.setAllIds(listType);
+        }else{
+            List<String> listA=new ArrayList<>();
+            listA.add("没有权限");
+            params.setAllIds(listA);
+        }*/
+
         for (SceneAccidentPO po: list) {
             if(po.getConflictBehavior().indexOf("追尾")>-1){
                 po.setLabel("追尾");
@@ -246,5 +276,6 @@ public class SceneAccidentService {
         params.setModifyTime(TimeUtil.getNowForMysql());
         params.setModifyUserId(AuthUtil.getCurrentUserId());
         SceneAccidentMapper.deleteSceneAccidentList(params);
+        //systemUserSceneService.deleteSystemUserSceneBySceneId(params.getAccidentId());
     }
 }

+ 50 - 85
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java

@@ -1,6 +1,7 @@
 package com.css.simulation.resource.scene.service;
 
 import api.common.pojo.common.ResponseBodyVO;
+import api.common.pojo.constants.DictConstants;
 import api.common.pojo.param.MinioParameter;
 import api.common.pojo.param.scene.SceneNaturalNewParam;
 import api.common.pojo.param.scene.SceneNaturalParam;
@@ -20,9 +21,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
 
 
 @Slf4j
@@ -31,6 +30,8 @@ public class SceneNaturalService {
 
     @Resource
     private SceneNaturalMapper sceneNaturalMapper;
+    @Resource
+    private SystemUserSceneService systemUserSceneService;
 
 
     @Resource
@@ -195,7 +196,13 @@ public class SceneNaturalService {
         String[][] trafficCondition = params.getTrafficCondition(); //交通状况
         String[][] selfBehavior = params.getSelfBehavior();//自车行为
         String[][] targetBehavior = params.getTargetBehavior(); //目标行为
-
+        //判断下拉选项是否为空
+        if(ObjectUtil.isNotNull(naturalName)||(naturalEnvironment!=null&&naturalEnvironment.length>0)||(road!=null&&road.length>0)
+        ||(infrastructure!=null&&infrastructure.length>0)||(temporaryOperation!=null&&temporaryOperation.length>0)||(trafficCondition!=null&&trafficCondition.length>0)||
+         (selfBehavior!=null&&selfBehavior.length>0)||(targetBehavior!=null&&targetBehavior.length>0)||(params.getIds()!=null&&params.getIds().length>0)){
+            po.setXlk("1");
+        }
+        SceneNaturalParam poBq = new SceneNaturalParam();
         String[][] highSpeed=params.getHighSpeed() ;//高速
         String[][] ramp=params.getRamp();//匝道
         String[][] tunnel=params.getTunnel();//隧道
@@ -203,25 +210,32 @@ public class SceneNaturalService {
         String[][] cutOut=params.getCutOut();//切出
         String[][] laneChange=params.getLaneChange();//变道
         String[][] turnAround=params.getTurnAround();//掉头
+        //判断标签是否为空
+        if((highSpeed!=null&&highSpeed.length>0)||(ramp!=null&&ramp.length>0)
+                ||(tunnel!=null&&tunnel.length>0)||(cutIn!=null&&cutIn.length>0)||(cutOut!=null&&cutOut.length>0)||
+                (laneChange!=null&&laneChange.length>0)||(turnAround!=null&&turnAround.length>0)){
+            po.setBq("1");
+        }
+
         if (highSpeed != null && highSpeed.length > 0) {
-            ParamUtil.arrConvertObj(highSpeed, po);
+            ParamUtil.arrConvertObj(highSpeed, poBq);
         }
         if (ramp != null && ramp.length > 0) {
-            ParamUtil.arrConvertObj(ramp, po);
+            ParamUtil.arrConvertObj(ramp, poBq);
         }
         if (tunnel != null && tunnel.length > 0) {
-            ParamUtil.arrConvertObj(tunnel, po);
+            ParamUtil.arrConvertObj(tunnel, poBq);
         }
         if (cutIn != null && cutIn.length > 0) {
-            ParamUtil.arrConvertObj(cutIn, po);
+            ParamUtil.arrConvertObj(cutIn, poBq);
         }
         if (cutOut != null && cutOut.length > 0) {
-            ParamUtil.arrConvertObj(cutOut, po);
+            ParamUtil.arrConvertObj(cutOut, poBq);
         } if (turnAround != null && turnAround.length > 0) {
-            ParamUtil.arrConvertObj(turnAround, po);
+            ParamUtil.arrConvertObj(turnAround, poBq);
         }
         if (laneChange != null && laneChange.length > 0) {
-            ParamUtil.arrConvertObj(laneChange, po);
+            ParamUtil.arrConvertObj(laneChange, poBq);
         }
 
 
@@ -268,80 +282,30 @@ public class SceneNaturalService {
             ParamUtil.arrConvertObj(targetBehavior, po);
         }
 
-        //处理标签
-     /*   //高速
-        if (ObjectUtil.isNotNull(params.getHighSpeed())) {
-            List<String> list=new ArrayList<>();
-            list.add("高速");
-            if(po.getRoadType()!=null&&po.getRoadType().size()>0){
-                list.addAll(po.getRoadType());
-            }
-            po.setRoadType(list);
-        }
-        //匝道
-        if (ObjectUtil.isNotNull(params.getRamp())) {
-            List<String> list=new ArrayList<>();
-            list.add("是");
-            if(po.getRamp()!=null&&po.getRamp().size()>0){
-                list.addAll(po.getRamp());
-            }
-            po.setRamp(list);
-        }
-        //隧道
-        if (ObjectUtil.isNotNull(params.getTunnel())) {
-            List<String> list=new ArrayList<>();
-            list.add("是");
-            if(po.getTunnel()!=null&&po.getTunnel().size()>0){
-                list.addAll(po.getTunnel());
-            }
-            po.setTunnel(list);
-        }
-        //切入
-        if (ObjectUtil.isNotNull(params.getCutIn())) {
-            List<String> list=new ArrayList<>();
-            list.add("机动车从左侧切入成功");
-            list.add("机动车从右侧切入成功");
-            if(po.getTargetBehavior()!=null&&po.getTargetBehavior().size()>0){
-                list.addAll(po.getTargetBehavior());
-            }
-            po.setTargetBehavior(list);
-        }
-        //切出
-        if (ObjectUtil.isNotNull(params.getCutOut())) {
-            List<String> list=new ArrayList<>();
-            list.add("机动车向左侧切出成功");
-            list.add("机动车向右侧切出成功");
-            if(po.getTargetBehavior()!=null&&po.getTargetBehavior().size()>0){
-                list.addAll(po.getTargetBehavior());
-            }
-            po.setTargetBehavior(list);
-        }
-        //掉头
-        if (ObjectUtil.isNotNull(params.getLaneChange())) {
-            List<String> list=new ArrayList<>();
-            list.add("直路掉头");
-            list.add("路口掉头");
-            if(po.getSelfBehavior()!=null&&po.getSelfBehavior().size()>0){
-                list.addAll(po.getSelfBehavior());
-            }
-            po.setSelfBehavior(list);
-        }
-        //变道
-        if (ObjectUtil.isNotNull(params.getTurnAround())) {
-            List<String> list=new ArrayList<>();
-            list.add("向左变道成功");
-            list.add("向右变道成功");
-            list.add("向左连续变道");
-            list.add("向右连续变道");
-            list.add("向左变道超车");
-            list.add("向右变道超车");
-            if(po.getSelfBehavior()!=null&&po.getSelfBehavior().size()>0){
-                list.addAll(po.getSelfBehavior());
-            }
-            po.setSelfBehavior(list);
-        }
-*/
-        List<SceneNaturalPO> list = sceneNaturalMapper.querySceneNaturalList(po);
+     //获取权限并赋值
+     /* List<String> listType=  systemUserSceneService.querySystemUserSceneByType(DictConstants.SCENE_NATURAL);
+        if(listType!=null&&listType.size()>0){
+            po.setAllIds(listType);
+        }else{
+            List<String> listA=new ArrayList<>();
+            listA.add("没有权限");
+            po.setAllIds(listA);
+        }*/
+         Map<String,SceneNaturalParam> map=new HashMap<String,SceneNaturalParam>();
+         map.put("po",po);
+         map.put("poBq",poBq);
+        //List<SceneNaturalPO> list = sceneNaturalMapper.querySceneNaturalList(po);
+        //只有标签,或下拉框,或者两者都为空
+        List<SceneNaturalPO> list=null;
+        if((po.getXlk().equals("0")&&po.getBq().equals("0"))||(po.getXlk().equals("1")&&po.getBq().equals("0"))){
+            list = sceneNaturalMapper.querySceneNaturalList(po);
+        }else if((po.getXlk().equals("0")&&po.getBq().equals("1"))) {
+             list = sceneNaturalMapper.querySceneNaturalListByBq(map);
+        }else{
+            list = sceneNaturalMapper.querySceneNaturalListByBqAndXlk(map);
+        }
+        //list = sceneNaturalMapper.querySceneNaturalListByBq(map);
+        //List<SceneNaturalPO> list = sceneNaturalMapper.querySceneNaturalList(map);
         for (SceneNaturalPO vo : list) {
             if (vo.getRoadType().equals("高速")) {
                 if (ObjectUtil.isNull(vo.getLabel())) {
@@ -401,6 +365,7 @@ public class SceneNaturalService {
         params.setModifyTime(TimeUtil.getNowForMysql());
         params.setModifyUserId(AuthUtil.getCurrentUserId());
         sceneNaturalMapper.deleteSceneNatural(params);
+       // systemUserSceneService.deleteSystemUserSceneBySceneId(params.getNaturalId());
     }
     public Integer querySceneNumBySy() {
         SceneNaturalParam params=new SceneNaturalParam();

+ 30 - 49
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/StandardsRegulationsService.java

@@ -1,6 +1,7 @@
 package com.css.simulation.resource.scene.service;
 
 import api.common.pojo.common.ResponseBodyVO;
+import api.common.pojo.constants.DictConstants;
 import api.common.pojo.param.MinioParameter;
 import api.common.pojo.param.scene.StandardsRegulationsParam;
 import api.common.pojo.po.scene.SceneAccidentPO;
@@ -30,7 +31,8 @@ public class StandardsRegulationsService {
 
     @Resource
     private FileDownService fileDownService;
-
+    @Resource
+    private SystemUserSceneService systemUserSceneService;
     /**
      * 获取标准法规场景数据:
      */
@@ -87,56 +89,25 @@ public class StandardsRegulationsService {
 
     //查看列表
     public List<StandardsRegulationsPO> queryStandardsRegulationsList(StandardsRegulationsParam params) {
-        //
-        /*if(ObjectUtil.isNotNull(params.getISO())){
-            if(params.getRegulationType()!=null&&params.getRegulationType().size()>0){
-                List<String> regulationType= params.getRegulationType();
-                regulationType.add(params.getISO());
-                params.setRegulationType(regulationType);
-            }else{
-                List<String> regulationType=new ArrayList<>();
-                regulationType.add(params.getISO());
-                params.setRegulationType(regulationType);
-            }
+        if(ObjectUtil.isNotNull(params.getSceneName()) || (params.getRegulationType()!=null&&params.getRegulationType().size()>0)||ObjectUtil.isNotNull(params.getStandardType())||ObjectUtil.isNotNull(params.getStandardType())
+                ||(params.getIds()!=null&&params.getIds().length>0)){
+            params.setXlk("1");
         }
-        //
-        if(ObjectUtil.isNotNull(params.getGB())){
-            if(params.getRegulationType()!=null&&params.getRegulationType().size()>0){
-                List<String> regulationType= params.getRegulationType();
-                regulationType.add(params.getGB());
-                params.setRegulationType(regulationType);
-            }else{
-                List<String> regulationType=new ArrayList<>();
-                regulationType.add(params.getGB());
-                params.setRegulationType(regulationType);
-            }
+        if(params.getLabel()!=null&&params.getLabel().size()>0){
+            params.setBq("1");
         }
-        //
-        if(ObjectUtil.isNotNull(params.getENCAP())){
-            if(params.getRegulationType()!=null&&params.getRegulationType().size()>0){
-                List<String> regulationType= params.getRegulationType();
-                regulationType.add(params.getENCAP());
-                params.setRegulationType(regulationType);
-            }else{
-                List<String> regulationType=new ArrayList<>();
-                regulationType.add(params.getENCAP());
-                params.setRegulationType(regulationType);
-            }
+        List<StandardsRegulationsPO> list =null;
+
+        if((params.getXlk().equals("1")&&params.getBq().equals("1"))||(params.getXlk().equals("0")&&params.getBq().equals("0"))||(params.getXlk().equals("1")&&params.getBq().equals("0"))){
+            list =  standardsRegulationsMapper.queryStandardsRegulationsList(params);
+        }/*else if(params.getXlk().equals("1")&&params.getBq().equals("0")){
+            list =  standardsRegulationsMapper.queryStandardsRegulationsList(params);
+        }*/else if(params.getXlk().equals("0")&&params.getBq().equals("1")){
+            list =  standardsRegulationsMapper.queryStandardsRegulationsListByBq(params);
         }
-        //
-        if(ObjectUtil.isNotNull(params.getCNCAP())){
-            if(params.getRegulationType()!=null&&params.getRegulationType().size()>0){
-                List<String> regulationType= params.getRegulationType();
-                regulationType.add(params.getCNCAP());
-                params.setRegulationType(regulationType);
-            }else{
-                List<String> regulationType=new ArrayList<>();
-                regulationType.add(params.getCNCAP());
-                params.setRegulationType(regulationType);
-            }
-        }*/
 
-        if(params.getLabel()!=null&&params.getLabel().size()>0){
+
+       /* if(params.getLabel()!=null&&params.getLabel().size()>0){
             if(params.getRegulationType()!=null&&params.getRegulationType().size()>0){
                 List<String> regulationType= params.getRegulationType();
                 regulationType.addAll(params.getLabel());
@@ -146,8 +117,17 @@ public class StandardsRegulationsService {
                 regulationType.addAll(params.getLabel());
                 params.setRegulationType(regulationType);
             }
-        }
-        List<StandardsRegulationsPO> list = standardsRegulationsMapper.queryStandardsRegulationsList(params);
+        }*/
+
+        //获取权限并赋值
+      /*  List<String> listType=  systemUserSceneService.querySystemUserSceneByType(DictConstants.SCENE_STANDARD);
+        if(listType!=null&&listType.size()>0){
+            params.setAllIds(listType);
+        }else{
+            List<String> listA=new ArrayList<>();
+            listA.add("没有权限");
+            params.setAllIds(listA);
+        }*/
         return list;
     }
 
@@ -156,5 +136,6 @@ public class StandardsRegulationsService {
         params.setModifyTime(TimeUtil.getNowForMysql());
         params.setModifyUserId(AuthUtil.getCurrentUserId());
         standardsRegulationsMapper.deleteStandardsRegulations(params);
+       // systemUserSceneService.deleteSystemUserSceneBySceneId(params.getRegulationsId());
     }
 }

+ 71 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SystemUserSceneService.java

@@ -0,0 +1,71 @@
+package com.css.simulation.resource.scene.service;
+
+
+import api.common.pojo.po.scene.SystemUserScenePO;
+import api.common.util.TimeUtil;
+import com.css.simulation.resource.common.utils.AuthUtil;
+import com.css.simulation.resource.scene.mapper.SystemUserSceneMapper;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Slf4j
+@Service
+public class SystemUserSceneService {
+
+    @Resource
+    private SystemUserSceneMapper systemUserSceneMapper;
+
+    /**
+     * 人员场景关联表数据录入
+     */
+    @SneakyThrows
+    public void saveSystemUserScene(List<SystemUserScenePO> list) {
+        for (SystemUserScenePO po:list) {
+            po.setUserId(AuthUtil.getCurrentUserId());
+            po.setIsDeleted("0");
+            po.setCreateUserId(AuthUtil.getCurrentUserId());
+            po.setCreateTime(TimeUtil.getNowForMysql());
+            po.setModifyTime(TimeUtil.getNowForMysql());
+        }
+        systemUserSceneMapper.saveSystemUserScene(list);
+    }
+
+    //场景列表展示时使用
+    @SneakyThrows
+    public  List<String> querySystemUserSceneByType(String type) {
+        SystemUserScenePO po=new SystemUserScenePO();
+        po.setSceneType(type);
+        po.setUserId(AuthUtil.getCurrentUserId());
+        return systemUserSceneMapper.querySystemUserSceneByType(po);
+    }
+
+    @SneakyThrows
+    public List<SystemUserScenePO> querySystemUserScene(SystemUserScenePO po) {
+        po.setUserId(AuthUtil.getCurrentUserId());
+       return systemUserSceneMapper.querySystemUserScene(po);
+    }
+    //根据用户id删除
+    @SneakyThrows
+    public void deleteSystemUserSceneByUserId() {
+        SystemUserScenePO po=new SystemUserScenePO();
+        po.setUserId(AuthUtil.getCurrentUserId());
+        po.setIsDeleted("1");
+        po.setModifyTime(TimeUtil.getNowForMysql());
+        po.setModifyUserId(AuthUtil.getCurrentUserId());
+        systemUserSceneMapper.deleteSystemUserSceneByUserId(po);
+    }
+    //场景删除时关联删除关系表
+    @SneakyThrows
+    public void deleteSystemUserSceneBySceneId(String sceneId) {
+        SystemUserScenePO po=new SystemUserScenePO();
+        po.setSceneId(sceneId);
+        po.setIsDeleted("1");
+        po.setModifyTime(TimeUtil.getNowForMysql());
+        po.setModifyUserId(AuthUtil.getCurrentUserId());
+        systemUserSceneMapper.deleteSystemUserSceneBySceneId(po);
+    }
+}

+ 16 - 7
simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml

@@ -222,13 +222,16 @@
     </update>
 
     <!--获取算法基本信息 /*where a.share = '0' and a.is_deleted = '0'*/-->
-    <select id="selectAlgorithmBaseInfoById" parameterType="string" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
+    <select id="selectAlgorithmBaseInfoById" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
         select a.id, a.algorithm_name, a.description
         from algorithm a
-        where a.is_deleted = '0'
+        where a.share = '0' and a.is_deleted = '0'
         <if test="id != null and id != ''">
             and a.id = #{id,jdbcType=VARCHAR}
         </if>
+        <if test="createUserId != null and createUserId !=''">
+            and create_user_id=#{createUserId,jdbcType=VARCHAR}
+        </if>
     </select>
 
     <!--获取车辆基本信息-->
@@ -242,13 +245,16 @@
     </select>
 
     <!--获取车辆配置信息-->
-    <select id="selectConfigVehicle" parameterType="string" resultType="api.common.pojo.po.model.ConfigPO">
-        select id, config_name, vehicle_id
+    <select id="selectConfigVehicle"  resultType="api.common.pojo.po.model.ConfigPO">
+        select id, config_name, vehicle_id, description
         from model_config
         where share = '0' and is_deleted = '0'
         <if test="id != null and id != ''">
             and id = #{id,jdbcType=VARCHAR}
         </if>
+        <if test="createUserId != null and createUserId !=''">
+            and create_user_id=#{createUserId,jdbcType=VARCHAR}
+        </if>
     </select>
 
     <!--查询车辆配置传感器信息-->
@@ -263,12 +269,15 @@
     </select>
 
     <!--获取场景包基本信息-->
-    <select id="selectScenePackageBaseById" parameterType="string" resultType="api.common.pojo.po.scene.ScenePackagePO">
+    <select id="selectScenePackageBaseById" resultType="api.common.pojo.po.scene.ScenePackagePO">
         select a.package_id,a.package_name, a.scene_num
         from scene_package a
         where a.share = '0' and a.is_deleted = '0'
-        <if test="id != null and id != ''">
-            and a.package_id = #{id,jdbcType=VARCHAR}
+        <if test="packageId != null and packageId != ''">
+            and a.package_id = #{packageId,jdbcType=VARCHAR}
+        </if>
+        <if test="createUserId != null and createUserId !=''">
+            and create_user_id=#{createUserId,jdbcType=VARCHAR}
         </if>
     </select>
 

+ 149 - 2
simulation-resource-server/src/main/resources/mapper/scene/SceneAccidentMapper.xml

@@ -26,13 +26,152 @@
         create_user_id,create_time,modify_user_id,modify_time,
         is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
         json_address
+        from(
+        select
+        accident_id,scene_name,self_driving,target_driving,
+        self_reaction,conflict_behavior,conflict_type,
+        create_user_id,create_time,modify_user_id,modify_time,
+        is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
+        json_address
         from simulation.scene_accident
         <where>
-            is_deleted = '0'
             <if test="sceneName != null and sceneName != ''">
                 and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
             </if>
+            <if test="selfDriving != null and selfDriving.size()>0 ">
+                and self_driving in
+                <foreach collection="selfDriving" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="targetDriving != null and targetDriving.size()>0">
+                and target_driving in
+                <foreach collection="targetDriving" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="selfReaction != null and selfReaction.size()>0">
+                and self_reaction in
+                <foreach collection="selfReaction" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="conflictBehavior != null and conflictBehavior.size()>0">
+                and conflict_behavior in
+                <foreach collection="conflictBehavior" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="conflictType != null and conflictType.size()>0">
+                and conflict_type in
+                <foreach collection="conflictType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="ids != null and ids.length>0">
+                and accident_id in
+                <foreach collection="ids" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+         <if test="bq != null and bq.equals(1)">
+            union
+            select
+            accident_id,scene_name,self_driving,target_driving,
+            self_reaction,conflict_behavior,conflict_type,
+            create_user_id,create_time,modify_user_id,modify_time,
+            is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
+            json_address
+            from simulation.scene_accident
+            <where>
+                <if test="rearEndCollision != null and rearEndCollision!=''">
+                    or conflict_behavior =#{rearEndCollision}
+                </if>
+                <if test="cutIn != null and cutIn!=''">
+                    or target_driving =#{cutIn}
+                </if>
+                <if test="driveCurve != null and driveCurve!=''">
+                    or target_driving =#{driveCurve}
+                </if>
+                <if test="carConflict != null and carConflict!=''">
+                    or conflict_type =#{carConflict}
+                </if>
+            </where>
+        </if>
+
+        ) a where
+        a.is_deleted = '0'
+        <if test="AllIds != null and AllIds.size()>0">
+            and a.accident_id in
+            <foreach collection="AllIds" item="item" index="index"
+                     separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+
+        order by a.modify_time desc
+    </select>
+    <select id="querySceneAccidentListByBq" parameterType="api.common.pojo.param.scene.SceneAccidentParam"
+            resultType="api.common.pojo.po.scene.SceneAccidentPO">
+        select
+        accident_id,scene_name,self_driving,target_driving,
+        self_reaction,conflict_behavior,conflict_type,
+        create_user_id,create_time,modify_user_id,modify_time,
+        is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
+        json_address
+        from( select
+        accident_id,scene_name,self_driving,target_driving,
+        self_reaction,conflict_behavior,conflict_type,
+        create_user_id,create_time,modify_user_id,modify_time,
+        is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
+        json_address
+        from simulation.scene_accident
+        <where>
+            <if test="rearEndCollision != null and rearEndCollision!=''">
+                conflict_behavior =#{rearEndCollision}
+            </if>
+            <if test="cutIn != null and cutIn!=''">
+                or target_driving =#{cutIn}
+            </if>
+            <if test="driveCurve != null and driveCurve!=''">
+                or target_driving =#{driveCurve}
+            </if>
+            <if test="carConflict != null and carConflict!=''">
+                or conflict_type =#{carConflict}
+            </if>
+        </where>
+        ) a where a.is_deleted = '0'
+        <if test="AllIds != null and AllIds.size()>0">
+            and a.accident_id in
+            <foreach collection="AllIds" item="item" index="index"
+                     separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        order by a.modify_time desc
+    </select>
 
+    <select id="querySceneAccidentListByXlk" parameterType="api.common.pojo.param.scene.SceneAccidentParam"
+            resultType="api.common.pojo.po.scene.SceneAccidentPO">
+        select
+        accident_id,scene_name,self_driving,target_driving,
+        self_reaction,conflict_behavior,conflict_type,
+        create_user_id,create_time,modify_user_id,modify_time,
+        is_deleted,share,video_address,video_preview,osgb_address,xml_address,xodr_address,
+        json_address
+        from simulation.scene_accident
+        <where>
+            is_deleted = '0'
+            <if test="sceneName != null and sceneName != ''">
+                and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
+            </if>
             <if test="selfDriving != null and selfDriving.size()>0 ">
                 and self_driving in
                 <foreach collection="selfDriving" item="item" index="index"
@@ -75,8 +214,16 @@
                     #{item}
                 </foreach>
             </if>
-            order by modify_time desc
+            <if test="AllIds != null and AllIds.size()>0">
+                and accident_id in
+                <foreach collection="AllIds" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
+
+        order by modify_time desc
     </select>
 
     <update id="deleteSceneAccidentList" parameterType="api.common.pojo.po.scene.SceneAccidentPO">

+ 893 - 0
simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml

@@ -312,6 +312,13 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="AllIds != null and AllIds.size()>0">
+                and natural_id in
+                <foreach collection="AllIds" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
             order by modify_time desc
         </where>
     </select>
@@ -365,4 +372,890 @@
             </if>
         </where>
     </select>
+
+
+    <select id="querySceneNaturalListByBqAndXlk" parameterType="api.common.pojo.param.scene.SceneNaturalParam"
+            resultType="api.common.pojo.po.scene.SceneNaturalPO">
+        select
+        natural_id,natural_name,weather,backlight,light_change,road_type,
+        road_matrrial,driveway_num,driveway_type,road_flatness,road_curvature,
+        ramp,intersection_type,plane_intersection,bridge,tunnel,speed_limit,
+        min_speed_limit,no_entry,no_stopping,left_lane_line,right_lane_line,
+        conductor_marking,pedestrian_crossing,traffic_light,deceleration_marking,
+        pavement_condition,natural_disaster,road_safety_signs,safety_warning_board,
+        traffic_accident,patency,special_vehicle_yield,violation,double_flashing_car,
+        self_behavior,target_behavior,create_user_id,create_time,modify_user_id,
+        modify_time,is_deleted,share,video_address,osgb_address,
+        xodr_address,xosc_address,json_address,video_preview
+        from (
+        select
+        natural_id,natural_name,weather,backlight,light_change,road_type,
+        road_matrrial,driveway_num,driveway_type,road_flatness,road_curvature,
+        ramp,intersection_type,plane_intersection,bridge,tunnel,speed_limit,
+        min_speed_limit,no_entry,no_stopping,left_lane_line,right_lane_line,
+        conductor_marking,pedestrian_crossing,traffic_light,deceleration_marking,
+        pavement_condition,natural_disaster,road_safety_signs,safety_warning_board,
+        traffic_accident,patency,special_vehicle_yield,violation,double_flashing_car,
+        self_behavior,target_behavior,create_user_id,create_time,modify_user_id,
+        modify_time,is_deleted,share,video_address,osgb_address,
+        xodr_address,xosc_address,json_address,video_preview
+        from simulation.scene_natural
+        <where>
+            <if test="po.naturalName != null and po.naturalName != ''">
+                natural_name like CONCAT('%',#{po.naturalName,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="po.weather != null and po.weather.size()>0 ">
+                and weather in
+                <foreach collection="po.weather" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.backlight != null and po.backlight.size()>0">
+                and backlight in
+                <foreach collection="po.backlight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.lightChange != null and po.lightChange.size()>0">
+                and light_change in
+                <foreach collection="po.lightChange" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.roadType != null and po.roadType.size()>0">
+                and road_type in
+                <foreach collection="po.roadType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.roadMatrrial != null and po.roadMatrrial.size()>0">
+                and road_matrrial in
+                <foreach collection="po.roadMatrrial" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.drivewayNum != null and po.drivewayNum.size()>0">
+                and driveway_num in
+                <foreach collection="po.drivewayNum" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.drivewayType != null and po.drivewayType.size()>0">
+                and driveway_type in
+                <foreach collection="po.drivewayType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.roadFlatness != null and po.roadFlatness.size()>0">
+                and road_flatness in
+                <foreach collection="po.roadFlatness" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.roadCurvature != null and po.roadCurvature.size()>0">
+                and road_curvature in
+                <foreach collection="po.roadCurvature" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.ramp != null and po.ramp.size()>0">
+                and ramp in
+                <foreach collection="po.ramp" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.intersectionType != null and po.intersectionType.size()>0">
+                and intersection_type in
+                <foreach collection="po.intersectionType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.planeIntersection != null and po.planeIntersection.size()>0">
+                and plane_intersection in
+                <foreach collection="po.planeIntersection" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.bridge != null and po.bridge.size()>0">
+                and bridge in
+                <foreach collection="po.bridge" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.tunnel != null and po.tunnel.size()>0">
+                and tunnel in
+                <foreach collection="po.tunnel" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.speedLimit != null and po.speedLimit.size()>0">
+                and speed_limit in
+                <foreach collection="po.speedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.minSpeedLimit != null and po.minSpeedLimit.size()>0">
+                and min_speed_limit in
+                <foreach collection="po.minSpeedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.noEntry != null and po.noEntry.size()>0">
+                and no_entry in
+                <foreach collection="po.noEntry" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.noStopping != null and po.noStopping.size()>0">
+                and no_stopping in
+                <foreach collection="po.noStopping" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.leftLaneLine != null and po.leftLaneLine.size()>0">
+                and left_lane_line in
+                <foreach collection="po.leftLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.rightLaneLine != null and po.rightLaneLine.size()>0">
+                and right_lane_line in
+                <foreach collection="po.rightLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.conductorMarking != null and po.conductorMarking.size()>0">
+                and conductor_marking in
+                <foreach collection="po.conductorMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.pedestrianCrossing != null and po.pedestrianCrossing.size()>0">
+                and pedestrian_crossing in
+                <foreach collection="po.pedestrianCrossing" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.trafficLight != null and po.trafficLight.size()>0">
+                and traffic_light in
+                <foreach collection="po.trafficLight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.decelerationMarking != null and po.decelerationMarking.size()>0">
+                and deceleration_marking in
+                <foreach collection="po.decelerationMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.pavementCondition != null and po.pavementCondition.size()>0">
+                and pavement_condition in
+                <foreach collection="po.pavementCondition" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.naturalDisaster != null and po.naturalDisaster.size()>0">
+                and natural_disaster in
+                <foreach collection="po.naturalDisaster" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.roadSafetySigns != null and po.roadSafetySigns.size()>0">
+                and road_safety_signs in
+                <foreach collection="po.roadSafetySigns" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.safetyWarningBoard != null and po.safetyWarningBoard.size()>0">
+                and safety_warning_board in
+                <foreach collection="po.safetyWarningBoard" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.trafficAccident != null and po.trafficAccident.size()>0">
+                and traffic_accident in
+                <foreach collection="po.trafficAccident" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.patency != null and po.patency.size()>0">
+                and patency in
+                <foreach collection="po.patency" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.specialVehicleYield != null and po.specialVehicleYield.size()>0">
+                and special_vehicle_yield in
+                <foreach collection="po.specialVehicleYield" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.violation != null and po.violation.size()>0">
+                and violation in
+                <foreach collection="po.violation" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.doubleFlashingCar != null and po.doubleFlashingCar.size()>0">
+                and double_flashing_car in
+                <foreach collection="po.doubleFlashingCar" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.selfBehavior != null and po.selfBehavior.size()>0">
+                and
+                <foreach collection="po.selfBehavior" item="item" index="index"
+                         separator=" or " open="(" close=")">
+                    self_behavior like CONCAT('%,',#{item},',%')
+                    or self_behavior like CONCAT('%,',#{item}) or
+                    self_behavior like CONCAT(#{item},',%') or
+                    self_behavior=#{item}
+                </foreach>
+
+            </if>
+            <if test="po.targetBehavior != null and po.targetBehavior.size()>0">
+                and
+                <foreach collection="po.targetBehavior" item="item" index="index"
+                         separator=" or " open="(" close=")">
+                    target_behavior like CONCAT('%,',#{item},',%')
+                    or target_behavior like CONCAT('%,',#{item}) or
+                    target_behavior like CONCAT(#{item},',%') or
+                    target_behavior=#{item}
+                </foreach>
+
+            </if>
+            <if test="po.ids != null and po.ids.length>0">
+                and natural_id in
+                <foreach collection="po.ids" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        union
+        select
+        natural_id,natural_name,weather,backlight,light_change,road_type,
+        road_matrrial,driveway_num,driveway_type,road_flatness,road_curvature,
+        ramp,intersection_type,plane_intersection,bridge,tunnel,speed_limit,
+        min_speed_limit,no_entry,no_stopping,left_lane_line,right_lane_line,
+        conductor_marking,pedestrian_crossing,traffic_light,deceleration_marking,
+        pavement_condition,natural_disaster,road_safety_signs,safety_warning_board,
+        traffic_accident,patency,special_vehicle_yield,violation,double_flashing_car,
+        self_behavior,target_behavior,create_user_id,create_time,modify_user_id,
+        modify_time,is_deleted,share,video_address,osgb_address,
+        xodr_address,xosc_address,json_address,video_preview
+        from simulation.scene_natural
+        <where>
+            <if test="poBq.naturalName != null and poBq.naturalName != ''">
+                or natural_name like CONCAT('%',#{poBq.naturalName,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="poBq.weather != null and poBq.weather.size()>0 ">
+                or weather in
+                <foreach collection="poBq.weather" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.backlight != null and poBq.backlight.size()>0">
+                or backlight in
+                <foreach collection="poBq.backlight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.lightChange != null and poBq.lightChange.size()>0">
+                or light_change in
+                <foreach collection="poBq.lightChange" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadType != null and poBq.roadType.size()>0">
+                or road_type in
+                <foreach collection="poBq.roadType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadMatrrial != null and poBq.roadMatrrial.size()>0">
+                or road_matrrial in
+                <foreach collection="poBq.roadMatrrial" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.drivewayNum != null and poBq.drivewayNum.size()>0">
+                or driveway_num in
+                <foreach collection="poBq.drivewayNum" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.drivewayType != null and poBq.drivewayType.size()>0">
+                or driveway_type in
+                <foreach collection="poBq.drivewayType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadFlatness != null and poBq.roadFlatness.size()>0">
+                or road_flatness in
+                <foreach collection="poBq.roadFlatness" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadCurvature != null and poBq.roadCurvature.size()>0">
+                or road_curvature in
+                <foreach collection="poBq.roadCurvature" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.ramp != null and poBq.ramp.size()>0">
+                or ramp in
+                <foreach collection="poBq.ramp" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.intersectionType != null and poBq.intersectionType.size()>0">
+                or intersection_type in
+                <foreach collection="poBq.intersectionType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.planeIntersection != null and poBq.planeIntersection.size()>0">
+                or plane_intersection in
+                <foreach collection="poBq.planeIntersection" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.bridge != null and poBq.bridge.size()>0">
+                or bridge in
+                <foreach collection="poBq.bridge" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.tunnel != null and poBq.tunnel.size()>0">
+                or tunnel in
+                <foreach collection="poBq.tunnel" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.speedLimit != null and poBq.speedLimit.size()>0">
+                or speed_limit in
+                <foreach collection="poBq.speedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.minSpeedLimit != null and poBq.minSpeedLimit.size()>0">
+                or min_speed_limit in
+                <foreach collection="poBq.minSpeedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.noEntry != null and poBq.noEntry.size()>0">
+                or no_entry in
+                <foreach collection="poBq.noEntry" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.noStopping != null and poBq.noStopping.size()>0">
+                or no_stopping in
+                <foreach collection="poBq.noStopping" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.leftLaneLine != null and poBq.leftLaneLine.size()>0">
+                or left_lane_line in
+                <foreach collection="poBq.leftLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.rightLaneLine != null and poBq.rightLaneLine.size()>0">
+                or right_lane_line in
+                <foreach collection="poBq.rightLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.conductorMarking != null and poBq.conductorMarking.size()>0">
+                or conductor_marking in
+                <foreach collection="poBq.conductorMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.pedestrianCrossing != null and poBq.pedestrianCrossing.size()>0">
+                or pedestrian_crossing in
+                <foreach collection="poBq.pedestrianCrossing" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.trafficLight != null and poBq.trafficLight.size()>0">
+                or traffic_light in
+                <foreach collection="poBq.trafficLight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.decelerationMarking != null and poBq.decelerationMarking.size()>0">
+                or deceleration_marking in
+                <foreach collection="poBq.decelerationMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.pavementCondition != null and poBq.pavementCondition.size()>0">
+                or pavement_condition in
+                <foreach collection="poBq.pavementCondition" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.naturalDisaster != null and poBq.naturalDisaster.size()>0">
+                or natural_disaster in
+                <foreach collection="poBq.naturalDisaster" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadSafetySigns != null and poBq.roadSafetySigns.size()>0">
+                or road_safety_signs in
+                <foreach collection="poBq.roadSafetySigns" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.safetyWarningBoard != null and poBq.safetyWarningBoard.size()>0">
+                or safety_warning_board in
+                <foreach collection="poBq.safetyWarningBoard" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.trafficAccident != null and poBq.trafficAccident.size()>0">
+                or traffic_accident in
+                <foreach collection="poBq.trafficAccident" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.patency != null and poBq.patency.size()>0">
+                or patency in
+                <foreach collection="poBq.patency" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.specialVehicleYield != null and poBq.specialVehicleYield.size()>0">
+                or special_vehicle_yield in
+                <foreach collection="poBq.specialVehicleYield" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.violation != null and poBq.violation.size()>0">
+                or violation in
+                <foreach collection="poBq.violation" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.doubleFlashingCar != null and poBq.doubleFlashingCar.size()>0">
+                or double_flashing_car in
+                <foreach collection="poBq.doubleFlashingCar" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.selfBehavior != null and poBq.selfBehavior.size()>0">
+                or
+                <foreach collection="poBq.selfBehavior" item="item" index="index"
+                         separator=" or " open="(" close=")">
+                    self_behavior like CONCAT('%,',#{item},',%')
+                    or self_behavior like CONCAT('%,',#{item}) or
+                    self_behavior like CONCAT(#{item},',%') or
+                    self_behavior=#{item}
+                </foreach>
+
+            </if>
+            <if test="poBq.targetBehavior != null and poBq.targetBehavior.size()>0">
+                or
+                <foreach collection="poBq.targetBehavior" item="item" index="index"
+                         separator=" or " open="(" close=")">
+                    target_behavior like CONCAT('%,',#{item},',%')
+                    or target_behavior like CONCAT('%,',#{item}) or
+                    target_behavior like CONCAT(#{item},',%') or
+                    target_behavior=#{item}
+                </foreach>
+
+            </if>
+            <if test="poBq.ids != null and poBq.ids.length>0">
+                or natural_id in
+                <foreach collection="poBq.ids" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        )a where
+        a.is_deleted = '0'
+        <if test="poBq.AllIds != null and poBq.AllIds.size()>0">
+            and a.natural_id in
+            <foreach collection="poBq.AllIds" item="item" index="index"
+                     separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        order by a.modify_time desc
+
+    </select>
+    <select id="querySceneNaturalListByBq" parameterType="java.util.Map"
+            resultType="api.common.pojo.po.scene.SceneNaturalPO">
+        select
+        natural_id,natural_name,weather,backlight,light_change,road_type,
+        road_matrrial,driveway_num,driveway_type,road_flatness,road_curvature,
+        ramp,intersection_type,plane_intersection,bridge,tunnel,speed_limit,
+        min_speed_limit,no_entry,no_stopping,left_lane_line,right_lane_line,
+        conductor_marking,pedestrian_crossing,traffic_light,deceleration_marking,
+        pavement_condition,natural_disaster,road_safety_signs,safety_warning_board,
+        traffic_accident,patency,special_vehicle_yield,violation,double_flashing_car,
+        self_behavior,target_behavior,create_user_id,create_time,modify_user_id,
+        modify_time,is_deleted,share,video_address,osgb_address,
+        xodr_address,xosc_address,json_address,video_preview  from (
+        select
+        natural_id,natural_name,weather,backlight,light_change,road_type,
+        road_matrrial,driveway_num,driveway_type,road_flatness,road_curvature,
+        ramp,intersection_type,plane_intersection,bridge,tunnel,speed_limit,
+        min_speed_limit,no_entry,no_stopping,left_lane_line,right_lane_line,
+        conductor_marking,pedestrian_crossing,traffic_light,deceleration_marking,
+        pavement_condition,natural_disaster,road_safety_signs,safety_warning_board,
+        traffic_accident,patency,special_vehicle_yield,violation,double_flashing_car,
+        self_behavior,target_behavior,create_user_id,create_time,modify_user_id,
+        modify_time,is_deleted,share,video_address,osgb_address,
+        xodr_address,xosc_address,json_address,video_preview
+        from simulation.scene_natural
+        <where>
+            <if test="poBq.naturalName != null and poBq.naturalName != ''">
+                 natural_name like CONCAT('%',#{poBq.naturalName,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="poBq.weather != null and poBq.weather.size()>0 ">
+                or weather in
+                <foreach collection="poBq.weather" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.backlight != null and poBq.backlight.size()>0">
+                or backlight in
+                <foreach collection="poBq.backlight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.lightChange != null and poBq.lightChange.size()>0">
+                or light_change in
+                <foreach collection="poBq.lightChange" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadType != null and poBq.roadType.size()>0">
+                or road_type in
+                <foreach collection="poBq.roadType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadMatrrial != null and poBq.roadMatrrial.size()>0">
+                or road_matrrial in
+                <foreach collection="poBq.roadMatrrial" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.drivewayNum != null and poBq.drivewayNum.size()>0">
+                or driveway_num in
+                <foreach collection="poBq.drivewayNum" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.drivewayType != null and poBq.drivewayType.size()>0">
+                or driveway_type in
+                <foreach collection="poBq.drivewayType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadFlatness != null and poBq.roadFlatness.size()>0">
+                or road_flatness in
+                <foreach collection="poBq.roadFlatness" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadCurvature != null and poBq.roadCurvature.size()>0">
+                or road_curvature in
+                <foreach collection="poBq.roadCurvature" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.ramp != null and poBq.ramp.size()>0">
+                or ramp in
+                <foreach collection="poBq.ramp" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.intersectionType != null and poBq.intersectionType.size()>0">
+                or intersection_type in
+                <foreach collection="poBq.intersectionType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.planeIntersection != null and poBq.planeIntersection.size()>0">
+                or plane_intersection in
+                <foreach collection="poBq.planeIntersection" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.bridge != null and poBq.bridge.size()>0">
+                or bridge in
+                <foreach collection="poBq.bridge" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.tunnel != null and poBq.tunnel.size()>0">
+                or tunnel in
+                <foreach collection="poBq.tunnel" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.speedLimit != null and poBq.speedLimit.size()>0">
+                or speed_limit in
+                <foreach collection="poBq.speedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.minSpeedLimit != null and poBq.minSpeedLimit.size()>0">
+                or min_speed_limit in
+                <foreach collection="poBq.minSpeedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.noEntry != null and poBq.noEntry.size()>0">
+                or no_entry in
+                <foreach collection="poBq.noEntry" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.noStopping != null and poBq.noStopping.size()>0">
+                or no_stopping in
+                <foreach collection="poBq.noStopping" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.leftLaneLine != null and poBq.leftLaneLine.size()>0">
+                or left_lane_line in
+                <foreach collection="poBq.leftLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.rightLaneLine != null and poBq.rightLaneLine.size()>0">
+                or right_lane_line in
+                <foreach collection="poBq.rightLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.conductorMarking != null and poBq.conductorMarking.size()>0">
+                or conductor_marking in
+                <foreach collection="poBq.conductorMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.pedestrianCrossing != null and poBq.pedestrianCrossing.size()>0">
+                or pedestrian_crossing in
+                <foreach collection="poBq.pedestrianCrossing" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.trafficLight != null and poBq.trafficLight.size()>0">
+                or traffic_light in
+                <foreach collection="poBq.trafficLight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.decelerationMarking != null and poBq.decelerationMarking.size()>0">
+                or deceleration_marking in
+                <foreach collection="poBq.decelerationMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.pavementCondition != null and poBq.pavementCondition.size()>0">
+                or pavement_condition in
+                <foreach collection="poBq.pavementCondition" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.naturalDisaster != null and poBq.naturalDisaster.size()>0">
+                or natural_disaster in
+                <foreach collection="poBq.naturalDisaster" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadSafetySigns != null and poBq.roadSafetySigns.size()>0">
+                or road_safety_signs in
+                <foreach collection="poBq.roadSafetySigns" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.safetyWarningBoard != null and poBq.safetyWarningBoard.size()>0">
+                or safety_warning_board in
+                <foreach collection="poBq.safetyWarningBoard" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.trafficAccident != null and poBq.trafficAccident.size()>0">
+                or traffic_accident in
+                <foreach collection="poBq.trafficAccident" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.patency != null and poBq.patency.size()>0">
+                or patency in
+                <foreach collection="poBq.patency" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.specialVehicleYield != null and poBq.specialVehicleYield.size()>0">
+                or special_vehicle_yield in
+                <foreach collection="poBq.specialVehicleYield" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.violation != null and poBq.violation.size()>0">
+                or violation in
+                <foreach collection="poBq.violation" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.doubleFlashingCar != null and poBq.doubleFlashingCar.size()>0">
+                or double_flashing_car in
+                <foreach collection="poBq.doubleFlashingCar" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.selfBehavior != null and poBq.selfBehavior.size()>0">
+                or
+                <foreach collection="poBq.selfBehavior" item="item" index="index"
+                         separator=" or " open="(" close=")">
+                    self_behavior like CONCAT('%,',#{item},',%')
+                    or self_behavior like CONCAT('%,',#{item}) or
+                    self_behavior like CONCAT(#{item},',%') or
+                    self_behavior=#{item}
+                </foreach>
+
+            </if>
+            <if test="poBq.targetBehavior != null and poBq.targetBehavior.size()>0">
+                or
+                <foreach collection="poBq.targetBehavior" item="item" index="index"
+                         separator=" or " open="(" close=")">
+                    target_behavior like CONCAT('%,',#{item},',%')
+                    or target_behavior like CONCAT('%,',#{item}) or
+                    target_behavior like CONCAT(#{item},',%') or
+                    target_behavior=#{item}
+                </foreach>
+
+            </if>
+            <if test="poBq.ids != null and poBq.ids.length>0">
+                or natural_id in
+                <foreach collection="poBq.ids" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            ) a
+            where
+             a.is_deleted = '0'
+            <if test="po.AllIds != null and po.AllIds.size()>0">
+                and a.natural_id in
+                <foreach collection="po.AllIds" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            order by a.modify_time desc
+        </where>
+    </select>
 </mapper>

+ 50 - 11
simulation-resource-server/src/main/resources/mapper/scene/StandardsRegulationsMapper.xml

@@ -26,11 +26,11 @@
         xml_address,xodr_address,json_address,video_preview
         from simulation.scene_standards_regulations
         <where>
-            is_deleted = '0'
-            <if test="sceneName != null and sceneName != ''">
+        (is_deleted = '0'
+        <if test=
+            "sceneName != null and sceneName != ''">
                 and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
             </if>
-
             <if test="regulationType != null and regulationType.size()>0">
                 and regulation_type in
                 <foreach collection="regulationType" item="item" index="index"
@@ -38,13 +38,6 @@
                     #{item}
                 </foreach>
             </if>
-            <if test="ids != null and ids.length != 0">
-                and regulation_type in
-                <foreach collection="regulationType" item="item" index="index"
-                         separator="," open="(" close=")">
-                    #{item}
-                </foreach>
-            </if>
             <if test="standardType != null and standardType != ''">
                 and standard_type like CONCAT('%',#{standardType,jdbcType=VARCHAR},'%')
             </if>
@@ -55,10 +48,56 @@
                     #{item}
                 </foreach>
             </if>
-            order by modify_time desc
+            <if test="AllIds != null and AllIds.size()>0">
+                and regulations_id in
+                <foreach collection="AllIds" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+           )
+            <if test="label != null and label.size()>0">
+                or (regulation_type in
+                <foreach collection="label" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+                and is_deleted = '0')
+            </if>
         </where>
+            order by modify_time desc
+
     </select>
 
+    <select id="queryStandardsRegulationsListByBq" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
+            resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
+        select
+        regulations_id,scene_name,regulation_type,standard_type,
+        create_user_id,create_time,modify_user_id,
+        modify_time,is_deleted,share,video_address,osgb_address,
+        xml_address,xodr_address,json_address,video_preview
+        from simulation.scene_standards_regulations
+        <where>
+            is_deleted = '0'
+            <if test="AllIds != null and AllIds.size()>0">
+                and regulations_id in
+                <foreach collection="AllIds" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="label != null and label.size()>0">
+               and regulation_type in
+                <foreach collection="label" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        order by modify_time desc
+
+    </select>
     <update id="deleteStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
         update simulation.scene_standards_regulations
         <set>

+ 85 - 0
simulation-resource-server/src/main/resources/mapper/scene/SystemUserSceneMapper.xml

@@ -0,0 +1,85 @@
+<?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="com.css.simulation.resource.scene.mapper.SystemUserSceneMapper">
+
+    <insert id="saveSystemUserScene" parameterType="api.common.pojo.po.scene.SystemUserScenePO">
+        insert into simulation.system_user_scene
+        (id,user_id,scene_id,scene_type,
+        create_user_id,create_time,modify_user_id,modify_time,
+        is_deleted) values
+        <foreach collection="list" index="index" item="item" separator=",">
+            (#{item.id,jdbcType=VARCHAR},#{item.userId,jdbcType=VARCHAR},#{item.sceneId,jdbcType=VARCHAR},#{item.sceneType,jdbcType=VARCHAR},
+            #{item.createUserId,jdbcType=VARCHAR},#{item.createTime},#{item.modifyUserId,jdbcType=VARCHAR},#{item.modifyTime},
+            #{item.isDeleted,jdbcType=VARCHAR})
+        </foreach>
+    </insert>
+
+    <select id="querySystemUserScene" parameterType="api.common.pojo.po.scene.SystemUserScenePO"
+            resultType="api.common.pojo.po.scene.SystemUserScenePO">
+        select
+        id,user_id,scene_id,scene_type,
+        create_time,modify_time,
+        is_deleted from simulation.system_user_scene
+        <where>
+            is_deleted = '0'
+            <if test="id != null and id != ''">
+                and id = #{id,jdbcType=VARCHAR}
+            </if>
+            <if test="userId != null and userId != ''">
+                and user_id = #{userId,jdbcType=VARCHAR}
+            </if>
+            <if test="sceneType != null and sceneType != ''">
+                and scene_type = #{sceneType,jdbcType=VARCHAR}
+            </if>
+            <if test="sceneId != null and sceneId != ''">
+                and scene_id = #{sceneId,jdbcType=VARCHAR}
+            </if>
+            order by modify_time desc
+        </where>
+    </select>
+    <select id="querySystemUserSceneByType" parameterType="api.common.pojo.po.scene.SystemUserScenePO"
+            resultType="java.lang.String">
+        select
+       scene_id from simulation.system_user_scene
+        <where>
+            is_deleted = '0'
+            <if test="userId != null and userId != ''">
+                and user_id = #{userId,jdbcType=VARCHAR}
+            </if>
+            <if test="sceneType != null and sceneType != ''">
+                and scene_type = #{sceneType,jdbcType=VARCHAR}
+            </if>
+        </where>
+    </select>
+
+
+    <update id="deleteSystemUserSceneByUserId" parameterType="api.common.pojo.po.scene.SystemUserScenePO">
+        update simulation.system_user_scene
+        set
+        <if test="isDeleted != null and isDeleted!=''">
+            is_deleted = #{isDeleted,jdbcType=VARCHAR},
+        </if>
+        <if test="modifyUserId != null and modifyUserId!=''">
+            modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
+        </if>
+        <if test="modifyTime != null">
+            modify_time = #{modifyTime},
+        </if>
+        where  user_id= #{userId,jdbcType=VARCHAR}
+    </update>
+    <update id="deleteSystemUserSceneBySceneId" parameterType="api.common.pojo.po.scene.SystemUserScenePO">
+        update simulation.system_user_scene
+        set
+        <if test="isDeleted != null and isDeleted!=''">
+            is_deleted = #{isDeleted,jdbcType=VARCHAR},
+        </if>
+        <if test="modifyUserId != null and modifyUserId!=''">
+            modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
+        </if>
+        <if test="modifyTime != null">
+            modify_time = #{modifyTime},
+        </if>
+        where scene_id = #{sceneId,jdbcType=VARCHAR}
+    </update>
+
+</mapper>