package com.cool.store.dao.dict;

import com.cool.store.entity.dict.SysDictGroupDO;
import com.cool.store.mapper.dict.SysDictGroupMapper;
import com.cool.store.request.dict.DictGroupQueryRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 字典分组DAO
 * </p>
 *
 * @author wangff
 * @since 2025/9/26
 */
@Repository
@RequiredArgsConstructor
public class SysDictGroupDAO {
    private final SysDictGroupMapper sysDictGroupMapper;

    /**
     * 根据id查询
     * @param id id
     * @return 字典分组表
     */
    public SysDictGroupDO getById(Long id) {
        return sysDictGroupMapper.selectById(id);
    }

    /**
     * 查询列表
     * @param dto 字典分组查询DTO
     * @return 字典分组表列表
     */
    public List<SysDictGroupDO> getList(DictGroupQueryRequest dto) {
        return sysDictGroupMapper.selectList(dto);
    }
}
