package com.playlet.system.service.impl;

import java.util.List;
import com.playlet.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.playlet.system.mapper.PublicDeptTagsMapper;
import com.playlet.system.domain.PublicDeptTags;
import com.playlet.system.service.IPublicDeptTagsService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 文章标签Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-14
 */
@Service
public class PublicDeptTagsServiceImpl extends ServiceImpl<PublicDeptTagsMapper, PublicDeptTags> implements IPublicDeptTagsService
{
    @Autowired
    private PublicDeptTagsMapper publicDeptTagsMapper;

    /**
     * 查询文章标签
     *
     * @param id 文章标签主键
     * @return 文章标签
     */
    @Override
    public PublicDeptTags selectPublicDeptTagsById(Long id)
    {
        return publicDeptTagsMapper.selectPublicDeptTagsById(id);
    }

    /**
     * 查询文章标签列表
     *
     * @param publicDeptTags 文章标签
     * @return 文章标签
     */
    @Override
    public List<PublicDeptTags> selectPublicDeptTagsList(PublicDeptTags publicDeptTags)
    {
        return publicDeptTagsMapper.selectPublicDeptTagsList(publicDeptTags);
    }

    /**
     * 新增文章标签
     *
     * @param publicDeptTags 文章标签
     * @return 结果
     */
    @Override
    public int insertPublicDeptTags(PublicDeptTags publicDeptTags)
    {
        publicDeptTags.setCreateTime(DateUtils.getNowDate());
        return publicDeptTagsMapper.insertPublicDeptTags(publicDeptTags);
    }

    /**
     * 修改文章标签
     *
     * @param publicDeptTags 文章标签
     * @return 结果
     */
    @Override
    public int updatePublicDeptTags(PublicDeptTags publicDeptTags)
    {
        publicDeptTags.setUpdateTime(DateUtils.getNowDate());
        return publicDeptTagsMapper.updatePublicDeptTags(publicDeptTags);
    }

    /**
     * 批量删除文章标签
     *
     * @param ids 需要删除的文章标签主键
     * @return 结果
     */
    @Override
    public int deletePublicDeptTagsByIds(String ids)
    {
        return publicDeptTagsMapper.deletePublicDeptTagsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除文章标签信息
     *
     * @param id 文章标签主键
     * @return 结果
     */
    @Override
    public int deletePublicDeptTagsById(Long id)
    {
        return publicDeptTagsMapper.deletePublicDeptTagsById(id);
    }
}
