package cn.com.qmth.examcloud.core.questions.dao;

import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
import cn.com.qmth.examcloud.core.questions.dao.entity.QuesTypeName;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import java.util.List;

/**
 * Created by songyue on 17/8/22.
 */
public interface QuesTypeNameRepo extends MongoRepository<QuesTypeName, String> {

    @Query(value = "{\"orgId\":?0,\"courseNo\":?1,\"questionType\":?2}")
    List<QuesTypeName> findQuesName(String orgId, String courseNo, QuesStructType quesType);

    @Query(value = "{\"orgId\":?0,\"questionType\":?1}")
    List<QuesTypeName> findQuesName(String orgId, QuesStructType quesType);

	void deleteByOrgId(String toRootOrgId);

	List<QuesTypeName> findByOrgId(Long fromRootOrgId);
}
