wangzhiqiang 3 жил өмнө
parent
commit
877c3d3f0d

+ 12 - 5
api-common/src/main/java/api/common/pojo/param/scene/SceneAccidentParam.java

@@ -4,6 +4,7 @@ import api.common.pojo.common.PageVO;
 import lombok.*;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * 交通事故场景
@@ -17,11 +18,11 @@ public class SceneAccidentParam extends PageVO implements Serializable {
 
     private String accidentId;              // (唯一)
     private String sceneName;  //场景名称
-    private String[] selfDriving;  //自车驾驶行为
-    private String[] targetDriving;  //目标驾驶行为
-    private String[] selfReaction ; //自车反应行为
-    private String[] conflictBehavior ; //冲突行为
-    private String[] conflictType ; //冲突类型
+    private List<String> selfDriving;  //自车驾驶行为
+    private List<String> targetDriving;  //目标驾驶行为
+    private List<String> selfReaction ; //自车反应行为
+    private List<String> conflictBehavior ; //冲突行为
+    private List<String> conflictType ; //冲突类型
     private String[] ids ; //回显数组
     private String videoAddress ; //视频地址
     private String osgbAddress  ;//
@@ -30,5 +31,11 @@ public class SceneAccidentParam extends PageVO implements Serializable {
     private String jsonAddress ; //
     private String videoPreview;//视频预览地址
 
+    private String rearEndCollision;//追尾
+    private String cutIn;//切入
+    private String driveCurve;//沿弯道行驶
+    private String carConflict;//机动车-机动车冲突
+
+
 
 }

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

@@ -26,6 +26,14 @@ public class SceneNaturalNewParam extends PageVO implements Serializable {
     private String[][] targetBehavior ; //目标行为
     private String[] ids ; //回显数组
 
+    private String[][] highSpeed ;//高速
+    private String[][] ramp;//匝道
+    private String[][] tunnel;//隧道
+    private String[][] cutIn;//切入
+    private String[][] cutOut;//切出
+    private String[][] laneChange;//变道
+    private String[][] turnAround;//掉头
+
 
 
 }

+ 10 - 1
api-common/src/main/java/api/common/pojo/param/scene/StandardsRegulationsParam.java

@@ -4,6 +4,7 @@ import api.common.pojo.common.PageVO;
 import lombok.*;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * 标准法规场景
@@ -17,7 +18,7 @@ public class StandardsRegulationsParam extends PageVO implements Serializable {
 
     private String regulationsId;              // (唯一)
     private String sceneName;  //场景名称
-    private String[]  regulationType;  //法规类型
+    private List<String> regulationType;  //法规类型
     private String standardType;  //标准类型
     private String share ; //是否分析  1为分享
 
@@ -29,4 +30,12 @@ public class StandardsRegulationsParam extends PageVO implements Serializable {
     private String videoPreview;//视频预览地址
     private String[] ids ; //回显数组
 
+/*    private String ISO;
+    private String GB;
+    private String CNCAP;
+    private String ENCAP;*/
+
+    private List<String> label;  //法规类型
+
+
 }

+ 49 - 5
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneAccidentService.java

@@ -163,13 +163,57 @@ public class SceneAccidentService {
     }
 
     public List<SceneAccidentPO> querySceneAccidentList(SceneAccidentParam params) {
-
+        //追尾
+        if(ObjectUtil.isNotNull(params.getRearEndCollision())){
+            if(params.getConflictBehavior()!=null&&params.getConflictBehavior().size()>0){
+                List<String> ConflictBehavior= params.getConflictBehavior();
+                ConflictBehavior.add(params.getRearEndCollision());
+                params.setConflictBehavior(ConflictBehavior);
+            }else{
+                List<String> ConflictBehavior=new ArrayList<>();
+                ConflictBehavior.add(params.getRearEndCollision());
+                        params.setConflictBehavior(ConflictBehavior);
+            }
+        }
+        if(ObjectUtil.isNotNull(params.getCutIn())){
+            if(params.getTargetDriving()!=null&&params.getTargetDriving().size()>0){
+                List<String> targetDriving= params.getTargetDriving();
+                targetDriving.add(params.getCutIn());
+                params.setTargetDriving(targetDriving);
+            }else{
+                List<String> targetDriving=new ArrayList<>();
+                targetDriving.add(params.getCutIn());
+                params.setConflictBehavior(targetDriving);
+            }
+        }
+        if(ObjectUtil.isNotNull(params.getDriveCurve())){
+            if(params.getTargetDriving()!=null&&params.getTargetDriving().size()>0){
+                List<String> targetDriving= params.getTargetDriving();
+                targetDriving.add(params.getDriveCurve());
+                params.setTargetDriving(targetDriving);
+            }else{
+                List<String> targetDriving=new ArrayList<>();
+                targetDriving.add(params.getDriveCurve());
+                params.setConflictBehavior(targetDriving);
+            }
+        }
+        if(ObjectUtil.isNotNull(params.getCarConflict())){
+            if(params.getConflictType()!=null&&params.getConflictType().size()>0){
+                List<String> conflictType= params.getConflictType();
+                conflictType.add(params.getCarConflict());
+                params.setConflictType(conflictType);
+            }else{
+                List<String> conflictType=new ArrayList<>();
+                conflictType.add(params.getCarConflict());
+                params.setConflictType(conflictType);
+            }
+        }
         List<SceneAccidentPO> list = SceneAccidentMapper.querySceneAccidentList(params);
         for (SceneAccidentPO po: list) {
-            if(po.getConflictBehavior().indexOf("追尾")>0){
+            if(po.getConflictBehavior().indexOf("追尾")>-1){
                 po.setLabel("追尾");
             }
-            if(po.getTargetDriving().indexOf("切入")>0){
+            if(po.getTargetDriving().indexOf("切入")>-1){
                 if(ObjectUtil.isNull(po.getLabel())){
                     po.setLabel("目标车切入");
                 }else{
@@ -177,7 +221,7 @@ public class SceneAccidentService {
                 }
 
             }
-            if(po.getTargetDriving().indexOf("沿弯道行驶")>0){
+            if(po.getTargetDriving().indexOf("沿弯道行驶")>-1){
                 if(ObjectUtil.isNull(po.getLabel())){
                     po.setLabel("目标车沿弯道行驶");
                 }else{
@@ -185,7 +229,7 @@ public class SceneAccidentService {
                 }
 
             }
-            if(po.getConflictType().indexOf("机动车-机动车冲突")>0){
+            if(po.getConflictType().indexOf("机动车-机动车冲突")>-1){
                 if(ObjectUtil.isNull(po.getLabel())){
                     po.setLabel("机动车-机动车冲突");
                 }else{

+ 157 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java

@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 
@@ -194,6 +195,36 @@ public class SceneNaturalService {
         String[][] trafficCondition = params.getTrafficCondition(); //交通状况
         String[][] selfBehavior = params.getSelfBehavior();//自车行为
         String[][] targetBehavior = params.getTargetBehavior(); //目标行为
+
+        String[][] highSpeed=params.getHighSpeed() ;//高速
+        String[][] ramp=params.getRamp();//匝道
+        String[][] tunnel=params.getTunnel();//隧道
+        String[][] cutIn=params.getCutIn();//切入
+        String[][] cutOut=params.getCutOut();//切出
+        String[][] laneChange=params.getLaneChange();//变道
+        String[][] turnAround=params.getTurnAround();//掉头
+        if (highSpeed != null && highSpeed.length > 0) {
+            ParamUtil.arrConvertObj(highSpeed, po);
+        }
+        if (ramp != null && ramp.length > 0) {
+            ParamUtil.arrConvertObj(ramp, po);
+        }
+        if (tunnel != null && tunnel.length > 0) {
+            ParamUtil.arrConvertObj(tunnel, po);
+        }
+        if (cutIn != null && cutIn.length > 0) {
+            ParamUtil.arrConvertObj(cutIn, po);
+        }
+        if (cutOut != null && cutOut.length > 0) {
+            ParamUtil.arrConvertObj(cutOut, po);
+        } if (turnAround != null && turnAround.length > 0) {
+            ParamUtil.arrConvertObj(turnAround, po);
+        }
+        if (laneChange != null && laneChange.length > 0) {
+            ParamUtil.arrConvertObj(laneChange, po);
+        }
+
+
         if (ObjectUtil.isNotNull(params.getIds())) {
             po.setIds(params.getIds());
         }
@@ -236,7 +267,133 @@ public class SceneNaturalService {
         if (targetBehavior != null && targetBehavior.length > 0) {
             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);
+        for (SceneNaturalPO vo : list) {
+            if (vo.getRoadType().equals("高速")) {
+                if (ObjectUtil.isNull(vo.getLabel())) {
+                    vo.setLabel("高速");
+                } else {
+                    vo.setLabel(vo.getLabel() + ",高速");
+                }
+            }
+            if (vo.getRamp().equals("是")) {
+                if (ObjectUtil.isNull(vo.getLabel())) {
+                    vo.setLabel("匝道");
+                } else {
+                    vo.setLabel(vo.getLabel() + ",匝道");
+                }
+            }
+            if (vo.getTunnel().equals("是")) {
+                if (ObjectUtil.isNull(vo.getLabel())) {
+                    vo.setLabel("隧道");
+                } else {
+                    vo.setLabel(vo.getLabel() + ",隧道");
+                }
+            }
+            if (vo.getTargetBehavior().equals("机动车从左侧切入成功") ||vo.getTargetBehavior().equals("机动车从右侧切入成功")) {
+                if (ObjectUtil.isNull(vo.getLabel())) {
+                    vo.setLabel("切入");
+                } else {
+                    vo.setLabel(vo.getLabel() + ",切入");
+                }
+            }
+            if (vo.getTargetBehavior().equals("机动车向左侧切出成功") ||vo.getTargetBehavior().equals("机动车向右侧切出成功")) {
+                if (ObjectUtil.isNull(vo.getLabel())) {
+                    vo.setLabel("切出");
+                } else {
+                    vo.setLabel(vo.getLabel() + ",切出");
+                }
+            }
+            if (vo.getSelfBehavior().equals("直路掉头") ||vo.getSelfBehavior().equals("路口掉头")) {
+                if (ObjectUtil.isNull(vo.getLabel())) {
+                    vo.setLabel("掉头");
+                } else {
+                    vo.setLabel(vo.getLabel() + ",掉头");
+                }
+            }
+            if (vo.getSelfBehavior().equals("向左变道成功") ||vo.getSelfBehavior().equals("向右变道成功")||vo.getSelfBehavior().equals("向左连续变道")||vo.getSelfBehavior().equals("向右连续变道")||vo.getSelfBehavior().equals("向左变道超车")||vo.getSelfBehavior().equals("向右变道超车")) {
+                if (ObjectUtil.isNull(vo.getLabel())) {
+                    vo.setLabel("变道");
+                } else {
+                    vo.setLabel(vo.getLabel() + ",变道");
+                }
+            }
+
+        }
         return list;
     }
 

+ 61 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/StandardsRegulationsService.java

@@ -5,6 +5,7 @@ import api.common.pojo.param.MinioParameter;
 import api.common.pojo.param.scene.StandardsRegulationsParam;
 import api.common.pojo.po.scene.SceneAccidentPO;
 import api.common.pojo.po.scene.StandardsRegulationsPO;
+import api.common.util.ObjectUtil;
 import api.common.util.StringUtil;
 import api.common.util.TimeUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
@@ -18,7 +19,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
 @Slf4j
@@ -87,6 +87,66 @@ 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.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(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);
+            }
+        }
+        //
+        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.getRegulationType()!=null&&params.getRegulationType().size()>0){
+                List<String> regulationType= params.getRegulationType();
+                regulationType.addAll(params.getLabel());
+                params.setRegulationType(regulationType);
+            }else{
+                List<String> regulationType=new ArrayList<>();
+                regulationType.addAll(params.getLabel());
+                params.setRegulationType(regulationType);
+            }
+        }
         List<StandardsRegulationsPO> list = standardsRegulationsMapper.queryStandardsRegulationsList(params);
         return list;
     }

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

@@ -33,35 +33,35 @@
                 and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
             </if>
 
-            <if test="selfDriving != null and selfDriving.length != 0 ">
+            <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.length != 0">
+            <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.length != 0">
+            <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.length != 0">
+            <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.length != 0">
+            <if test="conflictType != null and conflictType.size()>0">
                 and conflict_type in
                 <foreach collection="conflictType" item="item" index="index"
                          separator="," open="(" close=")">

+ 49 - 41
simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml

@@ -52,250 +52,258 @@
             <if test="naturalName != null and naturalName != ''">
                 and natural_name like CONCAT('%',#{naturalName,jdbcType=VARCHAR},'%')
             </if>
-            <if test="weather != null and weather != ''">
+            <if test="weather != null and weather.size()>0 ">
                 and weather in
                 <foreach collection="weather" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="backlight != null and backlight != ''">
+            <if test="backlight != null and backlight.size()>0">
                 and backlight in
                 <foreach collection="backlight" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="lightChange != null and lightChange != ''">
+            <if test="lightChange != null and lightChange.size()>0">
                 and light_change in
                 <foreach collection="lightChange" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="roadType != null and roadType != ''">
+            <if test="roadType != null and roadType.size()>0">
                 and road_type in
                 <foreach collection="roadType" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="roadMatrrial != null and roadMatrrial != ''">
+            <if test="roadMatrrial != null and roadMatrrial.size()>0">
                 and road_matrrial in
                 <foreach collection="roadMatrrial" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="drivewayNum != null and drivewayNum != ''">
+            <if test="drivewayNum != null and drivewayNum.size()>0">
                 and driveway_num in
                 <foreach collection="drivewayNum" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="drivewayType != null and drivewayType != ''">
+            <if test="drivewayType != null and drivewayType.size()>0">
                 and driveway_type in
                 <foreach collection="drivewayType" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="roadFlatness != null and roadFlatness != ''">
+            <if test="roadFlatness != null and roadFlatness.size()>0">
                 and road_flatness in
                 <foreach collection="roadFlatness" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="roadCurvature != null and roadCurvature != ''">
+            <if test="roadCurvature != null and roadCurvature.size()>0">
                 and road_curvature in
                 <foreach collection="roadCurvature" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="ramp != null and ramp != ''">
+            <if test="ramp != null and ramp.size()>0">
                 and ramp in
                 <foreach collection="ramp" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="intersectionType != null and intersectionType != ''">
+            <if test="intersectionType != null and intersectionType.size()>0">
                 and intersection_type in
                 <foreach collection="intersectionType" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="planeIntersection != null and planeIntersection != ''">
+            <if test="planeIntersection != null and planeIntersection.size()>0">
                 and plane_intersection in
                 <foreach collection="planeIntersection" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="bridge != null and bridge != ''">
+            <if test="bridge != null and bridge.size()>0">
                 and bridge in
                 <foreach collection="bridge" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="tunnel != null and tunnel != ''">
+            <if test="tunnel != null and tunnel.size()>0">
                 and tunnel in
                 <foreach collection="tunnel" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="speedLimit != null and speedLimit != ''">
+            <if test="speedLimit != null and speedLimit.size()>0">
                 and speed_limit in
                 <foreach collection="speedLimit" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="minSpeedLimit != null and minSpeedLimit != ''">
+            <if test="minSpeedLimit != null and minSpeedLimit.size()>0">
                 and min_speed_limit in
                 <foreach collection="minSpeedLimit" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="noEntry != null and noEntry != ''">
+            <if test="noEntry != null and noEntry.size()>0">
                 and no_entry in
                 <foreach collection="noEntry" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="noStopping != null and noStopping != ''">
+            <if test="noStopping != null and noStopping.size()>0">
                 and no_stopping in
                 <foreach collection="noStopping" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="leftLaneLine != null and leftLaneLine != ''">
+            <if test="leftLaneLine != null and leftLaneLine.size()>0">
                 and left_lane_line in
                 <foreach collection="leftLaneLine" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="rightLaneLine != null and rightLaneLine != ''">
+            <if test="rightLaneLine != null and rightLaneLine.size()>0">
                 and right_lane_line in
                 <foreach collection="rightLaneLine" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="conductorMarking != null and conductorMarking != ''">
+            <if test="conductorMarking != null and conductorMarking.size()>0">
                 and conductor_marking in
                 <foreach collection="conductorMarking" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="pedestrianCrossing != null and pedestrianCrossing != ''">
+            <if test="pedestrianCrossing != null and pedestrianCrossing.size()>0">
                 and pedestrian_crossing in
                 <foreach collection="pedestrianCrossing" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="trafficLight != null and trafficLight != ''">
+            <if test="trafficLight != null and trafficLight.size()>0">
                 and traffic_light in
                 <foreach collection="trafficLight" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="decelerationMarking != null and decelerationMarking != ''">
+            <if test="decelerationMarking != null and decelerationMarking.size()>0">
                 and deceleration_marking in
                 <foreach collection="decelerationMarking" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="pavementCondition != null and pavementCondition != ''">
+            <if test="pavementCondition != null and pavementCondition.size()>0">
                 and pavement_condition in
                 <foreach collection="pavementCondition" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="naturalDisaster != null and naturalDisaster != ''">
+            <if test="naturalDisaster != null and naturalDisaster.size()>0">
                 and natural_disaster in
                 <foreach collection="naturalDisaster" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="roadSafetySigns != null and roadSafetySigns != ''">
+            <if test="roadSafetySigns != null and roadSafetySigns.size()>0">
                 and road_safety_signs in
                 <foreach collection="roadSafetySigns" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="safetyWarningBoard != null and safetyWarningBoard != ''">
+            <if test="safetyWarningBoard != null and safetyWarningBoard.size()>0">
                 and safety_warning_board in
                 <foreach collection="safetyWarningBoard" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="trafficAccident != null and trafficAccident != ''">
+            <if test="trafficAccident != null and trafficAccident.size()>0">
                 and traffic_accident in
                 <foreach collection="trafficAccident" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="patency != null and patency != ''">
+            <if test="patency != null and patency.size()>0">
                 and patency in
                 <foreach collection="patency" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="specialVehicleYield != null and specialVehicleYield != ''">
+            <if test="specialVehicleYield != null and specialVehicleYield.size()>0">
                 and special_vehicle_yield in
                 <foreach collection="specialVehicleYield" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="violation != null and violation != ''">
+            <if test="violation != null and violation.size()>0">
                 and violation in
                 <foreach collection="violation" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="doubleFlashingCar != null and doubleFlashingCar != ''">
+            <if test="doubleFlashingCar != null and doubleFlashingCar.size()>0">
                 and double_flashing_car in
                 <foreach collection="doubleFlashingCar" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
-            <if test="selfBehavior != null and selfBehavior != ''">
-                and self_behavior in
+            <if test="selfBehavior != null and selfBehavior.size()>0">
+                and
                 <foreach collection="selfBehavior" item="item" index="index"
-                         separator="," open="(" close=")">
-                    #{item}
+                         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="targetBehavior != null and targetBehavior != ''">
-                and target_behavior in
+            <if test="targetBehavior != null and targetBehavior.size()>0">
+                and
                 <foreach collection="targetBehavior" item="item" index="index"
-                         separator="," open="(" close=")">
-                    #{item}
+                         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="ids != null and ids.length>0">
                 and natural_id in

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

@@ -31,7 +31,7 @@
                 and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
             </if>
 
-            <if test="regulationType != null and regulationType.length != 0">
+            <if test="regulationType != null and regulationType.size()>0">
                 and regulation_type in
                 <foreach collection="regulationType" item="item" index="index"
                          separator="," open="(" close=")">