package com.reyun.repository;

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

import java.util.List;

/**
 * Created by sunhao on 17/4/11.
 * desc:事件分析展示属性
 */
public interface EventViewAttrRepository extends JpaRepository<EventViewAttr,Long>{

    @Query(value = "select * from event_view_attr where valid is true ", nativeQuery = true)
    List<EventViewAttr> findEventViewAttr();

    @Query(value = "SELECT * FROM event_view_attr WHERE `view_attr_name`=?1 AND valid is true", nativeQuery = true)
    EventViewAttr findEventViewAttr(String viewAttrName);
}
