package com.yihu.wlyy.repository.job;

import com.yihu.wlyy.entity.job.QuartzJobConfig;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by Administrator on 2016/8/17.
 */
public interface QuartzJobConfigDao extends PagingAndSortingRepository<QuartzJobConfig, String>, JpaSpecificationExecutor<QuartzJobConfig> {

    @Query(" FROM QuartzJobConfig a WHERE a.id=?1 and a.status=?2 and a.del='1'")
    QuartzJobConfig findById(String code, String status);

    @Query(" FROM QuartzJobConfig a WHERE a.status=?1 and a.del='1'")
    List<QuartzJobConfig> findByAll(String s);

    @Query(" FROM QuartzJobConfig a WHERE a.id in (1,2,3,4,5,6,7,8,9,10,12)  and a.del='1' ")
    List<QuartzJobConfig> findByIds();

    @Query(" FROM QuartzJobConfig a WHERE a.id=?1 and a.del='1'")
    QuartzJobConfig findById(String id);
}
