Browse Source

ai中台代码迁移

lyq 3 weeks ago
parent
commit
d66d3ae26c
51 changed files with 4859 additions and 0 deletions
  1. 261 0
      src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiAlarmAnalysisController.java
  2. 201 0
      src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiAlgorithmController.java
  3. 216 0
      src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiAlgorithmTaskController.java
  4. 55 0
      src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiHistoryAlarmController.java
  5. 249 0
      src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiSingleTypeController.java
  6. 74 0
      src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlarmAnalysis.java
  7. 34 0
      src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlarmAnalysisChannel.java
  8. 37 0
      src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlarmAnalysisConfigJob.java
  9. 54 0
      src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlgorithm.java
  10. 79 0
      src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlgorithmTask.java
  11. 140 0
      src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlgorithmTaskChannel.java
  12. 114 0
      src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlgorithmTaskConfigJob.java
  13. 58 0
      src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlgorithmTaskInfo.java
  14. 63 0
      src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiSingleType.java
  15. 62 0
      src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlarmAnalysisChannelMapper.java
  16. 62 0
      src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlarmAnalysisConfigJobMapper.java
  17. 66 0
      src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlarmAnalysisMapper.java
  18. 66 0
      src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlgorithmMapper.java
  19. 62 0
      src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlgorithmTaskChannelMapper.java
  20. 62 0
      src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlgorithmTaskConfigJobMapper.java
  21. 62 0
      src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlgorithmTaskInfoMapper.java
  22. 64 0
      src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlgorithmTaskMapper.java
  23. 68 0
      src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiSingleTypeMapper.java
  24. 62 0
      src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlarmAnalysisChannelService.java
  25. 62 0
      src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlarmAnalysisConfigJobService.java
  26. 69 0
      src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlarmAnalysisService.java
  27. 65 0
      src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlgorithmService.java
  28. 62 0
      src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlgorithmTaskChannelService.java
  29. 62 0
      src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlgorithmTaskConfigJobService.java
  30. 62 0
      src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlgorithmTaskInfoService.java
  31. 64 0
      src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlgorithmTaskService.java
  32. 68 0
      src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiSingleTypeService.java
  33. 94 0
      src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlarmAnalysisChannelServiceImpl.java
  34. 94 0
      src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlarmAnalysisConfigJobServiceImpl.java
  35. 202 0
      src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlarmAnalysisServiceImpl.java
  36. 119 0
      src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmServiceImpl.java
  37. 95 0
      src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmTaskChannelServiceImpl.java
  38. 94 0
      src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmTaskConfigJobServiceImpl.java
  39. 94 0
      src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmTaskInfoServiceImpl.java
  40. 172 0
      src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmTaskServiceImpl.java
  41. 130 0
      src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiSingleTypeServiceImpl.java
  42. 61 0
      src/main/java/com/sooka/sponest/monitor/ai/util/DHOauthUtil.java
  43. 79 0
      src/main/resources/mapper/ai/BusAiAlarmAnalysisChannelMapper.xml
  44. 84 0
      src/main/resources/mapper/ai/BusAiAlarmAnalysisConfigJobMapper.xml
  45. 132 0
      src/main/resources/mapper/ai/BusAiAlarmAnalysisMapper.xml
  46. 110 0
      src/main/resources/mapper/ai/BusAiAlgorithmMapper.xml
  47. 94 0
      src/main/resources/mapper/ai/BusAiAlgorithmTaskChannelMapper.xml
  48. 84 0
      src/main/resources/mapper/ai/BusAiAlgorithmTaskConfigJobMapper.xml
  49. 64 0
      src/main/resources/mapper/ai/BusAiAlgorithmTaskInfoMapper.xml
  50. 143 0
      src/main/resources/mapper/ai/BusAiAlgorithmTaskMapper.xml
  51. 129 0
      src/main/resources/mapper/ai/BusAiSingleTypeMapper.xml

+ 261 - 0
src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiAlarmAnalysisController.java

@@ -0,0 +1,261 @@
+package com.sooka.sponest.monitor.ai.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.dahuatech.icc.oauth.model.v202010.OauthConfigUserPwdInfo;
+import com.dahuatech.icc.oauth.utils.HttpUtils;
+import com.ruoyi.common.core.constant.UserConstants;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysis;
+import com.sooka.sponest.monitor.ai.domain.BusAiSingleType;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlarmAnalysisService;
+import com.sooka.sponest.monitor.ai.service.IBusAiSingleTypeService;
+import com.sooka.sponest.monitor.ai.util.DHOauthUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 事件二次研判Controller
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@RestController
+@RequestMapping("/admin-api/ai/alarmanalysis")
+public class BusAiAlarmAnalysisController extends BaseController
+{
+    @Autowired
+    private IBusAiAlarmAnalysisService busAiAlarmAnalysisService;
+
+    @Autowired
+    private IBusAiSingleTypeService busAiSingleTypeService;
+
+    /**
+     * 同步事件二次研判
+     */
+    @RequiresPermissions("ai:alarmanalysis:list")
+    @GetMapping("/sync")
+    public AjaxResult sync(@RequestParam("id") Long id)
+    {
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        BusAiAlarmAnalysis aiAlarmAnalysis = busAiAlarmAnalysisService.selectBusAiAlarmAnalysisById(id);
+        if (StringUtils.isNull(aiAlarmAnalysis.getConfigId())) {
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/alarmAnalysis/add", aiAlarmAnalysis, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+        } else {
+            try {
+                aiAlarmAnalysis.setId(aiAlarmAnalysis.getConfigId());
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/alarmAnalysis/update", aiAlarmAnalysis, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+        }
+        JSONObject result = JSONObject.parseObject(response.getResult());
+        if (result.getBoolean("success")) {
+            aiAlarmAnalysis.setId(id);
+            aiAlarmAnalysis.setConfigId(result.getJSONObject("data").getLong("id"));
+            aiAlarmAnalysis.setSyncStatus("1");
+            busAiAlarmAnalysisService.updateBusAiAlarmAnalysis(aiAlarmAnalysis);
+            return success();
+        }
+        return error(response.getErrMsg());
+    }
+
+    @RequiresPermissions("ai:alarmanalysis:list")
+    @GetMapping("/syncDH")
+    public AjaxResult syncDH()
+    {
+        List<BusAiAlarmAnalysis> busAiAlarmAnalyses = new ArrayList<>();
+        Integer pageNum = 1;
+
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        while (true) {
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/alarmAnalysis/page?page=" + pageNum + "&pageSize=500", null, null, Method.GET, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+            JSONObject result = JSONObject.parseObject(response.getResult());
+            if (result.getBoolean("success")) {
+                List<BusAiAlarmAnalysis> alarmAnalyses = JSONObject.parseArray(result.getJSONObject("data").getString("data"), BusAiAlarmAnalysis.class);
+                if (alarmAnalyses.isEmpty()) {
+                    break;
+                }
+                busAiAlarmAnalyses.addAll(alarmAnalyses);
+                pageNum++;
+            }
+        }
+        int num = 0;
+        Map<String, Long> algorithmTaskNames = busAiAlarmAnalysisService.selectBusAiAlarmAnalysisList(new BusAiAlarmAnalysis()).stream().collect(Collectors.toMap(BusAiAlarmAnalysis::getConfigName, BusAiAlarmAnalysis::getId));
+        for (BusAiAlarmAnalysis item : busAiAlarmAnalyses) {
+            item.setConfigId(item.getId());
+            item.setSyncStatus("1");
+            if (algorithmTaskNames.containsKey(item.getConfigName())) {
+                item.setId(algorithmTaskNames.get(item.getConfigName()));
+                busAiAlarmAnalysisService.updateBusAiAlarmAnalysis(item);
+            } /*else {
+                BusAiAlarmAnalysis.PromptSuggestion promptSuggestion = new BusAiAlarmAnalysis.PromptSuggestion();
+                promptSuggestion.setGenerationType(1);
+                promptSuggestion.setOneSentenceDescription(item.getScenarioDescription());
+                item.setPromptSuggestion(promptSuggestion);
+                busAiAlarmAnalysisService.insertBusAiAlarmAnalysis(item);
+            }*/
+            num++;
+        }
+        return num > 0 ? success() : error();
+    }
+
+    /**
+     * 查询事件二次研判列表
+     */
+    @RequiresPermissions("ai:alarmanalysis:list")
+    @GetMapping("/list")
+    public TableDataInfo list(BusAiAlarmAnalysis busAiAlarmAnalysis)
+    {
+        startPage();
+        List<BusAiAlarmAnalysis> list = busAiAlarmAnalysisService.selectBusAiAlarmAnalysisList(busAiAlarmAnalysis);
+        return getDataTable(list);
+    }
+
+//    /**
+//     * 导出事件二次研判列表
+//     */
+//    @PreAuthorize("@ss.hasPermission('ai:alarmanalysis:export')")
+//    @Log(title = "事件二次研判", businessType = BusinessType.EXPORT)
+//    @PostMapping("/export")
+//    public void export(HttpServletResponse response, BusAiAlarmAnalysis busAiAlarmAnalysis)
+//    {
+//        List<BusAiAlarmAnalysis> list = busAiAlarmAnalysisService.selectBusAiAlarmAnalysisList(busAiAlarmAnalysis);
+//        ExcelUtil<BusAiAlarmAnalysis> util = new ExcelUtil<BusAiAlarmAnalysis>(BusAiAlarmAnalysis.class);
+//        util.exportExcel(response, list, "事件二次研判数据");
+//    }
+
+    /**
+     * 获取事件二次研判详细信息
+     */
+    @RequiresPermissions("ai:alarmanalysis:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(busAiAlarmAnalysisService.selectBusAiAlarmAnalysisById(id));
+    }
+
+    /**
+     * 新增事件二次研判
+     */
+    @RequiresPermissions("ai:alarmanalysis:add")
+    @PostMapping
+    public AjaxResult add(@RequestBody BusAiAlarmAnalysis busAiAlarmAnalysis)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(busAiAlarmAnalysisService.checkConfigNameUnique(busAiAlarmAnalysis))) {
+            return error("新增配置失败,配置名称'" + busAiAlarmAnalysis.getAlarmTypeName() + "'已存在");
+        }
+        if (UserConstants.NOT_UNIQUE.equals(busAiAlarmAnalysisService.checkAlarmTypeUnique(busAiAlarmAnalysis))) {
+            return error("新增配置失败,报警类型'" + busAiAlarmAnalysis.getAlarmType() + "'已存在");
+        }
+        return busAiAlarmAnalysisService.insertBusAiAlarmAnalysis(busAiAlarmAnalysis) > 0 ? success() : error();
+    }
+
+    /**
+     * 修改事件二次研判
+     */
+    @RequiresPermissions("ai:alarmanalysis:edit")
+    @PutMapping
+    public AjaxResult edit(@RequestBody BusAiAlarmAnalysis busAiAlarmAnalysis)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(busAiAlarmAnalysisService.checkConfigNameUnique(busAiAlarmAnalysis))) {
+            return error("新增配置失败,配置名称'" + busAiAlarmAnalysis.getAlarmTypeName() + "'已存在");
+        }
+        if (UserConstants.NOT_UNIQUE.equals(busAiAlarmAnalysisService.checkAlarmTypeUnique(busAiAlarmAnalysis))) {
+            return error("新增配置失败,报警类型'" + busAiAlarmAnalysis.getAlarmType() + "'已存在");
+        }
+        return busAiAlarmAnalysisService.updateBusAiAlarmAnalysis(busAiAlarmAnalysis) > 0 ? success() : error();
+    }
+
+    /**
+     * 删除事件二次研判
+     */
+    @RequiresPermissions("ai:alarmanalysis:remove")
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        BusAiAlarmAnalysis alarmAnalysis = busAiAlarmAnalysisService.selectBusAiAlarmAnalysisById(ids[0]);
+        if (StringUtils.isNotNull(alarmAnalysis.getConfigId())) {
+            OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+            GeneralResponse response = null;
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/alarmAnalysis/delete/" + alarmAnalysis.getConfigId(), null, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+            JSONObject result = JSONObject.parseObject(response.getResult());
+            if (!result.getBoolean("success")) {
+                return error(response.getErrMsg());
+            }
+        }
+        return busAiAlarmAnalysisService.deleteBusAiAlarmAnalysisById(ids[0]) > 0 ? success() : error();
+    }
+
+    /**
+     * 查询报警类型列表
+     */
+    @GetMapping("/listAlarmType")
+    public AjaxResult listAlarmType(BusAiSingleType singleType)
+    {
+        singleType.setSyncStatus("1");
+        return success(busAiSingleTypeService.selectBusAiSingleTypeList(singleType));
+    }
+
+    /**
+     * 生成提示词
+     */
+    @GetMapping("/genPromptWord")
+    public R<String> genPromptWord(@RequestParam("desc") String desc)
+    {
+        Map<String, Object> params = new HashMap<>();
+        params.put("generationType", 1);
+        params.put("oneSentenceDescription", desc);
+        params.put("sceneList", new ArrayList<>());
+        params.put("typeList", new ArrayList<>());
+
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        try {
+            response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.4.0/api/algorithms/getPrompt", params, null, Method.POST, config, GeneralResponse.class);
+        } catch (ClientException e) {
+            e.printStackTrace();
+        }
+        JSONObject result = JSONObject.parseObject(response.getResult());
+        if (result.getBoolean("success")) {
+            return R.ok(result.getJSONObject("data").getString("value"));
+        }
+        return R.ok("");
+    }
+
+    /**
+     * 查询摄像头-通道树
+     */
+    @GetMapping("/channelTree")
+    public AjaxResult channelTree()
+    {
+        return success(busAiAlarmAnalysisService.channelTree());
+    }
+}

+ 201 - 0
src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiAlgorithmController.java

@@ -0,0 +1,201 @@
+package com.sooka.sponest.monitor.ai.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.dahuatech.icc.oauth.model.v202010.OauthConfigUserPwdInfo;
+import com.dahuatech.icc.oauth.utils.HttpUtils;
+import com.ruoyi.common.core.constant.UserConstants;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithm;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmService;
+import com.sooka.sponest.monitor.ai.util.DHOauthUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 算法Controller
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@RestController
+@RequestMapping("/admin-api/ai/algorithm")
+public class BusAiAlgorithmController extends BaseController
+{
+    @Autowired
+    private IBusAiAlgorithmService busAiAlgorithmService;
+
+    /**
+     * 同步算法
+     */
+    @RequiresPermissions("ai:singletype:list")
+    @GetMapping("/sync")
+    public AjaxResult sync(@RequestParam("id") Long id)
+    {
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        BusAiAlgorithm aiAlgorithm = busAiAlgorithmService.selectBusAiAlgorithmById(id);
+        if (StringUtils.isNull(aiAlgorithm.getAlgorithmId())) {
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/algorithms/add", aiAlgorithm, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+        } else {
+            try {
+                aiAlgorithm.setId(aiAlgorithm.getAlgorithmId());
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/algorithms/update", aiAlgorithm, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+        }
+        JSONObject result = JSONObject.parseObject(response.getResult());
+        if (result.getBoolean("success")) {
+            aiAlgorithm.setId(id);
+            aiAlgorithm.setAlgorithmId(result.getJSONObject("data").getLong("id"));
+            aiAlgorithm.setSyncStatus("1");
+            busAiAlgorithmService.updateBusAiAlgorithm(aiAlgorithm);
+            return success();
+        }
+        return error(response.getErrMsg());
+    }
+
+    @RequiresPermissions("ai:singletype:list")
+    @GetMapping("/syncDH")
+    public AjaxResult syncDH()
+    {
+        List<BusAiAlgorithm> busAiAlgorithms = new ArrayList<>();
+        Integer pageNum = 1;
+
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        while (true) {
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.4.0/api/algorithms/page?page=" + pageNum + "&pageSize=500", null, null, Method.GET, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+            JSONObject result = JSONObject.parseObject(response.getResult());
+            if (result.getBoolean("success")) {
+                List<BusAiAlgorithm> algorithms = JSONObject.parseArray(result.getJSONObject("data").getString("data"), BusAiAlgorithm.class);
+                if (algorithms.isEmpty()) {
+                    break;
+                }
+                busAiAlgorithms.addAll(algorithms);
+                pageNum++;
+            }
+        }
+        int num = 0;
+        List<String> algorithmNames = busAiAlgorithmService.selectBusAiAlgorithmList(new BusAiAlgorithm()).stream().map(BusAiAlgorithm::getAlgorithmName).collect(Collectors.toList());
+        for (BusAiAlgorithm item : busAiAlgorithms) {
+            item.setAlgorithmId(item.getId());
+            item.setSyncStatus("1");
+            if (algorithmNames.contains(item.getAlgorithmName())) {
+                busAiAlgorithmService.updateByName(item);
+                num++;
+            } else if (StringUtils.isEmpty(algorithmNames)) {
+                BusAiAlgorithm.PromptSuggestion promptSuggestion = new BusAiAlgorithm.PromptSuggestion();
+                promptSuggestion.setGenerationType(1);
+                item.setPromptSuggestion(promptSuggestion);
+                busAiAlgorithmService.insertBusAiAlgorithm(item);
+                num++;
+            }
+        }
+        return num > 0 ? success() : error();
+    }
+
+    /**
+     * 查询算法列表
+     */
+    @RequiresPermissions("'ai:algorithm:list")
+    @GetMapping("/list")
+    public TableDataInfo list(BusAiAlgorithm busAiAlgorithm)
+    {
+        startPage();
+        List<BusAiAlgorithm> list = busAiAlgorithmService.selectBusAiAlgorithmList(busAiAlgorithm);
+        return getDataTable(list);
+    }
+
+//    /**
+//     * 导出算法列表
+//     */
+//    @PreAuthorize("@ss.hasPermission('ai:algorithm:export')")
+//    @Log(title = "算法", businessType = BusinessType.EXPORT)
+//    @PostMapping("/export")
+//    public void export(HttpServletResponse response, BusAiAlgorithm busAiAlgorithm)
+//    {
+//        List<BusAiAlgorithm> list = busAiAlgorithmService.selectBusAiAlgorithmList(busAiAlgorithm);
+//        ExcelUtil<BusAiAlgorithm> util = new ExcelUtil<BusAiAlgorithm>(BusAiAlgorithm.class);
+//        util.exportExcel(response, list, "算法数据");
+//    }
+
+    /**
+     * 获取算法详细信息
+     */
+    @RequiresPermissions("ai:algorithm:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(busAiAlgorithmService.selectBusAiAlgorithmById(id));
+    }
+
+    /**
+     * 新增算法
+     */
+    @RequiresPermissions("ai:algorithm:add")
+    @PostMapping
+    public AjaxResult add(@RequestBody BusAiAlgorithm busAiAlgorithm)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(busAiAlgorithmService.checkAlgorithmNameUnique(busAiAlgorithm))) {
+            return error("新增算法失败,算法名称'" + busAiAlgorithm.getAlgorithmName() + "'已存在");
+        }
+        return busAiAlgorithmService.insertBusAiAlgorithm(busAiAlgorithm)  > 0 ? success() : error();
+    }
+
+    /**
+     * 修改算法
+     */
+    @RequiresPermissions("ai:algorithm:edit")
+    @PutMapping
+    public AjaxResult edit(@RequestBody BusAiAlgorithm busAiAlgorithm)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(busAiAlgorithmService.checkAlgorithmNameUnique(busAiAlgorithm))) {
+            return error("修改算法失败,算法名称'" + busAiAlgorithm.getAlgorithmName() + "'已存在");
+        }
+        return busAiAlgorithmService.updateBusAiAlgorithm(busAiAlgorithm)  > 0 ? success() : error();
+    }
+
+    /**
+     * 删除算法
+     */
+    @RequiresPermissions("ai:algorithm:remove")
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        BusAiAlgorithm busAiAlgorithm = busAiAlgorithmService.selectBusAiAlgorithmById(ids[0]);
+        if (StringUtils.isNotNull(busAiAlgorithm.getAlgorithmId())) {
+            OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+            GeneralResponse response = null;
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/algorithms/delete/" + busAiAlgorithm.getAlgorithmId(), null, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+            JSONObject result = JSONObject.parseObject(response.getResult());
+            if (!result.getBoolean("success")) {
+                return error(response.getErrMsg());
+            }
+        }
+        return busAiAlgorithmService.deleteBusAiAlgorithmByIds(ids)  > 0 ? success() : error();
+    }
+}

+ 216 - 0
src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiAlgorithmTaskController.java

@@ -0,0 +1,216 @@
+package com.sooka.sponest.monitor.ai.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.dahuatech.icc.oauth.model.v202010.OauthConfigUserPwdInfo;
+import com.dahuatech.icc.oauth.utils.HttpUtils;
+import com.ruoyi.common.core.constant.UserConstants;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithm;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTask;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmService;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmTaskService;
+import com.sooka.sponest.monitor.ai.util.DHOauthUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 任务Controller
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@RestController
+@RequestMapping("/admin-api/ai/algorithmtask")
+public class BusAiAlgorithmTaskController extends BaseController
+{
+    @Autowired
+    private IBusAiAlgorithmTaskService busAiAlgorithmTaskService;
+
+    @Autowired
+    private IBusAiAlgorithmService busAiAlgorithmService;
+
+    /**
+     * 同步任务
+     */
+    @RequiresPermissions("ai:algorithmtask:list")
+    @GetMapping("/sync")
+    public AjaxResult sync(@RequestParam("id") Long id)
+    {
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        BusAiAlgorithmTask aiAlgorithmTask = busAiAlgorithmTaskService.selectBusAiAlgorithmTaskById(id);
+        if (StringUtils.isNull(aiAlgorithmTask.getTaskId())) {
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/algorithmTask/add", aiAlgorithmTask, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+        } else {
+            try {
+                aiAlgorithmTask.setId(aiAlgorithmTask.getTaskId());
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/algorithmTask/update", aiAlgorithmTask, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+        }
+        JSONObject result = JSONObject.parseObject(response.getResult());
+        if (result.getBoolean("success")) {
+            aiAlgorithmTask.setId(id);
+            aiAlgorithmTask.setTaskId(result.getJSONObject("data").getLong("id"));
+            aiAlgorithmTask.setSyncStatus("1");
+            busAiAlgorithmTaskService.updateBusAiAlgorithmTask(aiAlgorithmTask);
+            return success();
+        }
+        return error(response.getErrMsg());
+    }
+
+    @RequiresPermissions("ai:algorithmtask:list")
+    @GetMapping("/syncDH")
+    public AjaxResult syncDH()
+    {
+        List<BusAiAlgorithmTask> busAiAlgorithmTasks = new ArrayList<>();
+        Integer pageNum = 1;
+
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        while (true) {
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/algorithmTask/page?page=" + pageNum + "&pageSize=500", null, null, Method.GET, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+            JSONObject result = JSONObject.parseObject(response.getResult());
+            if (result.getBoolean("success")) {
+                List<BusAiAlgorithmTask> algorithmTasks = JSONObject.parseArray(result.getJSONObject("data").getString("data"), BusAiAlgorithmTask.class);
+                if (algorithmTasks.isEmpty()) {
+                    break;
+                }
+                busAiAlgorithmTasks.addAll(algorithmTasks);
+                pageNum++;
+            }
+        }
+        int num = 0;
+        Map<String, Long> algorithmTaskNames = busAiAlgorithmTaskService.selectBusAiAlgorithmTaskList(new BusAiAlgorithmTask()).stream().collect(Collectors.toMap(BusAiAlgorithmTask::getTaskName, BusAiAlgorithmTask::getId));
+        for (BusAiAlgorithmTask item : busAiAlgorithmTasks) {
+            item.setTaskId(item.getId());
+            item.setSyncStatus("1");
+            if (algorithmTaskNames.containsKey(item.getTaskName())) {
+                item.setId(algorithmTaskNames.get(item.getTaskName()));
+                busAiAlgorithmTaskService.updateBusAiAlgorithmTask(item);
+                num++;
+            } else if (StringUtils.isEmpty(algorithmTaskNames)) {
+                busAiAlgorithmTaskService.insertBusAiAlgorithmTask(item);
+                num++;
+            }
+        }
+        return toAjax(num);
+    }
+
+    /**
+     * 查询任务列表
+     */
+    @RequiresPermissions("ai:algorithmtask:list")
+    @GetMapping("/list")
+    public TableDataInfo list(BusAiAlgorithmTask busAiAlgorithmTask)
+    {
+        startPage();
+        List<BusAiAlgorithmTask> list = busAiAlgorithmTaskService.selectBusAiAlgorithmTaskList(busAiAlgorithmTask);
+        return getDataTable(list);
+    }
+
+//    /**
+//     * 导出任务列表
+//     */
+//    @PreAuthorize("@ss.hasPermission('ai:algorithmtask:export')")
+//    @Log(title = "任务", businessType = BusinessType.EXPORT)
+//    @PostMapping("/export")
+//    public void export(HttpServletResponse response, BusAiAlgorithmTask busAiAlgorithmTask)
+//    {
+//        List<BusAiAlgorithmTask> list = busAiAlgorithmTaskService.selectBusAiAlgorithmTaskList(busAiAlgorithmTask);
+//        ExcelUtil<BusAiAlgorithmTask> util = new ExcelUtil<BusAiAlgorithmTask>(BusAiAlgorithmTask.class);
+//        util.exportExcel(response, list, "任务数据");
+//    }
+
+    /**
+     * 获取任务详细信息
+     */
+    @RequiresPermissions("ai:algorithmtask:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(busAiAlgorithmTaskService.selectBusAiAlgorithmTaskById(id));
+    }
+
+    /**
+     * 新增任务
+     */
+    @RequiresPermissions("ai:algorithmtask:add")
+    @PostMapping
+    public AjaxResult add(@RequestBody BusAiAlgorithmTask busAiAlgorithmTask)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(busAiAlgorithmTaskService.checkTaskNameUnique(busAiAlgorithmTask))) {
+            return error("新增任务失败,任务名称'" + busAiAlgorithmTask.getTaskName() + "'已存在");
+        }
+        return busAiAlgorithmTaskService.insertBusAiAlgorithmTask(busAiAlgorithmTask) > 0 ? success() : error();
+    }
+
+    /**
+     * 修改任务
+     */
+    @RequiresPermissions("ai:algorithmtask:edit")
+    @PutMapping
+    public AjaxResult edit(@RequestBody BusAiAlgorithmTask busAiAlgorithmTask)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(busAiAlgorithmTaskService.checkTaskNameUnique(busAiAlgorithmTask))) {
+            return error("修改任务失败,任务名称'" + busAiAlgorithmTask.getTaskName() + "'已存在");
+        }
+        return busAiAlgorithmTaskService.updateBusAiAlgorithmTask(busAiAlgorithmTask) > 0 ? success() : error();
+    }
+
+    /**
+     * 删除任务
+     */
+    @RequiresPermissions("ai:algorithmtask:remove")
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        BusAiAlgorithmTask algorithmTask = busAiAlgorithmTaskService.selectBusAiAlgorithmTaskById(ids[0]);
+        if (StringUtils.isNotNull(algorithmTask.getTaskId())) {
+            OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+            GeneralResponse response = null;
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.0.0/api/algorithmTask/delete/" + algorithmTask.getTaskId(), null, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+            JSONObject result = JSONObject.parseObject(response.getResult());
+            if (!result.getBoolean("success")) {
+                return error(response.getErrMsg());
+            }
+        }
+        return busAiAlgorithmTaskService.deleteBusAiAlgorithmTaskById(ids[0]) > 0 ? success() : error();
+    }
+
+    /**
+     * 查询算法列表
+     */
+    @RequiresPermissions("ai:algorithmtask:remove")
+    @GetMapping("/listAlgorithm")
+    public AjaxResult listAlgorithm(BusAiAlgorithm algorithm)
+    {
+        algorithm.setSyncStatus("1");
+        return success(busAiAlgorithmService.selectBusAiAlgorithmList(algorithm));
+    }
+}

+ 55 - 0
src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiHistoryAlarmController.java

@@ -0,0 +1,55 @@
+package com.sooka.sponest.monitor.ai.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.dahuatech.icc.oauth.model.v202010.OauthConfigUserPwdInfo;
+import com.dahuatech.icc.oauth.utils.HttpUtils;
+import com.ruoyi.common.core.constant.HttpStatus;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.monitor.ai.util.DHOauthUtil;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 大模型分析结果Controller
+ *
+ * @author lyq
+ * @date 2025-09-19
+ */
+@RestController
+@RequestMapping("/admin-api/ai/historyalarm")
+public class BusAiHistoryAlarmController extends BaseController {
+
+    @RequiresPermissions("ai:historyalarm:list")
+    @PostMapping("/list")
+    public TableDataInfo list(@RequestBody JSONObject jsonObject) {
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        try {
+            response = HttpUtils.executeJson("/evo-apigw/evo-gmai/1.4.0/ai/history/alarm/page", jsonObject, null, Method.POST, config, GeneralResponse.class);
+        } catch (ClientException e) {
+            e.printStackTrace();
+        }
+        JSONObject result = JSONObject.parseObject(response.getResult());
+        if (result.getBoolean("success")) {
+            TableDataInfo rspData = new TableDataInfo();
+            rspData.setCode(HttpStatus.SUCCESS);
+            rspData.setMsg("查询成功");
+            List<JSONObject> list = JSONObject.parseArray(result.getString("data"), JSONObject.class);
+            list.forEach(item -> item.put("picture", DHOauthUtil.getInstance().getImageFullPath(item.getString("picture"))));
+            rspData.setRows(list);
+            rspData.setTotal(result.getJSONObject("data").getLong("total"));
+            return rspData;
+        }
+        return getDataTable(new ArrayList<>());
+    }
+}

+ 249 - 0
src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiSingleTypeController.java

@@ -0,0 +1,249 @@
+package com.sooka.sponest.monitor.ai.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.dahuatech.icc.oauth.model.v202010.OauthConfigUserPwdInfo;
+import com.dahuatech.icc.oauth.utils.HttpUtils;
+import com.ruoyi.common.core.constant.UserConstants;
+import com.ruoyi.common.core.utils.uuid.IdUtils;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.monitor.ai.domain.BusAiSingleType;
+import com.sooka.sponest.monitor.ai.service.IBusAiSingleTypeService;
+import com.sooka.sponest.monitor.ai.util.DHOauthUtil;
+import org.apache.commons.collections4.MapUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 报警类型Controller
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@RestController
+@RequestMapping("/admin-api/ai/singletype")
+public class BusAiSingleTypeController extends BaseController
+{
+    @Autowired
+    private IBusAiSingleTypeService busAiSingleTypeService;
+
+    /**
+     * 同步报警类型
+     */
+    @RequiresPermissions("ai:singletype:list")
+    @GetMapping("/sync")
+    public AjaxResult sync()
+    {
+        List<Long> alarmTypeList = new ArrayList<>();
+        Map<String, Object> params = new HashMap<>();
+        params.put("pageNum", 1);
+        params.put("pageSize", 500);
+
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        while (true) {
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-event/1.0.0/alarm/types/page", params, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+            JSONObject result = JSONObject.parseObject(response.getResult());
+            if (result.getBoolean("success")) {
+                List<Long> types = JSONObject.parseArray(result.getJSONObject("data").getString("pageData"), BusAiSingleType.class).stream().map(BusAiSingleType::getAlarmType).collect(Collectors.toList());
+                if (types.isEmpty()) {
+                    break;
+                }
+                alarmTypeList.addAll(types);
+                params.put("pageNum", MapUtils.getInteger(params, "pageNum") + 1);
+            }
+        }
+        int num = 0;
+        String url = "/evo-apigw/evo-event/1.0.0/alarm/single-type";
+        List<BusAiSingleType> busAiSingleTypes = busAiSingleTypeService.selectBusAiSingleTypeList(new BusAiSingleType());
+        for (BusAiSingleType item : busAiSingleTypes) {
+            if (alarmTypeList.contains(item.getAlarmType())) {
+                try {
+                    response = HttpUtils.executeJson(url, item, null, Method.PUT, config, GeneralResponse.class);
+                } catch (ClientException e) {
+                    e.printStackTrace();
+                }
+            } else {
+                try {
+                    response = HttpUtils.executeJson(url, item, null, Method.POST, config, GeneralResponse.class);
+                } catch (ClientException e) {
+                    e.printStackTrace();
+                }
+            }
+            JSONObject result = JSONObject.parseObject(response.getResult());
+            if (result.getBoolean("success")) {
+                item.setSyncStatus("1");
+                busAiSingleTypeService.updateBusAiSingleType(item);
+                num++;
+            }
+        }
+        return num > 0 ? success() : error();
+    }
+
+    @RequiresPermissions("ai:singletype:list")
+    @GetMapping("/syncDH")
+    public AjaxResult syncDH()
+    {
+        List<BusAiSingleType> busAiSingleTypes = new ArrayList<>();
+        Map<String, Object> params = new HashMap<>();
+        params.put("pageNum", 1);
+        params.put("pageSize", 500);
+
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        while (true) {
+            try {
+                response = HttpUtils.executeJson("/evo-apigw/evo-event/1.0.0/alarm/types/page", params, null, Method.POST, config, GeneralResponse.class);
+            } catch (ClientException e) {
+                e.printStackTrace();
+            }
+            JSONObject result = JSONObject.parseObject(response.getResult());
+            if (result.getBoolean("success")) {
+                List<BusAiSingleType> types = JSONObject.parseArray(result.getJSONObject("data").getString("pageData"), BusAiSingleType.class);
+                if (types.isEmpty()) {
+                    break;
+                }
+                busAiSingleTypes.addAll(types);
+                params.put("pageNum", MapUtils.getInteger(params, "pageNum") + 1);
+            }
+        }
+        int num = 0;
+        List<Long> alarmTypeList = busAiSingleTypeService.selectBusAiSingleTypeList(new BusAiSingleType()).stream().map(BusAiSingleType::getAlarmType).collect(Collectors.toList());
+        List<JSONObject> list = (List<JSONObject>) listAffiliation().get("data");
+        for (BusAiSingleType item : busAiSingleTypes) {
+            item.setSyncStatus("1");
+            if (alarmTypeList.contains(item.getAlarmType())) {
+                busAiSingleTypeService.updateByAlarmType(item);
+            } else {
+                item.setId(IdUtils.fastSimpleUUID());
+                item.setLanguage("zh-CN");
+                item.setAffiliationName(item.getAffiliationName().split(",")[0]);
+                item.setAffiliation(list.stream().filter(i -> i.getString("affiliationName").equals(item.getAffiliationName())).findFirst().get().getInteger("affiliation"));
+                busAiSingleTypeService.insertBusAiSingleType(item);
+            }
+            num++;
+        }
+        return num > 0 ? success() : error();
+    }
+
+    /**
+     * 查询报警类型列表
+     */
+    @RequiresPermissions("ai:singletype:list")
+    @GetMapping("/list")
+    public TableDataInfo list(BusAiSingleType busAiSingleType)
+    {
+        startPage();
+        List<BusAiSingleType> list = busAiSingleTypeService.selectBusAiSingleTypeList(busAiSingleType);
+        return getDataTable(list);
+    }
+
+//    /**
+//     * 导出报警类型列表
+//     */
+//    @PreAuthorize("@ss.hasPermission('ai:singletype:export')")
+//    @Log(title = "报警类型", businessType = BusinessType.EXPORT)
+//    @PostMapping("/export")
+//    public void export(HttpServletResponse response, BusAiSingleType busAiSingleType)
+//    {
+//        List<BusAiSingleType> list = busAiSingleTypeService.selectBusAiSingleTypeList(busAiSingleType);
+//        ExcelUtil<BusAiSingleType> util = new ExcelUtil<BusAiSingleType>(BusAiSingleType.class);
+//        util.exportExcel(response, list, "报警类型数据");
+//    }
+
+    /**
+     * 获取报警类型详细信息
+     */
+    @RequiresPermissions("ai:singletype:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return success(busAiSingleTypeService.selectBusAiSingleTypeById(id));
+    }
+
+    /**
+     * 新增报警类型
+     */
+    @RequiresPermissions("ai:singletype:add")
+    @PostMapping
+    public AjaxResult add(@RequestBody BusAiSingleType busAiSingleType, HttpServletRequest request)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(busAiSingleTypeService.checkAlarmTypeUnique(busAiSingleType))) {
+            return error("新增报警类型失败,报警编号'" + busAiSingleType.getAlarmType() + "'已存在");
+        }
+        if (UserConstants.NOT_UNIQUE.equals(busAiSingleTypeService.checkAlarmTypeNameUnique(busAiSingleType))) {
+            return error("新增报警类型'" + busAiSingleType.getAlarmTypeName() + "'失败,名称已存在");
+        }
+        busAiSingleType.setLanguage(request.getHeader("Accept-Language").split(",")[0]);
+        return busAiSingleTypeService.insertBusAiSingleType(busAiSingleType) > 0 ? success() : error();
+    }
+
+    /**
+     * 修改报警类型
+     */
+    @RequiresPermissions("ai:singletype:edit")
+    @PutMapping
+    public AjaxResult edit(@RequestBody BusAiSingleType busAiSingleType)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(busAiSingleTypeService.checkAlarmTypeNameUnique(busAiSingleType))) {
+            return error("修改报警类型'" + busAiSingleType.getAlarmTypeName() + "'失败,名称已存在");
+        }
+        return busAiSingleTypeService.updateBusAiSingleType(busAiSingleType) > 0 ? success() : error();
+    }
+
+    /**
+     * 删除报警类型
+     */
+    @RequiresPermissions("ai:singletype:remove")
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        BusAiSingleType singleType = busAiSingleTypeService.selectBusAiSingleTypeById(ids[0]);
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        try {
+            HttpUtils.executeJson("/evo-apigw/evo-event/1.0.0/alarm/single-type?alarmType=" + singleType.getAlarmType(), null, null, Method.DELETE, config, GeneralResponse.class);
+        } catch (ClientException e) {
+            e.printStackTrace();
+        }
+        return busAiSingleTypeService.deleteBusAiSingleTypeByIds(ids) > 0 ? success() : error();
+    }
+
+    /**
+     * 查询归属列表
+     */
+    @RequiresPermissions("ai:singletype:list")
+    @GetMapping("/listAffiliation")
+    public AjaxResult listAffiliation()
+    {
+        String url = "/evo-apigw/evo-event/1.0.0/alarm/types/affiliation";
+        OauthConfigUserPwdInfo config = DHOauthUtil.getInstance().getOauthConfig();
+        GeneralResponse response = null;
+        try {
+            response = HttpUtils.executeJson(url, null, null, Method.GET, config, GeneralResponse.class);
+        } catch (ClientException e) {
+            e.printStackTrace();
+        }
+        List<JSONObject> resultList = new ArrayList();
+        JSONObject result = JSONObject.parseObject(response.getResult());
+        if (result.getBoolean("success")) {
+            resultList = JSONObject.parseArray(result.getJSONObject("data").getString("affiliationList"), JSONObject.class);
+        }
+        return success(resultList);
+    }
+}

+ 74 - 0
src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlarmAnalysis.java

@@ -0,0 +1,74 @@
+package com.sooka.sponest.monitor.ai.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 事件二次研判对象 bus_ai_alarm_analysis
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Data
+public class BusAiAlarmAnalysis extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 配置ID,用于唯一标识该二次研判配置 */
+    private Long id;
+
+    private Long configId;
+
+    /** 配置名称,用于标识当前二次研判配置 */
+    private String configName;
+
+    /** 算法的分析规则,包场景描述,包含分析角色、分析规则及分析输出格式等信息,用于指导AI进行图像分析 */
+    private String scenarioDescription;
+
+    /** 分析周期,以英文逗号分隔的星期缩写表示,如示例表示每周一至周日均进行分析 */
+    private String analysisCycle;
+
+    /** 分析任务时间配置数组,用于设置每次分析任务的起止时间 */
+    private List<BusAiAlarmAnalysisConfigJob> alarmAnalysisConfigJobs;
+
+    /** 通道信息数组,包含需要进行二次研判分析的通道相关信息 */
+    private List<BusAiAlarmAnalysisChannel> channels;
+
+    /** 告警类型编码,用于标识告警的类型 */
+    private Long alarmType;
+
+    /** 告警类型名称,对告警类型的文字描述 */
+    private String alarmTypeName;
+
+    /** 启用状态标识,0表示未启用,1表示启用 */
+    private String enabled;
+
+    /** 检测开关标识,1表示开启检测,0表示关闭检测 */
+    private String detection;
+
+    /** 计算点数标识,0表示不计算点数,1表示计算点数 */
+    private String calculatePoints;
+
+    /** 同步状态 */
+    private String syncStatus;
+
+    /** 提示建议信息对象,用于辅助生成分析提示词 */
+    private PromptSuggestion promptSuggestion;
+
+    @Data
+    public static class PromptSuggestion {
+        /** 生成类型标识,1表示某种特定的生成方式(具体含义可根据业务场景确定) */
+        private Integer generationType;
+
+        /** 一句话描述,用于简要说明分析的目标内容 */
+        private String oneSentenceDescription;
+
+        /** 场景列表,用于指定分析的场景(当前示例为空数组) */
+        private String scenes;
+
+        /** 类型列表,用于指定分析的目标类型(当前示例为空数组) */
+        private String types;
+    }
+}

+ 34 - 0
src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlarmAnalysisChannel.java

@@ -0,0 +1,34 @@
+package com.sooka.sponest.monitor.ai.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 事件二次研判通道对象 bus_ai_alarm_analysis_channel
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Data
+public class BusAiAlarmAnalysisChannel extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 配置ID */
+    private Long alarmAnalysisId;
+
+    /** 通道编码,用于唯一标识该通道 */
+    private String channelCode;
+
+    /** 通道名称 */
+    private String channelName;
+
+    /** 所属组织名称 */
+    private String orgName;
+
+    /** 所属组织编码 */
+    private String orgCode;
+
+    /** 设备名称,该通道对应的设备标识 */
+    private String deviceName;
+}

+ 37 - 0
src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlarmAnalysisConfigJob.java

@@ -0,0 +1,37 @@
+package com.sooka.sponest.monitor.ai.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 事件二次研判配置对象 bus_ai_alarm_analysis_config_job
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Data
+public class BusAiAlarmAnalysisConfigJob extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 配置ID */
+    private Long alarmAnalysisId;
+
+    /** 分析任务开始时间的小时数(24小时制) */
+    private Integer startTimeHour;
+
+    /** 分析任务开始时间的分钟数 */
+    private Integer startTimeMinute;
+
+    /** 分析任务开始时间的秒数 */
+    private Integer startTimeSecond;
+
+    /** 分析任务结束时间的小时数(24小时制) */
+    private Integer endTimeHour;
+
+    /** 分析任务结束时间的分钟数 */
+    private Integer endTimeMinute;
+
+    /** 分析任务结束时间的秒数 */
+    private Integer endTimeSecond;
+}

+ 54 - 0
src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlgorithm.java

@@ -0,0 +1,54 @@
+package com.sooka.sponest.monitor.ai.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 算法对象 bus_ai_algorithm
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Data
+public class BusAiAlgorithm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 算法的唯一标识ID */
+    private Long id;
+
+    private Long algorithmId;
+
+    /** 算法的名称,用于标识该算法 */
+    private String algorithmName;
+
+    /** 算法的分析规则,包括分析角色、具体规则、输出格式及字段说明等内容 */
+    private String algorithmRule;
+
+    /** 告警类型对应的编码 */
+    private Integer alarmType;
+
+    /** 告警类型的名称 */
+    private String alarmTypeName;
+
+    /** 算法的启用状态,0表示未启用,1表示启用 */
+    private String enabled;
+
+    /** 同步状态 */
+    private String syncStatus;
+
+    /** 提示建议相关配置信息 */
+    private PromptSuggestion promptSuggestion;
+
+    @Data
+    public static class PromptSuggestion {
+        /** 生成类型的标识 */
+        private Integer generationType;
+
+        /** 场景列表,用于指定算法适用的场景 */
+        private String scenes;
+
+        /** 类型列表,用于指定算法相关的类型 */
+        private String types;
+    }
+}

+ 79 - 0
src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlgorithmTask.java

@@ -0,0 +1,79 @@
+package com.sooka.sponest.monitor.ai.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 任务对象 bus_ai_algorithm_task
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Data
+public class BusAiAlgorithmTask extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    private Long taskId;
+
+    /** 算法任务名称 */
+    private String taskName;
+
+    /** 算法信息 */
+    private List<BusAiAlgorithmTaskInfo> infos;
+
+    /** 抓图间隔 */
+    private String analysisFrequency;
+
+    /** 抓图间隔单位(时、分、秒) */
+    private String analysisFrequencyUnit;
+
+    /** 抓图周期,周一到周日的英文简写前三个字母小写 */
+    private String analysisCycle;
+
+    /** 分析任务时间配置数组,用于设置每次分析任务的起止时间 */
+    private List<BusAiAlgorithmTaskConfigJob> taskJobs;
+
+    /** 通道信息数组,包含需要进行二次研判分析的通道相关信息 */
+    private List<BusAiAlgorithmTaskChannel> channelInfos;
+
+    private String channelCode;
+
+    /** 1为开启,0为关闭 */
+    private String enabled;
+
+    /** 识别框开关 1为开启,0为关闭 */
+    private String detection;
+
+    /** 模板ID */
+    private String templateId;
+
+    /** 1:自动抓图 0:定时抓图 */
+    private Integer auto;
+
+    /** 等比缩放的短边分辨率 */
+    private Integer shortSideResolution;
+
+    /** 分析类型 1:单图分析,2:组合分析 */
+    private Integer analysisType;
+
+    /** 组合分析任务间隔(单位根据实际场景确定) */
+    private Integer combTaskInterval;
+
+    /** 抓图间隔(单位根据实际场景确定) */
+    private Integer captureInterval;
+
+    /** 每次抓图的数量 */
+    private Integer captureImageNum;
+
+    /** 目标点定位 1:开启 0:关闭 */
+    private String calculatePoints;
+
+    /** 同步状态 */
+    private String syncStatus;
+}

+ 140 - 0
src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlgorithmTaskChannel.java

@@ -0,0 +1,140 @@
+package com.sooka.sponest.monitor.ai.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 任务通道对象 bus_ai_algorithm_task_channel
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public class BusAiAlgorithmTaskChannel extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 任务ID */
+    private Long algorithmTaskId;
+
+    /** 通道编码 */
+    private String channelCode;
+
+    /** 通道名称 */
+    private String channelName;
+
+    /** 组织名称 */
+    private String orgName;
+
+    /** 组织编码 */
+    private String orgCode;
+
+    /** 设备名称 */
+    private String deviceName;
+
+    /** 设备协议 1: 大华协议 非1:其他海康或者级联三方设备协议 */
+    private String protocol;
+
+    /** 抓图方式 0: 设备抓图  1:网关抓图 */
+    private Integer snapMethod;
+
+    /** 裁剪区域点,JSON格式字符串 */
+    private String areaPoints;
+
+    public void setAlgorithmTaskId(Long algorithmTaskId)
+    {
+        this.algorithmTaskId = algorithmTaskId;
+    }
+
+    public Long getAlgorithmTaskId()
+    {
+        return algorithmTaskId;
+    }
+    public void setChannelCode(String channelCode)
+    {
+        this.channelCode = channelCode;
+    }
+
+    public String getChannelCode()
+    {
+        return channelCode;
+    }
+    public void setChannelName(String channelName)
+    {
+        this.channelName = channelName;
+    }
+
+    public String getChannelName()
+    {
+        return channelName;
+    }
+    public void setOrgName(String orgName)
+    {
+        this.orgName = orgName;
+    }
+
+    public String getOrgName()
+    {
+        return orgName;
+    }
+    public void setOrgCode(String orgCode)
+    {
+        this.orgCode = orgCode;
+    }
+
+    public String getOrgCode()
+    {
+        return orgCode;
+    }
+    public void setDeviceName(String deviceName)
+    {
+        this.deviceName = deviceName;
+    }
+
+    public String getDeviceName()
+    {
+        return deviceName;
+    }
+    public void setProtocol(String protocol)
+    {
+        this.protocol = protocol;
+    }
+
+    public String getProtocol()
+    {
+        return protocol;
+    }
+    public void setSnapMethod(Integer snapMethod)
+    {
+        this.snapMethod = snapMethod;
+    }
+
+    public Integer getSnapMethod()
+    {
+        return snapMethod;
+    }
+    public void setAreaPoints(String areaPoints)
+    {
+        this.areaPoints = areaPoints;
+    }
+
+    public String getAreaPoints()
+    {
+        return areaPoints;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("algorithmTaskId", getAlgorithmTaskId())
+            .append("channelCode", getChannelCode())
+            .append("channelName", getChannelName())
+            .append("orgName", getOrgName())
+            .append("orgCode", getOrgCode())
+            .append("deviceName", getDeviceName())
+            .append("protocol", getProtocol())
+            .append("snapMethod", getSnapMethod())
+            .append("areaPoints", getAreaPoints())
+            .toString();
+    }
+}

+ 114 - 0
src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlgorithmTaskConfigJob.java

@@ -0,0 +1,114 @@
+package com.sooka.sponest.monitor.ai.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 任务配置对象 bus_ai_algorithm_task_config_job
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public class BusAiAlgorithmTaskConfigJob extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 任务ID */
+    private Long algorithmTaskId;
+
+    /** 开始小时 */
+    private Integer startTimeHour;
+
+    /** 开始分钟 */
+    private Integer startTimeMinute;
+
+    /** 开始秒 */
+    private Integer startTimeSecond;
+
+    /** 结束小时 */
+    private Integer endTimeHour;
+
+    /** 结束分钟 */
+    private Integer endTimeMinute;
+
+    /** 结束秒 */
+    private Integer endTimeSecond;
+
+    public void setAlgorithmTaskId(Long algorithmTaskId)
+    {
+        this.algorithmTaskId = algorithmTaskId;
+    }
+
+    public Long getAlgorithmTaskId()
+    {
+        return algorithmTaskId;
+    }
+    public void setStartTimeHour(Integer startTimeHour)
+    {
+        this.startTimeHour = startTimeHour;
+    }
+
+    public Integer getStartTimeHour()
+    {
+        return startTimeHour;
+    }
+    public void setStartTimeMinute(Integer startTimeMinute)
+    {
+        this.startTimeMinute = startTimeMinute;
+    }
+
+    public Integer getStartTimeMinute()
+    {
+        return startTimeMinute;
+    }
+    public void setStartTimeSecond(Integer startTimeSecond)
+    {
+        this.startTimeSecond = startTimeSecond;
+    }
+
+    public Integer getStartTimeSecond()
+    {
+        return startTimeSecond;
+    }
+    public void setEndTimeHour(Integer endTimeHour)
+    {
+        this.endTimeHour = endTimeHour;
+    }
+
+    public Integer getEndTimeHour()
+    {
+        return endTimeHour;
+    }
+    public void setEndTimeMinute(Integer endTimeMinute)
+    {
+        this.endTimeMinute = endTimeMinute;
+    }
+
+    public Integer getEndTimeMinute()
+    {
+        return endTimeMinute;
+    }
+    public void setEndTimeSecond(Integer endTimeSecond)
+    {
+        this.endTimeSecond = endTimeSecond;
+    }
+
+    public Integer getEndTimeSecond()
+    {
+        return endTimeSecond;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("algorithmTaskId", getAlgorithmTaskId())
+            .append("startTimeHour", getStartTimeHour())
+            .append("startTimeMinute", getStartTimeMinute())
+            .append("startTimeSecond", getStartTimeSecond())
+            .append("endTimeHour", getEndTimeHour())
+            .append("endTimeMinute", getEndTimeMinute())
+            .append("endTimeSecond", getEndTimeSecond())
+            .toString();
+    }
+}

+ 58 - 0
src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiAlgorithmTaskInfo.java

@@ -0,0 +1,58 @@
+package com.sooka.sponest.monitor.ai.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 任务算法对象 bus_ai_algorithm_task_info
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public class BusAiAlgorithmTaskInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 任务ID */
+    private Long algorithmTaskId;
+
+    /** 算法管理ID */
+    private Long aigorithmId;
+
+    /** 算法管理名称 */
+    private String aigorithmName;
+
+    public void setAlgorithmTaskId(Long algorithmTaskId)
+    {
+        this.algorithmTaskId = algorithmTaskId;
+    }
+
+    public Long getAlgorithmTaskId()
+    {
+        return algorithmTaskId;
+    }
+    public void setAigorithmId(Long aigorithmId) {
+        this.aigorithmId = aigorithmId;
+    }
+
+    public Long getAigorithmId() {
+        return aigorithmId;
+    }
+    public void setAigorithmName(String aigorithmName) {
+        this.aigorithmName = aigorithmName;
+    }
+
+    public String getAigorithmName() {
+        return aigorithmName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("algorithmTaskId", getAlgorithmTaskId())
+            .append("aigorithmId", getAigorithmId())
+            .append("aigorithmName", getAigorithmName())
+            .toString();
+    }
+}

+ 63 - 0
src/main/java/com/sooka/sponest/monitor/ai/domain/BusAiSingleType.java

@@ -0,0 +1,63 @@
+package com.sooka.sponest.monitor.ai.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 报警类型对象 bus_ai_single_type
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Data
+public class BusAiSingleType extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private String id;
+
+    /** 报警编号 */
+//    @Excel(name = "报警编号")
+    private Long alarmType;
+
+    /** 和request中拿到的语言保持一致 */
+    private String language;
+
+    /** 报警类型名称 */
+//    @Excel(name = "报警类型名称")
+    private String alarmTypeName;
+
+    /** 归属 */
+    private Integer affiliation;
+
+//    @Excel(name = "归属")
+    private String affiliationName;
+
+    /** 报警等级 */
+//    @Excel(name = "报警等级", readConverterExp = "1=严重,2=一般,3=轻微")
+    private String alarmGrade;
+
+    /** 报警风暴 */
+//    @Excel(name = "报警风暴")
+    private Integer alarmStorm;
+
+    /** 是否禁用 */
+//    @Excel(name = "是否禁用", readConverterExp = "0=否,1=是")
+    private String status;
+
+    /** 是否保存 */
+//    @Excel(name = "是否保存", readConverterExp = "0=否,1=是")
+    private String isSave;
+
+    /** 是否故障 */
+//    @Excel(name = "是否故障", readConverterExp = "0=否,1=是")
+    private String failure;
+
+    /** 处理页面 */
+//    @Excel(name = "处理页面", readConverterExp = "default subsystem=默认")
+    private String urlNameKey;
+
+    /** 同步状态 */
+    private String syncStatus;
+}

+ 62 - 0
src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlarmAnalysisChannelMapper.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.monitor.ai.mapper;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysisChannel;
+
+import java.util.List;
+
+/**
+ * 事件二次研判通道Mapper接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface BusAiAlarmAnalysisChannelMapper
+{
+    /**
+     * 查询事件二次研判通道
+     *
+     * @param alarmAnalysisId 事件二次研判通道主键
+     * @return 事件二次研判通道
+     */
+    public List<BusAiAlarmAnalysisChannel> selectBusAiAlarmAnalysisChannelByAlarmAnalysisId(Long alarmAnalysisId);
+
+    /**
+     * 查询事件二次研判通道列表
+     *
+     * @param busAiAlarmAnalysisChannel 事件二次研判通道
+     * @return 事件二次研判通道集合
+     */
+    public List<BusAiAlarmAnalysisChannel> selectBusAiAlarmAnalysisChannelList(BusAiAlarmAnalysisChannel busAiAlarmAnalysisChannel);
+
+    /**
+     * 新增事件二次研判通道
+     *
+     * @param busAiAlarmAnalysisChannel 事件二次研判通道
+     * @return 结果
+     */
+    public int insertBusAiAlarmAnalysisChannel(BusAiAlarmAnalysisChannel busAiAlarmAnalysisChannel);
+
+    /**
+     * 修改事件二次研判通道
+     *
+     * @param busAiAlarmAnalysisChannel 事件二次研判通道
+     * @return 结果
+     */
+    public int updateBusAiAlarmAnalysisChannel(BusAiAlarmAnalysisChannel busAiAlarmAnalysisChannel);
+
+    /**
+     * 删除事件二次研判通道
+     *
+     * @param alarmAnalysisId 事件二次研判通道主键
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisChannelByAlarmAnalysisId(Long alarmAnalysisId);
+
+    /**
+     * 批量删除事件二次研判通道
+     *
+     * @param alarmAnalysisIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisChannelByAlarmAnalysisIds(Long[] alarmAnalysisIds);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlarmAnalysisConfigJobMapper.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.monitor.ai.mapper;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysisConfigJob;
+
+import java.util.List;
+
+/**
+ * 事件二次研判配置Mapper接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface BusAiAlarmAnalysisConfigJobMapper
+{
+    /**
+     * 查询事件二次研判配置
+     *
+     * @param alarmAnalysisId 事件二次研判配置主键
+     * @return 事件二次研判配置
+     */
+    public List<BusAiAlarmAnalysisConfigJob> selectBusAiAlarmAnalysisConfigJobByAlarmAnalysisId(Long alarmAnalysisId);
+
+    /**
+     * 查询事件二次研判配置列表
+     *
+     * @param busAiAlarmAnalysisConfigJob 事件二次研判配置
+     * @return 事件二次研判配置集合
+     */
+    public List<BusAiAlarmAnalysisConfigJob> selectBusAiAlarmAnalysisConfigJobList(BusAiAlarmAnalysisConfigJob busAiAlarmAnalysisConfigJob);
+
+    /**
+     * 新增事件二次研判配置
+     *
+     * @param busAiAlarmAnalysisConfigJob 事件二次研判配置
+     * @return 结果
+     */
+    public int insertBusAiAlarmAnalysisConfigJob(BusAiAlarmAnalysisConfigJob busAiAlarmAnalysisConfigJob);
+
+    /**
+     * 修改事件二次研判配置
+     *
+     * @param busAiAlarmAnalysisConfigJob 事件二次研判配置
+     * @return 结果
+     */
+    public int updateBusAiAlarmAnalysisConfigJob(BusAiAlarmAnalysisConfigJob busAiAlarmAnalysisConfigJob);
+
+    /**
+     * 删除事件二次研判配置
+     *
+     * @param alarmAnalysisId 事件二次研判配置主键
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisId(Long alarmAnalysisId);
+
+    /**
+     * 批量删除事件二次研判配置
+     *
+     * @param alarmAnalysisIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisIds(Long[] alarmAnalysisIds);
+}

+ 66 - 0
src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlarmAnalysisMapper.java

@@ -0,0 +1,66 @@
+package com.sooka.sponest.monitor.ai.mapper;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysis;
+
+import java.util.List;
+
+/**
+ * 事件二次研判Mapper接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface BusAiAlarmAnalysisMapper
+{
+    /**
+     * 查询事件二次研判
+     *
+     * @param id 事件二次研判主键
+     * @return 事件二次研判
+     */
+    public BusAiAlarmAnalysis selectBusAiAlarmAnalysisById(Long id);
+
+    /**
+     * 查询事件二次研判列表
+     *
+     * @param busAiAlarmAnalysis 事件二次研判
+     * @return 事件二次研判集合
+     */
+    public List<BusAiAlarmAnalysis> selectBusAiAlarmAnalysisList(BusAiAlarmAnalysis busAiAlarmAnalysis);
+
+    BusAiAlarmAnalysis checkConfigNameUnique(String configName);
+
+    BusAiAlarmAnalysis checkAlarmTypeUnique(Long alarmType);
+
+    /**
+     * 新增事件二次研判
+     *
+     * @param busAiAlarmAnalysis 事件二次研判
+     * @return 结果
+     */
+    public int insertBusAiAlarmAnalysis(BusAiAlarmAnalysis busAiAlarmAnalysis);
+
+    /**
+     * 修改事件二次研判
+     *
+     * @param busAiAlarmAnalysis 事件二次研判
+     * @return 结果
+     */
+    public int updateBusAiAlarmAnalysis(BusAiAlarmAnalysis busAiAlarmAnalysis);
+
+    /**
+     * 删除事件二次研判
+     *
+     * @param id 事件二次研判主键
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisById(Long id);
+
+    /**
+     * 批量删除事件二次研判
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisByIds(Long[] ids);
+}

+ 66 - 0
src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlgorithmMapper.java

@@ -0,0 +1,66 @@
+package com.sooka.sponest.monitor.ai.mapper;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithm;
+
+import java.util.List;
+
+/**
+ * 算法Mapper接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface BusAiAlgorithmMapper
+{
+    /**
+     * 查询算法
+     *
+     * @param id 算法主键
+     * @return 算法
+     */
+    public BusAiAlgorithm selectBusAiAlgorithmById(Long id);
+
+    /**
+     * 查询算法列表
+     *
+     * @param busAiAlgorithm 算法
+     * @return 算法集合
+     */
+    public List<BusAiAlgorithm> selectBusAiAlgorithmList(BusAiAlgorithm busAiAlgorithm);
+
+    BusAiAlgorithm checkAlgorithmNameUnique(String algorithmName);
+
+    /**
+     * 新增算法
+     *
+     * @param busAiAlgorithm 算法
+     * @return 结果
+     */
+    public int insertBusAiAlgorithm(BusAiAlgorithm busAiAlgorithm);
+
+    /**
+     * 修改算法
+     *
+     * @param busAiAlgorithm 算法
+     * @return 结果
+     */
+    public int updateBusAiAlgorithm(BusAiAlgorithm busAiAlgorithm);
+
+    int updateByName(BusAiAlgorithm busAiAlgorithm);
+
+    /**
+     * 删除算法
+     *
+     * @param id 算法主键
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmById(Long id);
+
+    /**
+     * 批量删除算法
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmByIds(Long[] ids);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlgorithmTaskChannelMapper.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.monitor.ai.mapper;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskChannel;
+
+import java.util.List;
+
+/**
+ * 任务通道Mapper接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface BusAiAlgorithmTaskChannelMapper
+{
+    /**
+     * 查询任务通道
+     *
+     * @param algorithmTaskId 任务通道主键
+     * @return 任务通道
+     */
+    public List<BusAiAlgorithmTaskChannel> selectBusAiAlgorithmTaskChannelByAlgorithmTaskId(Long algorithmTaskId);
+
+    /**
+     * 查询任务通道列表
+     *
+     * @param busAiAlgorithmTaskChannel 任务通道
+     * @return 任务通道集合
+     */
+    public List<BusAiAlgorithmTaskChannel> selectBusAiAlgorithmTaskChannelList(BusAiAlgorithmTaskChannel busAiAlgorithmTaskChannel);
+
+    /**
+     * 新增任务通道
+     *
+     * @param busAiAlgorithmTaskChannel 任务通道
+     * @return 结果
+     */
+    public int insertBusAiAlgorithmTaskChannel(BusAiAlgorithmTaskChannel busAiAlgorithmTaskChannel);
+
+    /**
+     * 修改任务通道
+     *
+     * @param busAiAlgorithmTaskChannel 任务通道
+     * @return 结果
+     */
+    public int updateBusAiAlgorithmTaskChannel(BusAiAlgorithmTaskChannel busAiAlgorithmTaskChannel);
+
+    /**
+     * 删除任务通道
+     *
+     * @param algorithmTaskId 任务通道主键
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskChannelByAlgorithmTaskId(Long algorithmTaskId);
+
+    /**
+     * 批量删除任务通道
+     *
+     * @param algorithmTaskIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskChannelByAlgorithmTaskIds(Long[] algorithmTaskIds);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlgorithmTaskConfigJobMapper.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.monitor.ai.mapper;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskConfigJob;
+
+import java.util.List;
+
+/**
+ * 任务配置Mapper接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface BusAiAlgorithmTaskConfigJobMapper
+{
+    /**
+     * 查询任务配置
+     *
+     * @param algorithmTaskId 任务配置主键
+     * @return 任务配置
+     */
+    public List<BusAiAlgorithmTaskConfigJob> selectBusAiAlgorithmTaskConfigJobByAlgorithmTaskId(Long algorithmTaskId);
+
+    /**
+     * 查询任务配置列表
+     *
+     * @param busAiAlgorithmTaskConfigJob 任务配置
+     * @return 任务配置集合
+     */
+    public List<BusAiAlgorithmTaskConfigJob> selectBusAiAlgorithmTaskConfigJobList(BusAiAlgorithmTaskConfigJob busAiAlgorithmTaskConfigJob);
+
+    /**
+     * 新增任务配置
+     *
+     * @param busAiAlgorithmTaskConfigJob 任务配置
+     * @return 结果
+     */
+    public int insertBusAiAlgorithmTaskConfigJob(BusAiAlgorithmTaskConfigJob busAiAlgorithmTaskConfigJob);
+
+    /**
+     * 修改任务配置
+     *
+     * @param busAiAlgorithmTaskConfigJob 任务配置
+     * @return 结果
+     */
+    public int updateBusAiAlgorithmTaskConfigJob(BusAiAlgorithmTaskConfigJob busAiAlgorithmTaskConfigJob);
+
+    /**
+     * 删除任务配置
+     *
+     * @param algorithmTaskId 任务配置主键
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskId(Long algorithmTaskId);
+
+    /**
+     * 批量删除任务配置
+     *
+     * @param algorithmTaskIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskIds(Long[] algorithmTaskIds);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlgorithmTaskInfoMapper.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.monitor.ai.mapper;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskInfo;
+
+import java.util.List;
+
+/**
+ * 任务算法Mapper接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface BusAiAlgorithmTaskInfoMapper
+{
+    /**
+     * 查询任务算法
+     *
+     * @param algorithmTaskId 任务算法主键
+     * @return 任务算法
+     */
+    public List<BusAiAlgorithmTaskInfo> selectBusAiAlgorithmTaskInfoByAlgorithmTaskId(Long algorithmTaskId);
+
+    /**
+     * 查询任务算法列表
+     *
+     * @param busAiAlgorithmTaskInfo 任务算法
+     * @return 任务算法集合
+     */
+    public List<BusAiAlgorithmTaskInfo> selectBusAiAlgorithmTaskInfoList(BusAiAlgorithmTaskInfo busAiAlgorithmTaskInfo);
+
+    /**
+     * 新增任务算法
+     *
+     * @param busAiAlgorithmTaskInfo 任务算法
+     * @return 结果
+     */
+    public int insertBusAiAlgorithmTaskInfo(BusAiAlgorithmTaskInfo busAiAlgorithmTaskInfo);
+
+    /**
+     * 修改任务算法
+     *
+     * @param busAiAlgorithmTaskInfo 任务算法
+     * @return 结果
+     */
+    public int updateBusAiAlgorithmTaskInfo(BusAiAlgorithmTaskInfo busAiAlgorithmTaskInfo);
+
+    /**
+     * 删除任务算法
+     *
+     * @param algorithmTaskId 任务算法主键
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskInfoByAlgorithmTaskId(Long algorithmTaskId);
+
+    /**
+     * 批量删除任务算法
+     *
+     * @param algorithmTaskIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskInfoByAlgorithmTaskIds(Long[] algorithmTaskIds);
+}

+ 64 - 0
src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiAlgorithmTaskMapper.java

@@ -0,0 +1,64 @@
+package com.sooka.sponest.monitor.ai.mapper;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTask;
+
+import java.util.List;
+
+/**
+ * 任务Mapper接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface BusAiAlgorithmTaskMapper
+{
+    /**
+     * 查询任务
+     *
+     * @param id 任务主键
+     * @return 任务
+     */
+    public BusAiAlgorithmTask selectBusAiAlgorithmTaskById(Long id);
+
+    /**
+     * 查询任务列表
+     *
+     * @param busAiAlgorithmTask 任务
+     * @return 任务集合
+     */
+    public List<BusAiAlgorithmTask> selectBusAiAlgorithmTaskList(BusAiAlgorithmTask busAiAlgorithmTask);
+
+    BusAiAlgorithmTask checkTaskNameUnique(String taskName);
+
+    /**
+     * 新增任务
+     *
+     * @param busAiAlgorithmTask 任务
+     * @return 结果
+     */
+    public int insertBusAiAlgorithmTask(BusAiAlgorithmTask busAiAlgorithmTask);
+
+    /**
+     * 修改任务
+     *
+     * @param busAiAlgorithmTask 任务
+     * @return 结果
+     */
+    public int updateBusAiAlgorithmTask(BusAiAlgorithmTask busAiAlgorithmTask);
+
+    /**
+     * 删除任务
+     *
+     * @param id 任务主键
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskById(Long id);
+
+    /**
+     * 批量删除任务
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskByIds(Long[] ids);
+}

+ 68 - 0
src/main/java/com/sooka/sponest/monitor/ai/mapper/BusAiSingleTypeMapper.java

@@ -0,0 +1,68 @@
+package com.sooka.sponest.monitor.ai.mapper;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiSingleType;
+
+import java.util.List;
+
+/**
+ * 报警类型Mapper接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface BusAiSingleTypeMapper
+{
+    /**
+     * 查询报警类型
+     *
+     * @param id 报警类型主键
+     * @return 报警类型
+     */
+    public BusAiSingleType selectBusAiSingleTypeById(String id);
+
+    /**
+     * 查询报警类型列表
+     *
+     * @param busAiSingleType 报警类型
+     * @return 报警类型集合
+     */
+    public List<BusAiSingleType> selectBusAiSingleTypeList(BusAiSingleType busAiSingleType);
+
+    BusAiSingleType checkAlarmTypeUnique(Long alarmType);
+
+    BusAiSingleType checkAlarmTypeNameUnique(String alarmTypeName);
+
+    /**
+     * 新增报警类型
+     *
+     * @param busAiSingleType 报警类型
+     * @return 结果
+     */
+    public int insertBusAiSingleType(BusAiSingleType busAiSingleType);
+
+    /**
+     * 修改报警类型
+     *
+     * @param busAiSingleType 报警类型
+     * @return 结果
+     */
+    public int updateBusAiSingleType(BusAiSingleType busAiSingleType);
+
+    int updateByAlarmType(BusAiSingleType busAiSingleType);
+
+    /**
+     * 删除报警类型
+     *
+     * @param id 报警类型主键
+     * @return 结果
+     */
+    public int deleteBusAiSingleTypeById(String id);
+
+    /**
+     * 批量删除报警类型
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBusAiSingleTypeByIds(String[] ids);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlarmAnalysisChannelService.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.monitor.ai.service;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysisChannel;
+
+import java.util.List;
+
+/**
+ * 事件二次研判通道Service接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface IBusAiAlarmAnalysisChannelService
+{
+    /**
+     * 查询事件二次研判通道
+     *
+     * @param alarmAnalysisId 事件二次研判通道主键
+     * @return 事件二次研判通道
+     */
+    public List<BusAiAlarmAnalysisChannel> selectBusAiAlarmAnalysisChannelByAlarmAnalysisId(Long alarmAnalysisId);
+
+    /**
+     * 查询事件二次研判通道列表
+     *
+     * @param busAiAlarmAnalysisChannel 事件二次研判通道
+     * @return 事件二次研判通道集合
+     */
+    public List<BusAiAlarmAnalysisChannel> selectBusAiAlarmAnalysisChannelList(BusAiAlarmAnalysisChannel busAiAlarmAnalysisChannel);
+
+    /**
+     * 新增事件二次研判通道
+     *
+     * @param busAiAlarmAnalysisChannel 事件二次研判通道
+     * @return 结果
+     */
+    public int insertBusAiAlarmAnalysisChannel(BusAiAlarmAnalysisChannel busAiAlarmAnalysisChannel);
+
+    /**
+     * 修改事件二次研判通道
+     *
+     * @param busAiAlarmAnalysisChannel 事件二次研判通道
+     * @return 结果
+     */
+    public int updateBusAiAlarmAnalysisChannel(BusAiAlarmAnalysisChannel busAiAlarmAnalysisChannel);
+
+    /**
+     * 批量删除事件二次研判通道
+     *
+     * @param alarmAnalysisIds 需要删除的事件二次研判通道主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisChannelByAlarmAnalysisIds(Long[] alarmAnalysisIds);
+
+    /**
+     * 删除事件二次研判通道信息
+     *
+     * @param alarmAnalysisId 事件二次研判通道主键
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisChannelByAlarmAnalysisId(Long alarmAnalysisId);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlarmAnalysisConfigJobService.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.monitor.ai.service;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysisConfigJob;
+
+import java.util.List;
+
+/**
+ * 事件二次研判配置Service接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface IBusAiAlarmAnalysisConfigJobService
+{
+    /**
+     * 查询事件二次研判配置
+     *
+     * @param alarmAnalysisId 事件二次研判配置主键
+     * @return 事件二次研判配置
+     */
+    public List<BusAiAlarmAnalysisConfigJob> selectBusAiAlarmAnalysisConfigJobByAlarmAnalysisId(Long alarmAnalysisId);
+
+    /**
+     * 查询事件二次研判配置列表
+     *
+     * @param busAiAlarmAnalysisConfigJob 事件二次研判配置
+     * @return 事件二次研判配置集合
+     */
+    public List<BusAiAlarmAnalysisConfigJob> selectBusAiAlarmAnalysisConfigJobList(BusAiAlarmAnalysisConfigJob busAiAlarmAnalysisConfigJob);
+
+    /**
+     * 新增事件二次研判配置
+     *
+     * @param busAiAlarmAnalysisConfigJob 事件二次研判配置
+     * @return 结果
+     */
+    public int insertBusAiAlarmAnalysisConfigJob(BusAiAlarmAnalysisConfigJob busAiAlarmAnalysisConfigJob);
+
+    /**
+     * 修改事件二次研判配置
+     *
+     * @param busAiAlarmAnalysisConfigJob 事件二次研判配置
+     * @return 结果
+     */
+    public int updateBusAiAlarmAnalysisConfigJob(BusAiAlarmAnalysisConfigJob busAiAlarmAnalysisConfigJob);
+
+    /**
+     * 批量删除事件二次研判配置
+     *
+     * @param alarmAnalysisIds 需要删除的事件二次研判配置主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisIds(Long[] alarmAnalysisIds);
+
+    /**
+     * 删除事件二次研判配置信息
+     *
+     * @param alarmAnalysisId 事件二次研判配置主键
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisId(Long alarmAnalysisId);
+}

+ 69 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlarmAnalysisService.java

@@ -0,0 +1,69 @@
+package com.sooka.sponest.monitor.ai.service;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysis;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 事件二次研判Service接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface IBusAiAlarmAnalysisService
+{
+    /**
+     * 查询事件二次研判
+     *
+     * @param id 事件二次研判主键
+     * @return 事件二次研判
+     */
+    public BusAiAlarmAnalysis selectBusAiAlarmAnalysisById(Long id);
+
+    /**
+     * 查询事件二次研判列表
+     *
+     * @param busAiAlarmAnalysis 事件二次研判
+     * @return 事件二次研判集合
+     */
+    public List<BusAiAlarmAnalysis> selectBusAiAlarmAnalysisList(BusAiAlarmAnalysis busAiAlarmAnalysis);
+
+    String checkConfigNameUnique(BusAiAlarmAnalysis busAiAlarmAnalysis);
+
+    String checkAlarmTypeUnique(BusAiAlarmAnalysis busAiAlarmAnalysis);
+
+    /**
+     * 新增事件二次研判
+     *
+     * @param busAiAlarmAnalysis 事件二次研判
+     * @return 结果
+     */
+    public int insertBusAiAlarmAnalysis(BusAiAlarmAnalysis busAiAlarmAnalysis);
+
+    /**
+     * 修改事件二次研判
+     *
+     * @param busAiAlarmAnalysis 事件二次研判
+     * @return 结果
+     */
+    public int updateBusAiAlarmAnalysis(BusAiAlarmAnalysis busAiAlarmAnalysis);
+
+    /**
+     * 批量删除事件二次研判
+     *
+     * @param ids 需要删除的事件二次研判主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisByIds(Long[] ids);
+
+    /**
+     * 删除事件二次研判信息
+     *
+     * @param id 事件二次研判主键
+     * @return 结果
+     */
+    public int deleteBusAiAlarmAnalysisById(Long id);
+
+    List<Map<String, Object>> channelTree();
+}

+ 65 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlgorithmService.java

@@ -0,0 +1,65 @@
+package com.sooka.sponest.monitor.ai.service;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithm;
+
+import java.util.List;
+
+/**
+ * 算法Service接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface IBusAiAlgorithmService {
+    /**
+     * 查询算法
+     *
+     * @param id 算法主键
+     * @return 算法
+     */
+    public BusAiAlgorithm selectBusAiAlgorithmById(Long id);
+
+    /**
+     * 查询算法列表
+     *
+     * @param busAiAlgorithm 算法
+     * @return 算法集合
+     */
+    public List<BusAiAlgorithm> selectBusAiAlgorithmList(BusAiAlgorithm busAiAlgorithm);
+
+    String checkAlgorithmNameUnique(BusAiAlgorithm busAiAlgorithm);
+
+    /**
+     * 新增算法
+     *
+     * @param busAiAlgorithm 算法
+     * @return 结果
+     */
+    public int insertBusAiAlgorithm(BusAiAlgorithm busAiAlgorithm);
+
+    /**
+     * 修改算法
+     *
+     * @param busAiAlgorithm 算法
+     * @return 结果
+     */
+    public int updateBusAiAlgorithm(BusAiAlgorithm busAiAlgorithm);
+
+    int updateByName(BusAiAlgorithm busAiAlgorithm);
+
+    /**
+     * 批量删除算法
+     *
+     * @param ids 需要删除的算法主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmByIds(Long[] ids);
+
+    /**
+     * 删除算法信息
+     *
+     * @param id 算法主键
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmById(Long id);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlgorithmTaskChannelService.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.monitor.ai.service;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskChannel;
+
+import java.util.List;
+
+/**
+ * 任务通道Service接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface IBusAiAlgorithmTaskChannelService
+{
+    /**
+     * 查询任务通道
+     *
+     * @param algorithmTaskId 任务通道主键
+     * @return 任务通道
+     */
+    public List<BusAiAlgorithmTaskChannel> selectBusAiAlgorithmTaskChannelByAlgorithmTaskId(Long algorithmTaskId);
+
+    /**
+     * 查询任务通道列表
+     *
+     * @param busAiAlgorithmTaskChannel 任务通道
+     * @return 任务通道集合
+     */
+    public List<BusAiAlgorithmTaskChannel> selectBusAiAlgorithmTaskChannelList(BusAiAlgorithmTaskChannel busAiAlgorithmTaskChannel);
+
+    /**
+     * 新增任务通道
+     *
+     * @param busAiAlgorithmTaskChannel 任务通道
+     * @return 结果
+     */
+    public int insertBusAiAlgorithmTaskChannel(BusAiAlgorithmTaskChannel busAiAlgorithmTaskChannel);
+
+    /**
+     * 修改任务通道
+     *
+     * @param busAiAlgorithmTaskChannel 任务通道
+     * @return 结果
+     */
+    public int updateBusAiAlgorithmTaskChannel(BusAiAlgorithmTaskChannel busAiAlgorithmTaskChannel);
+
+    /**
+     * 批量删除任务通道
+     *
+     * @param algorithmTaskIds 需要删除的任务通道主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskChannelByAlgorithmTaskIds(Long[] algorithmTaskIds);
+
+    /**
+     * 删除任务通道信息
+     *
+     * @param algorithmTaskId 任务通道主键
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskChannelByAlgorithmTaskId(Long algorithmTaskId);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlgorithmTaskConfigJobService.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.monitor.ai.service;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskConfigJob;
+
+import java.util.List;
+
+/**
+ * 任务配置Service接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface IBusAiAlgorithmTaskConfigJobService
+{
+    /**
+     * 查询任务配置
+     *
+     * @param algorithmTaskId 任务配置主键
+     * @return 任务配置
+     */
+    public List<BusAiAlgorithmTaskConfigJob> selectBusAiAlgorithmTaskConfigJobByAlgorithmTaskId(Long algorithmTaskId);
+
+    /**
+     * 查询任务配置列表
+     *
+     * @param busAiAlgorithmTaskConfigJob 任务配置
+     * @return 任务配置集合
+     */
+    public List<BusAiAlgorithmTaskConfigJob> selectBusAiAlgorithmTaskConfigJobList(BusAiAlgorithmTaskConfigJob busAiAlgorithmTaskConfigJob);
+
+    /**
+     * 新增任务配置
+     *
+     * @param busAiAlgorithmTaskConfigJob 任务配置
+     * @return 结果
+     */
+    public int insertBusAiAlgorithmTaskConfigJob(BusAiAlgorithmTaskConfigJob busAiAlgorithmTaskConfigJob);
+
+    /**
+     * 修改任务配置
+     *
+     * @param busAiAlgorithmTaskConfigJob 任务配置
+     * @return 结果
+     */
+    public int updateBusAiAlgorithmTaskConfigJob(BusAiAlgorithmTaskConfigJob busAiAlgorithmTaskConfigJob);
+
+    /**
+     * 批量删除任务配置
+     *
+     * @param algorithmTaskIds 需要删除的任务配置主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskIds(Long[] algorithmTaskIds);
+
+    /**
+     * 删除任务配置信息
+     *
+     * @param algorithmTaskId 任务配置主键
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskId(Long algorithmTaskId);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlgorithmTaskInfoService.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.monitor.ai.service;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskInfo;
+
+import java.util.List;
+
+/**
+ * 任务算法Service接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface IBusAiAlgorithmTaskInfoService
+{
+    /**
+     * 查询任务算法
+     *
+     * @param algorithmTaskId 任务算法主键
+     * @return 任务算法
+     */
+    public List<BusAiAlgorithmTaskInfo> selectBusAiAlgorithmTaskInfoByAlgorithmTaskId(Long algorithmTaskId);
+
+    /**
+     * 查询任务算法列表
+     *
+     * @param busAiAlgorithmTaskInfo 任务算法
+     * @return 任务算法集合
+     */
+    public List<BusAiAlgorithmTaskInfo> selectBusAiAlgorithmTaskInfoList(BusAiAlgorithmTaskInfo busAiAlgorithmTaskInfo);
+
+    /**
+     * 新增任务算法
+     *
+     * @param busAiAlgorithmTaskInfo 任务算法
+     * @return 结果
+     */
+    public int insertBusAiAlgorithmTaskInfo(BusAiAlgorithmTaskInfo busAiAlgorithmTaskInfo);
+
+    /**
+     * 修改任务算法
+     *
+     * @param busAiAlgorithmTaskInfo 任务算法
+     * @return 结果
+     */
+    public int updateBusAiAlgorithmTaskInfo(BusAiAlgorithmTaskInfo busAiAlgorithmTaskInfo);
+
+    /**
+     * 批量删除任务算法
+     *
+     * @param algorithmTaskIds 需要删除的任务算法主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskInfoByAlgorithmTaskIds(Long[] algorithmTaskIds);
+
+    /**
+     * 删除任务算法信息
+     *
+     * @param algorithmTaskId 任务算法主键
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskInfoByAlgorithmTaskId(Long algorithmTaskId);
+}

+ 64 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiAlgorithmTaskService.java

@@ -0,0 +1,64 @@
+package com.sooka.sponest.monitor.ai.service;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTask;
+
+import java.util.List;
+
+/**
+ * 任务Service接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface IBusAiAlgorithmTaskService
+{
+    /**
+     * 查询任务
+     *
+     * @param id 任务主键
+     * @return 任务
+     */
+    public BusAiAlgorithmTask selectBusAiAlgorithmTaskById(Long id);
+
+    /**
+     * 查询任务列表
+     *
+     * @param busAiAlgorithmTask 任务
+     * @return 任务集合
+     */
+    public List<BusAiAlgorithmTask> selectBusAiAlgorithmTaskList(BusAiAlgorithmTask busAiAlgorithmTask);
+
+    String checkTaskNameUnique(BusAiAlgorithmTask busAiAlgorithmTask);
+
+    /**
+     * 新增任务
+     *
+     * @param busAiAlgorithmTask 任务
+     * @return 结果
+     */
+    public int insertBusAiAlgorithmTask(BusAiAlgorithmTask busAiAlgorithmTask);
+
+    /**
+     * 修改任务
+     *
+     * @param busAiAlgorithmTask 任务
+     * @return 结果
+     */
+    public int updateBusAiAlgorithmTask(BusAiAlgorithmTask busAiAlgorithmTask);
+
+    /**
+     * 批量删除任务
+     *
+     * @param ids 需要删除的任务主键集合
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskByIds(Long[] ids);
+
+    /**
+     * 删除任务信息
+     *
+     * @param id 任务主键
+     * @return 结果
+     */
+    public int deleteBusAiAlgorithmTaskById(Long id);
+}

+ 68 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/IBusAiSingleTypeService.java

@@ -0,0 +1,68 @@
+package com.sooka.sponest.monitor.ai.service;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiSingleType;
+
+import java.util.List;
+
+/**
+ * 报警类型Service接口
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+public interface IBusAiSingleTypeService
+{
+    /**
+     * 查询报警类型
+     *
+     * @param id 报警类型主键
+     * @return 报警类型
+     */
+    public BusAiSingleType selectBusAiSingleTypeById(String id);
+
+    /**
+     * 查询报警类型列表
+     *
+     * @param busAiSingleType 报警类型
+     * @return 报警类型集合
+     */
+    public List<BusAiSingleType> selectBusAiSingleTypeList(BusAiSingleType busAiSingleType);
+
+    String checkAlarmTypeUnique(BusAiSingleType busAiSingleType);
+
+    String checkAlarmTypeNameUnique(BusAiSingleType busAiSingleType);
+
+    /**
+     * 新增报警类型
+     *
+     * @param busAiSingleType 报警类型
+     * @return 结果
+     */
+    public int insertBusAiSingleType(BusAiSingleType busAiSingleType);
+
+    /**
+     * 修改报警类型
+     *
+     * @param busAiSingleType 报警类型
+     * @return 结果
+     */
+    public int updateBusAiSingleType(BusAiSingleType busAiSingleType);
+
+    int updateByAlarmType(BusAiSingleType busAiSingleType);
+
+    /**
+     * 批量删除报警类型
+     *
+     * @param ids 需要删除的报警类型主键集合
+     * @return 结果
+     */
+    public int deleteBusAiSingleTypeByIds(String[] ids);
+
+    /**
+     * 删除报警类型信息
+     *
+     * @param id 报警类型主键
+     * @return 结果
+     */
+    public int deleteBusAiSingleTypeById(String id);
+}

+ 94 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlarmAnalysisChannelServiceImpl.java

@@ -0,0 +1,94 @@
+package com.sooka.sponest.monitor.ai.service.impl;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysisChannel;
+import com.sooka.sponest.monitor.ai.mapper.BusAiAlarmAnalysisChannelMapper;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlarmAnalysisChannelService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 事件二次研判通道Service业务层处理
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Service
+public class BusAiAlarmAnalysisChannelServiceImpl implements IBusAiAlarmAnalysisChannelService
+{
+    @Autowired
+    private BusAiAlarmAnalysisChannelMapper busAiAlarmAnalysisChannelMapper;
+
+    /**
+     * 查询事件二次研判通道
+     *
+     * @param alarmAnalysisId 事件二次研判通道主键
+     * @return 事件二次研判通道
+     */
+    @Override
+    public List<BusAiAlarmAnalysisChannel> selectBusAiAlarmAnalysisChannelByAlarmAnalysisId(Long alarmAnalysisId)
+    {
+        return busAiAlarmAnalysisChannelMapper.selectBusAiAlarmAnalysisChannelByAlarmAnalysisId(alarmAnalysisId);
+    }
+
+    /**
+     * 查询事件二次研判通道列表
+     *
+     * @param busAiAlarmAnalysisChannel 事件二次研判通道
+     * @return 事件二次研判通道
+     */
+    @Override
+    public List<BusAiAlarmAnalysisChannel> selectBusAiAlarmAnalysisChannelList(BusAiAlarmAnalysisChannel busAiAlarmAnalysisChannel)
+    {
+        return busAiAlarmAnalysisChannelMapper.selectBusAiAlarmAnalysisChannelList(busAiAlarmAnalysisChannel);
+    }
+
+    /**
+     * 新增事件二次研判通道
+     *
+     * @param busAiAlarmAnalysisChannel 事件二次研判通道
+     * @return 结果
+     */
+    @Override
+    public int insertBusAiAlarmAnalysisChannel(BusAiAlarmAnalysisChannel busAiAlarmAnalysisChannel)
+    {
+        return busAiAlarmAnalysisChannelMapper.insertBusAiAlarmAnalysisChannel(busAiAlarmAnalysisChannel);
+    }
+
+    /**
+     * 修改事件二次研判通道
+     *
+     * @param busAiAlarmAnalysisChannel 事件二次研判通道
+     * @return 结果
+     */
+    @Override
+    public int updateBusAiAlarmAnalysisChannel(BusAiAlarmAnalysisChannel busAiAlarmAnalysisChannel)
+    {
+        return busAiAlarmAnalysisChannelMapper.updateBusAiAlarmAnalysisChannel(busAiAlarmAnalysisChannel);
+    }
+
+    /**
+     * 批量删除事件二次研判通道
+     *
+     * @param alarmAnalysisIds 需要删除的事件二次研判通道主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusAiAlarmAnalysisChannelByAlarmAnalysisIds(Long[] alarmAnalysisIds)
+    {
+        return busAiAlarmAnalysisChannelMapper.deleteBusAiAlarmAnalysisChannelByAlarmAnalysisIds(alarmAnalysisIds);
+    }
+
+    /**
+     * 删除事件二次研判通道信息
+     *
+     * @param alarmAnalysisId 事件二次研判通道主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusAiAlarmAnalysisChannelByAlarmAnalysisId(Long alarmAnalysisId)
+    {
+        return busAiAlarmAnalysisChannelMapper.deleteBusAiAlarmAnalysisChannelByAlarmAnalysisId(alarmAnalysisId);
+    }
+}

+ 94 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlarmAnalysisConfigJobServiceImpl.java

@@ -0,0 +1,94 @@
+package com.sooka.sponest.monitor.ai.service.impl;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysisConfigJob;
+import com.sooka.sponest.monitor.ai.mapper.BusAiAlarmAnalysisConfigJobMapper;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlarmAnalysisConfigJobService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 事件二次研判配置Service业务层处理
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Service
+public class BusAiAlarmAnalysisConfigJobServiceImpl implements IBusAiAlarmAnalysisConfigJobService
+{
+    @Autowired
+    private BusAiAlarmAnalysisConfigJobMapper busAiAlarmAnalysisConfigJobMapper;
+
+    /**
+     * 查询事件二次研判配置
+     *
+     * @param alarmAnalysisId 事件二次研判配置主键
+     * @return 事件二次研判配置
+     */
+    @Override
+    public List<BusAiAlarmAnalysisConfigJob> selectBusAiAlarmAnalysisConfigJobByAlarmAnalysisId(Long alarmAnalysisId)
+    {
+        return busAiAlarmAnalysisConfigJobMapper.selectBusAiAlarmAnalysisConfigJobByAlarmAnalysisId(alarmAnalysisId);
+    }
+
+    /**
+     * 查询事件二次研判配置列表
+     *
+     * @param busAiAlarmAnalysisConfigJob 事件二次研判配置
+     * @return 事件二次研判配置
+     */
+    @Override
+    public List<BusAiAlarmAnalysisConfigJob> selectBusAiAlarmAnalysisConfigJobList(BusAiAlarmAnalysisConfigJob busAiAlarmAnalysisConfigJob)
+    {
+        return busAiAlarmAnalysisConfigJobMapper.selectBusAiAlarmAnalysisConfigJobList(busAiAlarmAnalysisConfigJob);
+    }
+
+    /**
+     * 新增事件二次研判配置
+     *
+     * @param busAiAlarmAnalysisConfigJob 事件二次研判配置
+     * @return 结果
+     */
+    @Override
+    public int insertBusAiAlarmAnalysisConfigJob(BusAiAlarmAnalysisConfigJob busAiAlarmAnalysisConfigJob)
+    {
+        return busAiAlarmAnalysisConfigJobMapper.insertBusAiAlarmAnalysisConfigJob(busAiAlarmAnalysisConfigJob);
+    }
+
+    /**
+     * 修改事件二次研判配置
+     *
+     * @param busAiAlarmAnalysisConfigJob 事件二次研判配置
+     * @return 结果
+     */
+    @Override
+    public int updateBusAiAlarmAnalysisConfigJob(BusAiAlarmAnalysisConfigJob busAiAlarmAnalysisConfigJob)
+    {
+        return busAiAlarmAnalysisConfigJobMapper.updateBusAiAlarmAnalysisConfigJob(busAiAlarmAnalysisConfigJob);
+    }
+
+    /**
+     * 批量删除事件二次研判配置
+     *
+     * @param alarmAnalysisIds 需要删除的事件二次研判配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisIds(Long[] alarmAnalysisIds)
+    {
+        return busAiAlarmAnalysisConfigJobMapper.deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisIds(alarmAnalysisIds);
+    }
+
+    /**
+     * 删除事件二次研判配置信息
+     *
+     * @param alarmAnalysisId 事件二次研判配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisId(Long alarmAnalysisId)
+    {
+        return busAiAlarmAnalysisConfigJobMapper.deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisId(alarmAnalysisId);
+    }
+}

+ 202 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlarmAnalysisServiceImpl.java

@@ -0,0 +1,202 @@
+package com.sooka.sponest.monitor.ai.service.impl;
+
+import com.ruoyi.common.core.constant.UserConstants;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysis;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysisChannel;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlarmAnalysisConfigJob;
+import com.sooka.sponest.monitor.ai.mapper.BusAiAlarmAnalysisMapper;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlarmAnalysisChannelService;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlarmAnalysisConfigJobService;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlarmAnalysisService;
+import com.sooka.sponest.monitor.camera.domain.CentermonitorTCamera;
+import com.sooka.sponest.monitor.camera.domain.CentermonitorTCamerachannel;
+import com.sooka.sponest.monitor.camera.service.ICentermonitorTCameraService;
+import com.sooka.sponest.monitor.camera.service.ICentermonitorTCamerachannelService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 事件二次研判Service业务层处理
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Service
+public class BusAiAlarmAnalysisServiceImpl implements IBusAiAlarmAnalysisService
+{
+    @Autowired
+    private BusAiAlarmAnalysisMapper busAiAlarmAnalysisMapper;
+
+    @Autowired
+    private IBusAiAlarmAnalysisConfigJobService busAiAlarmAnalysisConfigJobService;
+
+    @Autowired
+    private IBusAiAlarmAnalysisChannelService busAiAlarmAnalysisChannelService;
+
+    @Autowired
+    private ICentermonitorTCameraService cameraService;
+
+    @Autowired
+    private ICentermonitorTCamerachannelService cameraChannelService;
+
+    /**
+     * 查询事件二次研判
+     *
+     * @param id 事件二次研判主键
+     * @return 事件二次研判
+     */
+    @Override
+    public BusAiAlarmAnalysis selectBusAiAlarmAnalysisById(Long id)
+    {
+        return busAiAlarmAnalysisMapper.selectBusAiAlarmAnalysisById(id);
+    }
+
+    /**
+     * 查询事件二次研判列表
+     *
+     * @param busAiAlarmAnalysis 事件二次研判
+     * @return 事件二次研判
+     */
+    @Override
+    public List<BusAiAlarmAnalysis> selectBusAiAlarmAnalysisList(BusAiAlarmAnalysis busAiAlarmAnalysis)
+    {
+        return busAiAlarmAnalysisMapper.selectBusAiAlarmAnalysisList(busAiAlarmAnalysis);
+    }
+
+    @Override
+    public String checkConfigNameUnique(BusAiAlarmAnalysis busAiAlarmAnalysis) {
+        Long id = StringUtils.isNull(busAiAlarmAnalysis.getId()) ? -1L : busAiAlarmAnalysis.getId();
+        BusAiAlarmAnalysis info = busAiAlarmAnalysisMapper.checkConfigNameUnique(busAiAlarmAnalysis.getConfigName());
+        if (StringUtils.isNotNull(info) && !info.getId().equals(id)) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    @Override
+    public String checkAlarmTypeUnique(BusAiAlarmAnalysis busAiAlarmAnalysis) {
+        Long id = StringUtils.isNull(busAiAlarmAnalysis.getId()) ? -1L : busAiAlarmAnalysis.getId();
+        BusAiAlarmAnalysis info = busAiAlarmAnalysisMapper.checkAlarmTypeUnique(busAiAlarmAnalysis.getAlarmType());
+        if (StringUtils.isNotNull(info) && !info.getId().equals(id)) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    /**
+     * 新增事件二次研判
+     *
+     * @param busAiAlarmAnalysis 事件二次研判
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int insertBusAiAlarmAnalysis(BusAiAlarmAnalysis busAiAlarmAnalysis)
+    {
+        int result = busAiAlarmAnalysisMapper.insertBusAiAlarmAnalysis(busAiAlarmAnalysis);
+        if (StringUtils.isNotEmpty(busAiAlarmAnalysis.getAlarmAnalysisConfigJobs())) {
+            for (BusAiAlarmAnalysisConfigJob alarmAnalysisConfigJob : busAiAlarmAnalysis.getAlarmAnalysisConfigJobs()) {
+                alarmAnalysisConfigJob.setAlarmAnalysisId(busAiAlarmAnalysis.getId());
+                busAiAlarmAnalysisConfigJobService.insertBusAiAlarmAnalysisConfigJob(alarmAnalysisConfigJob);
+            }
+        }
+        if (StringUtils.isNotEmpty(busAiAlarmAnalysis.getChannels())) {
+            for (BusAiAlarmAnalysisChannel channel : busAiAlarmAnalysis.getChannels()) {
+                channel.setAlarmAnalysisId(busAiAlarmAnalysis.getId());
+                busAiAlarmAnalysisChannelService.insertBusAiAlarmAnalysisChannel(channel);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 修改事件二次研判
+     *
+     * @param busAiAlarmAnalysis 事件二次研判
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int updateBusAiAlarmAnalysis(BusAiAlarmAnalysis busAiAlarmAnalysis)
+    {
+        busAiAlarmAnalysis.setSyncStatus("0");
+        int result = busAiAlarmAnalysisMapper.updateBusAiAlarmAnalysis(busAiAlarmAnalysis);
+        if (StringUtils.isNotEmpty(busAiAlarmAnalysis.getAlarmAnalysisConfigJobs())) {
+            busAiAlarmAnalysisConfigJobService.deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisId(busAiAlarmAnalysis.getId());
+            for (BusAiAlarmAnalysisConfigJob alarmAnalysisConfigJob : busAiAlarmAnalysis.getAlarmAnalysisConfigJobs()) {
+                alarmAnalysisConfigJob.setAlarmAnalysisId(busAiAlarmAnalysis.getId());
+                busAiAlarmAnalysisConfigJobService.insertBusAiAlarmAnalysisConfigJob(alarmAnalysisConfigJob);
+            }
+        }
+        if (StringUtils.isNotEmpty(busAiAlarmAnalysis.getChannels())) {
+            busAiAlarmAnalysisChannelService.deleteBusAiAlarmAnalysisChannelByAlarmAnalysisId(busAiAlarmAnalysis.getId());
+            for (BusAiAlarmAnalysisChannel channel : busAiAlarmAnalysis.getChannels()) {
+                channel.setAlarmAnalysisId(busAiAlarmAnalysis.getId());
+                busAiAlarmAnalysisChannelService.insertBusAiAlarmAnalysisChannel(channel);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 批量删除事件二次研判
+     *
+     * @param ids 需要删除的事件二次研判主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteBusAiAlarmAnalysisByIds(Long[] ids)
+    {
+        return busAiAlarmAnalysisMapper.deleteBusAiAlarmAnalysisByIds(ids);
+    }
+
+    /**
+     * 删除事件二次研判信息
+     *
+     * @param id 事件二次研判主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteBusAiAlarmAnalysisById(Long id)
+    {
+        busAiAlarmAnalysisConfigJobService.deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisId(id);
+        busAiAlarmAnalysisChannelService.deleteBusAiAlarmAnalysisChannelByAlarmAnalysisId(id);
+        return busAiAlarmAnalysisMapper.deleteBusAiAlarmAnalysisById(id);
+    }
+
+    @Override
+    public List<Map<String, Object>> channelTree() {
+        List<Map<String, Object>> resultList = new ArrayList<>();
+        List<CentermonitorTCamerachannel> channels = cameraChannelService.selectCentermonitorTCamerachannelList(new CentermonitorTCamerachannel());
+        if (StringUtils.isEmpty(channels)) {
+            return resultList;
+        }
+//        List<String> deviceCodes = channels.stream().map(CentermonitorTCamerachannel::getCameraId).collect(Collectors.toList());
+        List<CentermonitorTCamera> cameras = cameraService.selectCentermonitorTCameraList(new CentermonitorTCamera());
+        resultList.addAll(cameras.stream().map(item -> {
+            Map<String, Object> map = new HashMap();
+            map.put("id", item.getId());
+            map.put("label", item.getCameraName());
+            map.put("parentId", "0");
+            return map;
+        }).collect(Collectors.toList()));
+        resultList.addAll(channels.stream().map(item -> {
+            Map<String, Object> map = new HashMap();
+            map.put("id", item.getChannelCode());
+            map.put("label", item.getChannelType());
+            map.put("parentId", item.getCameraId());
+            return map;
+        }).collect(Collectors.toList()));
+        return resultList;
+    }
+}

+ 119 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmServiceImpl.java

@@ -0,0 +1,119 @@
+package com.sooka.sponest.monitor.ai.service.impl;
+
+
+import com.ruoyi.common.core.constant.UserConstants;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithm;
+import com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmMapper;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 算法Service业务层处理
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Service
+public class BusAiAlgorithmServiceImpl implements IBusAiAlgorithmService
+{
+    @Autowired
+    private BusAiAlgorithmMapper busAiAlgorithmMapper;
+
+    /**
+     * 查询算法
+     *
+     * @param id 算法主键
+     * @return 算法
+     */
+    @Override
+    public BusAiAlgorithm selectBusAiAlgorithmById(Long id)
+    {
+        return busAiAlgorithmMapper.selectBusAiAlgorithmById(id);
+    }
+
+    /**
+     * 查询算法列表
+     *
+     * @param busAiAlgorithm 算法
+     * @return 算法
+     */
+    @Override
+    public List<BusAiAlgorithm> selectBusAiAlgorithmList(BusAiAlgorithm busAiAlgorithm)
+    {
+        return busAiAlgorithmMapper.selectBusAiAlgorithmList(busAiAlgorithm);
+    }
+
+    @Override
+    public String checkAlgorithmNameUnique(BusAiAlgorithm busAiAlgorithm) {
+        Long id = StringUtils.isNull(busAiAlgorithm.getId()) ? -1L : busAiAlgorithm.getId();
+        BusAiAlgorithm info = busAiAlgorithmMapper.checkAlgorithmNameUnique(busAiAlgorithm.getAlgorithmName());
+        if (StringUtils.isNotNull(info) && !info.getId().equals(id)) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    /**
+     * 新增算法
+     *
+     * @param busAiAlgorithm 算法
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int insertBusAiAlgorithm(BusAiAlgorithm busAiAlgorithm)
+    {
+        return busAiAlgorithmMapper.insertBusAiAlgorithm(busAiAlgorithm);
+    }
+
+    /**
+     * 修改算法
+     *
+     * @param busAiAlgorithm 算法
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int updateBusAiAlgorithm(BusAiAlgorithm busAiAlgorithm)
+    {
+        busAiAlgorithm.setSyncStatus("0");
+        return busAiAlgorithmMapper.updateBusAiAlgorithm(busAiAlgorithm);
+    }
+
+    @Transactional
+    @Override
+    public int updateByName(BusAiAlgorithm busAiAlgorithm) {
+        return busAiAlgorithmMapper.updateByName(busAiAlgorithm);
+    }
+
+    /**
+     * 批量删除算法
+     *
+     * @param ids 需要删除的算法主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteBusAiAlgorithmByIds(Long[] ids)
+    {
+        return busAiAlgorithmMapper.deleteBusAiAlgorithmByIds(ids);
+    }
+
+    /**
+     * 删除算法信息
+     *
+     * @param id 算法主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteBusAiAlgorithmById(Long id)
+    {
+        return busAiAlgorithmMapper.deleteBusAiAlgorithmById(id);
+    }
+}

+ 95 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmTaskChannelServiceImpl.java

@@ -0,0 +1,95 @@
+package com.sooka.sponest.monitor.ai.service.impl;
+
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskChannel;
+import com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskChannelMapper;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmTaskChannelService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 任务通道Service业务层处理
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Service
+public class BusAiAlgorithmTaskChannelServiceImpl implements IBusAiAlgorithmTaskChannelService
+{
+    @Autowired
+    private BusAiAlgorithmTaskChannelMapper busAiAlgorithmTaskChannelMapper;
+
+    /**
+     * 查询任务通道
+     *
+     * @param algorithmTaskId 任务通道主键
+     * @return 任务通道
+     */
+    @Override
+    public List<BusAiAlgorithmTaskChannel> selectBusAiAlgorithmTaskChannelByAlgorithmTaskId(Long algorithmTaskId)
+    {
+        return busAiAlgorithmTaskChannelMapper.selectBusAiAlgorithmTaskChannelByAlgorithmTaskId(algorithmTaskId);
+    }
+
+    /**
+     * 查询任务通道列表
+     *
+     * @param busAiAlgorithmTaskChannel 任务通道
+     * @return 任务通道
+     */
+    @Override
+    public List<BusAiAlgorithmTaskChannel> selectBusAiAlgorithmTaskChannelList(BusAiAlgorithmTaskChannel busAiAlgorithmTaskChannel)
+    {
+        return busAiAlgorithmTaskChannelMapper.selectBusAiAlgorithmTaskChannelList(busAiAlgorithmTaskChannel);
+    }
+
+    /**
+     * 新增任务通道
+     *
+     * @param busAiAlgorithmTaskChannel 任务通道
+     * @return 结果
+     */
+    @Override
+    public int insertBusAiAlgorithmTaskChannel(BusAiAlgorithmTaskChannel busAiAlgorithmTaskChannel)
+    {
+        return busAiAlgorithmTaskChannelMapper.insertBusAiAlgorithmTaskChannel(busAiAlgorithmTaskChannel);
+    }
+
+    /**
+     * 修改任务通道
+     *
+     * @param busAiAlgorithmTaskChannel 任务通道
+     * @return 结果
+     */
+    @Override
+    public int updateBusAiAlgorithmTaskChannel(BusAiAlgorithmTaskChannel busAiAlgorithmTaskChannel)
+    {
+        return busAiAlgorithmTaskChannelMapper.updateBusAiAlgorithmTaskChannel(busAiAlgorithmTaskChannel);
+    }
+
+    /**
+     * 批量删除任务通道
+     *
+     * @param algorithmTaskIds 需要删除的任务通道主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusAiAlgorithmTaskChannelByAlgorithmTaskIds(Long[] algorithmTaskIds)
+    {
+        return busAiAlgorithmTaskChannelMapper.deleteBusAiAlgorithmTaskChannelByAlgorithmTaskIds(algorithmTaskIds);
+    }
+
+    /**
+     * 删除任务通道信息
+     *
+     * @param algorithmTaskId 任务通道主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusAiAlgorithmTaskChannelByAlgorithmTaskId(Long algorithmTaskId)
+    {
+        return busAiAlgorithmTaskChannelMapper.deleteBusAiAlgorithmTaskChannelByAlgorithmTaskId(algorithmTaskId);
+    }
+}

+ 94 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmTaskConfigJobServiceImpl.java

@@ -0,0 +1,94 @@
+package com.sooka.sponest.monitor.ai.service.impl;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskConfigJob;
+import com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskConfigJobMapper;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmTaskConfigJobService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 任务配置Service业务层处理
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Service
+public class BusAiAlgorithmTaskConfigJobServiceImpl implements IBusAiAlgorithmTaskConfigJobService
+{
+    @Autowired
+    private BusAiAlgorithmTaskConfigJobMapper busAiAlgorithmTaskConfigJobMapper;
+
+    /**
+     * 查询任务配置
+     *
+     * @param algorithmTaskId 任务配置主键
+     * @return 任务配置
+     */
+    @Override
+    public List<BusAiAlgorithmTaskConfigJob> selectBusAiAlgorithmTaskConfigJobByAlgorithmTaskId(Long algorithmTaskId)
+    {
+        return busAiAlgorithmTaskConfigJobMapper.selectBusAiAlgorithmTaskConfigJobByAlgorithmTaskId(algorithmTaskId);
+    }
+
+    /**
+     * 查询任务配置列表
+     *
+     * @param busAiAlgorithmTaskConfigJob 任务配置
+     * @return 任务配置
+     */
+    @Override
+    public List<BusAiAlgorithmTaskConfigJob> selectBusAiAlgorithmTaskConfigJobList(BusAiAlgorithmTaskConfigJob busAiAlgorithmTaskConfigJob)
+    {
+        return busAiAlgorithmTaskConfigJobMapper.selectBusAiAlgorithmTaskConfigJobList(busAiAlgorithmTaskConfigJob);
+    }
+
+    /**
+     * 新增任务配置
+     *
+     * @param busAiAlgorithmTaskConfigJob 任务配置
+     * @return 结果
+     */
+    @Override
+    public int insertBusAiAlgorithmTaskConfigJob(BusAiAlgorithmTaskConfigJob busAiAlgorithmTaskConfigJob)
+    {
+        return busAiAlgorithmTaskConfigJobMapper.insertBusAiAlgorithmTaskConfigJob(busAiAlgorithmTaskConfigJob);
+    }
+
+    /**
+     * 修改任务配置
+     *
+     * @param busAiAlgorithmTaskConfigJob 任务配置
+     * @return 结果
+     */
+    @Override
+    public int updateBusAiAlgorithmTaskConfigJob(BusAiAlgorithmTaskConfigJob busAiAlgorithmTaskConfigJob)
+    {
+        return busAiAlgorithmTaskConfigJobMapper.updateBusAiAlgorithmTaskConfigJob(busAiAlgorithmTaskConfigJob);
+    }
+
+    /**
+     * 批量删除任务配置
+     *
+     * @param algorithmTaskIds 需要删除的任务配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskIds(Long[] algorithmTaskIds)
+    {
+        return busAiAlgorithmTaskConfigJobMapper.deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskIds(algorithmTaskIds);
+    }
+
+    /**
+     * 删除任务配置信息
+     *
+     * @param algorithmTaskId 任务配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskId(Long algorithmTaskId)
+    {
+        return busAiAlgorithmTaskConfigJobMapper.deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskId(algorithmTaskId);
+    }
+}

+ 94 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmTaskInfoServiceImpl.java

@@ -0,0 +1,94 @@
+package com.sooka.sponest.monitor.ai.service.impl;
+
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskInfo;
+import com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskInfoMapper;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmTaskInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 任务算法Service业务层处理
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Service
+public class BusAiAlgorithmTaskInfoServiceImpl implements IBusAiAlgorithmTaskInfoService
+{
+    @Autowired
+    private BusAiAlgorithmTaskInfoMapper busAiAlgorithmTaskInfoMapper;
+
+    /**
+     * 查询任务算法
+     *
+     * @param algorithmTaskId 任务算法主键
+     * @return 任务算法
+     */
+    @Override
+    public List<BusAiAlgorithmTaskInfo> selectBusAiAlgorithmTaskInfoByAlgorithmTaskId(Long algorithmTaskId)
+    {
+        return busAiAlgorithmTaskInfoMapper.selectBusAiAlgorithmTaskInfoByAlgorithmTaskId(algorithmTaskId);
+    }
+
+    /**
+     * 查询任务算法列表
+     *
+     * @param busAiAlgorithmTaskInfo 任务算法
+     * @return 任务算法
+     */
+    @Override
+    public List<BusAiAlgorithmTaskInfo> selectBusAiAlgorithmTaskInfoList(BusAiAlgorithmTaskInfo busAiAlgorithmTaskInfo)
+    {
+        return busAiAlgorithmTaskInfoMapper.selectBusAiAlgorithmTaskInfoList(busAiAlgorithmTaskInfo);
+    }
+
+    /**
+     * 新增任务算法
+     *
+     * @param busAiAlgorithmTaskInfo 任务算法
+     * @return 结果
+     */
+    @Override
+    public int insertBusAiAlgorithmTaskInfo(BusAiAlgorithmTaskInfo busAiAlgorithmTaskInfo)
+    {
+        return busAiAlgorithmTaskInfoMapper.insertBusAiAlgorithmTaskInfo(busAiAlgorithmTaskInfo);
+    }
+
+    /**
+     * 修改任务算法
+     *
+     * @param busAiAlgorithmTaskInfo 任务算法
+     * @return 结果
+     */
+    @Override
+    public int updateBusAiAlgorithmTaskInfo(BusAiAlgorithmTaskInfo busAiAlgorithmTaskInfo)
+    {
+        return busAiAlgorithmTaskInfoMapper.updateBusAiAlgorithmTaskInfo(busAiAlgorithmTaskInfo);
+    }
+
+    /**
+     * 批量删除任务算法
+     *
+     * @param algorithmTaskIds 需要删除的任务算法主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusAiAlgorithmTaskInfoByAlgorithmTaskIds(Long[] algorithmTaskIds)
+    {
+        return busAiAlgorithmTaskInfoMapper.deleteBusAiAlgorithmTaskInfoByAlgorithmTaskIds(algorithmTaskIds);
+    }
+
+    /**
+     * 删除任务算法信息
+     *
+     * @param algorithmTaskId 任务算法主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusAiAlgorithmTaskInfoByAlgorithmTaskId(Long algorithmTaskId)
+    {
+        return busAiAlgorithmTaskInfoMapper.deleteBusAiAlgorithmTaskInfoByAlgorithmTaskId(algorithmTaskId);
+    }
+}

+ 172 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmTaskServiceImpl.java

@@ -0,0 +1,172 @@
+package com.sooka.sponest.monitor.ai.service.impl;
+
+
+import com.ruoyi.common.core.constant.UserConstants;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTask;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskChannel;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskConfigJob;
+import com.sooka.sponest.monitor.ai.domain.BusAiAlgorithmTaskInfo;
+import com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskMapper;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmTaskChannelService;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmTaskConfigJobService;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmTaskInfoService;
+import com.sooka.sponest.monitor.ai.service.IBusAiAlgorithmTaskService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 任务Service业务层处理
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Service
+public class BusAiAlgorithmTaskServiceImpl implements IBusAiAlgorithmTaskService
+{
+    @Autowired
+    private BusAiAlgorithmTaskMapper busAiAlgorithmTaskMapper;
+
+    @Autowired
+    private IBusAiAlgorithmTaskInfoService busAiAlgorithmTaskInfoService;
+
+    @Autowired
+    private IBusAiAlgorithmTaskConfigJobService busAiAlgorithmTaskConfigJobService;
+
+    @Autowired
+    private IBusAiAlgorithmTaskChannelService busAiAlgorithmTaskChannelService;
+
+    /**
+     * 查询任务
+     *
+     * @param id 任务主键
+     * @return 任务
+     */
+    @Override
+    public BusAiAlgorithmTask selectBusAiAlgorithmTaskById(Long id)
+    {
+        return busAiAlgorithmTaskMapper.selectBusAiAlgorithmTaskById(id);
+    }
+
+    /**
+     * 查询任务列表
+     *
+     * @param busAiAlgorithmTask 任务
+     * @return 任务
+     */
+    @Override
+    public List<BusAiAlgorithmTask> selectBusAiAlgorithmTaskList(BusAiAlgorithmTask busAiAlgorithmTask)
+    {
+        return busAiAlgorithmTaskMapper.selectBusAiAlgorithmTaskList(busAiAlgorithmTask);
+    }
+
+    @Override
+    public String checkTaskNameUnique(BusAiAlgorithmTask busAiAlgorithmTask) {
+        Long id = StringUtils.isNull(busAiAlgorithmTask.getId()) ? -1L : busAiAlgorithmTask.getId();
+        BusAiAlgorithmTask info = busAiAlgorithmTaskMapper.checkTaskNameUnique(busAiAlgorithmTask.getTaskName());
+        if (StringUtils.isNotNull(info) && !info.getId().equals(id)) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    /**
+     * 新增任务
+     *
+     * @param busAiAlgorithmTask 任务
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int insertBusAiAlgorithmTask(BusAiAlgorithmTask busAiAlgorithmTask)
+    {
+        int result = busAiAlgorithmTaskMapper.insertBusAiAlgorithmTask(busAiAlgorithmTask);
+        if (StringUtils.isNotEmpty(busAiAlgorithmTask.getInfos())) {
+            for (BusAiAlgorithmTaskInfo taskInfo : busAiAlgorithmTask.getInfos()) {
+                taskInfo.setAlgorithmTaskId(busAiAlgorithmTask.getId());
+                busAiAlgorithmTaskInfoService.insertBusAiAlgorithmTaskInfo(taskInfo);
+            }
+        }
+        if (StringUtils.isNotEmpty(busAiAlgorithmTask.getTaskJobs())) {
+            for (BusAiAlgorithmTaskConfigJob taskConfigJob : busAiAlgorithmTask.getTaskJobs()) {
+                taskConfigJob.setAlgorithmTaskId(busAiAlgorithmTask.getId());
+                busAiAlgorithmTaskConfigJobService.insertBusAiAlgorithmTaskConfigJob(taskConfigJob);
+            }
+        }
+        if (StringUtils.isNotEmpty(busAiAlgorithmTask.getChannelInfos())) {
+            for (BusAiAlgorithmTaskChannel channel : busAiAlgorithmTask.getChannelInfos()) {
+                channel.setAlgorithmTaskId(busAiAlgorithmTask.getId());
+                busAiAlgorithmTaskChannelService.insertBusAiAlgorithmTaskChannel(channel);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 修改任务
+     *
+     * @param busAiAlgorithmTask 任务
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int updateBusAiAlgorithmTask(BusAiAlgorithmTask busAiAlgorithmTask)
+    {
+        busAiAlgorithmTask.setSyncStatus("0");
+        int result = busAiAlgorithmTaskMapper.updateBusAiAlgorithmTask(busAiAlgorithmTask);
+        if (StringUtils.isNotEmpty(busAiAlgorithmTask.getInfos())) {
+            busAiAlgorithmTaskInfoService.deleteBusAiAlgorithmTaskInfoByAlgorithmTaskId(busAiAlgorithmTask.getId());
+            for (BusAiAlgorithmTaskInfo taskInfo : busAiAlgorithmTask.getInfos()) {
+                taskInfo.setAlgorithmTaskId(busAiAlgorithmTask.getId());
+                busAiAlgorithmTaskInfoService.insertBusAiAlgorithmTaskInfo(taskInfo);
+            }
+        }
+        if (StringUtils.isNotEmpty(busAiAlgorithmTask.getTaskJobs())) {
+            busAiAlgorithmTaskConfigJobService.deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskId(busAiAlgorithmTask.getId());
+            for (BusAiAlgorithmTaskConfigJob taskConfigJob : busAiAlgorithmTask.getTaskJobs()) {
+                taskConfigJob.setAlgorithmTaskId(busAiAlgorithmTask.getId());
+                busAiAlgorithmTaskConfigJobService.insertBusAiAlgorithmTaskConfigJob(taskConfigJob);
+            }
+        }
+        if (StringUtils.isNotEmpty(busAiAlgorithmTask.getChannelInfos())) {
+            busAiAlgorithmTaskChannelService.deleteBusAiAlgorithmTaskChannelByAlgorithmTaskId(busAiAlgorithmTask.getId());
+            for (BusAiAlgorithmTaskChannel channel : busAiAlgorithmTask.getChannelInfos()) {
+                channel.setAlgorithmTaskId(busAiAlgorithmTask.getId());
+                busAiAlgorithmTaskChannelService.insertBusAiAlgorithmTaskChannel(channel);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 批量删除任务
+     *
+     * @param ids 需要删除的任务主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteBusAiAlgorithmTaskByIds(Long[] ids)
+    {
+        return busAiAlgorithmTaskMapper.deleteBusAiAlgorithmTaskByIds(ids);
+    }
+
+    /**
+     * 删除任务信息
+     *
+     * @param id 任务主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteBusAiAlgorithmTaskById(Long id)
+    {
+        busAiAlgorithmTaskInfoService.deleteBusAiAlgorithmTaskInfoByAlgorithmTaskId(id);
+        busAiAlgorithmTaskConfigJobService.deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskId(id);
+        busAiAlgorithmTaskChannelService.deleteBusAiAlgorithmTaskChannelByAlgorithmTaskId(id);
+        return busAiAlgorithmTaskMapper.deleteBusAiAlgorithmTaskById(id);
+    }
+}

+ 130 - 0
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiSingleTypeServiceImpl.java

@@ -0,0 +1,130 @@
+package com.sooka.sponest.monitor.ai.service.impl;
+
+import com.ruoyi.common.core.constant.UserConstants;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.uuid.IdUtils;
+import com.sooka.sponest.monitor.ai.domain.BusAiSingleType;
+import com.sooka.sponest.monitor.ai.mapper.BusAiSingleTypeMapper;
+import com.sooka.sponest.monitor.ai.service.IBusAiSingleTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 报警类型Service业务层处理
+ *
+ * @author lyq
+ * @date 2025-09-15
+ */
+@Service
+public class BusAiSingleTypeServiceImpl implements IBusAiSingleTypeService
+{
+    @Autowired
+    private BusAiSingleTypeMapper busAiSingleTypeMapper;
+
+    /**
+     * 查询报警类型
+     *
+     * @param id 报警类型主键
+     * @return 报警类型
+     */
+    @Override
+    public BusAiSingleType selectBusAiSingleTypeById(String id)
+    {
+        return busAiSingleTypeMapper.selectBusAiSingleTypeById(id);
+    }
+
+    /**
+     * 查询报警类型列表
+     *
+     * @param busAiSingleType 报警类型
+     * @return 报警类型
+     */
+    @Override
+    public List<BusAiSingleType> selectBusAiSingleTypeList(BusAiSingleType busAiSingleType)
+    {
+        return busAiSingleTypeMapper.selectBusAiSingleTypeList(busAiSingleType);
+    }
+
+    @Override
+    public String checkAlarmTypeUnique(BusAiSingleType busAiSingleType) {
+        String id = StringUtils.isNull(busAiSingleType.getId()) ? "-1" : busAiSingleType.getId();
+        BusAiSingleType info = busAiSingleTypeMapper.checkAlarmTypeUnique(busAiSingleType.getAlarmType());
+        if (StringUtils.isNotNull(info) && !info.getId().equals(id)) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    @Override
+    public String checkAlarmTypeNameUnique(BusAiSingleType busAiSingleType) {
+        String id = StringUtils.isNull(busAiSingleType.getId()) ? "-1" : busAiSingleType.getId();
+        BusAiSingleType info = busAiSingleTypeMapper.checkAlarmTypeNameUnique(busAiSingleType.getAlarmTypeName());
+        if (StringUtils.isNotNull(info) && !info.getId().equals(id)) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    /**
+     * 新增报警类型
+     *
+     * @param busAiSingleType 报警类型
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int insertBusAiSingleType(BusAiSingleType busAiSingleType)
+    {
+        busAiSingleType.setId(IdUtils.fastSimpleUUID());
+        return busAiSingleTypeMapper.insertBusAiSingleType(busAiSingleType);
+    }
+
+    /**
+     * 修改报警类型
+     *
+     * @param busAiSingleType 报警类型
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int updateBusAiSingleType(BusAiSingleType busAiSingleType)
+    {
+        busAiSingleType.setSyncStatus("0");
+        return busAiSingleTypeMapper.updateBusAiSingleType(busAiSingleType);
+    }
+
+    @Transactional
+    @Override
+    public int updateByAlarmType(BusAiSingleType busAiSingleType) {
+        return busAiSingleTypeMapper.updateByAlarmType(busAiSingleType);
+    }
+
+    /**
+     * 批量删除报警类型
+     *
+     * @param ids 需要删除的报警类型主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteBusAiSingleTypeByIds(String[] ids)
+    {
+        return busAiSingleTypeMapper.deleteBusAiSingleTypeByIds(ids);
+    }
+
+    /**
+     * 删除报警类型信息
+     *
+     * @param id 报警类型主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteBusAiSingleTypeById(String id)
+    {
+        return busAiSingleTypeMapper.deleteBusAiSingleTypeById(id);
+    }
+}

+ 61 - 0
src/main/java/com/sooka/sponest/monitor/ai/util/DHOauthUtil.java

@@ -0,0 +1,61 @@
+package com.sooka.sponest.monitor.ai.util;
+
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.model.v202010.OauthConfigUserPwdInfo;
+import com.dahuatech.icc.oauth.utils.HttpUtils;
+import com.ruoyi.common.core.utils.SpringUtils;
+import org.springframework.stereotype.Component;
+
+@Component
+public class DHOauthUtil {
+
+    private static DHOauthUtil instance;
+
+    public static DHOauthUtil getInstance() {
+        if (instance == null) {
+            instance = SpringUtils.getBean(DHOauthUtil.class);
+        }
+        return instance;
+    }
+
+    /**
+     * 获取Oauth配置信息
+     *
+     * @return Oauth配置信息
+     */
+    public OauthConfigUserPwdInfo getOauthConfig() {
+        OauthConfigUserPwdInfo oauthConfigUserPwdInfo = new OauthConfigUserPwdInfo(
+                "192.168.100.3",
+                "sooka",
+                "5e77bc92-82fc-450b-9a78-0d1ba8bcfa48",
+                "system",
+                "shoujiakeji@123",
+                false,
+                "443"
+        );
+        oauthConfigUserPwdInfo.getHttpConfigInfo().setReadTimeout(-1L);
+        oauthConfigUserPwdInfo.getHttpConfigInfo().setConnectionTimeout(-1L);
+        return oauthConfigUserPwdInfo;
+    }
+
+    /**
+     * 获取token
+     */
+    public String getToken() {
+        try {
+            return HttpUtils.getToken(getOauthConfig()).getAccess_token();
+        } catch (ClientException e) {
+            return null;
+        }
+    }
+
+    /**
+     * 获取图片全路径
+     *
+     * @param picUrl 图片相对地址
+     * @return
+     */
+    public String getImageFullPath(String picUrl) {
+        return "https://" + "192.168.100.3" + ":" + "443" + "/evo-apigw/evo-oss/" + picUrl + "?token=" + getToken();
+    }
+}

+ 79 - 0
src/main/resources/mapper/ai/BusAiAlarmAnalysisChannelMapper.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.monitor.ai.mapper.BusAiAlarmAnalysisChannelMapper">
+
+    <resultMap type="BusAiAlarmAnalysisChannel" id="BusAiAlarmAnalysisChannelResult">
+        <result property="alarmAnalysisId"    column="alarm_analysis_id"    />
+        <result property="channelCode"    column="channel_code"    />
+        <result property="channelName"    column="channel_name"    />
+        <result property="orgName"    column="org_name"    />
+        <result property="orgCode"    column="org_code"    />
+        <result property="deviceName"    column="device_name"    />
+    </resultMap>
+
+    <sql id="selectBusAiAlarmAnalysisChannelVo">
+        select alarm_analysis_id, channel_code, channel_name, org_name, org_code, device_name from bus_ai_alarm_analysis_channel
+    </sql>
+
+    <select id="selectBusAiAlarmAnalysisChannelList" parameterType="BusAiAlarmAnalysisChannel" resultMap="BusAiAlarmAnalysisChannelResult">
+        <include refid="selectBusAiAlarmAnalysisChannelVo"/>
+        <where>
+            <if test="alarmAnalysisId != null "> and alarm_analysis_id = #{alarmAnalysisId}</if>
+            <if test="channelCode != null  and channelCode != ''"> and channel_code = #{channelCode}</if>
+            <if test="channelName != null  and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
+            <if test="orgName != null  and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if>
+            <if test="orgCode != null  and orgCode != ''"> and org_code = #{orgCode}</if>
+            <if test="deviceName != null  and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectBusAiAlarmAnalysisChannelByAlarmAnalysisId" parameterType="Long" resultMap="BusAiAlarmAnalysisChannelResult">
+        <include refid="selectBusAiAlarmAnalysisChannelVo"/>
+        where alarm_analysis_id = #{alarmAnalysisId}
+    </select>
+
+    <insert id="insertBusAiAlarmAnalysisChannel" parameterType="BusAiAlarmAnalysisChannel">
+        insert into bus_ai_alarm_analysis_channel
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="alarmAnalysisId != null">alarm_analysis_id,</if>
+            <if test="channelCode != null and channelCode != ''">channel_code,</if>
+            <if test="channelName != null and channelName != ''">channel_name,</if>
+            <if test="orgName != null and orgName != ''">org_name,</if>
+            <if test="orgCode != null and orgCode != ''">org_code,</if>
+            <if test="deviceName != null and deviceName != ''">device_name,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="alarmAnalysisId != null">#{alarmAnalysisId},</if>
+            <if test="channelCode != null and channelCode != ''">#{channelCode},</if>
+            <if test="channelName != null and channelName != ''">#{channelName},</if>
+            <if test="orgName != null and orgName != ''">#{orgName},</if>
+            <if test="orgCode != null and orgCode != ''">#{orgCode},</if>
+            <if test="deviceName != null and deviceName != ''">#{deviceName},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBusAiAlarmAnalysisChannel" parameterType="BusAiAlarmAnalysisChannel">
+        update bus_ai_alarm_analysis_channel
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="channelCode != null and channelCode != ''">channel_code = #{channelCode},</if>
+            <if test="channelName != null and channelName != ''">channel_name = #{channelName},</if>
+            <if test="orgName != null and orgName != ''">org_name = #{orgName},</if>
+            <if test="orgCode != null and orgCode != ''">org_code = #{orgCode},</if>
+            <if test="deviceName != null and deviceName != ''">device_name = #{deviceName},</if>
+        </trim>
+        where alarm_analysis_id = #{alarmAnalysisId}
+    </update>
+
+    <delete id="deleteBusAiAlarmAnalysisChannelByAlarmAnalysisId" parameterType="Long">
+        delete from bus_ai_alarm_analysis_channel where alarm_analysis_id = #{alarmAnalysisId}
+    </delete>
+
+    <delete id="deleteBusAiAlarmAnalysisChannelByAlarmAnalysisIds" parameterType="String">
+        delete from bus_ai_alarm_analysis_channel where alarm_analysis_id in
+        <foreach item="alarmAnalysisId" collection="array" open="(" separator="," close=")">
+            #{alarmAnalysisId}
+        </foreach>
+    </delete>
+</mapper>

+ 84 - 0
src/main/resources/mapper/ai/BusAiAlarmAnalysisConfigJobMapper.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.monitor.ai.mapper.BusAiAlarmAnalysisConfigJobMapper">
+
+    <resultMap type="BusAiAlarmAnalysisConfigJob" id="BusAiAlarmAnalysisConfigJobResult">
+        <result property="alarmAnalysisId"    column="alarm_analysis_id"    />
+        <result property="startTimeHour"    column="start_time_hour"    />
+        <result property="startTimeMinute"    column="start_time_minute"    />
+        <result property="startTimeSecond"    column="start_time_second"    />
+        <result property="endTimeHour"    column="end_time_hour"    />
+        <result property="endTimeMinute"    column="end_time_minute"    />
+        <result property="endTimeSecond"    column="end_time_second"    />
+    </resultMap>
+
+    <sql id="selectBusAiAlarmAnalysisConfigJobVo">
+        select alarm_analysis_id, start_time_hour, start_time_minute, start_time_second, end_time_hour, end_time_minute, end_time_second from bus_ai_alarm_analysis_config_job
+    </sql>
+
+    <select id="selectBusAiAlarmAnalysisConfigJobList" parameterType="BusAiAlarmAnalysisConfigJob" resultMap="BusAiAlarmAnalysisConfigJobResult">
+        <include refid="selectBusAiAlarmAnalysisConfigJobVo"/>
+        <where>
+            <if test="alarmAnalysisId != null "> and alarm_analysis_id = #{alarmAnalysisId}</if>
+            <if test="startTimeHour != null "> and start_time_hour = #{startTimeHour}</if>
+            <if test="startTimeMinute != null "> and start_time_minute = #{startTimeMinute}</if>
+            <if test="startTimeSecond != null "> and start_time_second = #{startTimeSecond}</if>
+            <if test="endTimeHour != null "> and end_time_hour = #{endTimeHour}</if>
+            <if test="endTimeMinute != null "> and end_time_minute = #{endTimeMinute}</if>
+            <if test="endTimeSecond != null "> and end_time_second = #{endTimeSecond}</if>
+        </where>
+    </select>
+
+    <select id="selectBusAiAlarmAnalysisConfigJobByAlarmAnalysisId" parameterType="Long" resultMap="BusAiAlarmAnalysisConfigJobResult">
+        <include refid="selectBusAiAlarmAnalysisConfigJobVo"/>
+        where alarm_analysis_id = #{alarmAnalysisId}
+    </select>
+
+    <insert id="insertBusAiAlarmAnalysisConfigJob" parameterType="BusAiAlarmAnalysisConfigJob">
+        insert into bus_ai_alarm_analysis_config_job
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="alarmAnalysisId != null">alarm_analysis_id,</if>
+            <if test="startTimeHour != null">start_time_hour,</if>
+            <if test="startTimeMinute != null">start_time_minute,</if>
+            <if test="startTimeSecond != null">start_time_second,</if>
+            <if test="endTimeHour != null">end_time_hour,</if>
+            <if test="endTimeMinute != null">end_time_minute,</if>
+            <if test="endTimeSecond != null">end_time_second,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="alarmAnalysisId != null">#{alarmAnalysisId},</if>
+            <if test="startTimeHour != null">#{startTimeHour},</if>
+            <if test="startTimeMinute != null">#{startTimeMinute},</if>
+            <if test="startTimeSecond != null">#{startTimeSecond},</if>
+            <if test="endTimeHour != null">#{endTimeHour},</if>
+            <if test="endTimeMinute != null">#{endTimeMinute},</if>
+            <if test="endTimeSecond != null">#{endTimeSecond},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBusAiAlarmAnalysisConfigJob" parameterType="BusAiAlarmAnalysisConfigJob">
+        update bus_ai_alarm_analysis_config_job
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="startTimeHour != null">start_time_hour = #{startTimeHour},</if>
+            <if test="startTimeMinute != null">start_time_minute = #{startTimeMinute},</if>
+            <if test="startTimeSecond != null">start_time_second = #{startTimeSecond},</if>
+            <if test="endTimeHour != null">end_time_hour = #{endTimeHour},</if>
+            <if test="endTimeMinute != null">end_time_minute = #{endTimeMinute},</if>
+            <if test="endTimeSecond != null">end_time_second = #{endTimeSecond},</if>
+        </trim>
+        where alarm_analysis_id = #{alarmAnalysisId}
+    </update>
+
+    <delete id="deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisId" parameterType="Long">
+        delete from bus_ai_alarm_analysis_config_job where alarm_analysis_id = #{alarmAnalysisId}
+    </delete>
+
+    <delete id="deleteBusAiAlarmAnalysisConfigJobByAlarmAnalysisIds" parameterType="String">
+        delete from bus_ai_alarm_analysis_config_job where alarm_analysis_id in
+        <foreach item="alarmAnalysisId" collection="array" open="(" separator="," close=")">
+            #{alarmAnalysisId}
+        </foreach>
+    </delete>
+</mapper>

+ 132 - 0
src/main/resources/mapper/ai/BusAiAlarmAnalysisMapper.xml

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.monitor.ai.mapper.BusAiAlarmAnalysisMapper">
+
+    <resultMap type="BusAiAlarmAnalysis" id="BusAiAlarmAnalysisResult">
+        <result property="id"    column="id"    />
+        <result property="configId"    column="config_id"    />
+        <result property="configName"    column="config_name"    />
+        <result property="scenarioDescription"    column="scenario_description"    />
+        <result property="analysisCycle"    column="analysis_cycle"    />
+        <result property="alarmType"    column="alarm_type"    />
+        <result property="alarmTypeName"    column="alarm_type_name"    />
+        <result property="enabled"    column="enabled"    />
+        <result property="detection"    column="detection"    />
+        <result property="calculatePoints"    column="calculate_points"    />
+        <result property="syncStatus"    column="sync_status"    />
+        <association property="promptSuggestion">
+            <result property="generationType"    column="prompt_suggestion_generation_type"    />
+            <result property="oneSentenceDescription"    column="prompt_suggestion_one_sentence_description"    />
+            <result property="scenes"    column="prompt_suggestion_scene_list"    />
+            <result property="types"    column="prompt_suggestion_type_list"    />
+        </association>
+        <collection property="alarmAnalysisConfigJobs" column="id" select="com.sooka.sponest.monitor.ai.mapper.BusAiAlarmAnalysisConfigJobMapper.selectBusAiAlarmAnalysisConfigJobByAlarmAnalysisId">
+            <result property="alarmAnalysisId"    column="alarm_analysis_id"    />
+            <result property="startTimeHour"    column="start_time_hour"    />
+            <result property="startTimeMinute"    column="start_time_minute"    />
+            <result property="startTimeSecond"    column="start_time_second"    />
+            <result property="endTimeHour"    column="end_time_hour"    />
+            <result property="endTimeMinute"    column="end_time_minute"    />
+            <result property="endTimeSecond"    column="end_time_second"    />
+        </collection>
+        <collection property="channels" column="id" select="com.sooka.sponest.monitor.ai.mapper.BusAiAlarmAnalysisChannelMapper.selectBusAiAlarmAnalysisChannelByAlarmAnalysisId">
+            <result property="alarmAnalysisId"    column="alarm_analysis_id"    />
+            <result property="channelCode"    column="channel_code"    />
+            <result property="channelName"    column="channel_name"    />
+            <result property="orgName"    column="org_name"    />
+            <result property="orgCode"    column="org_code"    />
+            <result property="deviceName"    column="device_name"    />
+        </collection>
+    </resultMap>
+
+    <sql id="selectBusAiAlarmAnalysisVo">
+        select id, config_id, config_name, scenario_description, analysis_cycle, alarm_type, alarm_type_name, enabled, detection, calculate_points, sync_status, prompt_suggestion_generation_type, prompt_suggestion_one_sentence_description, prompt_suggestion_scene_list, prompt_suggestion_type_list from bus_ai_alarm_analysis
+    </sql>
+
+    <select id="selectBusAiAlarmAnalysisList" parameterType="BusAiAlarmAnalysis" resultMap="BusAiAlarmAnalysisResult">
+        <include refid="selectBusAiAlarmAnalysisVo"/>
+        <where>
+            <if test="configName != null  and configName != ''"> and config_name like concat('%', #{configName}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectBusAiAlarmAnalysisById" parameterType="Long" resultMap="BusAiAlarmAnalysisResult">
+        <include refid="selectBusAiAlarmAnalysisVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="checkConfigNameUnique" parameterType="String" resultMap="BusAiAlarmAnalysisResult">
+        select id, config_name from bus_ai_alarm_analysis where config_name = #{configName} limit 1
+    </select>
+
+    <select id="checkAlarmTypeUnique" parameterType="Long" resultMap="BusAiAlarmAnalysisResult">
+        select id, alarm_type from bus_ai_alarm_analysis where alarm_type = #{alarmType} limit 1
+    </select>
+
+    <insert id="insertBusAiAlarmAnalysis" useGeneratedKeys="true" keyProperty="id" parameterType="BusAiAlarmAnalysis">
+        insert into bus_ai_alarm_analysis
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="configName != null and configName != ''">config_name,</if>
+            <if test="scenarioDescription != null and scenarioDescription != ''">scenario_description,</if>
+            <if test="analysisCycle != null and analysisCycle != ''">analysis_cycle,</if>
+            <if test="alarmType != null and alarmType != ''">alarm_type,</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">alarm_type_name,</if>
+            <if test="enabled != null and enabled != ''">enabled,</if>
+            <if test="detection != null and detection != ''">detection,</if>
+            <if test="calculatePoints != null and calculatePoints != ''">calculate_points,</if>
+            <if test="promptSuggestion.generationType != null">prompt_suggestion_generation_type,</if>
+            <if test="promptSuggestion.oneSentenceDescription != null and promptSuggestion.oneSentenceDescription != ''">prompt_suggestion_one_sentence_description,</if>
+            <if test="promptSuggestion.scenes != null and promptSuggestion.scenes != ''">prompt_suggestion_scene_list,</if>
+            <if test="promptSuggestion.types != null and promptSuggestion.types != ''">prompt_suggestion_type_list,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="configName != null and configName != ''">#{configName},</if>
+            <if test="scenarioDescription != null and scenarioDescription != ''">#{scenarioDescription},</if>
+            <if test="analysisCycle != null and analysisCycle != ''">#{analysisCycle},</if>
+            <if test="alarmType != null and alarmType != ''">#{alarmType},</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">#{alarmTypeName},</if>
+            <if test="enabled != null and enabled != ''">#{enabled},</if>
+            <if test="detection != null and detection != ''">#{detection},</if>
+            <if test="calculatePoints != null and calculatePoints != ''">#{calculatePoints},</if>
+            <if test="promptSuggestion.generationType != null">#{promptSuggestion.generationType},</if>
+            <if test="promptSuggestion.oneSentenceDescription != null and promptSuggestion.oneSentenceDescription != ''">#{promptSuggestion.oneSentenceDescription},</if>
+            <if test="promptSuggestion.scenes != null and promptSuggestion.scenes != ''">#{promptSuggestion.scenes},</if>
+            <if test="promptSuggestion.types != null and promptSuggestion.types != ''">#{promptSuggestion.types},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBusAiAlarmAnalysis" parameterType="BusAiAlarmAnalysis">
+        update bus_ai_alarm_analysis
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="configName != null and configName != ''">config_name = #{configName},</if>
+            <if test="scenarioDescription != null and scenarioDescription != ''">scenario_description = #{scenarioDescription},</if>
+            <if test="analysisCycle != null and analysisCycle != ''">analysis_cycle = #{analysisCycle},</if>
+            <if test="alarmType != null and alarmType != ''">alarm_type = #{alarmType},</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">alarm_type_name = #{alarmTypeName},</if>
+            <if test="enabled != null and enabled != ''">enabled = #{enabled},</if>
+            <if test="detection != null and detection != ''">detection = #{detection},</if>
+            <if test="calculatePoints != null and calculatePoints != ''">calculate_points = #{calculatePoints},</if>
+            <if test="syncStatus != null and syncStatus != ''">sync_status = #{syncStatus},</if>
+            <if test="promptSuggestion.generationType != null">prompt_suggestion_generation_type = #{promptSuggestion.generationType},</if>
+            <if test="promptSuggestion.oneSentenceDescription != null and promptSuggestion.oneSentenceDescription != ''">prompt_suggestion_one_sentence_description = #{promptSuggestion.oneSentenceDescription},</if>
+            <if test="promptSuggestion.scenes != null and promptSuggestion.scenes != ''">prompt_suggestion_scene_list = #{promptSuggestion.scenes},</if>
+            <if test="promptSuggestion.types != null and promptSuggestion.types != ''">prompt_suggestion_type_list = #{promptSuggestion.types},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBusAiAlarmAnalysisById" parameterType="Long">
+        delete from bus_ai_alarm_analysis where id = #{id}
+    </delete>
+
+    <delete id="deleteBusAiAlarmAnalysisByIds" parameterType="String">
+        delete from bus_ai_alarm_analysis where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 110 - 0
src/main/resources/mapper/ai/BusAiAlgorithmMapper.xml

@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmMapper">
+
+    <resultMap type="BusAiAlgorithm" id="BusAiAlgorithmResult">
+        <result property="id"    column="id"    />
+        <result property="algorithmId"    column="algorithm_id"    />
+        <result property="algorithmName"    column="algorithm_name"    />
+        <result property="algorithmRule"    column="algorithm_rule"    />
+        <result property="alarmType"    column="alarm_type"    />
+        <result property="alarmTypeName"    column="alarm_type_name"    />
+        <result property="enabled"    column="enabled"    />
+        <result property="syncStatus"    column="sync_status"    />
+        <association property="promptSuggestion">
+            <result property="generationType"    column="prompt_suggestion_generation_type"    />
+            <result property="scenes"    column="prompt_suggestion_scene_list"    />
+            <result property="types"    column="prompt_suggestion_type_list"    />
+        </association>
+    </resultMap>
+
+    <sql id="selectBusAiAlgorithmVo">
+        select id, algorithm_id, algorithm_name, algorithm_rule, alarm_type, alarm_type_name, enabled, sync_status, prompt_suggestion_generation_type, prompt_suggestion_scene_list, prompt_suggestion_type_list from bus_ai_algorithm
+    </sql>
+
+    <select id="selectBusAiAlgorithmList" parameterType="BusAiAlgorithm" resultMap="BusAiAlgorithmResult">
+        <include refid="selectBusAiAlgorithmVo"/>
+        <where>
+            <if test="algorithmName != null  and algorithmName != ''"> and algorithm_name like concat('%', #{algorithmName}, '%')</if>
+            <if test="syncStatus != null  and syncStatus != ''"> and sync_status = #{syncStatus}</if>
+        </where>
+    </select>
+
+    <select id="selectBusAiAlgorithmById" parameterType="Long" resultMap="BusAiAlgorithmResult">
+        <include refid="selectBusAiAlgorithmVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="checkAlgorithmNameUnique" parameterType="String" resultMap="BusAiAlgorithmResult">
+        select id, algorithm_name from bus_ai_algorithm where algorithm_name = #{algorithmName} limit 1
+    </select>
+
+    <insert id="insertBusAiAlgorithm" parameterType="BusAiAlgorithm" useGeneratedKeys="true" keyProperty="id">
+        insert into bus_ai_algorithm
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="algorithmName != null and algorithmName != ''">algorithm_name,</if>
+            <if test="algorithmRule != null and algorithmRule != ''">algorithm_rule,</if>
+            <if test="alarmType != null">alarm_type,</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">alarm_type_name,</if>
+            <if test="enabled != null">enabled,</if>
+            <if test="promptSuggestion.generationType != null">prompt_suggestion_generation_type,</if>
+            <if test="promptSuggestion.scenes != null and promptSuggestion.scenes != ''">prompt_suggestion_scene_list,</if>
+            <if test="promptSuggestion.types != null and promptSuggestion.types != ''">prompt_suggestion_type_list,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="algorithmName != null and algorithmName != ''">#{algorithmName},</if>
+            <if test="algorithmRule != null and algorithmRule != ''">#{algorithmRule},</if>
+            <if test="alarmType != null">#{alarmType},</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">#{alarmTypeName},</if>
+            <if test="enabled != null">#{enabled},</if>
+            <if test="promptSuggestion.generationType != null">#{promptSuggestion.generationType},</if>
+            <if test="promptSuggestion.scenes != null and promptSuggestion.scenes != ''">#{promptSuggestion.scenes},</if>
+            <if test="promptSuggestion.types != null and promptSuggestion.types != ''">#{promptSuggestion.types},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBusAiAlgorithm" parameterType="BusAiAlgorithm">
+        update bus_ai_algorithm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="algorithmName != null and algorithmName != ''">algorithm_name = #{algorithmName},</if>
+            <if test="algorithmRule != null and algorithmRule != ''">algorithm_rule = #{algorithmRule},</if>
+            <if test="alarmType != null">alarm_type = #{alarmType},</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">alarm_type_name = #{alarmTypeName},</if>
+            <if test="enabled != null">enabled = #{enabled},</if>
+            <if test="syncStatus != null">sync_status = #{syncStatus},</if>
+            <if test="promptSuggestion.generationType != null">prompt_suggestion_generation_type = #{promptSuggestion.generationType},</if>
+            <if test="promptSuggestion.scenes != null and promptSuggestion.scenes != ''">prompt_suggestion_scene_list = #{promptSuggestion.scenes},</if>
+            <if test="promptSuggestion.types != null and promptSuggestion.types != ''">prompt_suggestion_type_list = #{promptSuggestion.types},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="updateByName" parameterType="BusAiAlgorithm">
+        update bus_ai_algorithm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="algorithmName != null and algorithmName != ''">algorithm_name = #{algorithmName},</if>
+            <if test="algorithmRule != null and algorithmRule != ''">algorithm_rule = #{algorithmRule},</if>
+            <if test="alarmType != null">alarm_type = #{alarmType},</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">alarm_type_name = #{alarmTypeName},</if>
+            <if test="enabled != null">enabled = #{enabled},</if>
+            <if test="syncStatus != null">sync_status = #{syncStatus},</if>
+            <if test="promptSuggestion.generationType != null">prompt_suggestion_generation_type = #{promptSuggestion.generationType},</if>
+            <if test="promptSuggestion.scenes != null and promptSuggestion.scenes != ''">prompt_suggestion_scene_list = #{promptSuggestion.scenes},</if>
+            <if test="promptSuggestion.types != null and promptSuggestion.types != ''">prompt_suggestion_type_list = #{promptSuggestion.types},</if>
+        </trim>
+        where algorithm_name = #{algorithmName}
+    </update>
+
+    <delete id="deleteBusAiAlgorithmById" parameterType="Long">
+        delete from bus_ai_algorithm where id = #{id}
+    </delete>
+
+    <delete id="deleteBusAiAlgorithmByIds" parameterType="String">
+        delete from bus_ai_algorithm where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 94 - 0
src/main/resources/mapper/ai/BusAiAlgorithmTaskChannelMapper.xml

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskChannelMapper">
+
+    <resultMap type="BusAiAlgorithmTaskChannel" id="BusAiAlgorithmTaskChannelResult">
+        <result property="algorithmTaskId"    column="algorithm_task_id"    />
+        <result property="channelCode"    column="channel_code"    />
+        <result property="channelName"    column="channel_name"    />
+        <result property="orgName"    column="org_name"    />
+        <result property="orgCode"    column="org_code"    />
+        <result property="deviceName"    column="device_name"    />
+        <result property="protocol"    column="protocol"    />
+        <result property="snapMethod"    column="snap_method"    />
+        <result property="areaPoints"    column="area_points"    />
+    </resultMap>
+
+    <sql id="selectBusAiAlgorithmTaskChannelVo">
+        select algorithm_task_id, channel_code, channel_name, org_name, org_code, device_name, protocol, snap_method, area_points from bus_ai_algorithm_task_channel
+    </sql>
+
+    <select id="selectBusAiAlgorithmTaskChannelList" parameterType="BusAiAlgorithmTaskChannel" resultMap="BusAiAlgorithmTaskChannelResult">
+        <include refid="selectBusAiAlgorithmTaskChannelVo"/>
+        <where>
+            <if test="algorithmTaskId != null "> and algorithm_task_id = #{algorithmTaskId}</if>
+            <if test="channelCode != null  and channelCode != ''"> and channel_code = #{channelCode}</if>
+            <if test="channelName != null  and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
+            <if test="orgName != null  and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if>
+            <if test="orgCode != null  and orgCode != ''"> and org_code = #{orgCode}</if>
+            <if test="deviceName != null  and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
+            <if test="protocol != null  and protocol != ''"> and protocol = #{protocol}</if>
+            <if test="snapMethod != null "> and snap_method = #{snapMethod}</if>
+            <if test="areaPoints != null  and areaPoints != ''"> and area_points = #{areaPoints}</if>
+        </where>
+    </select>
+
+    <select id="selectBusAiAlgorithmTaskChannelByAlgorithmTaskId" parameterType="Long" resultMap="BusAiAlgorithmTaskChannelResult">
+        <include refid="selectBusAiAlgorithmTaskChannelVo"/>
+        where algorithm_task_id = #{algorithmTaskId}
+    </select>
+
+    <insert id="insertBusAiAlgorithmTaskChannel" parameterType="BusAiAlgorithmTaskChannel">
+        insert into bus_ai_algorithm_task_channel
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="algorithmTaskId != null">algorithm_task_id,</if>
+            <if test="channelCode != null and channelCode != ''">channel_code,</if>
+            <if test="channelName != null and channelName != ''">channel_name,</if>
+            <if test="orgName != null and orgName != ''">org_name,</if>
+            <if test="orgCode != null and orgCode != ''">org_code,</if>
+            <if test="deviceName != null and deviceName != ''">device_name,</if>
+            <if test="protocol != null and protocol != ''">protocol,</if>
+            <if test="snapMethod != null">snap_method,</if>
+            <if test="areaPoints != null and areaPoints != ''">area_points,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="algorithmTaskId != null">#{algorithmTaskId},</if>
+            <if test="channelCode != null and channelCode != ''">#{channelCode},</if>
+            <if test="channelName != null and channelName != ''">#{channelName},</if>
+            <if test="orgName != null and orgName != ''">#{orgName},</if>
+            <if test="orgCode != null and orgCode != ''">#{orgCode},</if>
+            <if test="deviceName != null and deviceName != ''">#{deviceName},</if>
+            <if test="protocol != null and protocol != ''">#{protocol},</if>
+            <if test="snapMethod != null">#{snapMethod},</if>
+            <if test="areaPoints != null and areaPoints != ''">#{areaPoints},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBusAiAlgorithmTaskChannel" parameterType="BusAiAlgorithmTaskChannel">
+        update bus_ai_algorithm_task_channel
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="channelCode != null and channelCode != ''">channel_code = #{channelCode},</if>
+            <if test="channelName != null and channelName != ''">channel_name = #{channelName},</if>
+            <if test="orgName != null and orgName != ''">org_name = #{orgName},</if>
+            <if test="orgCode != null and orgCode != ''">org_code = #{orgCode},</if>
+            <if test="deviceName != null and deviceName != ''">device_name = #{deviceName},</if>
+            <if test="protocol != null and protocol != ''">protocol = #{protocol},</if>
+            <if test="snapMethod != null">snap_method = #{snapMethod},</if>
+            <if test="areaPoints != null and areaPoints != ''">area_points = #{areaPoints},</if>
+        </trim>
+        where algorithm_task_id = #{algorithmTaskId}
+    </update>
+
+    <delete id="deleteBusAiAlgorithmTaskChannelByAlgorithmTaskId" parameterType="Long">
+        delete from bus_ai_algorithm_task_channel where algorithm_task_id = #{algorithmTaskId}
+    </delete>
+
+    <delete id="deleteBusAiAlgorithmTaskChannelByAlgorithmTaskIds" parameterType="String">
+        delete from bus_ai_algorithm_task_channel where algorithm_task_id in
+        <foreach item="algorithmTaskId" collection="array" open="(" separator="," close=")">
+            #{algorithmTaskId}
+        </foreach>
+    </delete>
+</mapper>

+ 84 - 0
src/main/resources/mapper/ai/BusAiAlgorithmTaskConfigJobMapper.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskConfigJobMapper">
+
+    <resultMap type="BusAiAlgorithmTaskConfigJob" id="BusAiAlgorithmTaskConfigJobResult">
+        <result property="algorithmTaskId"    column="algorithm_task_id"    />
+        <result property="startTimeHour"    column="start_time_hour"    />
+        <result property="startTimeMinute"    column="start_time_minute"    />
+        <result property="startTimeSecond"    column="start_time_second"    />
+        <result property="endTimeHour"    column="end_time_hour"    />
+        <result property="endTimeMinute"    column="end_time_minute"    />
+        <result property="endTimeSecond"    column="end_time_second"    />
+    </resultMap>
+
+    <sql id="selectBusAiAlgorithmTaskConfigJobVo">
+        select algorithm_task_id, start_time_hour, start_time_minute, start_time_second, end_time_hour, end_time_minute, end_time_second from bus_ai_algorithm_task_config_job
+    </sql>
+
+    <select id="selectBusAiAlgorithmTaskConfigJobList" parameterType="BusAiAlgorithmTaskConfigJob" resultMap="BusAiAlgorithmTaskConfigJobResult">
+        <include refid="selectBusAiAlgorithmTaskConfigJobVo"/>
+        <where>
+            <if test="algorithmTaskId != null "> and algorithm_task_id = #{algorithmTaskId}</if>
+            <if test="startTimeHour != null "> and start_time_hour = #{startTimeHour}</if>
+            <if test="startTimeMinute != null "> and start_time_minute = #{startTimeMinute}</if>
+            <if test="startTimeSecond != null "> and start_time_second = #{startTimeSecond}</if>
+            <if test="endTimeHour != null "> and end_time_hour = #{endTimeHour}</if>
+            <if test="endTimeMinute != null "> and end_time_minute = #{endTimeMinute}</if>
+            <if test="endTimeSecond != null "> and end_time_second = #{endTimeSecond}</if>
+        </where>
+    </select>
+
+    <select id="selectBusAiAlgorithmTaskConfigJobByAlgorithmTaskId" parameterType="Long" resultMap="BusAiAlgorithmTaskConfigJobResult">
+        <include refid="selectBusAiAlgorithmTaskConfigJobVo"/>
+        where algorithm_task_id = #{algorithmTaskId}
+    </select>
+
+    <insert id="insertBusAiAlgorithmTaskConfigJob" parameterType="BusAiAlgorithmTaskConfigJob">
+        insert into bus_ai_algorithm_task_config_job
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="algorithmTaskId != null">algorithm_task_id,</if>
+            <if test="startTimeHour != null">start_time_hour,</if>
+            <if test="startTimeMinute != null">start_time_minute,</if>
+            <if test="startTimeSecond != null">start_time_second,</if>
+            <if test="endTimeHour != null">end_time_hour,</if>
+            <if test="endTimeMinute != null">end_time_minute,</if>
+            <if test="endTimeSecond != null">end_time_second,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="algorithmTaskId != null">#{algorithmTaskId},</if>
+            <if test="startTimeHour != null">#{startTimeHour},</if>
+            <if test="startTimeMinute != null">#{startTimeMinute},</if>
+            <if test="startTimeSecond != null">#{startTimeSecond},</if>
+            <if test="endTimeHour != null">#{endTimeHour},</if>
+            <if test="endTimeMinute != null">#{endTimeMinute},</if>
+            <if test="endTimeSecond != null">#{endTimeSecond},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBusAiAlgorithmTaskConfigJob" parameterType="BusAiAlgorithmTaskConfigJob">
+        update bus_ai_algorithm_task_config_job
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="startTimeHour != null">start_time_hour = #{startTimeHour},</if>
+            <if test="startTimeMinute != null">start_time_minute = #{startTimeMinute},</if>
+            <if test="startTimeSecond != null">start_time_second = #{startTimeSecond},</if>
+            <if test="endTimeHour != null">end_time_hour = #{endTimeHour},</if>
+            <if test="endTimeMinute != null">end_time_minute = #{endTimeMinute},</if>
+            <if test="endTimeSecond != null">end_time_second = #{endTimeSecond},</if>
+        </trim>
+        where algorithm_task_id = #{algorithmTaskId}
+    </update>
+
+    <delete id="deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskId" parameterType="Long">
+        delete from bus_ai_algorithm_task_config_job where algorithm_task_id = #{algorithmTaskId}
+    </delete>
+
+    <delete id="deleteBusAiAlgorithmTaskConfigJobByAlgorithmTaskIds" parameterType="String">
+        delete from bus_ai_algorithm_task_config_job where algorithm_task_id in
+        <foreach item="algorithmTaskId" collection="array" open="(" separator="," close=")">
+            #{algorithmTaskId}
+        </foreach>
+    </delete>
+</mapper>

+ 64 - 0
src/main/resources/mapper/ai/BusAiAlgorithmTaskInfoMapper.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskInfoMapper">
+
+    <resultMap type="BusAiAlgorithmTaskInfo" id="BusAiAlgorithmTaskInfoResult">
+        <result property="algorithmTaskId"    column="algorithm_task_id"    />
+        <result property="aigorithmId"    column="aigorithm_id"    />
+        <result property="aigorithmName"    column="aigorithm_name"    />
+    </resultMap>
+
+    <sql id="selectBusAiAlgorithmTaskInfoVo">
+        select algorithm_task_id, aigorithm_id, aigorithm_name from bus_ai_algorithm_task_info
+    </sql>
+
+    <select id="selectBusAiAlgorithmTaskInfoList" parameterType="BusAiAlgorithmTaskInfo" resultMap="BusAiAlgorithmTaskInfoResult">
+        <include refid="selectBusAiAlgorithmTaskInfoVo"/>
+        <where>
+            <if test="algorithmTaskId != null "> and algorithm_task_id = #{algorithmTaskId}</if>
+            <if test="algorithmId != null "> and algorithm_id = #{algorithmId}</if>
+            <if test="algorithmName != null  and algorithmName != ''"> and algorithm_name like concat('%', #{algorithmName}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectBusAiAlgorithmTaskInfoByAlgorithmTaskId" parameterType="Long" resultMap="BusAiAlgorithmTaskInfoResult">
+        <include refid="selectBusAiAlgorithmTaskInfoVo"/>
+        where algorithm_task_id = #{algorithmTaskId}
+    </select>
+
+    <insert id="insertBusAiAlgorithmTaskInfo" parameterType="BusAiAlgorithmTaskInfo">
+        insert into bus_ai_algorithm_task_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="algorithmTaskId != null">algorithm_task_id,</if>
+            <if test="aigorithmId != null">aigorithm_id,</if>
+            <if test="aigorithmName != null and aigorithmName != ''">aigorithm_name,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="algorithmTaskId != null">#{algorithmTaskId},</if>
+            <if test="aigorithmId != null">#{aigorithmId},</if>
+            <if test="aigorithmName != null and aigorithmName != ''">#{aigorithmName},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBusAiAlgorithmTaskInfo" parameterType="BusAiAlgorithmTaskInfo">
+        update bus_ai_algorithm_task_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="aigorithmId != null">aigorithm_id = #{aigorithmId},</if>
+            <if test="aigorithmName != null and aigorithmName != ''">aigorithm_name = #{aigorithmName},</if>
+        </trim>
+        where algorithm_task_id = #{algorithmTaskId}
+    </update>
+
+    <delete id="deleteBusAiAlgorithmTaskInfoByAlgorithmTaskId" parameterType="Long">
+        delete from bus_ai_algorithm_task_info where algorithm_task_id = #{algorithmTaskId}
+    </delete>
+
+    <delete id="deleteBusAiAlgorithmTaskInfoByAlgorithmTaskIds" parameterType="String">
+        delete from bus_ai_algorithm_task_info where algorithm_task_id in
+        <foreach item="algorithmTaskId" collection="array" open="(" separator="," close=")">
+            #{algorithmTaskId}
+        </foreach>
+    </delete>
+</mapper>

+ 143 - 0
src/main/resources/mapper/ai/BusAiAlgorithmTaskMapper.xml

@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskMapper">
+
+    <resultMap type="BusAiAlgorithmTask" id="BusAiAlgorithmTaskResult">
+        <result property="id"    column="id"    />
+        <result property="taskId"    column="task_id"    />
+        <result property="taskName"    column="task_name"    />
+        <result property="analysisFrequency"    column="analysis_frequency"    />
+        <result property="analysisFrequencyUnit"    column="analysis_frequency_unit"    />
+        <result property="analysisCycle"    column="analysis_cycle"    />
+        <result property="channelCode"    column="channel_code"    />
+        <result property="enabled"    column="enabled"    />
+        <result property="detection"    column="detection"    />
+        <result property="templateId"    column="template_id"    />
+        <result property="auto"    column="auto"    />
+        <result property="shortSideResolution"    column="short_side_resolution"    />
+        <result property="analysisType"    column="analysis_type"    />
+        <result property="combTaskInterval"    column="comb_task_interval"    />
+        <result property="captureInterval"    column="capture_interval"    />
+        <result property="captureImageNum"    column="capture_image_num"    />
+        <result property="calculatePoints"    column="calculate_points"    />
+        <result property="syncStatus"    column="sync_status"    />
+        <collection property="infos" column="id" select="com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskInfoMapper.selectBusAiAlgorithmTaskInfoByAlgorithmTaskId">
+            <result property="aigorithmId"    column="aigorithm_id"    />
+            <result property="aigorithmName"    column="aigorithm_name"    />
+        </collection>
+        <collection property="taskJobs" column="id" select="com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskConfigJobMapper.selectBusAiAlgorithmTaskConfigJobByAlgorithmTaskId">
+            <result property="algorithmTaskId"    column="algorithm_task_id"    />
+            <result property="startTimeHour"    column="start_time_hour"    />
+            <result property="startTimeMinute"    column="start_time_minute"    />
+            <result property="startTimeSecond"    column="start_time_second"    />
+            <result property="endTimeHour"    column="end_time_hour"    />
+            <result property="endTimeMinute"    column="end_time_minute"    />
+            <result property="endTimeSecond"    column="end_time_second"    />
+        </collection>
+        <collection property="channelInfos" column="id" select="com.sooka.sponest.monitor.ai.mapper.BusAiAlgorithmTaskChannelMapper.selectBusAiAlgorithmTaskChannelByAlgorithmTaskId">
+            <result property="algorithmTaskId"    column="algorithm_task_id"    />
+            <result property="channelCode"    column="channel_code"    />
+            <result property="channelName"    column="channel_name"    />
+            <result property="orgName"    column="org_name"    />
+            <result property="orgCode"    column="org_code"    />
+            <result property="deviceName"    column="device_name"    />
+            <result property="protocol"    column="protocol"    />
+            <result property="snapMethod"    column="snap_method"    />
+            <result property="areaPoints"    column="area_points"    />
+        </collection>
+    </resultMap>
+
+    <sql id="selectBusAiAlgorithmTaskVo">
+        select id, task_id, task_name, analysis_frequency, analysis_frequency_unit, analysis_cycle, enabled, detection, template_id, auto, short_side_resolution, analysis_type, comb_task_interval, capture_interval, capture_image_num, calculate_points, sync_status from bus_ai_algorithm_task
+    </sql>
+
+    <select id="selectBusAiAlgorithmTaskList" parameterType="BusAiAlgorithmTask" resultMap="BusAiAlgorithmTaskResult">
+        <include refid="selectBusAiAlgorithmTaskVo"/>
+        <where>
+            <if test="taskName != null  and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
+            <if test="channelCode != null  and channelCode != ''">
+                and id in ( select distinct algorithm_task_id from bus_ai_algorithm_task_channel where channel_code = #{channelCode} )
+            </if>
+        </where>
+    </select>
+
+    <select id="selectBusAiAlgorithmTaskById" parameterType="Long" resultMap="BusAiAlgorithmTaskResult">
+        <include refid="selectBusAiAlgorithmTaskVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="checkTaskNameUnique" parameterType="String" resultMap="BusAiAlgorithmTaskResult">
+        select id, task_name from bus_ai_algorithm_task where task_name = #{taskName} limit 1
+    </select>
+
+    <insert id="insertBusAiAlgorithmTask" parameterType="BusAiAlgorithmTask" useGeneratedKeys="true" keyProperty="id">
+        insert into bus_ai_algorithm_task
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="taskName != null and taskName != ''">task_name,</if>
+            <if test="analysisFrequency != null and analysisFrequency != ''">analysis_frequency,</if>
+            <if test="analysisFrequencyUnit != null and analysisFrequencyUnit != ''">analysis_frequency_unit,</if>
+            <if test="analysisCycle != null">analysis_cycle,</if>
+            <if test="enabled != null">enabled,</if>
+            <if test="detection != null">detection,</if>
+            <if test="templateId != null">template_id,</if>
+            <if test="auto != null">auto,</if>
+            <if test="shortSideResolution != null">short_side_resolution,</if>
+            <if test="analysisType != null">analysis_type,</if>
+            <if test="combTaskInterval != null">comb_task_interval,</if>
+            <if test="captureInterval != null">capture_interval,</if>
+            <if test="captureImageNum != null">capture_image_num,</if>
+            <if test="calculatePoints != null">calculate_points,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="taskName != null and taskName != ''">#{taskName},</if>
+            <if test="analysisFrequency != null and analysisFrequency != ''">#{analysisFrequency},</if>
+            <if test="analysisFrequencyUnit != null and analysisFrequencyUnit != ''">#{analysisFrequencyUnit},</if>
+            <if test="analysisCycle != null">#{analysisCycle},</if>
+            <if test="enabled != null">#{enabled},</if>
+            <if test="detection != null">#{detection},</if>
+            <if test="templateId != null">#{templateId},</if>
+            <if test="auto != null">#{auto},</if>
+            <if test="shortSideResolution != null">#{shortSideResolution},</if>
+            <if test="analysisType != null">#{analysisType},</if>
+            <if test="combTaskInterval != null">#{combTaskInterval},</if>
+            <if test="captureInterval != null">#{captureInterval},</if>
+            <if test="captureImageNum != null">#{captureImageNum},</if>
+            <if test="calculatePoints != null">#{calculatePoints},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBusAiAlgorithmTask" parameterType="BusAiAlgorithmTask">
+        update bus_ai_algorithm_task
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
+            <if test="analysisFrequency != null and analysisFrequency != ''">analysis_frequency = #{analysisFrequency},</if>
+            <if test="analysisFrequencyUnit != null and analysisFrequencyUnit != ''">analysis_frequency_unit = #{analysisFrequencyUnit},</if>
+            <if test="analysisCycle != null">analysis_cycle = #{analysisCycle},</if>
+            <if test="enabled != null">enabled = #{enabled},</if>
+            <if test="detection != null">detection = #{detection},</if>
+            <if test="templateId != null">template_id = #{templateId},</if>
+            <if test="auto != null">auto = #{auto},</if>
+            <if test="shortSideResolution != null">short_side_resolution = #{shortSideResolution},</if>
+            <if test="analysisType != null">analysis_type = #{analysisType},</if>
+            <if test="combTaskInterval != null">comb_task_interval = #{combTaskInterval},</if>
+            <if test="captureInterval != null">capture_interval = #{captureInterval},</if>
+            <if test="captureImageNum != null">capture_image_num = #{captureImageNum},</if>
+            <if test="calculatePoints != null">calculate_points = #{calculatePoints},</if>
+            <if test="syncStatus != null">sync_status = #{syncStatus},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBusAiAlgorithmTaskById" parameterType="Long">
+        delete from bus_ai_algorithm_task where id = #{id}
+    </delete>
+
+    <delete id="deleteBusAiAlgorithmTaskByIds" parameterType="String">
+        delete from bus_ai_algorithm_task where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 129 - 0
src/main/resources/mapper/ai/BusAiSingleTypeMapper.xml

@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.monitor.ai.mapper.BusAiSingleTypeMapper">
+
+    <resultMap type="BusAiSingleType" id="BusAiSingleTypeResult">
+        <result property="id"    column="id"    />
+        <result property="alarmType"    column="alarm_type"    />
+        <result property="language"    column="language"    />
+        <result property="alarmTypeName"    column="alarm_type_name"    />
+        <result property="affiliation"    column="affiliation"    />
+        <result property="affiliationName"    column="affiliation_name"    />
+        <result property="alarmGrade"    column="alarm_grade"    />
+        <result property="alarmStorm"    column="alarm_storm"    />
+        <result property="status"    column="status"    />
+        <result property="isSave"    column="is_save"    />
+        <result property="failure"    column="failure"    />
+        <result property="urlNameKey"    column="url_name_key"    />
+        <result property="syncStatus"    column="sync_status"    />
+    </resultMap>
+
+    <sql id="selectBusAiSingleTypeVo">
+        select id, alarm_type, language, alarm_type_name, affiliation, affiliation_name, alarm_grade, alarm_storm, status, is_save, failure, url_name_key, sync_status from bus_ai_single_type
+    </sql>
+
+    <select id="selectBusAiSingleTypeList" parameterType="BusAiSingleType" resultMap="BusAiSingleTypeResult">
+        <include refid="selectBusAiSingleTypeVo"/>
+        <where>
+            <if test="alarmType != null "> and alarm_type like concat('%', #{alarmType}, '%')</if>
+            <if test="alarmTypeName != null  and alarmTypeName != ''"> and alarm_type_name like concat('%', #{alarmTypeName}, '%')</if>
+            <if test="syncStatus != null  and syncStatus != ''"> and sync_status = #{syncStatus}</if>
+        </where>
+    </select>
+
+    <select id="selectBusAiSingleTypeById" parameterType="String" resultMap="BusAiSingleTypeResult">
+        <include refid="selectBusAiSingleTypeVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="checkAlarmTypeUnique" parameterType="Long" resultMap="BusAiSingleTypeResult">
+        select id, alarm_type from bus_ai_single_type where alarm_type = #{alarmType} limit 1
+    </select>
+
+    <select id="checkAlarmTypeNameUnique" parameterType="String" resultMap="BusAiSingleTypeResult">
+        select id, alarm_type_name from bus_ai_single_type where alarm_type_name = #{alarmTypeName} limit 1
+    </select>
+
+    <insert id="insertBusAiSingleType" parameterType="BusAiSingleType">
+        insert into bus_ai_single_type
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="alarmType != null">alarm_type,</if>
+            <if test="language != null and language != ''">language,</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">alarm_type_name,</if>
+            <if test="affiliation != null">affiliation,</if>
+            <if test="affiliationName != null">affiliation_name,</if>
+            <if test="alarmGrade != null">alarm_grade,</if>
+            <if test="alarmStorm != null">alarm_storm,</if>
+            <if test="status != null">status,</if>
+            <if test="isSave != null">is_save,</if>
+            <if test="failure != null">failure,</if>
+            <if test="urlNameKey != null and urlNameKey != ''">url_name_key,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="alarmType != null">#{alarmType},</if>
+            <if test="language != null and language != ''">#{language},</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">#{alarmTypeName},</if>
+            <if test="affiliation != null">#{affiliation},</if>
+            <if test="affiliationName != null">#{affiliationName},</if>
+            <if test="alarmGrade != null">#{alarmGrade},</if>
+            <if test="alarmStorm != null">#{alarmStorm},</if>
+            <if test="status != null">#{status},</if>
+            <if test="isSave != null">#{isSave},</if>
+            <if test="failure != null">#{failure},</if>
+            <if test="urlNameKey != null and urlNameKey != ''">#{urlNameKey},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBusAiSingleType" parameterType="BusAiSingleType">
+        update bus_ai_single_type
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="alarmType != null">alarm_type = #{alarmType},</if>
+            <if test="language != null and language != ''">language = #{language},</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">alarm_type_name = #{alarmTypeName},</if>
+            <if test="affiliation != null">affiliation = #{affiliation},</if>
+            <if test="affiliationName != null">affiliation_name = #{affiliationName},</if>
+            <if test="alarmGrade != null">alarm_grade = #{alarmGrade},</if>
+            <if test="alarmStorm != null">alarm_storm = #{alarmStorm},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="isSave != null">is_save = #{isSave},</if>
+            <if test="failure != null">failure = #{failure},</if>
+            <if test="urlNameKey != null and urlNameKey != ''">url_name_key = #{urlNameKey},</if>
+            <if test="syncStatus != null and syncStatus != ''">sync_status = #{syncStatus},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="updateByAlarmType" parameterType="BusAiSingleType">
+        update bus_ai_single_type
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="alarmType != null">alarm_type = #{alarmType},</if>
+            <if test="language != null and language != ''">language = #{language},</if>
+            <if test="alarmTypeName != null and alarmTypeName != ''">alarm_type_name = #{alarmTypeName},</if>
+            <if test="affiliation != null">affiliation = #{affiliation},</if>
+            <if test="affiliationName != null">affiliation_name = #{affiliationName},</if>
+            <if test="alarmGrade != null">alarm_grade = #{alarmGrade},</if>
+            <if test="alarmStorm != null">alarm_storm = #{alarmStorm},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="isSave != null">is_save = #{isSave},</if>
+            <if test="failure != null">failure = #{failure},</if>
+            <if test="urlNameKey != null and urlNameKey != ''">url_name_key = #{urlNameKey},</if>
+            <if test="syncStatus != null and syncStatus != ''">sync_status = #{syncStatus},</if>
+        </trim>
+        where alarm_type = #{alarmType}
+    </update>
+
+    <delete id="deleteBusAiSingleTypeById" parameterType="String">
+        delete from bus_ai_single_type where id = #{id}
+    </delete>
+
+    <delete id="deleteBusAiSingleTypeByIds" parameterType="String">
+        delete from bus_ai_single_type where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>