package com.erp.dashboard.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.erp.dashboard.entity.SystemConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 系统配置Repository
 */
@Mapper
public interface SystemConfigRepository extends BaseMapper<SystemConfig> {

    /**
     * 获取配置值
     */
    @Select("""
        SELECT value 
        FROM system_configs 
        WHERE `group` = #{group} AND `key` = #{key} 
          AND deleted_at IS NULL 
        LIMIT 1
        """)
    String getValue(@Param("group") String group, @Param("key") String key);
}
