package com.reyun.repository;

import com.reyun.model.ComplicatedParam;
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/9/21.
 * 复杂事件操作符配置
 */
public interface ComplicatedParamRepository extends JpaRepository<ComplicatedParam, Long> {

    @Query(value = "select * from complicated_param where valid is true ", nativeQuery = true)
    List<ComplicatedParam> findAllParam();

    @Query(value = "SELECT * FROM complicated_param WHERE view_attr_name = ?1 AND valid is true", nativeQuery = true)
    ComplicatedParam findComplicateOperator(String operator);
}
