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.

24 lines
878 B

package cn.teammodel.repository;
import cn.teammodel.model.entity.school.ClassInfo;
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;
/**
* @author winter
* @create 2023-12-01 16:37
*/
@Repository
public interface ClassRepository extends CosmosRepository<ClassInfo, String> {
ClassInfo findClassByIdAndCode(String targetId, String code);
@Query("select c.id, c.name from School as c where c.code = @code and c.id in (@ids)")
List<ClassInfo> findAllByCodeAndIdIn(String code, Collection<String> ids);
@Query("select c.id, c.name,c.year,c.periodId from School as c where c.periodId = @periodId and c.pk = 'Class'")
List<ClassInfo> findClassBySchoolIdAndPeriodId(String periodId);
}