|
|
|
@ -132,6 +132,10 @@ queryByConditionQuery
|
|
|
|
|
@pageTag(){
|
|
|
|
|
t.*,
|
|
|
|
|
tc.class_name,
|
|
|
|
|
ifnull((select count(1) from teacher_open_course_chat_log a
|
|
|
|
|
where a.teacher_open_course_chat_log_status = 1
|
|
|
|
|
and a.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
|
|
|
|
|
), 0) as comment_count,
|
|
|
|
|
@// 指定提问,随机提问类型,查询学生回答的数据。只查询一级
|
|
|
|
|
(case when find_in_set(t.chat_log_send_type, 'specify_ask,random_ask') then
|
|
|
|
|
(select chat_content
|
|
|
|
@ -686,4 +690,80 @@ chatLogAnalysis
|
|
|
|
|
@if(isNotEmpty(teacherOpenCourseId)) {
|
|
|
|
|
AND t.teacher_open_course_id = #teacherOpenCourseId#
|
|
|
|
|
@}
|
|
|
|
|
AND t.teacher_open_course_chat_log_status = 1
|
|
|
|
|
AND t.teacher_open_course_chat_log_status = 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getTeacherAskUnReadCountByTeacher
|
|
|
|
|
===
|
|
|
|
|
* 获取老师提问模块未读数量,对于老师来说
|
|
|
|
|
SELECT IFNULL(sum(
|
|
|
|
|
(select count(*)
|
|
|
|
|
from teacher_open_course_chat_log t2
|
|
|
|
|
where t2.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
|
|
|
|
|
and t2.teacher_read_status = 0)
|
|
|
|
|
),0)
|
|
|
|
|
FROM teacher_open_course_chat_log t
|
|
|
|
|
WHERE 1
|
|
|
|
|
AND t.teacher_open_course_id = #teacherOpenCourseId#
|
|
|
|
|
AND t.teacher_id = #teacherId#
|
|
|
|
|
AND t.chat_log_send_type in ('specify_ask', 'random_ask')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getTeacherAskUnReadCountByStudent
|
|
|
|
|
===
|
|
|
|
|
* 获取老师提问模块未读数量,对于学生来说
|
|
|
|
|
|
|
|
|
|
SELECT count(*)
|
|
|
|
|
FROM teacher_open_course_chat_log t
|
|
|
|
|
WHERE 1
|
|
|
|
|
AND t.teacher_open_course_id = #teacherOpenCourseId#
|
|
|
|
|
AND t.student_id = #studentId#
|
|
|
|
|
AND t.chat_log_send_type in ('specify_ask','random_ask')
|
|
|
|
|
@//这里的未读我们可以认为就是不存在回复
|
|
|
|
|
AND NOT EXISTS(
|
|
|
|
|
SELECT 1
|
|
|
|
|
FROM teacher_open_course_chat_log ta
|
|
|
|
|
WHERE 1
|
|
|
|
|
and t.student_id = #studentId#
|
|
|
|
|
AND t.teacher_open_course_id = #teacherOpenCourseId#
|
|
|
|
|
AND ta.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getStudentAskUnReadCountByTeacher
|
|
|
|
|
===
|
|
|
|
|
* 获取学生提问模块未读数量,对于老师来说
|
|
|
|
|
|
|
|
|
|
SELECT count(*)
|
|
|
|
|
FROM teacher_open_course_chat_log t
|
|
|
|
|
WHERE 1
|
|
|
|
|
AND t.teacher_open_course_id = #teacherOpenCourseId#
|
|
|
|
|
AND t.chat_log_send_type = 'student_ask'
|
|
|
|
|
AND NOT EXISTS(
|
|
|
|
|
SELECT 1
|
|
|
|
|
FROM teacher_open_course_chat_log ta
|
|
|
|
|
WHERE 1
|
|
|
|
|
and t.teacher_id = #teacherId#
|
|
|
|
|
AND t.teacher_open_course_id = #teacherOpenCourseId#
|
|
|
|
|
AND ta.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getStudentAskUnReadCountByStudent
|
|
|
|
|
===
|
|
|
|
|
* 获取学生提问模块未读数量,对于学生来说
|
|
|
|
|
|
|
|
|
|
SELECT IFNULL(sum(
|
|
|
|
|
(select count(*)
|
|
|
|
|
from teacher_open_course_chat_log t2
|
|
|
|
|
where t2.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
|
|
|
|
|
and t2.teacher_read_status = 0)
|
|
|
|
|
),0)
|
|
|
|
|
FROM teacher_open_course_chat_log t
|
|
|
|
|
WHERE 1
|
|
|
|
|
AND t.student_id = #studentId#
|
|
|
|
|
AND t.teacher_open_course_id = #teacherOpenCourseId#
|
|
|
|
|
AND t.chat_log_send_type = 'student_ask'
|