获取场景关系
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.solution.scene.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 平台通信关系表
|
||||
*/
|
||||
@Data
|
||||
public class PlatformCommunication {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 指挥平台名称/ID
|
||||
*/
|
||||
private String commandPlatform;
|
||||
|
||||
/**
|
||||
* 下属平台名称/ID
|
||||
*/
|
||||
private String subordinatePlatform;
|
||||
|
||||
/**
|
||||
* 指挥通信方式/内容
|
||||
*/
|
||||
private String commandComm;
|
||||
|
||||
/**
|
||||
* 下属通信方式/内容
|
||||
*/
|
||||
private String subordinateComm;
|
||||
|
||||
/**
|
||||
* 想定ID
|
||||
*/
|
||||
private Integer scenaryId;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.solution.scene.mapper;
|
||||
|
||||
import com.solution.scene.domain.AfsimScenario;
|
||||
import com.solution.scene.domain.AfsimScenarioForm;
|
||||
import com.solution.scene.domain.PlatformCommunication;
|
||||
import com.solution.system.domain.Behaviortree;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -34,4 +35,11 @@ public interface SceneMapper {
|
||||
* @return
|
||||
*/
|
||||
List<Behaviortree> selectAllTreeBySceneId(Integer id);
|
||||
|
||||
/**
|
||||
* 根据场景id获取场景下所有关系
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<PlatformCommunication> selectAllRelationBySceneId(Integer id);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.solution.scene.service;
|
||||
|
||||
import com.solution.scene.domain.AfsimScenario;
|
||||
import com.solution.scene.domain.AfsimScenarioForm;
|
||||
import com.solution.scene.domain.PlatformCommunication;
|
||||
import com.solution.system.domain.Behaviortree;
|
||||
|
||||
import java.util.List;
|
||||
@@ -33,4 +34,11 @@ public interface SceneService {
|
||||
* @return
|
||||
*/
|
||||
List<Behaviortree> getAllTree(Integer id);
|
||||
|
||||
/**
|
||||
* 根据场景id获取场景下所有关系
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<PlatformCommunication> getAllRelation(Integer id);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import com.solution.common.constant.ExceptionConstants;
|
||||
import com.solution.scene.domain.AfsimScenario;
|
||||
import com.solution.scene.domain.AfsimScenarioForm;
|
||||
import com.solution.scene.domain.PlatformCommunication;
|
||||
import com.solution.scene.mapper.PlatFormCommunicationMapper;
|
||||
import com.solution.scene.mapper.SceneMapper;
|
||||
import com.solution.scene.service.SceneService;
|
||||
@@ -90,4 +91,18 @@ public class SceneServiceImpl implements SceneService {
|
||||
return allTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据场景id获取场景下所有关系
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PlatformCommunication> getAllRelation(Integer id) {
|
||||
List<PlatformCommunication> result = sceneMapper.selectAllRelationBySceneId(id);
|
||||
if(CollUtil.isEmpty( result)){
|
||||
throw new RuntimeException("该场景下不存在关系");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM behaviortree
|
||||
WHERE scenario_id=#{id}
|
||||
</select>
|
||||
<select id="selectAllRelationBySceneId" resultType="com.solution.scene.domain.PlatformCommunication"
|
||||
parameterType="java.lang.Integer">
|
||||
SELECT id,command_platform,subordinate_platform,command_comm,subordinate_comm,scenary_id
|
||||
FROM platform_communication
|
||||
WHERE scenary_id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="update" parameterType="com.solution.scene.domain.AfsimScenario">
|
||||
update afsim_scenario
|
||||
|
||||
Reference in New Issue
Block a user