package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PostCollectionsMapper;
import com.ruoyi.system.domain.PostCollections;
import com.ruoyi.system.service.IPostCollectionsService;

/**
 * 藏品Service业务层处理
 *
 * @author ruoyi
 * @date 2023-02-15
 */
@Service
public class PostCollectionsServiceImpl implements IPostCollectionsService
{
    @Autowired
    private PostCollectionsMapper postCollectionsMapper;

    /**
     * 查询藏品
     *
     * @param id 藏品主键
     * @return 藏品
     */
    @Override
    public PostCollections selectPostCollectionsById(Long id)
    {
        return postCollectionsMapper.selectPostCollectionsById(id);
    }

    /**
     * 查询藏品列表
     *
     * @param postCollections 藏品
     * @return 藏品
     */
    @Override
    public List<PostCollections> selectPostCollectionsList(PostCollections postCollections)
    {
        return postCollectionsMapper.selectPostCollectionsList(postCollections);
    }

    /**
     * 新增藏品
     *
     * @param postCollections 藏品
     * @return 结果
     */
    @Override
    public int insertPostCollections(PostCollections postCollections)
    {
        postCollections.setCreateTime(DateUtils.getNowDate());
        return postCollectionsMapper.insertPostCollections(postCollections);
    }

    /**
     * 修改藏品
     *
     * @param postCollections 藏品
     * @return 结果
     */
    @Override
    public int updatePostCollections(PostCollections postCollections)
    {
        postCollections.setUpdateTime(DateUtils.getNowDate());
        return postCollectionsMapper.updatePostCollections(postCollections);
    }

    /**
     * 批量删除藏品
     *
     * @param ids 需要删除的藏品主键
     * @return 结果
     */
    @Override
    public int deletePostCollectionsByIds(Long[] ids)
    {
        return postCollectionsMapper.deletePostCollectionsByIds(ids);
    }

    /**
     * 删除藏品信息
     *
     * @param id 藏品主键
     * @return 结果
     */
    @Override
    public int deletePostCollectionsById(Long id)
    {
        return postCollectionsMapper.deletePostCollectionsById(id);
    }
}
