26-03-15-09:53 火力规则模块:获取通信组件的所有平台和组件 增加返回平台description字段
This commit is contained in:
@@ -53,8 +53,12 @@ public class FireRuleController extends BaseController {
|
||||
return success(ruleService.getCommPlatformComponentNames(scenarioId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据场景id获取所有平台及其组件
|
||||
* @param scenarioId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/platforms/{scenarioId}")
|
||||
@ApiOperation("获取通信组件的所有平台和组件")
|
||||
public AjaxResult platforms(@PathVariable Integer scenarioId){
|
||||
return success(ruleService.findPlatformComponents(scenarioId));
|
||||
}
|
||||
|
||||
@@ -14,4 +14,7 @@ public class PlatformComponentNamesVO {
|
||||
|
||||
@ApiModelProperty("该平台下的组件名称列表(去重)")
|
||||
private List<String> componentNames;
|
||||
|
||||
@ApiModelProperty("平台描述")
|
||||
private String platformDescription;
|
||||
}
|
||||
@@ -39,5 +39,10 @@ public interface FireRuleService {
|
||||
*/
|
||||
List<PlatformComponent> getComponents(Integer platformId);
|
||||
|
||||
/**
|
||||
* 根据场景id获取所有平台及其组件
|
||||
* @param scenarioId
|
||||
* @return
|
||||
*/
|
||||
List<Platform> findPlatformComponents(Integer scenarioId);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
<resultMap id="PlatformComponentNamesVOResultMap" type="com.solution.rule.domain.vo.PlatformComponentNamesVO">
|
||||
<result property="platformName" column="platformName"/>
|
||||
<result property="platformDescription" column="description"/>
|
||||
<collection property="componentNames" ofType="java.lang.String">
|
||||
<result column="componentName"/>
|
||||
</collection>
|
||||
@@ -55,10 +56,11 @@
|
||||
parameterType="java.lang.Integer">
|
||||
SELECT
|
||||
p.name AS platformName,
|
||||
pc.name AS componentName
|
||||
pc.name AS componentName,
|
||||
p.description AS description
|
||||
FROM platform p
|
||||
INNER JOIN platform_component pc ON p.id = pc.platform_id
|
||||
WHERE pc.type = "comm"
|
||||
WHERE pc.type = 'comm'
|
||||
AND p.scenario_id = #{scenarioId}
|
||||
</select>
|
||||
<select id="getComponents" resultType="com.solution.rule.domain.PlatformComponent"
|
||||
|
||||
Reference in New Issue
Block a user