feat(mcp): 新增站点备用机列表查询工具 hardware.back.list.query

- 复刻老系统(xiaoqu-complex)/districtHardwareBack/queryHardwareBackListByDistrictId,
  返回 LLM 友好记录列表,selectCount 修复老接口分页 records 取页大小的 bug
- districtId 与 snCode 至少传一个;onlineStatus 取自 hardware_view.status 按页批量 IN 查询
- 新增 applyHardwareBackRowFilter 镜像 hardware_view 行权限,补齐老接口缺失的权限过滤
- prod 启动绑定研发专用 scope 6(code=code),dev 种子绑「测试专用」(code=test)
This commit is contained in:
wangheng
2026-12-02 11:39:48 +08:00
parent 8b985a4696
commit 5650f6732e
9 changed files with 3234 additions and 2640 deletions
+7
View File
@@ -125,6 +125,13 @@ SELECT s.id, t.id, 0 FROM agent_scope s JOIN tool t
WHERE s.code = 'test' AND t.name = 'sms.vercode.latest.query'
AND NOT EXISTS (SELECT 1 FROM scope_tool st WHERE st.scope_id = s.id AND st.tool_id = t.id);
-- 站点备用机列表(hardware.back.list.query):拍板 prod 只绑研发专用 scope 6,
-- dev 等价绑「测试专用」(code='test');不进入 operation/hardware/ops-query/sync。
INSERT INTO scope_tool (scope_id, tool_id, create_id)
SELECT s.id, t.id, 0 FROM agent_scope s JOIN tool t
WHERE s.code = 'test' AND t.name = 'hardware.back.list.query'
AND NOT EXISTS (SELECT 1 FROM scope_tool st WHERE st.scope_id = s.id AND st.tool_id = t.id);
COMMIT;
-- 校验
@@ -0,0 +1,20 @@
-- =============================================================
-- prod 种子:hardware.back.list.query 绑定(只绑研发专用 scope 6,2026-12-02 拍板)
-- 前置:应用已完成部署启动(tool 表由 ToolSyncService 同步)后再执行本脚本。
-- 执行方式:在 prod svc 库上执行(mysql 客户端需已选中 svc 库,本脚本不含 USE)。
-- 幂等:按 (scope_id, tool_id) 判重,可重复执行;scope_tool 行按拍板显式使用 id=469。
-- =============================================================
START TRANSACTION;
INSERT INTO scope_tool (id, scope_id, tool_id, create_id)
SELECT 469, 6, t.id, 0 FROM tool t
WHERE t.name = 'hardware.back.list.query'
AND NOT EXISTS (SELECT 1 FROM scope_tool st WHERE st.scope_id = 6 AND st.tool_id = t.id);
COMMIT;
-- 校验:应返回 scope_id=6 绑定 hardware.back.list.query 一行
SELECT st.id, st.scope_id, t.id AS tool_id, t.name
FROM scope_tool st JOIN tool t ON st.tool_id = t.id
WHERE t.name = 'hardware.back.list.query';