package com.pig4cloud.pig.statistics.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pig4cloud.pig.statistics.api.entity.ConfigItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author wcl
 * @date 2025/8/20 17:00
 * @description: 统计配置表Mapper
 */
@Mapper
public interface StatConfigMapper extends BaseMapper<ConfigItem> {
    
    /**
     * 根据配置键查询配置项
     * @param configKey 配置键
     * @return 配置项列表
     */
    @Select("SELECT config_key as name, config_value as value, config_label as label " +
            "FROM stat_config " +
            "WHERE config_key = #{configKey} AND enable = 1 " +
            "ORDER BY sort ASC")
    List<ConfigItem> selectByConfigKey(String configKey);
}
