package com.ssj.dao.sys.award.dao;


import com.ssj.bean.sys.award.domain.AwardMaterial;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AwardMaterialDao extends JpaRepository<AwardMaterial, String>{
	
	@Query(nativeQuery = true, value = " SELECT * from tb_award_material t WHERE t.`level`=?1 AND t.`status`=1 ORDER BY t.create_time DESC ")
	public List<AwardMaterial> findAwardMaterialByLevel(Integer level);
	
	@Query(nativeQuery = true, value = " SELECT * from tb_award_material t WHERE t.`id`=?1 AND t.`status`=1 LIMIT 1 ")
	public AwardMaterial getAwardMaterialById(String id);
	
	
	
}
