beetlsql3-dev
yaodan 2 years ago
parent 03a79ee0f2
commit 7e5ce4ca45

@ -119,6 +119,9 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
if (bean instanceof Student){
List<Long> idList = ret.getList().stream().filter(e->Objects.equals(e.getStudentReadStatus(),0)).map(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogId).collect(Collectors.toList());
readChatLogByIds(idList,1);
}else if (bean instanceof Teacher){
List<Long> idList = ret.getList().stream().filter(e->Objects.equals(e.getTeacherReadStatus(),0)).map(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogId).collect(Collectors.toList());
readChatLogByIds(idList,2);
}
}
break;

@ -186,7 +186,7 @@ queryByConditionQuery
and find_in_set(t.student_id,#studentIdPlural#)
@}
@if(!isEmpty(chatContent)){
and t.chat_content =#chatContent#
and t.chat_content like #'%'+chatContent+'%'#
@}
@if(!isEmpty(keywords)){
and t.keywords like #"%"+keywords+"%"#
@ -215,6 +215,13 @@ queryByConditionQuery
@if(!isEmpty(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)){
and t.org_id =#orgId#
@}
@ -736,20 +743,29 @@ getTeacherAskUnReadCountByStudent
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
select sum(num) from (
SELECT count(*) `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'
AND t.teacher_read_status = 0
union all
SELECT (
SELECT count(*)
FROM teacher_open_course_chat_log ta
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_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

Loading…
Cancel
Save