wangzhiqiang 3 rokov pred
rodič
commit
aaa69080c2

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

@@ -15,6 +15,7 @@ public interface SceneNaturalMapper {
     void saveSceneNatural(SceneNaturalPO params);
 
     List<SceneNaturalPO> querySceneNaturalList(SceneNaturalParam params);
+    List<SceneNaturalPO> querySceneNaturalListByBqAndXlk(Map<String,SceneNaturalParam> map);
     List<SceneNaturalPO> querySceneNaturalListByBq(Map<String,SceneNaturalParam> map);
 
     void deleteSceneNatural(SceneNaturalPO params);

+ 5 - 3
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java

@@ -297,10 +297,12 @@ public class SceneNaturalService {
         //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 {
+        if((po.getXlk().equals("0")&&po.getBq().equals("0"))||(po.getXlk().equals("1")&&po.getBq().equals("0"))){
+            list = sceneNaturalMapper.querySceneNaturalList(po);
+        }else if((po.getXlk().equals("0")&&po.getBq().equals("1"))) {
              list = sceneNaturalMapper.querySceneNaturalListByBq(map);
+        }else{
+            list = sceneNaturalMapper.querySceneNaturalListByBqAndXlk(map);
         }
         //list = sceneNaturalMapper.querySceneNaturalListByBq(map);
         //List<SceneNaturalPO> list = sceneNaturalMapper.querySceneNaturalList(map);

+ 336 - 16
simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml

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