package com.sysu.admin.support.system.config;

import com.xiesx.fastboot.core.jpa.JpaPlusRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface SConfigRepository extends JpaPlusRepository<SConfig, String> {

    @Query(value = "select * from sys_config where k=?1", nativeQuery = true)
    SConfig get(String k);

    @Transactional
    @Modifying
    @Query(value = "update sys_config set k=?1 where v=?2", nativeQuery = true)
    void set(String k, String v);
}
