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

develop
hhb@hotmail.com 4 weeks ago
parent a9c6c6a499
commit 4153162ff1

@ -139,11 +139,11 @@ public class TeacherServiceImpl implements TeacherService {
do {
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())) {
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 {
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();
if (ObjectUtils.isEmpty(content)) {

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

@ -19,11 +19,14 @@ public interface LessonRecordRepository extends CosmosRepository<LessonRecord, S
" c.tmdid = @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 ")
Slice<LessonRecord> findAllByAcademicYearId(String code, String tmdId,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) ")
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 ")
Slice<LessonRecord> findAll(String code,Pageable pageable);
@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) ")
Slice<LessonRecord> findAllByAcademicYearId(String code, String tmdId,String subjectId,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" +
"(IS_NULL(@subjectId) or c.subjectId = @subjectId) ")
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