移动组

This commit is contained in:
2026-08-24 11:33:04 +08:00
parent f69a5c2182
commit af7d17c9c5
11 changed files with 505 additions and 12 deletions
@@ -16,5 +16,15 @@ import java.util.Optional;
@Repository
public interface SchClassHistoryRepository extends JpaRepository<SchClassHistory, Integer>, JpaSpecificationExecutor<SchClassHistory> {
/**
* 按学校、班级组(classId=group_class_id)、学年、学期查询班级历史快照
* 历史任教统一取第二学期(term=2)
*/
List<SchClassHistory> findBySchIdAndClassIdAndYearAndTerm(Integer schId, Integer classId, Integer year, Integer term);
/**
* 取某班级最新学年的第二学期(term=2)历史快照,用于“历史学生”页班级头信息
*/
SchClassHistory findTopBySchIdAndClassIdAndTermOrderByYearDesc(Integer schId, Integer classId, Integer term);
}
@@ -6,7 +6,15 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SchClassTeachHistoryRepository extends JpaRepository<SchClassTeachHistory, Integer>, JpaSpecificationExecutor<SchClassTeachHistory> {
/**
* 按学校、班级组(classId=group_class_id)、学年、学期查询班级任教历史
* 历史任教统一取第二学期(term=2)
*/
List<SchClassTeachHistory> findBySchIdAndClassIdAndYearAndTerm(Integer schId, Integer classId, Integer year, Integer term);
}
@@ -6,7 +6,18 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SchStudentHistoryRepository extends JpaRepository<SchStudentHistory, Integer>, JpaSpecificationExecutor<SchStudentHistory> {
/**
* 按学校、班级、学年、学期查询历史学生(term=2 为学年快照)
*/
List<SchStudentHistory> findBySchIdAndClassIdAndYearAndTerm(Integer schId, Integer classId, Integer year, Integer term);
/**
* 按学校、学生(stuId)查询历史学生记录,用于解析学生所属班级
*/
List<SchStudentHistory> findBySchIdAndStuId(Integer schId, Integer stuId);
}