package org.dromara.system.mapper;

import org.dromara.system.domain.VsNavBottomIcon;
import org.dromara.system.domain.vo.VsNavBottomIconVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 底部图标导航表Mapper接口
 *
 * @author system
 * @date 2025-01-20
 */
public interface VsNavBottomIconMapper extends BaseMapperPlus<VsNavBottomIcon, VsNavBottomIconVo> {

    /**
     * 获取启用的底部图标导航列表
     */
    List<VsNavBottomIconVo> getEnabledIconList();

    /**
     * 根据业务类型获取图标导航列表
     */
    List<VsNavBottomIconVo> getIconListByBizType(Integer bizType);

    /**
     * 更新所有记录的颜色设置
     */
    @Update("UPDATE common_vs_nav_bottom_icon SET text_selected_color = #{selectedTextColor}, text_unselected_color = #{unselectedTextColor}")
    int updateAllColorSettings(@Param("selectedTextColor") String selectedTextColor,
                              @Param("unselectedTextColor") String unselectedTextColor);

    /**
     * 获取颜色设置（从第一条记录获取）
     */
    @Select("SELECT text_selected_color as selectedTextColor, text_unselected_color as unselectedTextColor FROM common_vs_nav_bottom_icon LIMIT 1")
    Map<String, String> getColorSettings();
}
