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

import cn.com.qmth.stmms.biz.mark.model.MarkSpecialTag;
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 java.util.List;

/**
 * @ClassName MarkSpecialTagDao
 * @Description TODO
 * @Author nikang
 * @Date 2018/9/4 20:51
 * @Version 1.0
 */
public interface MarkSpecialTagDao extends PagingAndSortingRepository<MarkSpecialTag, Integer>,
        JpaSpecificationExecutor<MarkSpecialTag> {

    @Modifying
    @Query("delete from MarkSpecialTag s where s.libraryId = ?1")
    public void deleteByLibraryId(Integer libraryId);

    public List<MarkSpecialTag> findByLibraryIdOrderByIdAsc(Integer libraryId);

}
