-- 查询最近失败任务（使用正确的表名）
SELECT 
    id,
    user_id,
    lover_id,
    task_type,
    status,
    error_msg,
    created_at,
    updated_at
FROM nf_generation_tasks
WHERE task_type = 'video'
AND status = 'failed'
ORDER BY id DESC
LIMIT 10;

-- 查询任务382附近的任务
SELECT 
    id,
    user_id,
    lover_id,
    task_type,
    status,
    error_msg,
    created_at
FROM nf_generation_tasks
WHERE id BETWEEN 380 AND 385
ORDER BY id;

-- 查询所有视频任务的统计
SELECT 
    status,
    COUNT(*) as count,
    MAX(created_at) as last_time
FROM nf_generation_tasks
WHERE task_type = 'video'
GROUP BY status;
