Pārlūkot izejas kodu

标签模块修改

wangzhiqiang 3 gadi atpakaļ
vecāks
revīzija
8fd1e63fe2
18 mainītis faili ar 1143 papildinājumiem un 158 dzēšanām
  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. 36 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SyetemUserSceneController.java
  7. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneAccidentMapper.java
  8. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneNaturalMapper.java
  9. 1 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/StandardsRegulationsMapper.java
  10. 26 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemUserSceneMapper.java
  11. 35 4
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneAccidentService.java
  12. 48 85
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java
  13. 30 49
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/StandardsRegulationsService.java
  14. 71 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SystemUserSceneService.java
  15. 149 2
      simulation-resource-server/src/main/resources/mapper/scene/SceneAccidentMapper.xml
  16. 573 0
      simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml
  17. 50 11
      simulation-resource-server/src/main/resources/mapper/scene/StandardsRegulationsMapper.xml
  18. 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;          // 场景类型
+}

+ 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);
 

+ 2 - 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,7 @@ public interface SceneNaturalMapper {
     void saveSceneNatural(SceneNaturalPO params);
 
     List<SceneNaturalPO> querySceneNaturalList(SceneNaturalParam params);
+    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());
     }
 }

+ 48 - 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,28 @@ 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("1"))||po.getXlk().equals("0")&&po.getBq().equals("0")||(po.getXlk().equals("1")&&po.getBq().equals("0"))){
+            list = sceneNaturalMapper.querySceneNaturalList(poBq);
+        }else {
+             list = sceneNaturalMapper.querySceneNaturalListByBq(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 +363,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);
+    }
+}

+ 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">

+ 573 - 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,570 @@
             </if>
         </where>
     </select>
+
+
+    <select id="querySceneNaturalListByBq" 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 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>
+            <if test="po.AllIds != null and po.AllIds.size()>0">
+                and natural_id in
+                <foreach collection="po.AllIds" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            )
+            <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>
+            <if test="poBq.AllIds != null and poBq.AllIds.size()>0">
+                or natural_id in
+                <foreach collection="poBq.AllIds" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            )
+            and is_deleted = '0'
+            order by 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>