001project_wildgrowth/backend/prisma/add_vertical_screen_course.sql

162 lines
8.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.

-- 添加竖屏课程测试数据
-- 执行方式psql -U your_username -d your_database -f add_vertical_screen_course.sql
-- 或者cd backend && psql $DATABASE_URL -f prisma/add_vertical_screen_course.sql
-- ============================================================
-- 竖屏课程:高效沟通的艺术
-- ============================================================
-- 插入竖屏课程
INSERT INTO courses (id, title, subtitle, description, type, total_nodes, created_at)
VALUES (
'course_vertical_001',
'高效沟通的艺术',
'掌握职场沟通的核心技巧',
'通过真实案例和实用方法,帮助你提升沟通能力,在职场中更游刃有余。',
'vertical_screen',
3,
NOW()
)
ON CONFLICT (id) DO UPDATE SET
title = EXCLUDED.title,
subtitle = EXCLUDED.subtitle,
description = EXCLUDED.description,
type = 'vertical_screen',
total_nodes = EXCLUDED.total_nodes;
-- ============================================================
-- 小节 1倾听的艺术
-- ============================================================
-- 插入节点 1
INSERT INTO course_nodes (id, course_id, title, subtitle, order_index, duration, created_at)
VALUES (
'node_vertical_001_01',
'course_vertical_001',
'倾听的艺术',
'学会真正听懂对方',
0,
8,
NOW()
)
ON CONFLICT (id) DO UPDATE SET
course_id = EXCLUDED.course_id,
title = EXCLUDED.title,
subtitle = EXCLUDED.subtitle,
order_index = EXCLUDED.order_index,
duration = EXCLUDED.duration;
-- 为节点 1 创建富文本内容(竖屏课程使用 rich_text 字段)
INSERT INTO node_slides (id, node_id, slide_type, order_index, content, effect, created_at)
VALUES (
'slide_vertical_001_01',
'node_vertical_001_01',
'text',
0,
'{"rich_text": "<h1>倾听的艺术</h1><p>真正的沟通不是说话,而是倾听。学会倾听,是高效沟通的第一步。</p><h2>为什么倾听如此重要?</h2><p>很多人认为沟通就是表达自己的观点,但实际上,<span class=\"highlight\">倾听才是沟通的核心</span>。只有真正听懂对方,才能做出有效的回应。</p><h2>倾听的三个层次</h2><p><strong>第一层:听到</strong> - 你听到了对方的声音,但可能没有理解。</p><p><strong>第二层:听懂</strong> - 你理解了对方说的内容,知道了表面意思。</p><p><strong>第三层:听透</strong> - 你理解了对方的情绪、需求和背后的真实意图。</p><h2>如何提升倾听能力?</h2><p>1. 保持专注,避免分心</p><p>2. 用眼神和肢体语言表达关注</p><p>3. 不打断对方,让对方说完</p><p>4. 用提问确认理解,而不是急于回应</p><p>5. 关注对方的情绪,而不只是内容</p>"}'::jsonb,
'fade_in',
NOW()
)
ON CONFLICT (id) DO UPDATE SET
slide_type = EXCLUDED.slide_type,
order_index = EXCLUDED.order_index,
content = EXCLUDED.content,
effect = EXCLUDED.effect;
-- ============================================================
-- 小节 2表达的技巧
-- ============================================================
-- 插入节点 2
INSERT INTO course_nodes (id, course_id, title, subtitle, order_index, duration, created_at)
VALUES (
'node_vertical_001_02',
'course_vertical_001',
'表达的技巧',
'让你的话更有说服力',
1,
10,
NOW()
)
ON CONFLICT (id) DO UPDATE SET
course_id = EXCLUDED.course_id,
title = EXCLUDED.title,
subtitle = EXCLUDED.subtitle,
order_index = EXCLUDED.order_index,
duration = EXCLUDED.duration;
-- 为节点 2 创建富文本内容
INSERT INTO node_slides (id, node_id, slide_type, order_index, content, effect, created_at)
VALUES (
'slide_vertical_001_02',
'node_vertical_001_02',
'text',
0,
'{"rich_text": "<h1>表达的技巧</h1><p>清晰、有力的表达能让你的观点更容易被接受。掌握表达的技巧,让沟通更高效。</p><h2>结构化表达</h2><p>好的表达需要清晰的结构。推荐使用<span class=\"highlight\">金字塔原理</span>:先结论,后原因,再案例。</p><p><strong>结论先行</strong> - 先说你的核心观点</p><p><strong>分层说明</strong> - 用3个要点支撑你的观点</p><p><strong>案例佐证</strong> - 用具体案例让观点更有说服力</p><h2>语言的力量</h2><p>用词的选择会直接影响沟通效果:</p><p>❌ \"我觉得可能这样会好一点\"</p><p>✅ \"我建议采用这个方案,原因有三点\"</p><p>用肯定的语言替代模糊的表达,会让你的观点更可信。</p><h2>非语言沟通</h2><p>除了语言,肢体语言也至关重要:</p><p>• <strong>眼神接触</strong> - 保持适度的眼神交流,表达自信</p><p>• <strong>姿态</strong> - 保持开放的身体姿态,不要交叉手臂</p><p>• <strong>语速</strong> - 控制语速,重要内容可以放慢强调</p><p>• <strong>手势</strong> - 适度的手势能增强表达力</p>"}'::jsonb,
'fade_in',
NOW()
)
ON CONFLICT (id) DO UPDATE SET
slide_type = EXCLUDED.slide_type,
order_index = EXCLUDED.order_index,
content = EXCLUDED.content,
effect = EXCLUDED.effect;
-- ============================================================
-- 小节 3冲突的处理
-- ============================================================
-- 插入节点 3
INSERT INTO course_nodes (id, course_id, title, subtitle, order_index, duration, created_at)
VALUES (
'node_vertical_001_03',
'course_vertical_001',
'冲突的处理',
'在分歧中寻找共识',
2,
12,
NOW()
)
ON CONFLICT (id) DO UPDATE SET
course_id = EXCLUDED.course_id,
title = EXCLUDED.title,
subtitle = EXCLUDED.subtitle,
order_index = EXCLUDED.order_index,
duration = EXCLUDED.duration;
-- 为节点 3 创建富文本内容
INSERT INTO node_slides (id, node_id, slide_type, order_index, content, effect, created_at)
VALUES (
'slide_vertical_001_03',
'node_vertical_001_03',
'text',
0,
'{"rich_text": "<h1>冲突的处理</h1><p>冲突是沟通中不可避免的。关键在于如何将冲突转化为建设性的对话。</p><h2>理解冲突的本质</h2><p>大多数冲突不是观点的对立,而是<span class=\"highlight\">需求的不匹配</span>。找到双方的真实需求,是解决冲突的关键。</p><p>冲突通常源于:</p><p>• 利益的不一致</p><p>• 价值观的差异</p><p>• 沟通的误解</p><p>• 情绪的干扰</p><h2>处理冲突的三步法</h2><p><strong>第一步:冷静下来</strong></p><p>情绪激动时不要沟通。给自己和对方一些时间,等情绪平复后再讨论。</p><p><strong>第二步:理解对方</strong></p><p>尝试站在对方的角度思考:\"如果我是他,为什么会这样想?\"理解对方的立场和需求。</p><p><strong>第三步:寻找共赢</strong></p><p>不要只想着\"我赢\",而是寻找\"我们都赢\"的解决方案。通常有第三种选择比妥协更好。</p><h2>实用技巧</h2><p>• 使用\"我\"的表达方式,而不是\"你\"\"我感到...\" 而不是 \"你总是...\"</p><p>• 关注问题本身,而不是攻击对方</p><p>• 承认对方的感受:\"我理解你的感受\"</p><p>• 寻找共同目标:\"我们都是为了...\"</p><p>• 如果无法解决,可以暂时搁置,之后再讨论</p>"}'::jsonb,
'fade_in',
NOW()
)
ON CONFLICT (id) DO UPDATE SET
slide_type = EXCLUDED.slide_type,
order_index = EXCLUDED.order_index,
content = EXCLUDED.content,
effect = EXCLUDED.effect;
-- ============================================================
-- 验证数据
-- ============================================================
SELECT
c.id as course_id,
c.title as course_title,
c.type,
c.total_nodes,
n.id as node_id,
n.title as node_title,
n.order_index,
n.duration,
(SELECT COUNT(*) FROM node_slides WHERE node_id = n.id) as slide_count
FROM courses c
LEFT JOIN course_nodes n ON c.id = n.course_id
WHERE c.id = 'course_vertical_001'
ORDER BY n.order_index;