package com.reyun.repository;

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

import java.util.List;

/**
 * Created by sunhao on 17/3/2.
 */
public interface ConfigParamRepository extends JpaRepository<ConfigParam,Long> {

    @Query(value = "select value_param from config_param where key_param = ?1 ", nativeQuery = true)
    String findParamsByKey(String key);

    @Query(value = "select * from config_param where key_param in ?1 ", nativeQuery = true)
    List<ConfigParam> findParamsByKeys(List<String> keys);
}
