update 每周不同层级课例数据加上科目内容

develop
hhb@hotmail.com 1 month ago
parent a9c6c6a499
commit 4153162ff1

@ -139,11 +139,11 @@ public class TeacherServiceImpl implements TeacherService {
do { do {
if(StringUtils.isNotEmpty(teacherDto.getGrade())) { if(StringUtils.isNotEmpty(teacherDto.getGrade())) {
slice = lessonRecordRepository.findAllByGrade(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getGrade(),pageRequest); slice = lessonRecordRepository.findAllByGrade(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getGrade(),teacherDto.getSubjectId(),pageRequest);
} else if(StringUtils.isNotEmpty(teacherDto.getTmdId())) { } else if(StringUtils.isNotEmpty(teacherDto.getTmdId())) {
slice = lessonRecordRepository.findAllByAcademicYearId(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getTmdId(),pageRequest); slice = lessonRecordRepository.findAllByAcademicYearId(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getTmdId(),teacherDto.getSubjectId(),pageRequest);
} else { } else {
slice = lessonRecordRepository.findAll(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), pageRequest); slice = lessonRecordRepository.findAll(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getSubjectId(), pageRequest);
} }
List<LessonRecord> content = slice.getContent(); List<LessonRecord> content = slice.getContent();
if (ObjectUtils.isEmpty(content)) { if (ObjectUtils.isEmpty(content)) {

@ -18,4 +18,6 @@ public class TeacherDto {
public Integer year; public Integer year;
@ApiModelProperty("年级") @ApiModelProperty("年级")
public String grade; public String grade;
@ApiModelProperty("科目信息")
public String subjectId;
} }

@ -19,11 +19,14 @@ public interface LessonRecordRepository extends CosmosRepository<LessonRecord, S
" c.tmdid = @tmdId") " c.tmdid = @tmdId")
List<LessonRecord> getLessonsByConditions(String code, Long startTime, Long endTime,String tmdId); List<LessonRecord> getLessonsByConditions(String code, Long startTime, Long endTime,String tmdId);
@Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and c.tmdid = @tmdId ") @Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and c.tmdid = @tmdId and " +
Slice<LessonRecord> findAllByAcademicYearId(String code, String tmdId,Pageable pageable); "(IS_NULL(@subjectId) or c.subjectId = @subjectId) ")
@Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and array_contains(c.grade,@grade) ") Slice<LessonRecord> findAllByAcademicYearId(String code, String tmdId,String subjectId,Pageable pageable);
Slice<LessonRecord> findAllByGrade(String code, String grade,Pageable pageable); @Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and array_contains(c.grade,@grade) and" +
@Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 ") "(IS_NULL(@subjectId) or c.subjectId = @subjectId) ")
Slice<LessonRecord> findAll(String code,Pageable pageable); Slice<LessonRecord> findAllByGrade(String code, String grade,String subjectId,Pageable pageable);
@Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and " +
"(IS_NULL(@subjectId) or c.subjectId = @subjectId) ")
Slice<LessonRecord> findAll(String code,String subjectId,Pageable pageable);
} }

Loading…
Cancel
Save