-- 检查数据是否正确插入

-- 1. 检查缘池板块
SELECT COUNT(*) AS category_count FROM eb_community_category;

-- 2. 检查缘池消息
SELECT COUNT(*) AS message_count FROM eb_community_message WHERE is_delete = 0;

-- 3. 检查许愿树节日
SELECT COUNT(*) AS festival_count FROM eb_wishtree_festival;

-- 4. 检查许愿树心愿
SELECT COUNT(*) AS wish_count FROM eb_wishtree_wish WHERE is_delete = 0;

-- 5. 检查心愿点赞
SELECT COUNT(*) AS like_count FROM eb_wishtree_like;

-- 6. 检查心愿评论
SELECT COUNT(*) AS comment_count FROM eb_wishtree_comment WHERE is_delete = 0;

-- 7. 检查背景素材
SELECT COUNT(*) AS background_count FROM eb_wishtree_background;

-- 8. 检查匹配配置
SELECT * FROM eb_community_match_config;

-- 9. 查看消息列表（带用户信息）
SELECT 
    m.id,
    m.uid,
    u.nickname,
    c.name AS categoryName,
    m.content,
    m.status,
    m.create_time
FROM eb_community_message m
LEFT JOIN eb_user u ON m.uid = u.uid
LEFT JOIN eb_community_category c ON m.category_id = c.id
WHERE m.is_delete = 0
ORDER BY m.create_time DESC
LIMIT 10;

-- 10. 查看心愿列表（带用户信息）
SELECT 
    w.id,
    w.uid,
    u.nickname,
    f.name AS festivalName,
    w.content,
    w.status,
    w.like_count,
    w.comment_count,
    w.create_time
FROM eb_wishtree_wish w
LEFT JOIN eb_user u ON w.uid = u.uid
LEFT JOIN eb_wishtree_festival f ON w.festival_id = f.id
WHERE w.is_delete = 0
ORDER BY w.create_time DESC
LIMIT 10;
