From de621c854163278b7bc1d6b759bbf297c016a46f Mon Sep 17 00:00:00 2001 From: "hhb@hotmail.com" Date: Tue, 26 Nov 2024 17:36:49 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=8A=A0=E4=B8=8A=E7=A7=91=E7=9B=AE?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/service/impl/TeacherServiceImpl.java | 2 +- .../java/cn/teammodel/repository/LessonRecordRepository.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java b/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java index 3b9f332..4722080 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java +++ b/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java @@ -188,7 +188,7 @@ public class TeacherServiceImpl implements TeacherService { long startTimestamp = startDatetime.toInstant(ZoneOffset.UTC).toEpochMilli(); long endTimestamp = endDatetime.toInstant(ZoneOffset.UTC).toEpochMilli(); - List lessonRecords = lessonRecordRepository.getLessonsByConditions(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), startTimestamp, endTimestamp, teacherDto.getTmdId()); + List lessonRecords = lessonRecordRepository.getLessonsByConditions(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), startTimestamp, endTimestamp, teacherDto.getSubjectId(),teacherDto.getTmdId()); int[] counts = {0, 0, 0, 0, 0}; String[] keys = {"cooperation", "internet", "task", "exam", "diffential"}; diff --git a/src/main/java/cn/teammodel/repository/LessonRecordRepository.java b/src/main/java/cn/teammodel/repository/LessonRecordRepository.java index ca88428..6aa1cb3 100644 --- a/src/main/java/cn/teammodel/repository/LessonRecordRepository.java +++ b/src/main/java/cn/teammodel/repository/LessonRecordRepository.java @@ -15,9 +15,10 @@ public interface LessonRecordRepository extends CosmosRepository= @startTime) and " + - "(IS_NULL(@endTime) or c.startTime <= @endTime) and" + + "(IS_NULL(@endTime) or c.startTime <= @endTime) and"+ + "(IS_NULL(@subjectId) or c.subjectId = @subjectId) and"+ " c.tmdid = @tmdId") - List getLessonsByConditions(String code, Long startTime, Long endTime,String tmdId); + List getLessonsByConditions(String code, Long startTime, Long endTime,String subjectId,String tmdId); @Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and c.tmdid = @tmdId and " + "(IS_NULL(@subjectId) or c.subjectId = @subjectId) ")