package com.fs.his.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.his.param.FsDoctorArticleListDParam;
import com.fs.his.param.FsDoctorArticleListUParam;
import com.fs.his.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.his.mapper.FsDoctorArticleMapper;
import com.fs.his.domain.FsDoctorArticle;
import com.fs.his.service.IFsDoctorArticleService;

/**
 * 医生文章Service业务层处理
 *
 * @author fs
 * @date 2023-06-05
 */
@Service
public class FsDoctorArticleServiceImpl implements IFsDoctorArticleService
{
    @Autowired
    private FsDoctorArticleMapper fsDoctorArticleMapper;

    /**
     * 查询医生文章
     *
     * @param articleId 医生文章主键
     * @return 医生文章
     */
    @Override
    public FsDoctorArticleVO selectFsDoctorArticleByArticleId(Long articleId)
    {
        return fsDoctorArticleMapper.selectFsDoctorArticleVOByArticleId(articleId);
    }

    /**
     * 查询医生文章列表
     *
     * @param fsDoctorArticle 医生文章
     * @return 医生文章
     */
    @Override
    public List<FsDoctorArticle> selectFsDoctorArticleList(FsDoctorArticle fsDoctorArticle)
    {
        return fsDoctorArticleMapper.selectFsDoctorArticleList(fsDoctorArticle);
    }

    /**
     * 新增医生文章
     *
     * @param fsDoctorArticle 医生文章
     * @return 结果
     */
    @Override
    public int insertFsDoctorArticle(FsDoctorArticle fsDoctorArticle)
    {

        fsDoctorArticle.setCreateTime(DateUtils.getNowDate());
        return fsDoctorArticleMapper.insertFsDoctorArticle(fsDoctorArticle);
    }

    /**
     * 修改医生文章
     *
     * @param fsDoctorArticle 医生文章
     * @return 结果
     */
    @Override
    public int updateFsDoctorArticle(FsDoctorArticle fsDoctorArticle)
    {
        fsDoctorArticle.setUpdateTime(DateUtils.getNowDate());
        return fsDoctorArticleMapper.updateFsDoctorArticle(fsDoctorArticle);
    }

    /**
     * 批量删除医生文章
     *
     * @param articleIds 需要删除的医生文章主键
     * @return 结果
     */
    @Override
    public int deleteFsDoctorArticleByArticleIds(Long[] articleIds)
    {
        return fsDoctorArticleMapper.deleteFsDoctorArticleByArticleIds(articleIds);
    }

    /**
     * 删除医生文章信息
     *
     * @param articleId 医生文章主键
     * @return 结果
     */
    @Override
    public int deleteFsDoctorArticleByArticleId(Long articleId)
    {
        return fsDoctorArticleMapper.deleteFsDoctorArticleByArticleId(articleId);
    }

    @Override
    public List<FsDoctorArticleListVO> selectFsDoctorArticleListVO(FsDoctorArticle fsDoctorArticle) {
        return fsDoctorArticleMapper.selectFsDoctorArticleListVO(fsDoctorArticle);
    }

    @Override
    public List<FsDoctorArticleListUVO> selectFsDoctorArticleListUVO(FsDoctorArticleListUParam param) {
        return fsDoctorArticleMapper.selectFsDoctorArticleListUVO(param);
    }

    @Override
    public int updateViews(Long articleId) {
        return fsDoctorArticleMapper.updateViews(articleId);
    }

    @Override
    public FsDoctorArticleUVO selectFsDoctorArticleUVOByArticleId(Long articleId) {
        return fsDoctorArticleMapper.selectFsDoctorArticleUVOByArticleId(articleId);
    }

    @Override
    public List<FsDoctorArticleListDVO> selectFsDoctorArticleListDVO(FsDoctorArticleListDParam param) {
        return fsDoctorArticleMapper.selectFsDoctorArticleListDVO(param);
    }
}
