diff --git a/auto-solution-admin/src/main/java/com/solution/web/controller/scene/SceneController.java b/auto-solution-admin/src/main/java/com/solution/web/controller/scene/SceneController.java
index 311cbed..7116aa6 100644
--- a/auto-solution-admin/src/main/java/com/solution/web/controller/scene/SceneController.java
+++ b/auto-solution-admin/src/main/java/com/solution/web/controller/scene/SceneController.java
@@ -64,4 +64,15 @@ public class SceneController extends BaseController {
public AjaxResult getAllTree(@PathVariable Integer id){
return success(sceneService.getAllTree(id));
}
+
+ /**
+ * 根据场景id获取场景下所有关系
+ * @param id
+ * @return
+ */
+ @GetMapping("/getAllRelation/{id}")
+ @ApiOperation("根据场景id获取场景下所有关系")
+ public AjaxResult getAllRelation(@PathVariable Integer id){
+ return success(sceneService.getAllRelation(id));
+ }
}
diff --git a/auto-solution-rule/src/main/resources/mapper/rule/FireRuleMapper.xml b/auto-solution-rule/src/main/resources/mapper/rule/FireRuleMapper.xml
index 9bde0f1..4a90672 100644
--- a/auto-solution-rule/src/main/resources/mapper/rule/FireRuleMapper.xml
+++ b/auto-solution-rule/src/main/resources/mapper/rule/FireRuleMapper.xml
@@ -119,13 +119,10 @@
p.name,
p.description
FROM platform p
- WHERE p.scenario_id = #{scenarioId}
- AND EXISTS (
- SELECT 1 FROM platform_component pc
- WHERE pc.platform_id = p.id
- AND pc.type = 'comm'
- )
- ORDER BY p.name
+ LEFT JOIN platform_component pc ON p.id = pc.platform_id
+ WHERE pc.type = 'comm'
+ AND p.scenario_id = #{scenarioId}
+ ORDER BY p.name,pc.name
+
update afsim_scenario