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
25 lines
1.1 KiB
1 year ago
|
package cn.teammodel.repository;
|
||
2 years ago
|
|
||
2 years ago
|
import cn.teammodel.model.entity.school.Student;
|
||
2 years ago
|
import com.azure.spring.data.cosmos.repository.CosmosRepository;
|
||
2 years ago
|
import com.azure.spring.data.cosmos.repository.Query;
|
||
2 years ago
|
import org.springframework.stereotype.Repository;
|
||
|
|
||
2 years ago
|
import java.util.List;
|
||
2 years ago
|
import java.util.Set;
|
||
2 years ago
|
|
||
2 years ago
|
@Repository
|
||
|
public interface StudentRepository extends CosmosRepository<Student, String> {
|
||
2 years ago
|
|
||
1 year ago
|
@Deprecated
|
||
|
// 似乎会出现 irs 的重复问题,建议使用下面的 findByIdAndCode
|
||
2 years ago
|
Student findStudentByIdAndCode(String id, String code);
|
||
2 years ago
|
|
||
|
@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
|
|
||
1 year 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);
|
||
1 year ago
|
|
||
|
int countByClassIdAndCode(String classId, String code);
|
||
2 years ago
|
}
|