package cn.teammodel.repository;

import cn.teammodel.model.entity.school.SchoolTeacher;
import cn.teammodel.model.entity.school.Teacher;
import com.azure.spring.data.cosmos.repository.CosmosRepository;
import com.azure.spring.data.cosmos.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

@Repository
public interface SchoolTeacherRepository extends CosmosRepository<SchoolTeacher, String> {
    @Query("select c.id, c.name,c.job,c.subjectIds from SchoolTeacher as c where c.code = @code")
    List<SchoolTeacher> findAllByCode(String code);
    @Query("select c.id from SchoolTeacher as c where c.code = @code and c.id in (@ids)")
    List<SchoolTeacher> findAllByCodeAndIdIn(String code, Collection<String> ids);
}
