Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

martin 2 rokov pred
rodič
commit
466231c1aa
48 zmenil súbory, kde vykonal 1889 pridanie a 349 odobranie
  1. 2 0
      api-common/src/main/java/api/common/pojo/param/project/SimulationManualProjectKafkaParam.java
  2. 2 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneAccidentParam.java
  3. 2 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneGeneralTemplateParam.java
  4. 1 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneNaturalParam.java
  5. 2 0
      api-common/src/main/java/api/common/pojo/param/scene/StandardsRegulationsParam.java
  6. 0 19
      api-common/src/main/java/api/common/pojo/po/home/SystemAccessPO.java
  7. 4 4
      api-common/src/main/java/api/common/pojo/po/scene/SystemScenePackageNewPO.java
  8. 1 1
      api-common/src/main/java/api/common/pojo/po/scene/SystemScenePackageSublistPO.java
  9. 0 14
      api-common/src/main/java/api/common/pojo/vo/home/AccessVO.java
  10. 11 0
      api-common/src/main/java/api/common/pojo/vo/home/LineChartVO.java
  11. 0 15
      api-common/src/main/java/api/common/pojo/vo/scene/RunProjectVO.java
  12. 8 2
      api-common/src/main/java/api/common/util/TimeUtil.java
  13. 14 1
      simulation-oauth-client/src/main/java/com/css/simulation/oauth/client/controller/SignController.java
  14. 21 56
      simulation-resource-server/src/main/java/com/css/simulation/resource/home/ctrl/HomePageCtrl.java
  15. 10 6
      simulation-resource-server/src/main/java/com/css/simulation/resource/home/mapper/HomePageMapper.java
  16. 75 57
      simulation-resource-server/src/main/java/com/css/simulation/resource/home/service/HomePageService.java
  17. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/log/mapper/LogMapper.java
  18. 4 4
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/constants/ProjectConstants.java
  19. 7 33
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java
  20. 0 2
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectMapper.java
  21. 0 2
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectTaskMapper.java
  22. 0 4
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/service/SimulationProjectService.java
  23. 1 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SystemScenePackageController.java
  24. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneAccidentMapper.java
  25. 1 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneGeneralTemplateMapper.java
  26. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneNaturalMapper.java
  27. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/StandardsRegulationsMapper.java
  28. 0 29
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemAccessMapper.java
  29. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemScenePackageMapper.java
  30. 85 4
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneAccidentService.java
  31. 4 2
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneGeneralTemplateService.java
  32. 16 3
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java
  33. 32 28
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SystemScenePackageService.java
  34. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/ClusterCtrl.java
  35. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/ParameterCtrl.java
  36. 2 3
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/UserInfoCtrl.java
  37. 4 4
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/service/UserService.java
  38. 40 0
      simulation-resource-server/src/main/resources/mapper/home/HomePageMapper.xml
  39. 10 0
      simulation-resource-server/src/main/resources/mapper/log/LogMapper.xml
  40. 0 19
      simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml
  41. 0 16
      simulation-resource-server/src/main/resources/mapper/project/SimulationProjectTaskMapper.xml
  42. 162 0
      simulation-resource-server/src/main/resources/mapper/scene/SceneAccidentMapper.xml
  43. 48 3
      simulation-resource-server/src/main/resources/mapper/scene/SceneGeneralTemplateMapper.xml
  44. 1193 0
      simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml
  45. 90 0
      simulation-resource-server/src/main/resources/mapper/scene/StandardsRegulationsMapper.xml
  46. 13 10
      simulation-resource-server/src/main/resources/mapper/scene/SystemScenePackageMapper.xml
  47. 6 7
      simulation-resource-server/src/main/resources/mapper/scene/SystemScenePackageSublistMapper.xml
  48. 1 0
      simulation-resource-server/src/main/resources/mapper/system/UserMapper.xml

+ 2 - 0
api-common/src/main/java/api/common/pojo/param/project/SimulationManualProjectKafkaParam.java

@@ -21,4 +21,6 @@ public class SimulationManualProjectKafkaParam {
     private Long maxSimulationTime;
 
     private Integer parallelism;
+
+    private String type;
 }

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

@@ -40,5 +40,7 @@ public class SceneAccidentParam extends PageVO implements Serializable {
     private String  xlk="0";//判断下拉框是否为空 0为空  1为有值
     private Integer  bq=0;//判断标签是否为空 0为空  1为有值
 
+    private String  userId;//用户id
+
 
 }

+ 2 - 0
api-common/src/main/java/api/common/pojo/param/scene/SceneGeneralTemplateParam.java

@@ -23,4 +23,6 @@ public class SceneGeneralTemplateParam extends PageVO implements Serializable {
     private List<String> fileName;//模块名称
     private String version;//版本号
 
+    private String userId;//用户id
+
 }

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

@@ -70,4 +70,5 @@ public class SceneNaturalParam extends PageVO implements Serializable {
     private String  xlk="0";//判断下拉框是否为空 0为空  1为有值
     private String  bq="0";//判断标签是否为空 0为空  1为有值
 
+    private String userId;//用户id
 }

+ 2 - 0
api-common/src/main/java/api/common/pojo/param/scene/StandardsRegulationsParam.java

@@ -35,4 +35,6 @@ public class StandardsRegulationsParam extends PageVO implements Serializable {
     private String  xlk="0";//判断下拉框是否为空 0为空  1为有值
     private String  bq="0";//判断标签是否为空 0为空  1为有值
 
+    private String userId;
+
 }

+ 0 - 19
api-common/src/main/java/api/common/pojo/po/home/SystemAccessPO.java

@@ -1,19 +0,0 @@
-package api.common.pojo.po.home;
-
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.sql.Timestamp;
-
-
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class SystemAccessPO {
-    String id;
-    Timestamp accessTime;
-}

+ 4 - 4
api-common/src/main/java/api/common/pojo/po/scene/SystemScenePackageNewPO.java

@@ -20,8 +20,8 @@ public class SystemScenePackageNewPO extends CommonPO implements Serializable {
     private String id;              // 主键
     private String packageName;        // 场景包名
     private String sceneDescribe;          // 场景包描述
-    private List<String> zrIds;          // 自然场景ids
-    private List<String> bzIds;          // 标准法规场景ids
-    private List<String> jtIds;          // 交通事故自然场景ids
-    private List<String> fhIds;          // 泛化模板场景ids
+    private List<String> zrSceneNames;          // 自然场景名集合
+    private List<String> bzSceneNames;          // 标准法规场景名集合
+    private List<String> jtSceneNames;          // 交通事故自然场景名集合
+    private List<String> fhSceneNames;          // 泛化模板场景名集合
 }

+ 1 - 1
api-common/src/main/java/api/common/pojo/po/scene/SystemScenePackageSublistPO.java

@@ -18,6 +18,6 @@ import java.io.Serializable;
 public class SystemScenePackageSublistPO extends CommonPO implements Serializable {
     private String sublistId;              // 主键
     private String sceneType;        // 场景类型
-    private String sceneId;        // 场景id
+    private String sceneName;        // 场景名称
     private String sceneAndPackage;          // 关联场景包id
 }

+ 0 - 14
api-common/src/main/java/api/common/pojo/vo/home/AccessVO.java

@@ -1,14 +0,0 @@
-package api.common.pojo.vo.home;
-
-
-import lombok.*;
-
-
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class AccessVO  {
-    String toDate;
-    Integer num;
-}

+ 11 - 0
api-common/src/main/java/api/common/pojo/vo/home/LineChartVO.java

@@ -0,0 +1,11 @@
+package api.common.pojo.vo.home;
+
+import lombok.Data;
+
+@Data
+public class LineChartVO {
+
+    private String toDate;//时间
+    private Integer num;//数量
+
+}

+ 0 - 15
api-common/src/main/java/api/common/pojo/vo/scene/RunProjectVO.java

@@ -1,15 +0,0 @@
-package api.common.pojo.vo.scene;
-
-import lombok.*;
-
-import java.io.Serializable;
-
-@EqualsAndHashCode()
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class RunProjectVO implements Serializable {
-    private String toDate;//时间
-    private Integer Num;//数量
-}

+ 8 - 2
api-common/src/main/java/api/common/util/TimeUtil.java

@@ -1,8 +1,8 @@
 package api.common.util;
 
 import java.sql.Timestamp;
-import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.util.*;
 
 public class TimeUtil {
@@ -64,7 +64,7 @@ public class TimeUtil {
         return map;
     }
 
-    //获取间隔 n 秒的时间
+    //获取间隔 n 秒的时间
     public static Timestamp getPostTimestamp(int secends) {
         return new Timestamp(System.currentTimeMillis() + secends * 1000L);
     }
@@ -94,4 +94,10 @@ public class TimeUtil {
         return message;
     }
 
+    //获取 n 天前的日期
+    public static String getMinusDaysStr(int days) {
+        LocalDate before = LocalDate.now().minusDays(days);
+        return before.toString();
+    }
+
 }

+ 14 - 1
simulation-oauth-client/src/main/java/com/css/simulation/oauth/client/controller/SignController.java

@@ -91,7 +91,7 @@ public class SignController {
     @RequestMapping("/single")
     @SneakyThrows
     @ResponseBody
-    public ResponseBodyVO<SimulationTokenVO> single(@RequestBody SignSingleParameter signSingleParameter) {
+    public ResponseBodyVO<SimulationTokenVO> single(@RequestBody SignSingleParameter signSingleParameter, HttpServletRequest request) {
 
         String code = signSingleParameter.getCode();
         String encodeCode = EncodeUtil.utf8(code);
@@ -176,6 +176,7 @@ public class SignController {
 
         //3 使用 union_id 查询数据库,是否已在仿真平台存在该用户
         UserPO oldUser = userMapper.selectByOpenIdIgnoreDelete(openid);
+        String userId = "";
         if (oldUser == null) {   //3-1 仿真平台不存在用户,直接创建新的
             UserPO newUser = new UserPO();
             newUser.setId(StringUtil.getRandomUUID());
@@ -193,6 +194,7 @@ public class SignController {
             newUser.setModifyTime(TimeUtil.getNowForMysql());
             newUser.setIsDeleted("0");
             userMapper.insert(newUser);
+            userId = newUser.getId();
             log.info("------- /single 成功插入新用户信息:" + newUser);
         } else {
             if ("1".equals(oldUser.getIsDeleted())) { //3-2 仿真平台存在删除状态用户,改为未删除
@@ -201,6 +203,7 @@ public class SignController {
             //3-3 仿真平台用户存在未删除用户,放行。不会每次都更新,防止在仿真云平台更新的信息被众工业覆盖
             username = oldUser.getUsername();
             password = oldUser.getPassword();
+            userId = oldUser.getId();
         }
 
         // -------------------------------- 这里需要用到前面创建的用户信息,所以不使用事务 --------------------------------
@@ -215,6 +218,16 @@ public class SignController {
         String simulationToken = HttpUtil.get(closeableHttpClient, requestConfig, simulationTokenUrl);
         log.info("------- /single 仿真云平台 token 信息为:" + simulationToken);
         SimulationTokenVO simulationTokenVO = JsonUtil.jsonToBean(simulationToken, SimulationTokenVO.class);
+        //登录日志
+        LogLoginPO po = new LogLoginPO();
+        po.setId(StringUtil.getRandomUUID());
+        po.setCreateTime(TimeUtil.getNowForMysql());
+        String remoteAddress = IpUtil.getRemoteAddress(request);
+        po.setIp(remoteAddress);
+        po.setUserId(userId);
+        po.setUsername(username);
+        po.setState(1);
+        logLoginMapper.insertLog(po);
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, simulationTokenVO);
     }
 

+ 21 - 56
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/HomePageController.java → simulation-resource-server/src/main/java/com/css/simulation/resource/home/ctrl/HomePageCtrl.java

@@ -1,15 +1,14 @@
-package com.css.simulation.resource.scene.ctrl;
+package com.css.simulation.resource.home.ctrl;
 
 import api.common.pojo.common.PageVO;
 import api.common.pojo.common.ResponseBodyVO;
-import api.common.pojo.vo.home.AccessVO;
-import api.common.pojo.vo.home.HardwareVO;
-import api.common.pojo.vo.home.ServiceVO;
-import api.common.pojo.vo.home.SystemServerVO;
+import api.common.pojo.vo.home.*;
 import com.css.simulation.resource.algorithm.service.AlgorithmService;
+import com.css.simulation.resource.home.service.HomePageService;
+import com.css.simulation.resource.model.service.ConfigService;
 import com.css.simulation.resource.project.service.SimulationProjectService;
-import com.css.simulation.resource.scene.service.HomePageService;
 import com.css.simulation.resource.scene.service.SceneNaturalService;
+import com.css.simulation.resource.system.service.ClusterService;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,7 +24,7 @@ import java.util.Map;
 @Slf4j
 @RestController
 @RequestMapping("/homePage")
-public class HomePageController {
+public class HomePageCtrl {
     @Autowired
     SceneNaturalService sceneNaturalService;
     @Autowired
@@ -33,82 +32,47 @@ public class HomePageController {
     @Autowired
     SimulationProjectService simulationProjectService;
     @Autowired
-    com.css.simulation.resource.model.service.ConfigService ConfigService;
+    ConfigService configService;
     @Autowired
     HomePageService homePageService;
+    @Autowired
+    ClusterService clusterService;
 
     //首页概况汇总方法
     @PostMapping("/queryAllNum")
     @ResponseBody
     public ResponseBodyVO<Map<String,Integer>> queryAllNum() {
 
-        Map<String,Integer> map = algorithmService.selectDetailsBySy();
-        map.put("ConfigTotal", ConfigService.getConfigTotal());
-        map.put("SceneNum", sceneNaturalService.querySceneNumBySy());
-        map.put("maxConcurrency", 1);
-        map.put("currentConcurrency", 1);
+        Map<String,Integer> map = algorithmService.selectDetailsBySy();//算法文件数量
+        map.put("ConfigTotal", configService.getConfigTotal());//车辆配置数量
+        map.put("SceneNum", sceneNaturalService.querySceneNumBySy());//场景数量
+        map.put("maxConcurrency", clusterService.getLicenseNum());//最大并发数量
+        map.put("currentConcurrency", homePageService.getRuningTask());//当前并发数量
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, map);
     }
 
-
-    //首页查询场景数量
-    @PostMapping("/querySceneNumBySy")
-    @ResponseBody
-    public ResponseBodyVO<Integer> querySceneNumBySy() {
-        Integer SceneNum = sceneNaturalService.querySceneNumBySy();
-        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, SceneNum);
-    }
-
-    //首页车辆配置数量
-    @PostMapping("/queryCarDisposeNumBySy")
-    @ResponseBody
-    public ResponseBodyVO<Integer> queryCarDisposeNumBySy() {
-        Integer ConfigTotal = ConfigService.getConfigTotal();
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, ConfigTotal);
-    }
-
-    /**
-     * 首页文件数量
-     *
-     * @param
-     * @return
-     */
-    @RequestMapping("selectDetailsBySy")
-    @ResponseBody
-    public ResponseBodyVO selectDetailsBySy() {
-
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, algorithmService.selectDetailsBySy());
-    }
-
     /**
      * 近一周运行运行项目数量
-     *
-     * @param
-     * @return
      */
     @RequestMapping("selectRunProjectBySy")
     @ResponseBody
     public ResponseBodyVO selectRunProjectBySy() {
-        return simulationProjectService.selectRunProjectBySy();
+        List<LineChartVO> list = homePageService.selectRunProjectChart();
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,list);
     }
 
     /**
      * 近一周运行任务数量
-     *
-     * @param
-     * @return
      */
     @RequestMapping("selectRunTaskBySy")
     @ResponseBody
     public ResponseBodyVO selectRunTaskBySy() {
-        return simulationProjectService.selectRunTaskBySy();
+        List<LineChartVO> list = homePageService.selectRunTaskChart();
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,list);
     }
 
     /**
      * 任务运行状态统计-饼图
-     *
-     * @param
-     * @return
      */
     @RequestMapping("selectRunTaskByState")
     @ResponseBody
@@ -158,8 +122,9 @@ public class HomePageController {
      */
     @RequestMapping("selectAccess")
     @ResponseBody
-    public ResponseBodyVO<List<AccessVO>> selectAccess() {
-        return homePageService.selectAccess();
+    public ResponseBodyVO<List<LineChartVO>> selectAccess() {
+        List<LineChartVO> list = homePageService.selectAccess();
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,list);
     }
 
 

+ 10 - 6
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemServerMapper.java → simulation-resource-server/src/main/java/com/css/simulation/resource/home/mapper/HomePageMapper.java

@@ -1,13 +1,12 @@
-package com.css.simulation.resource.scene.mapper;
+package com.css.simulation.resource.home.mapper;
 
 import api.common.pojo.po.home.SystemServerPO;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Result;
-import org.apache.ibatis.annotations.Results;
-import org.apache.ibatis.annotations.Select;
+import api.common.pojo.vo.home.LineChartVO;
+import org.apache.ibatis.annotations.*;
 import org.apache.ibatis.type.JdbcType;
 
 import java.util.List;
+import java.util.Map;
 
 
 /**
@@ -27,7 +26,7 @@ import java.util.List;
  * comment '服务器表';
  */
 @Mapper
-public interface SystemServerMapper {
+public interface HomePageMapper {
     @Results(id = "server", value = {
             @Result(column = "id", property = "id", jdbcType = JdbcType.VARCHAR),
             @Result(column = "server_id", property = "serverId", jdbcType = JdbcType.VARCHAR),
@@ -70,4 +69,9 @@ public interface SystemServerMapper {
             "where is_deleted = '0'")
     Integer selectSumOfTaskNumber();
 
+    List<LineChartVO> selectRunTaskChart(Map<String, String> param);
+
+    List<LineChartVO> selectRunProjectChart(Map<String, String> param);
+
+    Integer getRuningTask(@Param("currentUserId")String currentUserId);
 }

+ 75 - 57
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/HomePageService.java → simulation-resource-server/src/main/java/com/css/simulation/resource/home/service/HomePageService.java

@@ -1,55 +1,50 @@
-package com.css.simulation.resource.scene.service;
+package com.css.simulation.resource.home.service;
 
 import api.common.pojo.common.PageVO;
 import api.common.pojo.common.ResponseBodyVO;
-import api.common.pojo.po.home.SystemAccessPO;
 import api.common.pojo.po.home.SystemServerPO;
-import api.common.pojo.vo.home.AccessVO;
-import api.common.pojo.vo.home.HardwareVO;
-import api.common.pojo.vo.home.ServiceVO;
-import api.common.pojo.vo.home.SystemServerVO;
-import api.common.util.StringUtil;
+import api.common.pojo.vo.home.*;
+import api.common.util.ObjectUtil;
 import api.common.util.TimeUtil;
+import com.css.simulation.resource.common.utils.AuthUtil;
+import com.css.simulation.resource.common.utils.PageUtil;
 import com.css.simulation.resource.feign.OauthClientService;
-import com.css.simulation.resource.scene.mapper.SystemAccessMapper;
-import com.css.simulation.resource.scene.mapper.SystemServerMapper;
+import com.css.simulation.resource.log.mapper.LogMapper;
+import com.css.simulation.resource.home.mapper.HomePageMapper;
 import com.css.simulation.resource.system.mapper.UserMapper;
-import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 @Service
 public class HomePageService {
 
-    @Autowired
-    SystemServerMapper systemServerMapper;
-
-    @Autowired
-    SystemAccessMapper systemAccessMapper;
+    @Resource
+    HomePageMapper homePageMapper;
 
     @Autowired
     UserMapper userMapper;
 
     @Autowired
+    LogMapper logMapper;
+
+    @Resource
     OauthClientService oauthClientService;
 
 
     public ResponseBodyVO<HardwareVO> selectHardware() {
-
-
-        List<SystemServerPO> systemServerPOList = systemServerMapper.selectAll();
-
-
+        List<SystemServerPO> systemServerPOList = homePageMapper.selectAll();
         long memorySum = systemServerPOList.stream().mapToLong(SystemServerPO::getMemoryTotal).sum();  // 内存之和
         long diskSum = systemServerPOList.stream().mapToLong(SystemServerPO::getDiskTotal).sum();  // 磁盘之和
-        long cpuSum = systemServerPOList.stream().mapToLong(SystemServerPO::getDiskTotal).sum();  // cpu线程数 之和
-        long gpuSum = systemServerPOList.stream().mapToLong(SystemServerPO::getDiskTotal).sum();  // 显存之和
-
+        long cpuSum = systemServerPOList.stream().mapToLong(SystemServerPO::getCpuTotal).sum();  // cpu线程数 之和
+        long gpuSum = systemServerPOList.stream().mapToLong(SystemServerPO::getGpuTotal).sum();  // 显存之和
         HardwareVO build = HardwareVO.builder()
                 .serverNumber(systemServerPOList.size())
                 .memoryUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getMemoryUsage() * po.getMemoryTotal() / memorySum).sum() + "%")
@@ -57,55 +52,26 @@ public class HomePageService {
                 .cpuUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getCpuUsage() * po.getCpuTotal() / cpuSum).sum() + "%")
                 .gpuUsage((int) systemServerPOList.stream().mapToDouble(po -> po.getGpuUsage() * po.getGpuTotal() / gpuSum).sum() + "%")
                 .build();
-
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, build);
-
     }
 
 
     public ResponseBodyVO<ServiceVO> selectService() {
-
-        List<SystemServerPO> systemServerPOList = systemServerMapper.selectAll();
+        List<SystemServerPO> systemServerPOList = homePageMapper.selectAll();
         long count = systemServerPOList.stream().filter(system -> "gpu".equals(system.getServerType())).count();
-
         ServiceVO build = ServiceVO.builder()
                 .userNumber(userMapper.selectCount())
                 .onlineNumber(oauthClientService.online().getInfo())
                 .simulationNodeNumber((int) count)
-                .simulationLicenseNumber(systemServerMapper.selectSumOfTaskNumber())
+                .simulationLicenseNumber(homePageMapper.selectSumOfTaskNumber())
                 .dynamicsLicenseNumber(1)   // 待定
                 .build();
-
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, build);
-
-    }
-
-
-    public ResponseBodyVO<List<AccessVO>> selectAccess() {
-
-        SystemAccessPO systemAccessPO = SystemAccessPO.builder()
-                .id(StringUtil.getRandomUUID())
-                .accessTime(TimeUtil.getNowForMysql())
-                .build();
-        systemAccessMapper.insert(systemAccessPO);
-
-        List<AccessVO> list = new ArrayList<>();
-        for (int i = 6; i > -1; i--) {
-            AccessVO vo = new AccessVO();
-            Map<String, Object> params = TimeUtil.getPastTime(i);
-            Integer num = systemAccessMapper.selectPastAccess(params);
-            vo.setToDate(params.get("toDate").toString());
-            vo.setNum(num);
-            list.add(vo);
-        }
-        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, list);
-
     }
 
     public ResponseBodyVO<PageInfo<SystemServerVO>> selectServer(PageVO pageVO) {
-
-        PageHelper.startPage(pageVO.getCurrentPage(), pageVO.getPageSize());
-        List<SystemServerPO> systemServerPOList = systemServerMapper.selectAll();
+        PageUtil.setPageInfo(pageVO);
+        List<SystemServerPO> systemServerPOList = homePageMapper.selectAll();
         List<SystemServerVO> systemServerVOList = new ArrayList<>();
         systemServerPOList.forEach(po -> {
             SystemServerVO vo = SystemServerVO.builder()
@@ -122,8 +88,60 @@ public class HomePageService {
                     .build();
             systemServerVOList.add(vo);
         });
-
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, new PageInfo<>(systemServerVOList));
     }
 
+    public List<LineChartVO> selectAccess() {
+        String dateBegin = TimeUtil.getMinusDaysStr(6);
+        List<LineChartVO> listVo = logMapper.getAccessCount(dateBegin);
+        List<LineChartVO> list = makeLineChartDate(listVo, 6);
+        return list;
+    }
+
+    public List<LineChartVO> selectRunTaskChart() {
+        Map<String,String> param = new HashMap();
+        param.put("dateBegin",TimeUtil.getMinusDaysStr(6));
+        param.put("createUserId", AuthUtil.getCurrentUserId());
+        List<LineChartVO> listVo = homePageMapper.selectRunTaskChart(param);
+        List<LineChartVO> list = makeLineChartDate(listVo, 6);
+        return list;
+    }
+
+    public List<LineChartVO> selectRunProjectChart() {
+        Map<String,String> param = new HashMap();
+        param.put("dateBegin",TimeUtil.getMinusDaysStr(6));
+        param.put("createUserId", AuthUtil.getCurrentUserId());
+        List<LineChartVO> listVo = homePageMapper.selectRunProjectChart(param);
+        List<LineChartVO> list = makeLineChartDate(listVo, 6);
+        return list;
+    }
+
+    /**
+     * 构建图标基础数据
+     */
+    private List<LineChartVO> makeLineChartDate(List<LineChartVO> listVo, int j) {
+        List<LineChartVO> list = new ArrayList<>();
+        boolean notNull = ObjectUtil.isNotNull(listVo);
+        for (int i = j; i >= 0; i--) {
+            String date = TimeUtil.getMinusDaysStr(i);
+            if(notNull){
+                List<LineChartVO> collect = listVo.stream().filter(v -> date.equals(v.getToDate())).collect(Collectors.toList());
+                if(ObjectUtil.isNotNull(collect)){
+                    LineChartVO vo = collect.get(0);
+                    list.add(vo);
+                    continue;
+                }
+            }
+            //创建新数据
+            LineChartVO vo = new LineChartVO();
+            vo.setToDate(date);
+            vo.setNum(0);
+            list.add(vo);
+        }
+        return list;
+    }
+
+    public Integer getRuningTask() {
+        return homePageMapper.getRuningTask(AuthUtil.getCurrentUserId());
+    }
 }

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/log/mapper/LogMapper.java

@@ -4,7 +4,9 @@ import api.common.pojo.param.log.LogPageParam;
 import api.common.pojo.po.log.LogLoginPO;
 import api.common.pojo.po.log.LogOperationPO;
 import api.common.pojo.po.log.LogSystemPO;
+import api.common.pojo.vo.home.LineChartVO;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -23,4 +25,5 @@ public interface LogMapper {
 
     void insertSystemLog(LogSystemPO po);
 
+    List<LineChartVO> getAccessCount(@Param("dateBegin") String dateBegin);
 }

+ 4 - 4
simulation-resource-server/src/main/java/com/css/simulation/resource/project/constants/ProjectConstants.java

@@ -6,16 +6,16 @@ package com.css.simulation.resource.project.constants;
 public class ProjectConstants {
 
     //任务运行 Kafka推送主题
-    public static final String RUN_TASK_TOPIC = "manualProject";
+    public static final String RUN_TASK_TOPIC = "project";
 
     //任务终止,kafka推送主题
-    public static final String STOP_TASK_TOPPIC = "stopManualProject";//   manualProject-stop
+    public static final String STOP_TASK_TOPPIC = "stopProject";//   manualProject-stop
 
     //自动任务运行开始
-    public static final String AUTO_PROJECT = "autoProject";
+//    public static final String AUTO_PROJECT = "autoProject";
 
     //自动任务运行中止
-    public static final String STOP_AUTO_PROJECT = "stopAutoProject";
+//    public static final String STOP_AUTO_PROJECT = "stopAutoProject";
 
     //任务运行状态字典
     public static final String TASK_RUN_STATE = "taskRunState";

+ 7 - 33
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -18,7 +18,6 @@ import api.common.pojo.po.model.VehiclePO;
 import api.common.pojo.po.project.*;
 import api.common.pojo.po.scene.ScenePackagePO;
 import api.common.pojo.vo.project.*;
-import api.common.pojo.vo.scene.RunProjectVO;
 import api.common.util.*;
 import com.css.simulation.resource.algorithm.mapper.AlgorithmMapper;
 import com.css.simulation.resource.algorithm.service.AlgorithmService;
@@ -328,6 +327,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         kafkaParam.setScenePackageId(po.getScene());
         kafkaParam.setMaxSimulationTime(po.getMaxSimulationTime());
         kafkaParam.setParallelism(Integer.valueOf(po.getParallelism()));
+        kafkaParam.setType(DictConstants.PROJECT_TYPE_MANUAL);
         KafkaParameter kafkaParameter = new KafkaParameter();
         kafkaParameter.setTopic(ProjectConstants.RUN_TASK_TOPIC);
         String data = JsonUtil.beanToJson(kafkaParam);
@@ -338,6 +338,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     private void projectStopToKafka(SimulationManualProjectPo po) throws JsonProcessingException{
         SimulationManualProjectKafkaParam kafkaParam = new SimulationManualProjectKafkaParam();
         kafkaParam.setProjectId(po.getId());
+        kafkaParam.setType(DictConstants.PROJECT_TYPE_MANUAL);
         KafkaParameter kafkaParameter = new KafkaParameter();
         kafkaParameter.setTopic(ProjectConstants.STOP_TASK_TOPPIC);
         String data = JsonUtil.beanToJson(kafkaParam);
@@ -350,8 +351,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     private void autoProjectStopToKafka(SimulationAutomaticSubProjectPo po) throws JsonProcessingException{
         SimulationManualProjectKafkaParam kafkaParam = new SimulationManualProjectKafkaParam();
         kafkaParam.setProjectId(po.getId());
+        kafkaParam.setType(DictConstants.PROJECT_TYPE_AUTO_SUB);
         KafkaParameter kafkaParameter = new KafkaParameter();
-        kafkaParameter.setTopic(ProjectConstants.STOP_AUTO_PROJECT);
+        kafkaParameter.setTopic(ProjectConstants.STOP_TASK_TOPPIC);
         String data = JsonUtil.beanToJson(kafkaParam);
         kafkaParameter.setData(data);
         log.info("推送自动项目中止消息到kafka:"+data);
@@ -2471,36 +2473,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             cloums.add(map);
         }
     }
-    //运行项目统计-折线图
-    @Override
-    public ResponseBodyVO selectRunProjectBySy() {
-        List<RunProjectVO> list=new ArrayList();
-        for(Integer i=6;i>-1;i--) {
-            RunProjectVO vo=new RunProjectVO();
-            Map<String,Object> params = TimeUtil.getPastTime(i);
-            params.put("createUserId", AuthUtil.getCurrentUserId());
-            Integer num = simulationProjectMapper.selectRunProjectBySy(params);
-            vo.setToDate(params.get("toDate").toString());
-            vo.setNum(num);
-            list.add(vo);
-        }
-         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,list);
-    }
-    //运行任务统计-折线图
-    @Override
-    public ResponseBodyVO selectRunTaskBySy() {
-        List<RunProjectVO> list=new ArrayList();
-        for(Integer i=6;i>-1;i--) {
-            RunProjectVO vo=new RunProjectVO();
-            Map<String,Object> params = TimeUtil.getPastTime(i);
-            params.put("createUserId", AuthUtil.getCurrentUserId());
-            Integer num = simulationProjectTaskMapper.selectRunTaskBySy(params);
-            vo.setToDate(params.get("toDate").toString());
-            vo.setNum(num);
-            list.add(vo);
-        }
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,list);
-    }
+
     //任务运行状态统计-饼图
     @Override
     public ResponseBodyVO selectRunTaskByState() {
@@ -4030,8 +4003,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         kafkaParam.setScenePackageId(po.getScene());
         kafkaParam.setMaxSimulationTime(po.getMaxSimulationTime());
         kafkaParam.setParallelism(Integer.valueOf(po.getParallelism()));
+        kafkaParam.setType(DictConstants.PROJECT_TYPE_AUTO_SUB);
         KafkaParameter kafkaParameter = new KafkaParameter();
-        kafkaParameter.setTopic(ProjectConstants.AUTO_PROJECT);
+        kafkaParameter.setTopic(ProjectConstants.RUN_TASK_TOPIC);
         String data = JsonUtil.beanToJson(kafkaParam);
         kafkaParameter.setData(data);
         log.info("自动运行项目推送消息到kafka:"+data);

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

@@ -93,8 +93,6 @@ public interface SimulationProjectMapper {
 
     List<SublistScoreVo> selectSubScore2(SimulationManualProjectParam param);
 
-    Integer selectRunProjectBySy(Map map);
-
     List<Map> selectRunProjectByState(Map map);
 
     List<Map> selectEvaluationLevel(Map map);

+ 0 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectTaskMapper.java

@@ -32,8 +32,6 @@ public interface SimulationProjectTaskMapper {
 
     SceneScoreVo selectSceneScoreNumQuery(SimulationMptSceneScorePo po);
 
-    Integer selectRunTaskBySy(Map map);
-
     List<Map> selectRunTaskByState(Map map);
 
     //更新仿真结果到数据库

+ 0 - 4
simulation-resource-server/src/main/java/com/css/simulation/resource/project/service/SimulationProjectService.java

@@ -33,10 +33,6 @@ public interface SimulationProjectService {
 
     ResponseBodyVO selectProjectTaskList(SimulationManualProjectParam param);
 
-    ResponseBodyVO selectRunProjectBySy();
-
-    ResponseBodyVO selectRunTaskBySy();
-
     ResponseBodyVO selectRunTaskByState();
 
     ResponseBodyVO selectRunProjectByState();

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SystemScenePackageController.java

@@ -46,7 +46,7 @@ public class SystemScenePackageController {
 
     }
 
-    //新增打分规则
+    //新增场景包
     @PostMapping("/saveSystemScenePackage")
     @ResponseBody
     public ResponseBodyVO<String> saveSystemScenePackage(@RequestBody SystemScenePackageNewPO parms) {

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

@@ -15,8 +15,10 @@ public interface SceneAccidentMapper {
     void saveSceneAccidentList(List<SceneAccidentPO> list);
 
     List<SceneAccidentPO> querySceneAccidentList(SceneAccidentParam params);
+    List<SceneAccidentPO> querySceneAccidentListByQx(SceneAccidentParam params);
     List<SceneAccidentPO> querySceneAccidentListByXlk(SceneAccidentParam params);
     List<SceneAccidentPO> querySceneAccidentListByBq(SceneAccidentParam params);
+    List<SceneAccidentPO> querySceneAccidentListByBqAndQx(SceneAccidentParam params);
 
     void deleteSceneAccidentList(SceneAccidentPO params);
 

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

@@ -18,5 +18,6 @@ public interface SceneGeneralTemplateMapper {
     void deleteSceneGeneralTemplateById(SceneGeneralTemplatePO po);
     List<String> queryType( );
 
+    List<SceneGeneralTemplatePO> querySceneGeneralTemplateListByQx(SceneGeneralTemplateParam params);
 
 }

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

@@ -28,4 +28,7 @@ public interface SceneNaturalMapper {
     void updateSceneNatural(SceneNaturalPO params);
     void updateSceneNaturalList(List<SceneNaturalPO> list);
 
+    List<SceneNaturalPO> querySceneNaturalListByQx(SceneNaturalParam params);
+    List<SceneNaturalPO> querySceneNaturalListByBqAndXlkAndQx(Map<String,SceneNaturalParam> map);
+    List<SceneNaturalPO> querySceneNaturalListByBqAndQx(Map<String,SceneNaturalParam> map);
 }

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

@@ -23,4 +23,7 @@ public interface StandardsRegulationsMapper {
 
     void updateStandardsRegulations(StandardsRegulationsPO params);
     void updateStandardsRegulationsList(List<StandardsRegulationsPO> list);
+
+    List<StandardsRegulationsPO> queryStandardsRegulationsListByQx(StandardsRegulationsParam params);
+    List<StandardsRegulationsPO> queryStandardsRegulationsListByBqAndQx(StandardsRegulationsParam params);
 }

+ 0 - 29
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemAccessMapper.java

@@ -1,29 +0,0 @@
-package com.css.simulation.resource.scene.mapper;
-
-import api.common.pojo.po.home.SystemAccessPO;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.Map;
-
-
-@Mapper
-public interface SystemAccessMapper {
-
-
-    @Select("<script>" +
-            "        select count(id) from system_access\n" +
-            "        where 1=1\n" +
-            "        <if test=\"startDate != null\">\n" +
-            "            and access_time &gt;= #{startDate}\n" +
-            "        </if>\n" +
-            "        <if test=\"endDate != null\">\n" +
-            "            and access_time &lt;= #{endDate}\n" +
-            "        </if>" +
-            "</script>")
-    Integer selectPastAccess(Map<String, Object> params);
-
-    @Select("insert into system_access(id, access_time) values (#{po.id}, #{po.accessTime})")
-    Integer insert(@Param("po") SystemAccessPO systemAccessPO);
-}

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

@@ -22,5 +22,7 @@ public interface SystemScenePackageMapper {
     void deleteSystemScenePackage(SystemScenePackagePO po);
     void updateSystemScenePackage(SystemScenePackagePO po);
 
+    //首页场景数量
+    Integer querySceneNum(String userId);
 
 }

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

@@ -194,14 +194,45 @@ public class SceneAccidentService {
             params.setBq(1);
         }
         List<SceneAccidentPO> list = new ArrayList<>();
-        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")){
+
+        String roleCode = AuthUtil.getCurrentUserRoleCode();
+        String userId = AuthUtil.getCurrentUserId();
+        if(DictConstants.ROLE_CODE_ADMIN.equals(roleCode) || DictConstants.ROLE_CODE_SYSADMIN.equals(roleCode)){ //管理员账户
+
+            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);
+                list = SceneAccidentMapper.querySceneAccidentListByBq(params);
+            }
+        }else if(DictConstants.ROLE_CODE_SUBUESR.equals(roleCode)){
+            //查询父账户
+            userId = AuthUtil.getCreateUserId();
+            params.setUserId(userId);
+            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.querySceneAccidentListByQx(params);
+            } else if (params.getXlk().equals("0") && params.getBq().equals(1)) {
+                list = SceneAccidentMapper.querySceneAccidentListByBqAndQx(params);
+            }
+        }else if(DictConstants.ROLE_CODE_UESR.equals(roleCode)){
+            //查询普通账户
+            params.setUserId(userId);
+            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.querySceneAccidentListByQx(params);
+            } else if (params.getXlk().equals("0") && params.getBq().equals(1)) {
+                list = SceneAccidentMapper.querySceneAccidentListByBqAndQx(params);
+            }
         }
 
+     /*   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(params.getConflictBehavior()!=null&&params.getConflictBehavior().size()>0){
@@ -290,6 +321,56 @@ public class SceneAccidentService {
         return list;
     }
 
+
+
+    public List<SceneAccidentPO> querySceneAccidentListByQx(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 = new ArrayList<>();
+        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("0") && params.getBq().equals(1)) {
+            list = SceneAccidentMapper.querySceneAccidentListByBq(params);
+        }
+
+
+        for (SceneAccidentPO po : list) {
+            if (po.getConflictBehavior().indexOf("追尾") > -1) {
+                po.setLabel("追尾");
+            }
+            if (po.getTargetDriving().indexOf("切入") > -1) {
+                if (ObjectUtil.isNull(po.getLabel())) {
+                    po.setLabel("目标车切入");
+                } else {
+                    po.setLabel(po.getLabel() + ",目标车切入");
+                }
+
+            }
+            if (po.getTargetDriving().indexOf("沿弯道行驶") > -1) {
+                if (ObjectUtil.isNull(po.getLabel())) {
+                    po.setLabel("目标车沿弯道行驶");
+                } else {
+                    po.setLabel(po.getLabel() + ",目标车沿弯道行驶");
+                }
+
+            }
+            if (po.getConflictType().indexOf("机动车-机动车") > -1) {
+                if (ObjectUtil.isNull(po.getLabel())) {
+                    po.setLabel("机动车-机动车冲突");
+                } else {
+                    po.setLabel(po.getLabel() + ",机动车-机动车冲突");
+                }
+            }
+        }
+
+        return list;
+    }
+
     public void deleteSceneAccidentList(SceneAccidentPO params) {
         params.setIsDeleted("1");
         params.setModifyTime(TimeUtil.getNowForMysql());

+ 4 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneGeneralTemplateService.java

@@ -325,8 +325,10 @@ public class SceneGeneralTemplateService {
         }else{
             SceneGeneralTemplateMbVO  mbVO=new SceneGeneralTemplateMbVO();
             BeanUtils.copyProperties(po, mbVO);
-            mbVO.setGeneralizationType(po.getGeneralizationType());
-            listMb.add(mbVO);
+            if(ObjectUtil.isNotNull(mbVO.getObsStartX())||ObjectUtil.isNotNull(mbVO.getObsStartY())||ObjectUtil.isNotNull(mbVO.getObsLateralAcceleration())||ObjectUtil.isNotNull(mbVO.getObsStartVelocity())){
+                mbVO.setGeneralizationType(po.getGeneralizationType());
+                listMb.add(mbVO);
+            }
         }
         vo.setListMb(listMb);
         vo.setTemplateId(vo.getId());

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

@@ -14,6 +14,7 @@ import api.common.util.TimeUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
 import com.css.simulation.resource.feign.FileDownService;
 import com.css.simulation.resource.scene.mapper.SceneNaturalMapper;
+import com.css.simulation.resource.scene.mapper.SystemScenePackageMapper;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.github.pagehelper.util.StringUtil;
@@ -33,7 +34,7 @@ public class SceneNaturalService {
     @Resource
     private SceneNaturalMapper sceneNaturalMapper;
     @Resource
-    private SystemUserSceneService systemUserSceneService;
+    private SystemScenePackageMapper systemScenePackageMapper;
 
 
     @Resource
@@ -377,8 +378,20 @@ public class SceneNaturalService {
     }
     public Integer querySceneNumBySy() {
         SceneNaturalParam params=new SceneNaturalParam();
-        params.setCreateUserId(AuthUtil.getCurrentUserId());
-       return sceneNaturalMapper.querySceneNumBySy(params);
+        String roleCode = AuthUtil.getCurrentUserRoleCode();
+        String userId = AuthUtil.getCurrentUserId();
+        if(DictConstants.ROLE_CODE_ADMIN.equals(roleCode) || DictConstants.ROLE_CODE_SYSADMIN.equals(roleCode)){
+            //管理员账户
+            return sceneNaturalMapper.querySceneNumBySy(params);
+        }else if(DictConstants.ROLE_CODE_SUBUESR.equals(roleCode)){
+            //根据普通子账户查询父账户
+            userId = AuthUtil.getCreateUserId();
+           return systemScenePackageMapper.querySceneNum(userId);
+        }else if(DictConstants.ROLE_CODE_UESR.equals(roleCode)){
+            //查询普通账户
+            return systemScenePackageMapper.querySceneNum(userId);
+        }
+        return 0;
     }
 
 

+ 32 - 28
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SystemScenePackageService.java

@@ -53,65 +53,69 @@ public class SystemScenePackageService {
         po.setCreateUserId(AuthUtil.getCurrentUserId());
         po.setIsDeleted("0");
         //zr
-        List<String> zrIds=params.getZrIds();
-        if(ObjectUtil.isNotNull(zrIds)){
+        List<String> zrSceneNames=params.getZrSceneNames();
+        if(ObjectUtil.isNotNull(zrSceneNames)){
             List<SystemScenePackageSublistPO> zrList=new ArrayList<>();
-            for (String id:zrIds) {
+            for (String zrSceneName:zrSceneNames) {
                 SystemScenePackageSublistPO zrPo=new SystemScenePackageSublistPO();
                 zrPo.setSublistId(StringUtil.getRandomUUID());
                 zrPo.setSceneType("1");
-                zrPo.setSceneId(id);
+                zrPo.setSceneName(zrSceneName);
                 zrPo.setSceneAndPackage(packId);
                 zrPo.setCreateTime(TimeUtil.getNowForMysql());
                 zrPo.setModifyTime(TimeUtil.getNowForMysql());
                 zrPo.setCreateUserId(AuthUtil.getCurrentUserId());
+                zrPo.setIsDeleted("0");
                 zrList.add(zrPo);
             }
             systemScenePackageSublistMapper.saveSystemScenePackageSublist(zrList);
         }
 //zr
-        List<String> bzIds=params.getBzIds();
-        if(ObjectUtil.isNotNull(bzIds)){
+        List<String> bzSceneNames=params.getBzSceneNames();
+        if(ObjectUtil.isNotNull(bzSceneNames)){
             List<SystemScenePackageSublistPO> bzList=new ArrayList<>();
-            for (String id:bzIds) {
+            for (String bzSceneName:bzSceneNames) {
                 SystemScenePackageSublistPO bzPo=new SystemScenePackageSublistPO();
                 bzPo.setSublistId(StringUtil.getRandomUUID());
                 bzPo.setSceneType("2");
-                bzPo.setSceneId(id);
+                bzPo.setSceneName(bzSceneName);
                 bzPo.setSceneAndPackage(packId);
                 bzPo.setCreateTime(TimeUtil.getNowForMysql());
                 bzPo.setModifyTime(TimeUtil.getNowForMysql());
+                bzPo.setIsDeleted("0");
                 bzPo.setCreateUserId(AuthUtil.getCurrentUserId());
                 bzList.add(bzPo);
             }
             systemScenePackageSublistMapper.saveSystemScenePackageSublist(bzList);
         }
         //zr
-        List<String> jtIds=params.getJtIds();
-        if(ObjectUtil.isNotNull(jtIds)){
+        List<String> jtSceneNames=params.getJtSceneNames();
+        if(ObjectUtil.isNotNull(jtSceneNames)){
             List<SystemScenePackageSublistPO> jtList=new ArrayList<>();
-            for (String id:jtIds) {
+            for (String jtSceneName:jtSceneNames) {
                 SystemScenePackageSublistPO jtPo=new SystemScenePackageSublistPO();
                 jtPo.setSublistId(StringUtil.getRandomUUID());
                 jtPo.setSceneType("3");
-                jtPo.setSceneId(id);
+                jtPo.setSceneName(jtSceneName);
                 jtPo.setSceneAndPackage(packId);
                 jtPo.setCreateTime(TimeUtil.getNowForMysql());
                 jtPo.setModifyTime(TimeUtil.getNowForMysql());
                 jtPo.setCreateUserId(AuthUtil.getCurrentUserId());
+                jtPo.setIsDeleted("0");
                 jtList.add(jtPo);
             }
             systemScenePackageSublistMapper.saveSystemScenePackageSublist(jtList);
         }
         //zr
-        List<String> fhIds=params.getFhIds();
-        if(ObjectUtil.isNotNull(fhIds)){
+        List<String> fhSceneNames=params.getFhSceneNames();
+        if(ObjectUtil.isNotNull(fhSceneNames)){
             List<SystemScenePackageSublistPO> fhList=new ArrayList<>();
-            for (String id:zrIds) {
+            for (String fhSceneName:fhSceneNames) {
                 SystemScenePackageSublistPO fhPo=new SystemScenePackageSublistPO();
                 fhPo.setSublistId(StringUtil.getRandomUUID());
+                fhPo.setIsDeleted("0");
                 fhPo.setSceneType("4");
-                fhPo.setSceneId(id);
+                fhPo.setSceneName(fhSceneName);
                 fhPo.setSceneAndPackage(packId);
                 fhPo.setCreateTime(TimeUtil.getNowForMysql());
                 fhPo.setModifyTime(TimeUtil.getNowForMysql());
@@ -144,10 +148,10 @@ public class SystemScenePackageService {
         sublistPo.setSceneType("4");
         List<String>  fhList=systemScenePackageSublistMapper.querySystemScenePackageSublistList(sublistPo);
         BeanUtils.copyProperties(po, newPo);
-        newPo.setZrIds(zrList);
-        newPo.setBzIds(bzList);
-        newPo.setJtIds(jtList);
-        newPo.setFhIds(fhList);
+        newPo.setZrSceneNames(zrList);
+        newPo.setBzSceneNames(bzList);
+        newPo.setJtSceneNames(jtList);
+        newPo.setFhSceneNames(fhList);
         return newPo;
     }
     //编辑场景包
@@ -166,14 +170,14 @@ public class SystemScenePackageService {
         sublistPO.setIsDeleted("1");
         systemScenePackageSublistMapper.deleteSystemScenePackageSublist(sublistPO);
         //zr
-        List<String> zrIds=params.getZrIds();
+        List<String> zrIds=params.getZrSceneNames();
         if(ObjectUtil.isNotNull(zrIds)){
             List<SystemScenePackageSublistPO> zrList=new ArrayList<>();
             for (String id:zrIds) {
                 SystemScenePackageSublistPO zrPo=new SystemScenePackageSublistPO();
                 zrPo.setSublistId(StringUtil.getRandomUUID());
                 zrPo.setSceneType("1");
-                zrPo.setSceneId(id);
+                zrPo.setSceneName(id);
                 zrPo.setSceneAndPackage(packId);
                 zrPo.setCreateTime(TimeUtil.getNowForMysql());
                 zrPo.setModifyTime(TimeUtil.getNowForMysql());
@@ -183,14 +187,14 @@ public class SystemScenePackageService {
             systemScenePackageSublistMapper.saveSystemScenePackageSublist(zrList);
         }
 //zr
-        List<String> bzIds=params.getBzIds();
+        List<String> bzIds=params.getBzSceneNames();
         if(ObjectUtil.isNotNull(bzIds)){
             List<SystemScenePackageSublistPO> bzList=new ArrayList<>();
             for (String id:bzIds) {
                 SystemScenePackageSublistPO bzPo=new SystemScenePackageSublistPO();
                 bzPo.setSublistId(StringUtil.getRandomUUID());
                 bzPo.setSceneType("2");
-                bzPo.setSceneId(id);
+                bzPo.setSceneName(id);
                 bzPo.setSceneAndPackage(packId);
                 bzPo.setCreateTime(TimeUtil.getNowForMysql());
                 bzPo.setModifyTime(TimeUtil.getNowForMysql());
@@ -200,14 +204,14 @@ public class SystemScenePackageService {
             systemScenePackageSublistMapper.saveSystemScenePackageSublist(bzList);
         }
         //zr
-        List<String> jtIds=params.getJtIds();
+        List<String> jtIds=params.getJtSceneNames();
         if(ObjectUtil.isNotNull(jtIds)){
             List<SystemScenePackageSublistPO> jtList=new ArrayList<>();
             for (String id:jtIds) {
                 SystemScenePackageSublistPO jtPo=new SystemScenePackageSublistPO();
                 jtPo.setSublistId(StringUtil.getRandomUUID());
                 jtPo.setSceneType("3");
-                jtPo.setSceneId(id);
+                jtPo.setSceneName(id);
                 jtPo.setSceneAndPackage(packId);
                 jtPo.setCreateTime(TimeUtil.getNowForMysql());
                 jtPo.setModifyTime(TimeUtil.getNowForMysql());
@@ -217,14 +221,14 @@ public class SystemScenePackageService {
             systemScenePackageSublistMapper.saveSystemScenePackageSublist(jtList);
         }
         //zr
-        List<String> fhIds=params.getFhIds();
+        List<String> fhIds=params.getFhSceneNames();
         if(ObjectUtil.isNotNull(fhIds)){
             List<SystemScenePackageSublistPO> fhList=new ArrayList<>();
             for (String id:zrIds) {
                 SystemScenePackageSublistPO fhPo=new SystemScenePackageSublistPO();
                 fhPo.setSublistId(StringUtil.getRandomUUID());
                 fhPo.setSceneType("4");
-                fhPo.setSceneId(id);
+                fhPo.setSceneName(id);
                 fhPo.setSceneAndPackage(packId);
                 fhPo.setCreateTime(TimeUtil.getNowForMysql());
                 fhPo.setModifyTime(TimeUtil.getNowForMysql());

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/ClusterCtrl.java

@@ -8,6 +8,7 @@ import api.common.util.ObjectUtil;
 import com.css.simulation.resource.system.service.ClusterService;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -18,6 +19,7 @@ import java.util.HashMap;
 
 @Controller()
 @RequestMapping("/cluster")
+@PreAuthorize("@AuthorityCheck.adminAndUser()")
 public class ClusterCtrl {
 
     @Autowired

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/ParameterCtrl.java

@@ -8,6 +8,7 @@ import api.common.util.ObjectUtil;
 import com.css.simulation.resource.system.service.ParameterService;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -18,6 +19,7 @@ import java.util.HashMap;
 
 @Controller()
 @RequestMapping("/parameter")
+@PreAuthorize("@AuthorityCheck.admin()")
 public class ParameterCtrl {
 
     @Autowired

+ 2 - 3
simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/UserInfoCtrl.java

@@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.annotation.Resource;
 import java.security.NoSuchAlgorithmException;
-import java.util.HashMap;
 import java.util.List;
 
 
@@ -81,7 +80,7 @@ public class UserInfoCtrl {
     }
 
     /**
-     * 获取当前登录人详情
+     * 获取场景资源
      */
     @RequestMapping("/getSceneResource")
     @ResponseBody
@@ -89,7 +88,7 @@ public class UserInfoCtrl {
         String roleCode = AuthUtil.getCurrentUserRoleCode();
         String userId = AuthUtil.getCurrentUserId();
         if(DictConstants.ROLE_CODE_ADMIN.equals(roleCode) || DictConstants.ROLE_CODE_SYSADMIN.equals(roleCode)){ //管理员账户
-            return null;
+            return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
         }else if(DictConstants.ROLE_CODE_SUBUESR.equals(roleCode)){
             //查询父账户
             userId = AuthUtil.getCreateUserId();

+ 4 - 4
simulation-resource-server/src/main/java/com/css/simulation/resource/system/service/UserService.java

@@ -41,10 +41,10 @@ public class UserService {
     public UserVO getCurrentUserInfo() {
         String userId = AuthUtil.getCurrentUserId();
         UserVO userVO = userMapper.getUserInfo(userId);
-        Map<String, String> useTypeDictMap = dictService.getDictMapByType(DictConstants.USE_TYPE);
-        userVO.setUseTypeName(useTypeDictMap.get(userVO.getUseType()));
-        Map<String, String> roleCodeDictMap = dictService.getDictMapByType(DictConstants.ROLE_CODE);
-        userVO.setRoleCodeName(roleCodeDictMap.get(userVO.getRoleCode()));
+        //字典翻译
+        Map<String, Map<String, String>> dictMaps = dictService.getDictMapsByTypes(DictConstants.USE_TYPE + "," + DictConstants.ROLE_CODE);
+        userVO.setUseTypeName(dictMaps.get(DictConstants.USE_TYPE).get(userVO.getUseType()));
+        userVO.setRoleCodeName(dictMaps.get(DictConstants.ROLE_CODE).get(userVO.getRoleCode()));
         return userVO;
     }
 

+ 40 - 0
simulation-resource-server/src/main/resources/mapper/home/HomePageMapper.xml

@@ -0,0 +1,40 @@
+<?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.home.mapper.HomePageMapper" >
+
+    <select id="selectRunTaskChart" parameterType="java.util.Map" resultType="api.common.pojo.vo.home.LineChartVO">
+        select
+          COUNT(id) as num,
+          DATE(run_start_time) as toDate
+        FROM simulation_manual_project_task
+        WHERE run_start_time >= #{dateBegin,jdbcType=VARCHAR}
+        and create_user_id = #{createUserId,jdbcType=VARCHAR}
+        GROUP BY DATE(run_start_time)
+        ORDER BY toDate ASC
+    </select>
+
+    <select id="selectRunProjectChart" parameterType="java.util.Map" resultType="api.common.pojo.vo.home.LineChartVO">
+        SELECT
+          COUNT(1) as num,
+          DATE(t.start_time) as toDate
+        FROM(
+          SELECT start_time FROM simulation_manual_project
+          WHERE start_time >= #{dateBegin,jdbcType=VARCHAR} and create_user_id = #{createUserId,jdbcType=VARCHAR}
+          UNION ALL
+          SELECT start_time FROM simulation_automatic_subproject
+          WHERE start_time >= #{dateBegin,jdbcType=VARCHAR} and create_user_id = #{createUserId,jdbcType=VARCHAR}) as t
+        GROUP BY DATE(t.start_time)
+        ORDER BY toDate ASC
+    </select>
+
+    <select id="getRuningTask" parameterType="java.lang.String" resultType="java.lang.Integer">
+        select
+          COUNT(id) as num
+        FROM simulation_manual_project_task
+        WHERE (run_state = 'Pending'
+          OR run_state = 'Running'
+          OR run_state = 'PendingAnalysis'
+          OR run_state = 'Analysing')
+          and create_user_id = #{currentUserId,jdbcType=VARCHAR}
+    </select>
+</mapper>

+ 10 - 0
simulation-resource-server/src/main/resources/mapper/log/LogMapper.xml

@@ -125,4 +125,14 @@
           #{content,jdbcType=VARCHAR},
           #{createTime,jdbcType=TIMESTAMP})
     </insert>
+
+    <select id="getAccessCount" parameterType="java.lang.String" resultType="api.common.pojo.vo.home.LineChartVO">
+        select
+          COUNT(DISTINCT(user_id)) as num,
+          DATE(create_time) as toDate
+        FROM log_login
+        WHERE create_time &gt;= #{dateBegin,jdbcType=VARCHAR}
+        GROUP BY DATE(create_time)
+        ORDER BY toDate ASC
+    </select>
 </mapper>

+ 0 - 19
simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml

@@ -499,25 +499,6 @@
 		order by sub.seq
     </select>
 
-
-
-    <!--查询某天运行项目数量-->
-    <select id="selectRunProjectBySy" parameterType="java.util.Map" resultType="java.lang.Integer">
-        select count(id) from simulation_manual_project
-        where
-        is_deleted = '0'
-        <if test="createUserId != null and createUserId != ''">
-            and create_user_id=#{createUserId,jdbcType=VARCHAR}
-        </if>
-        <if test="startDate != null">
-            and start_time &gt;= #{startDate}
-        </if>
-        <if test="endDate != null">
-            and start_time &lt;= #{endDate}
-        </if>
-    </select>
-
-
     <!--运行项目状态-->
     <select id="selectRunProjectByState" parameterType="java.util.Map" resultType="java.util.Map">
         select count(now_run_state) num,now_run_state nowRunState from simulation_manual_project

+ 0 - 16
simulation-resource-server/src/main/resources/mapper/project/SimulationProjectTaskMapper.xml

@@ -73,22 +73,6 @@
         group by run_state
     </select>
 
-    <!--查询某天运行任务数量-->
-    <select id="selectRunTaskBySy" parameterType="java.util.Map" resultType="java.lang.Integer">
-        select count(id) from simulation_manual_project_task
-        where
-        is_deleted = '0'
-        <if test="createUserId != null and createUserId != ''">
-            and create_user_id=#{createUserId,jdbcType=VARCHAR}
-        </if>
-        <if test="startDate != null">
-            and run_start_time &gt;= #{startDate}
-        </if>
-        <if test="endDate != null">
-            and run_start_time &lt;= #{endDate}
-        </if>
-    </select>
-
     <!--查询场景不等于0的得分的数量-->
     <select id="selectSceneScoreNumQuery" parameterType="api.common.pojo.po.project.SimulationMptSceneScorePo" resultType="api.common.pojo.vo.project.SceneScoreVo">
         select count(*) as num

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

@@ -306,4 +306,166 @@
             where accident_id = #{item.accidentId,jdbcType=VARCHAR}
         </foreach>
     </update>
+
+
+
+
+    <select id="querySceneAccidentListByQx" 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,
+        scence_resume,scene_time,scene_weather,
+        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,max_time
+        from(
+        select
+        accident_id,scene_name,self_driving,target_driving,
+        self_reaction,conflict_behavior,conflict_type,
+        scence_resume,scene_time,scene_weather,
+        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,max_time
+        from ( select jt.* from( select s.scene_name
+        FROM system_scene_package p
+        JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+        JOIN system_scene_package_sublist s on p.id = s.scene_and_package
+        where scene_type='3' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join  scene_accident jt on qx.scene_name=jt.scene_name) cc
+        <where>
+            <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,
+            scence_resume,scene_time,scene_weather,
+            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,max_time
+            from ( select jt.* from( select s.scene_name
+            FROM system_scene_package p
+            JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+            JOIN system_scene_package_sublist s on p.id = s.scene_and_package
+            where scene_type='3' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join  scene_accident jt on qx.scene_name=jt.scene_name) dd
+            <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="querySceneAccidentListByBqAndQx" 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,
+        scence_resume,scene_time,scene_weather,
+        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,max_time
+        from( select
+        accident_id,scene_name,self_driving,target_driving,
+        self_reaction,conflict_behavior,conflict_type,
+        scence_resume,scene_time,scene_weather,
+        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,max_time
+        from ( select jt.* from( select s.scene_name
+        FROM system_scene_package p
+        JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+        JOIN system_scene_package_sublist s on p.id = s.scene_and_package
+        where scene_type='3' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join  scene_accident jt on qx.scene_name=jt.scene_name) dd
+        <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>
+
 </mapper>

+ 48 - 3
simulation-resource-server/src/main/resources/mapper/scene/SceneGeneralTemplateMapper.xml

@@ -3,7 +3,6 @@
 <mapper namespace="com.css.simulation.resource.scene.mapper.SceneGeneralTemplateMapper">
 
     <insert id="saveSceneGeneralTemplateAll" parameterType="java.util.List">
-
         insert into simulation.scene_general_template
         (id,scene_id,scenario_name,scenario_weather,scenario_time,
         scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
@@ -32,7 +31,6 @@
 
     <select id="querySceneGeneralTemplateList" parameterType="api.common.pojo.param.scene.SceneGeneralTemplateParam"
             resultType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
-
         select
         id,scene_id,scenario_name,scenario_weather,scenario_time,
         scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
@@ -77,7 +75,6 @@
     </select>
     <select id="querySceneGeneralTemplateById" parameterType="java.lang.String"
             resultType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
-
         select
         id,scene_id,scenario_name,scenario_weather,scenario_time,
         scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
@@ -142,4 +139,52 @@
         where id=#{id}
     </update>
 
+    <select id="querySceneGeneralTemplateListByQx" parameterType="api.common.pojo.param.scene.SceneGeneralTemplateParam"
+            resultType="api.common.pojo.po.scene.SceneGeneralTemplatePO">
+        select
+        id,scene_id,scenario_name,scenario_weather,scenario_time,
+        scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
+        ego_start_velocity,ego_heading_angle,ego_velocity_status,ego_trajectory,ego_duration_time,
+        ego_velocity_time,ego_trajectory_time,obs_start_x,obs_start_y,obs_start_velocity,
+        obs_lateral_acceleration,obs_longitudinal_acceleration,
+        obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
+        obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
+        video_link,file_name,version,
+        create_user_id,create_time,modify_time
+        from (select fh.* from( select s.scene_name
+        FROM system_scene_package p
+        JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+        JOIN system_scene_package_sublist s on p.id = s.scene_and_package
+        where scene_type='2' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_general_template  fh on qx.scene_name=fh.scene_id and fh.is_deleted = '0') dd
+        <where>
+            is_deleted = '0'
+            <if test="id != null and id != ''">
+                and id #{id,jdbcType=VARCHAR}
+            </if>
+            <if test="sceneId != null and sceneId != ''">
+                and scene_id like CONCAT('%',#{sceneId,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="scenarioWeather != null and scenarioWeather.size()>0 ">
+                and scenario_weather in
+                <foreach collection="scenarioWeather" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="fileName != null and fileName.size()>0 ">
+                and file_name in
+                <foreach collection="fileName" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="scenarioTime != null and scenarioTime != ''">
+                and scenario_time= #{scenarioTime,jdbcType=VARCHAR}
+            </if>
+            <if test="version != null and version != ''">
+                and version= #{version}
+            </if>
+            order by modify_time desc
+        </where>
+    </select>
 </mapper>

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

@@ -1327,4 +1327,1197 @@
             where natural_id = #{item.naturalId,jdbcType=VARCHAR}
         </foreach>
     </update>
+
+
+    <select id="querySceneNaturalListByQx" 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,max_time
+        from  (select zr.* from( select s.scene_name
+        FROM system_scene_package p
+        JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+        JOIN system_scene_package_sublist s on p.id = s.scene_and_package
+        where scene_type='1' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_natural  zr on qx.scene_name=zr.natural_name) dd
+        <where>
+            is_deleted = '0'
+            <if test="naturalName != null and naturalName != ''">
+                and natural_name like CONCAT('%',#{naturalName,jdbcType=VARCHAR},'%')
+            </if>
+            <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.size()>0">
+                and backlight in
+                <foreach collection="backlight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <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.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.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.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.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.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.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.size()>0">
+                and ramp in
+                <foreach collection="ramp" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <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.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.size()>0">
+                and bridge in
+                <foreach collection="bridge" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.size()>0">
+                and patency in
+                <foreach collection="patency" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <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.size()>0">
+                and violation in
+                <foreach collection="violation" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <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.size()>0">
+                and
+                <foreach collection="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="targetBehavior != null and targetBehavior.size()>0">
+                and
+                <foreach collection="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="ids != null and ids.length>0">
+                and natural_id in
+                <foreach collection="ids" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{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>
+
+    <select id="querySceneNaturalListByBqAndXlkAndQx" 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,max_time
+        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,max_time
+        from (select zr.* from( select s.scene_name
+        FROM system_scene_package p
+        JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+        JOIN system_scene_package_sublist s on p.id = s.scene_and_package
+        where scene_type='1' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_natural  zr on qx.scene_name=zr.natural_name) dd
+        <where>
+            <if test="po.naturalName != null and po.naturalName != ''">
+                natural_name like CONCAT('%',#{po.naturalName,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="po.weather != null and po.weather.size()>0 ">
+                and weather in
+                <foreach collection="po.weather" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.backlight != null and po.backlight.size()>0">
+                and backlight in
+                <foreach collection="po.backlight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.lightChange != null and po.lightChange.size()>0">
+                and light_change in
+                <foreach collection="po.lightChange" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.roadType != null and po.roadType.size()>0">
+                and road_type in
+                <foreach collection="po.roadType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.roadMatrrial != null and po.roadMatrrial.size()>0">
+                and road_matrrial in
+                <foreach collection="po.roadMatrrial" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.drivewayNum != null and po.drivewayNum.size()>0">
+                and driveway_num in
+                <foreach collection="po.drivewayNum" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.drivewayType != null and po.drivewayType.size()>0">
+                and driveway_type in
+                <foreach collection="po.drivewayType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.roadFlatness != null and po.roadFlatness.size()>0">
+                and road_flatness in
+                <foreach collection="po.roadFlatness" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.roadCurvature != null and po.roadCurvature.size()>0">
+                and road_curvature in
+                <foreach collection="po.roadCurvature" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.ramp != null and po.ramp.size()>0">
+                and ramp in
+                <foreach collection="po.ramp" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.intersectionType != null and po.intersectionType.size()>0">
+                and intersection_type in
+                <foreach collection="po.intersectionType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.planeIntersection != null and po.planeIntersection.size()>0">
+                and plane_intersection in
+                <foreach collection="po.planeIntersection" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.bridge != null and po.bridge.size()>0">
+                and bridge in
+                <foreach collection="po.bridge" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.tunnel != null and po.tunnel.size()>0">
+                and tunnel in
+                <foreach collection="po.tunnel" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.speedLimit != null and po.speedLimit.size()>0">
+                and speed_limit in
+                <foreach collection="po.speedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.minSpeedLimit != null and po.minSpeedLimit.size()>0">
+                and min_speed_limit in
+                <foreach collection="po.minSpeedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.noEntry != null and po.noEntry.size()>0">
+                and no_entry in
+                <foreach collection="po.noEntry" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.noStopping != null and po.noStopping.size()>0">
+                and no_stopping in
+                <foreach collection="po.noStopping" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.leftLaneLine != null and po.leftLaneLine.size()>0">
+                and left_lane_line in
+                <foreach collection="po.leftLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.rightLaneLine != null and po.rightLaneLine.size()>0">
+                and right_lane_line in
+                <foreach collection="po.rightLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.conductorMarking != null and po.conductorMarking.size()>0">
+                and conductor_marking in
+                <foreach collection="po.conductorMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.pedestrianCrossing != null and po.pedestrianCrossing.size()>0">
+                and pedestrian_crossing in
+                <foreach collection="po.pedestrianCrossing" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.trafficLight != null and po.trafficLight.size()>0">
+                and traffic_light in
+                <foreach collection="po.trafficLight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.decelerationMarking != null and po.decelerationMarking.size()>0">
+                and deceleration_marking in
+                <foreach collection="po.decelerationMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.pavementCondition != null and po.pavementCondition.size()>0">
+                and pavement_condition in
+                <foreach collection="po.pavementCondition" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.naturalDisaster != null and po.naturalDisaster.size()>0">
+                and natural_disaster in
+                <foreach collection="po.naturalDisaster" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.roadSafetySigns != null and po.roadSafetySigns.size()>0">
+                and road_safety_signs in
+                <foreach collection="po.roadSafetySigns" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.safetyWarningBoard != null and po.safetyWarningBoard.size()>0">
+                and safety_warning_board in
+                <foreach collection="po.safetyWarningBoard" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.trafficAccident != null and po.trafficAccident.size()>0">
+                and traffic_accident in
+                <foreach collection="po.trafficAccident" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.patency != null and po.patency.size()>0">
+                and patency in
+                <foreach collection="po.patency" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.specialVehicleYield != null and po.specialVehicleYield.size()>0">
+                and special_vehicle_yield in
+                <foreach collection="po.specialVehicleYield" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.violation != null and po.violation.size()>0">
+                and violation in
+                <foreach collection="po.violation" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.doubleFlashingCar != null and po.doubleFlashingCar.size()>0">
+                and double_flashing_car in
+                <foreach collection="po.doubleFlashingCar" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="po.selfBehavior != null and po.selfBehavior.size()>0">
+                and
+                <foreach collection="po.selfBehavior" item="item" index="index"
+                         separator=" or " open="(" close=")">
+                    self_behavior like CONCAT('%,',#{item},',%')
+                    or self_behavior like CONCAT('%,',#{item}) or
+                    self_behavior like CONCAT(#{item},',%') or
+                    self_behavior=#{item}
+                </foreach>
+
+            </if>
+            <if test="po.targetBehavior != null and po.targetBehavior.size()>0">
+                and
+                <foreach collection="po.targetBehavior" item="item" index="index"
+                         separator=" or " open="(" close=")">
+                    target_behavior like CONCAT('%,',#{item},',%')
+                    or target_behavior like CONCAT('%,',#{item}) or
+                    target_behavior like CONCAT(#{item},',%') or
+                    target_behavior=#{item}
+                </foreach>
+
+            </if>
+            <if test="po.ids != null and po.ids.length>0">
+                and natural_id in
+                <foreach collection="po.ids" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        union
+        select
+        natural_id,natural_name,weather,backlight,light_change,road_type,
+        road_matrrial,driveway_num,driveway_type,road_flatness,road_curvature,
+        ramp,intersection_type,plane_intersection,bridge,tunnel,speed_limit,
+        min_speed_limit,no_entry,no_stopping,left_lane_line,right_lane_line,
+        conductor_marking,pedestrian_crossing,traffic_light,deceleration_marking,
+        pavement_condition,natural_disaster,road_safety_signs,safety_warning_board,
+        traffic_accident,patency,special_vehicle_yield,violation,double_flashing_car,
+        self_behavior,target_behavior,create_user_id,create_time,modify_user_id,
+        modify_time,is_deleted,share,video_address,osgb_address,
+        xodr_address,xosc_address,json_address,video_preview,max_time
+        from (select zr.* from( select s.scene_name
+        FROM system_scene_package p
+        JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+        JOIN system_scene_package_sublist s on p.id = s.scene_and_package
+        where scene_type='1' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_natural  zr on qx.scene_name=zr.natural_name) ee
+        <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="querySceneNaturalListByBqAndQx" 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,max_time  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,max_time
+        from (select zr.* from( select s.scene_name
+        FROM system_scene_package p
+        JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+        JOIN system_scene_package_sublist s on p.id = s.scene_and_package
+        where scene_type='1' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_natural  zr on qx.scene_name=zr.natural_name) dd
+        <where>
+            <if test="poBq.naturalName != null and poBq.naturalName != ''">
+                natural_name like CONCAT('%',#{poBq.naturalName,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="poBq.weather != null and poBq.weather.size()>0 ">
+                or weather in
+                <foreach collection="poBq.weather" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.backlight != null and poBq.backlight.size()>0">
+                or backlight in
+                <foreach collection="poBq.backlight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.lightChange != null and poBq.lightChange.size()>0">
+                or light_change in
+                <foreach collection="poBq.lightChange" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadType != null and poBq.roadType.size()>0">
+                or road_type in
+                <foreach collection="poBq.roadType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadMatrrial != null and poBq.roadMatrrial.size()>0">
+                or road_matrrial in
+                <foreach collection="poBq.roadMatrrial" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.drivewayNum != null and poBq.drivewayNum.size()>0">
+                or driveway_num in
+                <foreach collection="poBq.drivewayNum" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.drivewayType != null and poBq.drivewayType.size()>0">
+                or driveway_type in
+                <foreach collection="poBq.drivewayType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadFlatness != null and poBq.roadFlatness.size()>0">
+                or road_flatness in
+                <foreach collection="poBq.roadFlatness" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadCurvature != null and poBq.roadCurvature.size()>0">
+                or road_curvature in
+                <foreach collection="poBq.roadCurvature" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.ramp != null and poBq.ramp.size()>0">
+                or ramp in
+                <foreach collection="poBq.ramp" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.intersectionType != null and poBq.intersectionType.size()>0">
+                or intersection_type in
+                <foreach collection="poBq.intersectionType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.planeIntersection != null and poBq.planeIntersection.size()>0">
+                or plane_intersection in
+                <foreach collection="poBq.planeIntersection" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.bridge != null and poBq.bridge.size()>0">
+                or bridge in
+                <foreach collection="poBq.bridge" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.tunnel != null and poBq.tunnel.size()>0">
+                or tunnel in
+                <foreach collection="poBq.tunnel" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.speedLimit != null and poBq.speedLimit.size()>0">
+                or speed_limit in
+                <foreach collection="poBq.speedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.minSpeedLimit != null and poBq.minSpeedLimit.size()>0">
+                or min_speed_limit in
+                <foreach collection="poBq.minSpeedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.noEntry != null and poBq.noEntry.size()>0">
+                or no_entry in
+                <foreach collection="poBq.noEntry" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.noStopping != null and poBq.noStopping.size()>0">
+                or no_stopping in
+                <foreach collection="poBq.noStopping" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.leftLaneLine != null and poBq.leftLaneLine.size()>0">
+                or left_lane_line in
+                <foreach collection="poBq.leftLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.rightLaneLine != null and poBq.rightLaneLine.size()>0">
+                or right_lane_line in
+                <foreach collection="poBq.rightLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.conductorMarking != null and poBq.conductorMarking.size()>0">
+                or conductor_marking in
+                <foreach collection="poBq.conductorMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.pedestrianCrossing != null and poBq.pedestrianCrossing.size()>0">
+                or pedestrian_crossing in
+                <foreach collection="poBq.pedestrianCrossing" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.trafficLight != null and poBq.trafficLight.size()>0">
+                or traffic_light in
+                <foreach collection="poBq.trafficLight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.decelerationMarking != null and poBq.decelerationMarking.size()>0">
+                or deceleration_marking in
+                <foreach collection="poBq.decelerationMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.pavementCondition != null and poBq.pavementCondition.size()>0">
+                or pavement_condition in
+                <foreach collection="poBq.pavementCondition" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.naturalDisaster != null and poBq.naturalDisaster.size()>0">
+                or natural_disaster in
+                <foreach collection="poBq.naturalDisaster" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.roadSafetySigns != null and poBq.roadSafetySigns.size()>0">
+                or road_safety_signs in
+                <foreach collection="poBq.roadSafetySigns" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.safetyWarningBoard != null and poBq.safetyWarningBoard.size()>0">
+                or safety_warning_board in
+                <foreach collection="poBq.safetyWarningBoard" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.trafficAccident != null and poBq.trafficAccident.size()>0">
+                or traffic_accident in
+                <foreach collection="poBq.trafficAccident" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.patency != null and poBq.patency.size()>0">
+                or patency in
+                <foreach collection="poBq.patency" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.specialVehicleYield != null and poBq.specialVehicleYield.size()>0">
+                or special_vehicle_yield in
+                <foreach collection="poBq.specialVehicleYield" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.violation != null and poBq.violation.size()>0">
+                or violation in
+                <foreach collection="poBq.violation" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.doubleFlashingCar != null and poBq.doubleFlashingCar.size()>0">
+                or double_flashing_car in
+                <foreach collection="poBq.doubleFlashingCar" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="poBq.selfBehavior != null and poBq.selfBehavior.size()>0">
+                or
+                <foreach collection="poBq.selfBehavior" item="item" index="index"
+                         separator=" or " open="(" close=")">
+                    self_behavior like CONCAT('%,',#{item},',%')
+                    or self_behavior like CONCAT('%,',#{item}) or
+                    self_behavior like CONCAT(#{item},',%') or
+                    self_behavior=#{item}
+                </foreach>
+
+            </if>
+            <if test="poBq.targetBehavior != null and poBq.targetBehavior.size()>0">
+                or
+                <foreach collection="poBq.targetBehavior" item="item" index="index"
+                         separator=" or " open="(" close=")">
+                    target_behavior like CONCAT('%,',#{item},',%')
+                    or target_behavior like CONCAT('%,',#{item}) or
+                    target_behavior like CONCAT(#{item},',%') or
+                    target_behavior=#{item}
+                </foreach>
+
+            </if>
+            <if test="poBq.ids != null and poBq.ids.length>0">
+                or natural_id in
+                <foreach collection="poBq.ids" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            ) a
+            where
+            a.is_deleted = '0'
+            <if test="po.AllIds != null and po.AllIds.size()>0">
+                and a.natural_id in
+                <foreach collection="po.AllIds" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            order by a.modify_time desc
+        </where>
+    </select>
+
 </mapper>

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

@@ -160,4 +160,94 @@
             where regulations_id = #{item.regulationsId,jdbcType=VARCHAR}
         </foreach>
     </update>
+
+    <select id="queryStandardsRegulationsListByQx" 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,max_time
+        from (select bz.* from( select s.scene_name
+        FROM system_scene_package p
+        JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+        JOIN system_scene_package_sublist s on p.id = s.scene_and_package
+        where scene_type='2' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_standards_regulations  bz on qx.scene_name=bz.scene_name) dd
+        <where>
+            (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"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="standardType != null and standardType != ''">
+                and standard_type like CONCAT('%',#{standardType,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="ids != null and ids.length>0">
+                and regulations_id in
+                <foreach collection="ids" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <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="queryStandardsRegulationsListByBqAndQx" 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,max_time
+        from (select bz.* from( select s.scene_name
+        FROM system_scene_package p
+        JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+        JOIN system_scene_package_sublist s on p.id = s.scene_and_package
+        where scene_type='2' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_standards_regulations  bz on qx.scene_name=bz.scene_name) dd
+        <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>
 </mapper>

+ 13 - 10
simulation-resource-server/src/main/resources/mapper/scene/SystemScenePackageMapper.xml

@@ -4,12 +4,9 @@
 
     <insert id="saveSystemScenePackage" parameterType="api.common.pojo.po.scene.SystemScenePackagePO">
         insert into simulation.system_scene_package
-        (id,package_name,self_driving,target_driving,
-        self_reaction,conflict_behavior,conflict_type,
-        scence_resume,scene_time,scene_weather,
+        (id,package_name,scene_describe,
        create_user_id,create_time,modify_user_id,modify_time,
-         is_deleted,share,video_preview,video_address,osgb_address,xml_address,xodr_address,
-        json_address,max_time)
+         is_deleted)
         values (#{id,jdbcType=VARCHAR},#{packageName,jdbcType=VARCHAR},#{sceneDescribe},
        #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
         #{isDeleted,jdbcType=VARCHAR})
@@ -33,7 +30,7 @@
         p.*,
         COUNT(u.id) as userCount
         FROM system_scene_package p
-        JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
+       left JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
         <where>
             <if test="userId != null and userId != ''">
                 and u.user_id = #{userId,jdbcType=VARCHAR}
@@ -45,10 +42,10 @@
         <where>
             s.is_deleted='0'
             <if test="packageName != null and packageName != ''">
-                and s.package_name like CONCAT('%',#{packageName,jdbcType=VARCHAR},'%')
+                and t.package_name like CONCAT('%',#{packageName,jdbcType=VARCHAR},'%')
             </if>
             <if test="yearMax != null and yearMax != ''">
-                and #{yearMax,jdbcType=VARCHAR} &gt; s.create_time and #{yearMin,jdbcType=VARCHAR} &lt; s.create_time
+                and #{yearMax,jdbcType=VARCHAR} &gt; t.create_time and #{yearMin,jdbcType=VARCHAR} &lt; t.create_time
             </if>
         </where>
         GROUP BY t.id   order by create_time desc
@@ -82,8 +79,7 @@
             resultType="api.common.pojo.po.scene.SystemScenePackagePO">
         select
         id,package_name,scene_describe,
-        create_user_id,create_time,modify_user_id,modify_time,
-
+        create_user_id,create_time,modify_user_id,modify_time
         from system_scene_package
         where  id =#{id}
 
@@ -120,4 +116,11 @@
         where id = #{id,jdbcType=VARCHAR}
     </update>
 
+    <select id="querySceneNum" parameterType="java.lang.String"
+            resultType="java.lang.Integer">
+    select count(scene_name) from system_user_scene a left join system_scene_package b on a.package_id=b.id and b.is_deleted='0'
+    join system_scene_package_sublist c on b.id=c.scene_and_package and c.is_deleted='0'
+        where  a.user_id =#{userId} group by scene_name
+
+    </select>
 </mapper>

+ 6 - 7
simulation-resource-server/src/main/resources/mapper/scene/SystemScenePackageSublistMapper.xml

@@ -3,14 +3,13 @@
 <mapper namespace="com.css.simulation.resource.scene.mapper.SystemScenePackageSublistMapper">
 
     <insert id="saveSystemScenePackageSublist" parameterType="java.util.List">
-        insert into simulation.system_scene_package
-        (sublist_id,scene_type,scene_id,scene_and_package,
+        insert into simulation.system_scene_package_sublist
+        (sublist_id,scene_type,scene_name,scene_and_package,
        create_user_id,create_time,modify_user_id,modify_time, is_deleted)
         values
          <foreach collection="list" index="index" item="item" separator=",">
-        (#{item.sublistId,jdbcType=VARCHAR},#{item.sceneType,jdbcType=VARCHAR},#{item.sceneId,jdbcType=VARCHAR}, #{item.sceneAndPackage,jdbcType=VARCHAR},
-        #{item.createUserId,jdbcType=VARCHAR},#{item.createTime},#{item.modifyUserId,jdbcType=VARCHAR},#{item.modifyTime},
-        #{item.isDeleted,jdbcType=VARCHAR})
+        (#{item.sublistId,jdbcType=VARCHAR},#{item.sceneType,jdbcType=VARCHAR},#{item.sceneName,jdbcType=VARCHAR}, #{item.sceneAndPackage,jdbcType=VARCHAR},
+        #{item.createUserId,jdbcType=VARCHAR},#{item.createTime},#{item.modifyUserId,jdbcType=VARCHAR},#{item.modifyTime},#{item.isDeleted,jdbcType=VARCHAR})
     </foreach>
     </insert>
 
@@ -18,8 +17,8 @@
 
     <select id="querySystemScenePackageSublistList" parameterType="api.common.pojo.po.scene.SystemScenePackageSublistPO"
             resultType="java.lang.String">
-        select scene_id
-        FROM system_scene_package_sublist
+        select scene_name
+        FROM system_scene_package_sublist where
             is_deleted='0' and scene_and_package =#{sceneAndPackage} and scene_type =#{sceneType}
     </select>
 

+ 1 - 0
simulation-resource-server/src/main/resources/mapper/system/UserMapper.xml

@@ -83,6 +83,7 @@
     <select id="selectCount" resultType="java.lang.Integer">
         select count(*)
         from system_user
+        where is_deleted = '0'
     </select>
 
     <select id="checkUsername" parameterType="api.common.pojo.po.system.UserPO" resultType="api.common.pojo.po.system.UserPO">