From 4e4cc5f6a71522dc4d7b83416e1b94b846be47cc Mon Sep 17 00:00:00 2001 From: Mlxa0324 Date: Tue, 29 Nov 2022 22:21:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E7=9B=AE=E5=AE=8C=E6=88=90=E7=94=A8?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data_base_design/天泽数据大平台.pdb | 8 +++--- data_base_design/天泽数据大平台.pdm | 8 +++--- doc/sql/mysql/tianze-pro-update.sql | 4 +-- .../ibeetl/jlw/entity/GeneralQuestionLog.java | 2 +- .../entity/TeacherOpenCourseQuestionLog.java | 2 +- ...TeacherOpenCourseQuestionLogScoreInfo.java | 26 ++++++++++--------- .../TeacherOpenCourseQuestionSetting.java | 4 +-- .../service/GeneralQuestionLogService.java | 6 ++--- .../TeacherOpenCourseQuestionLogService.java | 6 ++--- .../web/query/GeneralQuestionLogQuery.java | 2 +- .../TeacherOpenCourseQuestionLogQuery.java | 2 +- 11 files changed, 36 insertions(+), 34 deletions(-) diff --git a/data_base_design/天泽数据大平台.pdb b/data_base_design/天泽数据大平台.pdb index 95793849..bf31bc20 100644 --- a/data_base_design/天泽数据大平台.pdb +++ b/data_base_design/天泽数据大平台.pdb @@ -15090,8 +15090,8 @@ COLLATE = utf8_general_ci 87966 1669379179 lx -总用时(分钟) -int(10) +总用时(秒) +bigint(15) 10 @@ -20440,8 +20440,8 @@ COLLATE = utf8_general_ci 87966 1669368784 87966 -总用时(分钟) -int(10) +总用时(秒) +bigint(15) 10 diff --git a/data_base_design/天泽数据大平台.pdm b/data_base_design/天泽数据大平台.pdm index e3b7d3b0..07569a30 100644 --- a/data_base_design/天泽数据大平台.pdm +++ b/data_base_design/天泽数据大平台.pdm @@ -15090,8 +15090,8 @@ COLLATE = utf8_general_ci 87966 1669379179 lx -总用时(分钟) -int(10) +总用时(秒) +bigint(15) 10 @@ -20440,8 +20440,8 @@ COLLATE = utf8_general_ci 87966 1669368784 87966 -总用时(分钟) -int(10) +总用时(秒) +bigint(15) 10 diff --git a/doc/sql/mysql/tianze-pro-update.sql b/doc/sql/mysql/tianze-pro-update.sql index 7a722ffc..7bf22eb6 100644 --- a/doc/sql/mysql/tianze-pro-update.sql +++ b/doc/sql/mysql/tianze-pro-update.sql @@ -366,7 +366,7 @@ ALTER TABLE teacher_open_course_question_log ADD COLUMN question_analysis varcha ALTER TABLE teacher_open_course_question_log ADD COLUMN is_tuck int(2) default 0 COMMENT '是否收藏夹'; ALTER TABLE teacher_open_course_question_log ADD COLUMN is_error_favorite int(2) default 0 COMMENT '是否错题库'; ALTER TABLE teacher_open_course_question_log ADD COLUMN teacher_open_course_question_log_update_time datetime COMMENT '修改时间'; -ALTER TABLE teacher_open_course_question_log ADD COLUMN teacher_open_course_question_log_finish_time int(10) default 1 COMMENT '总用时(分钟)'; +ALTER TABLE teacher_open_course_question_log ADD COLUMN teacher_open_course_question_log_finish_time bigint(15) default 1 COMMENT '总用时(秒)'; ALTER TABLE teacher_open_course_question_log ADD COLUMN teacher_open_course_question_log_reply varchar(300) COMMENT '评语'; ALTER TABLE teacher_open_course_question_log ADD COLUMN question_log_add_type varchar(50) COMMENT '题目添加类型(枚举 QuestionLogAddTypeEnum)'; @@ -443,7 +443,7 @@ CREATE TABLE `general_question_log` ( `is_tuck` int(2) DEFAULT NULL COMMENT '是否收藏夹', `is_error_favorite` int(2) DEFAULT NULL COMMENT '是否错题库', `general_question_log_update_time` datetime COMMENT '修改时间', - `general_question_log_finish_time` int(10) default 1 COMMENT '总用时(分钟)', + `general_question_log_finish_time` bigint(10) default 1 COMMENT '总用时(秒)', `general_question_log_reply` varchar(300) default 1 COMMENT '评语', `question_log_add_type` varchar(50) COMMENT '题目添加类型(枚举 QuestionLogAddTypeEnum)', `org_id` bigint(20) DEFAULT NULL COMMENT '组织ID', diff --git a/web/src/main/java/com/ibeetl/jlw/entity/GeneralQuestionLog.java b/web/src/main/java/com/ibeetl/jlw/entity/GeneralQuestionLog.java index 5bdf354f..cb3882c3 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/GeneralQuestionLog.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/GeneralQuestionLog.java @@ -125,7 +125,7 @@ public class GeneralQuestionLog extends BaseEntity{ private Date generalQuestionLogUpdateTime ; - //用时(分钟) + //用时(秒) private Long generalQuestionLogFinishTime ; diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLog.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLog.java index abf7d021..f1bda63f 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLog.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLog.java @@ -127,7 +127,7 @@ public class TeacherOpenCourseQuestionLog extends BaseEntity { private Date teacherOpenCourseQuestionLogUpdateTime ; - //用时(分钟) + //用时(秒) private Long teacherOpenCourseQuestionLogFinishTime ; diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLogScoreInfo.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLogScoreInfo.java index c8081d2d..aa8aecab 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLogScoreInfo.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionLogScoreInfo.java @@ -108,18 +108,7 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity { /** * 完成用时 */ -// @FetchSql(value = "SELECT max(TIMEDIFF( t.teacher_open_course_question_log_update_time , t.teacher_open_course_question_log_add_time )) as finish_time " + -// "FROM teacher_open_course_question_log t " + -// "WHERE t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" + -// "@if(!isEmpty(studentId)) { \n" + -// "and t.student_id = #studentId# \n" + -// "@} \n" + -// "and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# " + -// "AND t.teacher_open_course_question_log_update_time IS NOT NULL " -// ) -// private String finishTime; - - @FetchSql(value = "SELECT max(ifnull(t.teacher_open_course_question_log_finish_time , 0)) as finish_time " + + @FetchSql(value = "SELECT max(TIMEDIFF( t.teacher_open_course_question_log_update_time , t.teacher_open_course_question_log_add_time )) as finish_time " + "FROM teacher_open_course_question_log t " + "WHERE t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" + "@if(!isEmpty(studentId)) { \n" + @@ -129,6 +118,19 @@ public class TeacherOpenCourseQuestionLogScoreInfo extends BaseEntity { "AND t.teacher_open_course_question_log_update_time IS NOT NULL " ) private String finishTime; +// /** +// * 完成用时 的第二种实现 +// */ +// @FetchSql(value = "SELECT max(ifnull(t.teacher_open_course_question_log_finish_time , 0)) as finish_time " + +// "FROM teacher_open_course_question_log t " + +// "WHERE t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' \n" + +// "@if(!isEmpty(studentId)) { \n" + +// "and t.student_id = #studentId# \n" + +// "@} \n" + +// "and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# " + +// "AND t.teacher_open_course_question_log_update_time IS NOT NULL " +// ) +// private String finishTime; public void setCorrectCount(Integer correctCount) { this.correctCount = correctCount; diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionSetting.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionSetting.java index 29b33567..3ac02089 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionSetting.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionSetting.java @@ -229,14 +229,14 @@ public class TeacherOpenCourseQuestionSetting extends BaseEntity { private String resourcesQuestionIdPlural; /** - * 用时(分钟) + * 用时(秒) */ @UpdateIgnore @InsertIgnore @FetchSql("select max(ifnull(t.teacher_open_course_question_log_finish_time , 0)) from teacher_open_course_question_log t " + "where t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# " + "and t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT'") - private long finishTime; + private String finishTime; /** * 我的得分 diff --git a/web/src/main/java/com/ibeetl/jlw/service/GeneralQuestionLogService.java b/web/src/main/java/com/ibeetl/jlw/service/GeneralQuestionLogService.java index cba19878..b6fef67e 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/GeneralQuestionLogService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/GeneralQuestionLogService.java @@ -48,7 +48,7 @@ import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; -import static cn.hutool.core.date.DateUnit.MINUTE; +import static cn.hutool.core.date.DateUnit.SECOND; import static cn.hutool.core.util.ArrayUtil.join; import static cn.jlw.util.CacheUserUtil.getStudent; import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue; @@ -574,11 +574,11 @@ public class GeneralQuestionLogService extends CoreBaseService