Files
xiaoqu_mcp_service/xiaoqu-agent-service/sql/seed-prod-hardware-back-list.sql
T
wangheng 5650f6732e 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)
2026-12-02 11:39:48 +08:00

21 lines
1.0 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- =============================================================
-- 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';