USE cattletrade;

-- 简单直接的修复脚本：修复被截断的字段值
-- 直接通过ID更新，确保修复成功

-- ============================================
-- 修复进仓管理菜单（id=88）的 page_url
-- 当前值：warehouse/warehouselr (长度21)
-- 目标值：warehouse/warehouseIn (长度20)
-- ============================================
UPDATE sys_menu 
SET 
    page_url = 'warehouse/warehouseIn',
    update_time = NOW()
WHERE id = 88
  AND is_delete = 0;

-- ============================================
-- 修复出仓管理菜单（id=93）的 page_url 和 authority
-- 当前值：page_url = warehouse/warehouseO (长度22), authority = warehouseout:li (长度17)
-- 目标值：page_url = warehouse/warehouseOut (长度21), authority = warehouseout:list (长度16)
-- ============================================
UPDATE sys_menu 
SET 
    page_url = 'warehouse/warehouseOut',
    authority = 'warehouseout:list',
    update_time = NOW()
WHERE id = 93
  AND is_delete = 0;

-- ============================================
-- 验证修复结果（执行后运行此查询）
-- ============================================
SELECT 
    id, 
    parent_id, 
    type, 
    name, 
    route_url, 
    page_url, 
    LENGTH(page_url) as page_url_len,
    authority,
    LENGTH(authority) as authority_len
FROM sys_menu 
WHERE id IN (88, 93)
  AND is_delete = 0;

-- 预期结果：
-- id=88: page_url='warehouse/warehouseIn', page_url_len=20
-- id=93: page_url='warehouse/warehouseOut', page_url_len=21, authority='warehouseout:list', authority_len=16

