package cn.com.qmth.stmms.biz.exam.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import cn.com.qmth.stmms.biz.exam.model.MarkerClass;

public interface MarkerClassDao extends PagingAndSortingRepository<MarkerClass, Integer>,
        JpaSpecificationExecutor<MarkerClass> {

    List<MarkerClass> findByMarkerId(int markerId);

    @Query("select count(s) from MarkerClass s where s.markerId=?1")
    public long countByMarkerId(int markerId);

    @Modifying
    @Query("delete MarkerClass c where c.markerId=?1 ")
    void deleteByMarkerId(int markerId);

}
