peixue-dev/Archive/peidu-temp-files/sql/🚀插入成长记录测试数据-2026-01-23.sql

130 lines
3.9 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.

-- ==================== 插入成长记录测试数据 ====================
-- 1. 确保有学生数据
INSERT INTO student (
id, user_id, student_name, gender,
birth_date, grade, school,
parent_name, parent_phone,
create_time, update_time
) VALUES (
1, 1, '小明', 1,
'2016-01-01', '四年级', '实验小学',
'张先生', '13800138000',
NOW(), NOW()
) ON DUPLICATE KEY UPDATE
student_name = '小明',
user_id = 1;
-- 2. 插入每日反馈测试数据
INSERT INTO growth_record (
order_id, teacher_id, student_id, student_name,
record_date, record_type, content, status,
images, videos, deleted, -- ✅ 添加deleted字段
create_time, update_time
) VALUES
(
1, 1, 1, '小明',
'2026-01-23', 'daily',
'今天小明的学习状态很好,完成了数学作业和英语阅读。在学习过程中表现出很强的专注力,能够独立完成大部分题目。数学题目理解能力有所提升。',
1,
'["https://example.com/image1.jpg", "https://example.com/image2.jpg"]',
'["https://example.com/video1.mp4"]',
0, -- ✅ deleted=0
NOW(), NOW()
),
(
2, 1, 1, '小明',
'2026-01-22', 'daily',
'今天主要辅导了语文阅读理解,小明对文章的理解能力有所提升。能够准确把握文章主旨,回答问题时思路清晰。',
1,
'["https://example.com/image3.jpg"]',
'[]',
0, -- ✅ deleted=0
NOW(), NOW()
),
(
3, 1, 1, '小明',
'2026-01-21', 'daily',
'今天完成了英语单词背诵和课文朗读。小明的发音准确,记忆力很好,能够快速记住新单词。',
1,
'[]',
'[]',
0, -- ✅ deleted=0
NOW(), NOW()
),
(
4, 1, 1, '小明',
'2026-01-20', 'daily',
'今天学习了数学应用题,小明的逻辑思维能力很强,能够独立分析问题并找到解决方法。',
1,
'["https://example.com/image4.jpg", "https://example.com/image5.jpg"]',
'[]',
0, -- ✅ deleted=0
NOW(), NOW()
),
(
5, 1, 1, '小明',
'2026-01-19', 'daily',
'今天复习了本周所学内容,小明对知识点掌握扎实,能够举一反三。',
1,
'[]',
'[]',
0, -- ✅ deleted=0
NOW(), NOW()
);
-- 3. 插入周反馈测试数据
INSERT INTO growth_record (
teacher_id, student_id, student_name,
record_date, record_type, content, status,
week_start_date, summary, deleted, -- ✅ 添加deleted字段
create_time, update_time
) VALUES (
1, 1, '小明',
'2026-01-19', 'weekly',
'本周学习状态良好,完成了所有作业。数学和英语进步明显,语文阅读理解能力有所提升。建议继续保持良好的学习习惯。',
1,
'2026-01-13',
'本周共服务5次总时长600分钟。学生表现优秀学习态度认真。',
0, -- ✅ deleted=0
NOW(), NOW()
);
-- 4. 插入月反馈测试数据
INSERT INTO growth_record (
teacher_id, student_id, student_name,
record_date, record_type, content, status,
month_year, summary, deleted, -- ✅ 添加deleted字段
create_time, update_time
) VALUES (
1, 1, '小明',
'2026-01-31', 'monthly',
'本月学习进步明显各科成绩都有提升。数学从70分提升到85分英语从75分提升到90分。学习态度认真能够主动完成作业。建议继续保持并加强薄弱环节的练习。',
1,
'2026-01',
'本月共服务20次总时长2400分钟。学生整体表现优秀学习能力强。',
0, -- ✅ deleted=0
NOW(), NOW()
);
-- 5. 验证数据
SELECT
id,
student_id,
student_name,
record_type,
record_date,
LEFT(content, 50) as content_preview,
status
FROM growth_record
WHERE student_id = 1
ORDER BY record_date DESC;
-- 6. 统计数据
SELECT
record_type,
COUNT(*) as count
FROM growth_record
WHERE student_id = 1
GROUP BY record_type;