package cn.com.qmth.stmms.ms.core.repository;

import cn.com.qmth.stmms.ms.core.domain.ChangeLevel;
import cn.com.qmth.stmms.ms.core.domain.Paper;
import cn.com.qmth.stmms.ms.core.vo.Subject;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ChangeLevelRepo extends JpaRepository<ChangeLevel, Long>, JpaSpecificationExecutor {
    ChangeLevel findByWorkIdAndSubjectAndPaperId(Long workId, String subject, Long paperId);

    @Query("select s from ChangeLevel s where s.workId = ?1 and s.subject = ?2 and s.auditStatus = 1")
    List<ChangeLevel> findByWorkIdAndSubjectAndAuditStatus(Long workId, String name);
}
