Ver código fonte

工作中下拉列表增加共有数据

wangzhiqiang 2 anos atrás
pai
commit
3a3a51d008

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

@@ -1389,7 +1389,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             configPO.setId(ConfigId);
         }
         configPO.setCreateUserId(AuthUtil.getCurrentUserId());
-        List<ConfigPO> vehicleBaseInfoVo = simulationProjectMapper.selectConfigVehicle(configPO);
+        List<ConfigPO> vehicleBaseInfoVo = simulationProjectMapper.selectConfigVehicle2(configPO);
         List<DropDownVo> vehicleList = new ArrayList<>();
         for (ConfigPO v : vehicleBaseInfoVo) {
             DropDownVo dropDownVo = new DropDownVo();

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

@@ -100,6 +100,7 @@ public interface SimulationProjectMapper {
     SystemUserVo selectUserById(String id);
 
     List<ConfigPO> selectConfigVehicle(ConfigPO configPO);
+    List<ConfigPO> selectConfigVehicle2(ConfigPO configPO);
 
     List<ConfigSensorPO> selectConfigSensor(String id);
 

+ 34 - 6
simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml

@@ -270,9 +270,10 @@
 
     <!--获取算法基本信息 /*where a.share = '0' and a.is_deleted = '0'*/-->
     <select id="selectAlgorithmBaseInfoById" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
-        select a.id, a.algorithm_name, a.description
+        select id, algorithm_name, description,share from(
+         select a.id, a.algorithm_name, a.description,a.share,a.modify_time
         from algorithm a
-        where a.share = '0' and a.is_deleted = '0'
+        where  a.is_deleted = '0' and share='0'
         <if test="id != null and id != ''">
             and a.id = #{id,jdbcType=VARCHAR}
         </if>
@@ -282,6 +283,13 @@
         <if test="uploadMode != null and uploadMode != ''">
             and upload_mode = #{uploadMode,jdbcType=VARCHAR}
         </if>
+        union  select b.id, b.algorithm_name,b.description,b.share,b.modify_time
+        from algorithm b
+        where  b.is_deleted = '0' and b.share='1'
+        <if test="uploadMode != null and uploadMode != ''">
+            and upload_mode = #{uploadMode,jdbcType=VARCHAR}
+        </if>
+        )c order by c.share ,c.modify_time desc
     </select>
 
     <!--获取车辆基本信息-->
@@ -296,9 +304,9 @@
 
     <!--获取车辆配置信息-->
     <select id="selectConfigVehicle" resultType="api.common.pojo.po.model.ConfigPO">
-        select id, config_name, vehicle_id, description
+        select id, config_name, vehicle_id, description,share
         from model_config
-        where share = '0' and is_deleted = '0'
+        where  is_deleted = '0'
         <if test="id != null and id != ''">
             and id = #{id,jdbcType=VARCHAR}
         </if>
@@ -307,6 +315,23 @@
         </if>
     </select>
 
+    <!--获取车辆配置信息-->
+    <select id="selectConfigVehicle2" resultType="api.common.pojo.po.model.ConfigPO">
+        select id, config_name, vehicle_id, description,share from(
+        select id, config_name, vehicle_id, description,share,modify_time
+        from model_config
+        where  is_deleted = '0' and share='0'
+        <if test="id != null and id != ''">
+            and id = #{id,jdbcType=VARCHAR}
+        </if>
+        <if test="createUserId != null and createUserId !=''">
+            and create_user_id=#{createUserId,jdbcType=VARCHAR}
+        </if>
+        union select id, config_name, vehicle_id, description,share,modify_time
+        from model_config
+        where  is_deleted = '0' and share='1')c order by c.share ,c.modify_time desc
+    </select>
+
     <!--查询车辆配置传感器信息-->
     <select id="selectConfigSensor" parameterType="string" resultType="api.common.pojo.po.model.ConfigSensorPO">
         select sensor_type
@@ -320,7 +345,8 @@
 
     <!--获取场景包基本信息-->
     <select id="selectScenePackageBaseById" resultType="api.common.pojo.po.scene.ScenePackagePO">
-        select a.package_id,a.package_name, a.scene_num
+        select package_id,package_name, scene_num,share from(
+        select a.package_id,a.package_name, a.scene_num,a.share,a.modify_time
         from scene_package a
         where a.share = '0' and a.is_deleted = '0'
         <if test="packageId != null and packageId != ''">
@@ -329,7 +355,9 @@
         <if test="createUserId != null and createUserId !=''">
             and create_user_id=#{createUserId,jdbcType=VARCHAR}
         </if>
-        order by modify_time desc
+        union select b.package_id,b.package_name, b.scene_num,b.share,b.modify_time
+        from scene_package b where b.share = '1' and b.is_deleted = '0'
+        ) c order by c.share ,c.modify_time desc
     </select>
 
     <!--根据id查询场景包信息-->