diff --git a/doc/sql/mysql/tianze-pro-update.sql b/doc/sql/mysql/tianze-pro-update.sql index a3896340..da4b11a9 100644 --- a/doc/sql/mysql/tianze-pro-update.sql +++ b/doc/sql/mysql/tianze-pro-update.sql @@ -321,3 +321,6 @@ create table teacher_open_course_merge_schedule_session COLLATE = utf8_general_ci; alter table teacher_open_course_merge_schedule_session comment '课程开课-关联-排课配置'; + + +ALTER TABLE teacher_open_course_chat_log ADD COLUMN chat_log_send_type varchar(50) COMMENT '发送类型 枚举(ChatLogSendTypeEnum)'; diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseChatLog.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseChatLog.java index b293b438..7d74a369 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseChatLog.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseChatLog.java @@ -3,6 +3,7 @@ package com.ibeetl.jlw.entity; import com.ibeetl.admin.core.annotation.Dict; import com.ibeetl.admin.core.entity.BaseEntity; import com.ibeetl.admin.core.util.ValidateConfig; +import com.ibeetl.jlw.enums.ChatLogSendTypeEnum; import lombok.Data; import lombok.EqualsAndHashCode; import org.beetl.sql.annotation.entity.AssignID; @@ -75,6 +76,10 @@ public class TeacherOpenCourseChatLog extends BaseEntity{ //学生得分 private BigDecimal studentScore ; + + // 提问方式 + + private ChatLogSendTypeEnum chatLogSendType; //附件上传(仅支持图片,多个逗号隔开) 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 3d8c8b82..89434224 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 @@ -4,6 +4,7 @@ import cn.jlw.validate.ValidateConfig; import com.ibeetl.admin.core.annotation.Query; import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.jlw.entity.TeacherOpenCourseChatLog; +import com.ibeetl.jlw.enums.ChatLogSendTypeEnum; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @@ -49,8 +50,8 @@ public class TeacherOpenCourseChatLogQuery extends PageParam { private String keywords; @Query(name = "学生得分", display = false) private BigDecimal studentScore; -// @Query(name = "提问方式", display = false) -// private SendTypeEnum sendType; + @Query(name = "提问方式", display = false) + private ChatLogSendTypeEnum chatLogSendType; @Query(name = "附件上传(仅支持图片,多个逗号隔开)", display = false) private String chatFiles; @@ -63,6 +64,9 @@ public class TeacherOpenCourseChatLogQuery extends PageParam { @Query(name = "用户ID", display = false) private Long userId; + @Query(name = "回复状态 1 待回复 2已回复", display = false) + private Integer replyStatus; + private String teacherOpenCourseChatLogIdPlural; private String teacherOpenCourseChatLogParentIdPlural; private String teacherOpenCourseIdPlural; @@ -240,4 +244,20 @@ public class TeacherOpenCourseChatLogQuery extends PageParam { public void set_given(String _given) { this._given = _given; } + + public ChatLogSendTypeEnum getChatLogSendType() { + return chatLogSendType; + } + + public void setChatLogSendType(ChatLogSendTypeEnum chatLogSendType) { + this.chatLogSendType = chatLogSendType; + } + + public Integer getReplyStatus() { + return replyStatus; + } + + public void setReplyStatus(Integer replyStatus) { + this.replyStatus = replyStatus; + } } diff --git a/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md b/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md index 7d9e5e0f..cc1c2f63 100644 --- a/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md +++ b/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md @@ -53,7 +53,7 @@ queryByCondition and t.chat_content =#chatContent# @} @if(!isEmpty(keywords)){ - and t.keywords =#keywords# + and t.keywords like #"%"+keywords+"%"# @} @if(!isEmpty(studentScore)){ and t.student_score =#studentScore# @@ -61,6 +61,9 @@ queryByCondition @if(!isEmpty(chatFiles)){ and t.chat_files =#chatFiles# @} + @if(!isEmpty(chatLogSendType)){ + and t.chat_log_send_type =#chatLogSendType# + @} @if(isEmpty(teacherOpenCourseChatLogStatus) && isEmpty(teacherOpenCourseChatLogStatusPlural)){ and t.teacher_open_course_chat_log_status != 2 @}else{ @@ -90,6 +93,26 @@ queryByCondition order by teacher_open_course_chat_log_add_time desc @} @} + @if(!isEmpty(replyStatus)){ + and + @// 待回复的消息 + @if(replyStatus == 1) { + NOT + @} + @if(replyStatus == 1) { + @// 这里留空,代表查询已回复的消息 + @} + EXISTS ( + SELECT + 1 + FROM + teacher_open_course_chat_log ta + WHERE + ta.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id + AND ta.teacher_open_course_chat_log_status = 1 + ) + @} + queryByConditionQuery @@ -139,7 +162,7 @@ queryByConditionQuery and t.chat_content =#chatContent# @} @if(!isEmpty(keywords)){ - and t.keywords =#keywords# + and t.keywords like #"%"+keywords+"%"# @} @if(!isEmpty(studentScore)){ and t.student_score =#studentScore# @@ -147,6 +170,9 @@ queryByConditionQuery @if(!isEmpty(chatFiles)){ and t.chat_files =#chatFiles# @} + @if(!isEmpty(chatLogSendType)){ + and t.chat_log_send_type =#chatLogSendType# + @} @if(isEmpty(teacherOpenCourseChatLogStatus) && isEmpty(teacherOpenCourseChatLogStatusPlural)){ and t.teacher_open_course_chat_log_status != 2 @}else{ @@ -268,6 +294,13 @@ updateGivenByIds chat_files = #chatFiles# , @} @} + @if(contain("chatLogSendType",_given)){ + @if(isEmpty(chatLogSendType)){ + chat_log_send_type = null , + @}else{ + chat_log_send_type = #chatLogSendType# , + @} + @} @if(contain("teacherOpenCourseChatLogStatus",_given)){ @if(isEmpty(teacherOpenCourseChatLogStatus)){ teacher_open_course_chat_log_status = null , @@ -331,7 +364,7 @@ getTeacherOpenCourseChatLogValues and t.chat_content =#chatContent# @} @if(!isEmpty(keywords)){ - and t.keywords =#keywords# + and t.keywords like #"%"+keywords+"%"# @} @if(!isEmpty(studentScore)){ and t.student_score =#studentScore# @@ -339,6 +372,9 @@ getTeacherOpenCourseChatLogValues @if(!isEmpty(chatFiles)){ and t.chat_files =#chatFiles# @} + @if(!isEmpty(chatLogSendType)){ + and t.chat_log_send_type =#chatLogSendType# + @} @if(!isEmpty(teacherOpenCourseChatLogStatus)){ and t.teacher_open_course_chat_log_status =#teacherOpenCourseChatLogStatus# @}else{ @@ -400,7 +436,7 @@ getValuesByQuery and t.chat_content =#chatContent# @} @if(!isEmpty(keywords)){ - and t.keywords =#keywords# + and t.keywords like #"%"+keywords+"%"# @} @if(!isEmpty(studentScore)){ and t.student_score =#studentScore# @@ -408,6 +444,9 @@ getValuesByQuery @if(!isEmpty(chatFiles)){ and t.chat_files =#chatFiles# @} + @if(!isEmpty(chatLogSendType)){ + and t.chat_log_send_type =#chatLogSendType# + @} @if(isEmpty(teacherOpenCourseChatLogStatus) && isEmpty(teacherOpenCourseChatLogStatusPlural)){ and t.teacher_open_course_chat_log_status != 2 @}else{ @@ -478,7 +517,7 @@ getValuesByQueryNotWithPermission and t.chat_content =#chatContent# @} @if(!isEmpty(keywords)){ - and t.keywords =#keywords# + and t.keywords like #"%"+keywords+"%"# @} @if(!isEmpty(studentScore)){ and t.student_score =#studentScore# @@ -486,6 +525,9 @@ getValuesByQueryNotWithPermission @if(!isEmpty(chatFiles)){ and t.chat_files =#chatFiles# @} + @if(!isEmpty(chatLogSendType)){ + and t.chat_log_send_type =#chatLogSendType# + @} @if(isEmpty(teacherOpenCourseChatLogStatus) && isEmpty(teacherOpenCourseChatLogStatusPlural)){ and t.teacher_open_course_chat_log_status != 2 @}else{