/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.wlyy.repository.advert;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.yihu.wlyy.entity.advert.Advert;

public interface AdvertDao extends PagingAndSortingRepository<Advert, Long>, JpaSpecificationExecutor<Advert> {
	
	@Query("select a from Advert a where a.type = ?1 and del = '1'")
	Page<Advert> findByType(int type, Pageable pageRequest);
	
}
