diff --git a/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseChatLogDao.java b/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseChatLogDao.java index f958a0b4..f47ccd14 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseChatLogDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseChatLogDao.java @@ -62,4 +62,12 @@ public interface TeacherOpenCourseChatLogDao extends BaseMapper> getMyselfValues(TeacherOpenCourseQuery param, @TTeacher Teacher teacher) { + param.setTeacherId(teacher.getTeacherId()); + Listlist = teacherOpenCourseService.getValuesByQuery(param); + return JsonResult.success(list); + } + + @PostMapping(MODEL + "/delete.json") @Function("teacherOpenCourse.delete") @ResponseBody diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseChatLogQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseChatLogQuery.java index a4887763..8f324271 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseChatLogQuery.java +++ b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseChatLogQuery.java @@ -82,6 +82,9 @@ public class TeacherOpenCourseChatLogQuery extends PageParam { @Query(name = "回复状态 1 待回复 2已回复", display = false) private Integer replyStatus; + private Integer teacherReadStatus; + + private Integer studentReadStatus; private String teacherOpenCourseChatLogIdPlural; private String teacherOpenCourseChatLogParentIdPlural; private String teacherOpenCourseIdPlural; @@ -198,6 +201,8 @@ public class TeacherOpenCourseChatLogQuery extends PageParam { pojo.setChatLogSendType(ObjectUtil.defaultIfNull(this.getChatLogSendType(), normal)); pojo.setOrgId(this.getOrgId()); pojo.setUserId(this.getUserId()); + pojo.setTeacherReadStatus(this.getTeacherReadStatus()); + pojo.setStudentReadStatus(this.getStudentReadStatus()); return pojo; } @@ -292,4 +297,20 @@ public class TeacherOpenCourseChatLogQuery extends PageParam { public void setChatLogSendTypePlural(String chatLogSendTypePlural) { this.chatLogSendTypePlural = chatLogSendTypePlural; } + + public Integer getTeacherReadStatus() { + return teacherReadStatus; + } + + public void setTeacherReadStatus(Integer teacherReadStatus) { + this.teacherReadStatus = teacherReadStatus; + } + + public Integer getStudentReadStatus() { + return studentReadStatus; + } + + public void setStudentReadStatus(Integer studentReadStatus) { + this.studentReadStatus = studentReadStatus; + } } diff --git a/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md b/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md index 706f8bf4..1844323e 100644 --- a/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md +++ b/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md @@ -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 \ No newline at end of file + 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' \ No newline at end of file