package com.fs.delivery.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.delivery.mapper.TagGroupMapper;
import com.fs.delivery.domain.TagGroup;
import com.fs.delivery.service.ITagGroupService;

/**
 * 标签分组Service业务层处理
 * 
 * @author fs
 * @date 2026-01-20
 */
@Service
public class TagGroupServiceImpl implements ITagGroupService 
{
    @Autowired
    private TagGroupMapper tagGroupMapper;

    /**
     * 查询标签分组
     * 
     * @param id 标签分组主键
     * @return 标签分组
     */
    @Override
    public TagGroup selectTagGroupById(Long id)
    {
        return tagGroupMapper.selectTagGroupById(id);
    }

    /**
     * 查询标签分组列表
     * 
     * @param tagGroup 标签分组
     * @return 标签分组
     */
    @Override
    public List<TagGroup> selectTagGroupList(TagGroup tagGroup)
    {
        return tagGroupMapper.selectTagGroupList(tagGroup);
    }

    /**
     * 新增标签分组
     * 
     * @param tagGroup 标签分组
     * @return 结果
     */
    @Override
    public int insertTagGroup(TagGroup tagGroup)
    {
        tagGroup.setCreateTime(DateUtils.getNowDate());
        return tagGroupMapper.insertTagGroup(tagGroup);
    }

    /**
     * 修改标签分组
     * 
     * @param tagGroup 标签分组
     * @return 结果
     */
    @Override
    public int updateTagGroup(TagGroup tagGroup)
    {
        tagGroup.setUpdateTime(DateUtils.getNowDate());
        return tagGroupMapper.updateTagGroup(tagGroup);
    }

    /**
     * 批量删除标签分组
     * 
     * @param ids 需要删除的标签分组主键
     * @return 结果
     */
    @Override
    public int deleteTagGroupByIds(Long[] ids)
    {
        return tagGroupMapper.deleteTagGroupByIds(ids);
    }

    /**
     * 删除标签分组信息
     * 
     * @param id 标签分组主键
     * @return 结果
     */
    @Override
    public int deleteTagGroupById(Long id)
    {
        return tagGroupMapper.deleteTagGroupById(id);
    }
}
