package com.reyun.repository;

import com.reyun.model.AttributeRestrict;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by song on 2017/9/28.
 */
public interface AttributeRestrictRepository extends JpaRepository<AttributeRestrict, Long> {

    @Query(value = "select * from attribute_restrict where attribute_name=?1 and type=?2 and app_key=?3", nativeQuery = true)
    AttributeRestrict findIsAllRestrictByNameAndType(String s, String profile,String appKey);

    @Query(value = "select * from attribute_restrict where app_key=?1 and type=?2 and attribute_name=?3",nativeQuery = true)
    AttributeRestrict findIsRestrictByAppIdAndType(String appKey,String profile,String attribute_name);
}
