根据场景id获取总指挥的行为树的原数据
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package com.solution.system.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 收集数据用来生成总指挥官
|
||||
*/
|
||||
@Data
|
||||
public class PlatformChiefCommander {
|
||||
|
||||
/**
|
||||
* Primary Key 主键ID(自增)
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* Create Time 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
private Integer time;
|
||||
|
||||
/**
|
||||
* 指令
|
||||
*/
|
||||
private String command;
|
||||
|
||||
/**
|
||||
* 下属指挥官
|
||||
*/
|
||||
private String subordinateCommander;
|
||||
|
||||
/**
|
||||
* 场景ID
|
||||
*/
|
||||
private Integer scenarioId;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.solution.system.mapper;
|
||||
import java.util.List;
|
||||
|
||||
import com.solution.system.domain.Behaviortree;
|
||||
import com.solution.system.domain.PlatformChiefCommander;
|
||||
|
||||
/**
|
||||
* 行为树主Mapper接口
|
||||
@@ -62,4 +63,11 @@ public interface BehaviortreeMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviortreeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据场景id获取总指挥的行为树的原数据
|
||||
* @param scenarioId
|
||||
* @return
|
||||
*/
|
||||
List<PlatformChiefCommander> getCommander(Integer scenarioId);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.solution.system.service;
|
||||
import java.util.List;
|
||||
|
||||
import com.solution.system.domain.Behaviortree;
|
||||
import com.solution.system.domain.PlatformChiefCommander;
|
||||
|
||||
/**
|
||||
* 行为树主Service接口
|
||||
@@ -69,4 +70,11 @@ public interface IBehaviortreeService
|
||||
* @return
|
||||
*/
|
||||
List<String> getUnderling(Integer treeId);
|
||||
|
||||
/**
|
||||
* 根据场景id获取总指挥的行为树的原数据
|
||||
* @param scenarioId
|
||||
* @return
|
||||
*/
|
||||
List<PlatformChiefCommander> getCommander(Integer scenarioId);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.solution.common.constant.ExceptionConstants;
|
||||
import com.solution.system.domain.PlatformChiefCommander;
|
||||
import com.solution.system.domain.PlatformTree;
|
||||
import com.solution.system.mapper.PlatformCommunicationMapper;
|
||||
import com.solution.system.mapper.PlatformMapper;
|
||||
@@ -135,4 +136,14 @@ public class BehaviortreeServiceImpl implements IBehaviortreeService
|
||||
}
|
||||
return underlingChineseName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据场景id获取总指挥的行为树的原数据
|
||||
* @param scenarioId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PlatformChiefCommander> getCommander(Integer scenarioId) {
|
||||
return behaviortreeMapper.getCommander(scenarioId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select id, name, description, created_at, updated_at, english_name,graph, xml_content ,platform_id, scenario_id from behaviortree
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getCommander" resultType="com.solution.system.domain.PlatformChiefCommander"
|
||||
parameterType="java.lang.Integer">
|
||||
SELECT id,
|
||||
create_time AS createTime,
|
||||
name,time,command,
|
||||
subordinate_commander AS subordinateCommander,
|
||||
scenario_id AS scenarioId
|
||||
FROM platform_chief_commander
|
||||
WHERE scenario_id = #{scenarioId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBehaviortree" parameterType="Behaviortree" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into behaviortree
|
||||
|
||||
Reference in New Issue
Block a user