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

import cn.com.qmth.examcloud.core.questions.dao.entity.Property;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.repository.query.QueryByExampleExecutor;

import java.util.List;

/**
 * @author weiwenhai
 * @describle 课程属性repo
 * @date 2017.11.6
 */
public interface PropertyRepo extends MongoRepository<Property, String>, QueryByExampleExecutor<Property> {

    //查询所有节点
    List<Property> findByOrgIdAndCoursePropertyIdAndParentIdOrderByNumber(Long orgId, String coursePropertyId, String parentId);

    //查询子节点
    List<Property> findByParentIdOrderByNumber(String parentId);

	//根据课程属性id，一级id，属性名称查询
    Property findByOrgIdAndCoursePropertyIdAndParentIdAndCode(Long orgId, String coursePropertyId, String parentId, String code);

	List<Property> findByCoursePropertyIdOrderByNumber(String id);

	List<Property> findByOrgId(Long fromRootOrgId);

	void deleteByOrgIdAndBatch(Long rootOrgId, String batch);

	Property findByCoursePropertyIdAndFromId(String coursePropertyId,String string);

}