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.WorkReviewMapper;
import com.ruoyi.system.domain.WorkReview;
import com.ruoyi.system.service.IWorkReviewService;

/**
 * 作品评审意见Service业务层处理
 * 
 * @author haotian
 * @date 2024-12-11
 */
@Service
public class WorkReviewServiceImpl implements IWorkReviewService 
{
    @Autowired
    private WorkReviewMapper workReviewMapper;

    /**
     * 查询作品评审意见
     * 
     * @param reviewId 作品评审意见主键
     * @return 作品评审意见
     */
    @Override
    public WorkReview selectWorkReviewByReviewId(Long reviewId)
    {
        return workReviewMapper.selectWorkReviewByReviewId(reviewId);
    }

    /**
     * 查询作品评审意见列表
     * 
     * @param workReview 作品评审意见
     * @return 作品评审意见
     */
    @Override
    public List<WorkReview> selectWorkReviewList(WorkReview workReview)
    {
        return workReviewMapper.selectWorkReviewList(workReview);
    }

    /**
     * 新增作品评审意见
     * 
     * @param workReview 作品评审意见
     * @return 结果
     */
    @Override
    public int insertWorkReview(WorkReview workReview)
    {
        workReview.setCreateTime(DateUtils.getNowDate());
        return workReviewMapper.insertWorkReview(workReview);
    }

    /**
     * 修改作品评审意见
     * 
     * @param workReview 作品评审意见
     * @return 结果
     */
    @Override
    public int updateWorkReview(WorkReview workReview)
    {
        return workReviewMapper.updateWorkReview(workReview);
    }

    /**
     * 批量删除作品评审意见
     * 
     * @param reviewIds 需要删除的作品评审意见主键
     * @return 结果
     */
    @Override
    public int deleteWorkReviewByReviewIds(Long[] reviewIds)
    {
        return workReviewMapper.deleteWorkReviewByReviewIds(reviewIds);
    }

    /**
     * 删除作品评审意见信息
     * 
     * @param reviewId 作品评审意见主键
     * @return 结果
     */
    @Override
    public int deleteWorkReviewByReviewId(Long reviewId)
    {
        return workReviewMapper.deleteWorkReviewByReviewId(reviewId);
    }

    @Override
    public int setWorkReviewDeleteFlag(WorkReview workReview){
        return workReviewMapper.setWorkReviewDeleteFlag(workReview);
    }
}
