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

import java.util.List;

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.MarkStep;

public interface MarkStepDao extends PagingAndSortingRepository<MarkStep, Integer> {

    @Query("select m from MarkStep m where m.pk.blockId=?1 order by m.pk.number")
    public List<MarkStep> findByBlockId(int blockId);

    @Query("select m from MarkStep m where m.pk.blockId=?1 and m.pk.number=?2")
    public List<MarkStep> findByBlockIdAndNumber(int blockId, int number);

    @Modifying
    @Query("delete from MarkStep m where m.pk.blockId=?1")
    public void deleteByBlockId(int blockId);
}
