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; import java.util.Set; @Repository public interface StudentRepository extends CosmosRepository { @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 findByIdAndCode(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.code = @code and c.id in (@ids)") List findAllByCodeAndIdIn(String code, Set ids); int countByClassIdAndCode(String classId, String code); }