@ -186,7 +186,7 @@ queryByConditionQuery
and find_in_set(t.student_id,#studentIdPlural#)
and find_in_set(t.student_id,#studentIdPlural#)
@}
@}
@if (!isEmpty(chatContent)){
@if (!isEmpty(chatContent)){
and t.chat_content =#chatContent #
and t.chat_content like #'%'+chatContent+'%' #
@}
@}
@if (!isEmpty(keywords)){
@if (!isEmpty(keywords)){
and t.keywords like #"%"+keywords+"%"#
and t.keywords like #"%"+keywords+"%"#
@ -215,6 +215,13 @@ queryByConditionQuery
@if (!isEmpty(teacherOpenCourseChatLogAddTime)){
@if (!isEmpty(teacherOpenCourseChatLogAddTime)){
and t.teacher_open_course_chat_log_add_time =#teacherOpenCourseChatLogAddTime#
and t.teacher_open_course_chat_log_add_time =#teacherOpenCourseChatLogAddTime#
@}
@}
@if (!isEmpty(replyStatus)){
@if (replyStatus == 2){
and exists( select 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)
@}else if(replyStatus == 1){
and not exists( select 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)
@}
@}
@if (!isEmpty(orgId)){
@if (!isEmpty(orgId)){
and t.org_id =#orgId#
and t.org_id =#orgId#
@}
@}
@ -736,20 +743,29 @@ getTeacherAskUnReadCountByStudent
getStudentAskUnReadCountByTeacher
getStudentAskUnReadCountByTeacher
===
===
* 获取学生提问模块未读数量,对于老师来说
* 获取学生提问模块未读数量,对于老师来说
select sum(num) from (
SELECT count(*)
SELECT count(*) `num`
FROM teacher_open_course_chat_log t
FROM teacher_open_course_chat_log t
WHERE 1
WHERE 1
AND t.teacher_open_course_id = #teacherOpenCourseId #
AND t.teacher_open_course_id = #teacherOpenCourseId #
AND t.chat_log_send_type = 'student_ask'
AND t.chat_log_send_type = 'student_ask'
AND NOT EXISTS(
AND t.teacher_read_status = 0
SELECT 1
union all
SELECT (
SELECT count(*)
FROM teacher_open_course_chat_log ta
FROM teacher_open_course_chat_log ta
WHERE 1
WHERE 1
and ta.teacher_id = #teacherId #
and ta.student_id is not null
AND ta.teacher_open_course_id = #teacherOpenCourseId #
AND ta.teacher_open_course_id = #teacherOpenCourseId #
AND ta.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
AND ta.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
)
AND ta.teacher_read_status = 0
) `num`
FROM teacher_open_course_chat_log t
WHERE 1
AND t.teacher_open_course_id = #teacherOpenCourseId #
AND t.chat_log_send_type = 'student_ask'
)t1
getStudentAskUnReadCountByStudent
getStudentAskUnReadCountByStudent