package com.ruoyi.post.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.post.mapper.PostCollectionMapper;
import com.ruoyi.post.domain.PostCollection;
import com.ruoyi.post.service.IPostCollectionService;
import javax.annotation.Resource;

/**
 * 邮贝藏品信息; Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-11
 */
@Service
public class PostCollectionServiceImpl implements IPostCollectionService 
{
    @Resource
    private PostCollectionMapper postCollectionMapper;

    /**
     * 查询邮贝藏品信息; 
     * 
     * @param collectionId 邮贝藏品信息; 主键
     * @return 邮贝藏品信息; 
     */
    @Override
    public PostCollection selectPostCollectionByCollectionId(Long collectionId)
    {
        return postCollectionMapper.selectPostCollectionByCollectionId(collectionId);
    }

    /**
     * 查询邮贝藏品信息; 列表
     * 
     * @param postCollection 邮贝藏品信息; 
     * @return 邮贝藏品信息; 
     */
    @Override
    public List<PostCollection> selectPostCollectionList(PostCollection postCollection)
    {
        return postCollectionMapper.selectPostCollectionList(postCollection);
    }

    /**
     * 新增邮贝藏品信息; 
     * 
     * @param postCollection 邮贝藏品信息; 
     * @return 结果
     */
    @Override
    public int insertPostCollection(PostCollection postCollection)
    {
        postCollection.setCreateTime(DateUtils.getNowDate());
        return postCollectionMapper.insertPostCollection(postCollection);
    }

    /**
     * 修改邮贝藏品信息; 
     * 
     * @param postCollection 邮贝藏品信息; 
     * @return 结果
     */
    @Override
    public int updatePostCollection(PostCollection postCollection)
    {
        postCollection.setUpdateTime(DateUtils.getNowDate());
        return postCollectionMapper.updatePostCollection(postCollection);
    }

    /**
     * 批量删除邮贝藏品信息; 
     * 
     * @param collectionIds 需要删除的邮贝藏品信息; 主键
     * @return 结果
     */
    @Override
    public int deletePostCollectionByCollectionIds(Long[] collectionIds)
    {
        return postCollectionMapper.deletePostCollectionByCollectionIds(collectionIds);
    }

    /**
     * 删除邮贝藏品信息; 信息
     * 
     * @param collectionId 邮贝藏品信息; 主键
     * @return 结果
     */
    @Override
    public int deletePostCollectionByCollectionId(Long collectionId)
    {
        return postCollectionMapper.deletePostCollectionByCollectionId(collectionId);
    }
}
