You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.1 KiB

package cn.teammodel.repository;
import cn.teammodel.model.entity.school.Student;
import com.azure.spring.data.cosmos.repository.CosmosRepository;
import com.azure.spring.data.cosmos.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
2 years ago
import java.util.Set;
@Repository
public interface StudentRepository extends CosmosRepository<Student, String> {
@Deprecated
// 似乎会出现 irs 的重复问题,建议使用下面的 findByIdAndCode
Student findStudentByIdAndCode(String id, String code);
@Query("select c.pk, c.code, c.id, c.name, c.gender, c.schoolId, c.periodId, c.year, c.createTime, c.picture, c.mail, c.mobile, c.country, c.classId, c.no, c.groupId, c.groupName, c.guardians, c.irs, c.salt from Student as c where c.id = @id and c.code = @code")
List<Student> findByIdAndCode(String id, String code);
2 years ago
@Query("select c.id, c.name, c.classId, c.picture from Student as c where c.code = @code and c.id in (@ids)")
2 years ago
List<Student> findAllByCodeAndIdIn(String code, Set<String> ids);
int countByClassIdAndCode(String classId, String code);
}