package com.zioinfo.signage.admin.mapper;

import com.zioinfo.signage.admin.dto.SignageSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 시스템 설정 매퍼. @Mapper 어노테이션 필수
 * (SignageApplication 의 @MapperScan(annotationClass = Mapper.class) 패턴).
 */
@Mapper
public interface SettingMapper {

    List<SignageSetting> findAll(@Param("category") String category);

    SignageSetting findByKey(@Param("settingKey") String settingKey);

    /** upsert (ON CONFLICT). description/category 는 신규 INSERT 시에만 사용. */
    int upsert(@Param("settingKey") String settingKey,
               @Param("settingValue") String settingValue,
               @Param("category") String category,
               @Param("description") String description);
}
