package com.ruoyi.project.production.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.project.production.mapper.TMonthlyQualityCommentMapper;
import com.ruoyi.project.production.domain.TMonthlyQualityComment;
import com.ruoyi.project.production.service.ITMonthlyQualityCommentService;

/**
 * 质量月报评价Service业务层处理
 *
 * @author ssy
 * @date 2023-12-14
 */
@Service
public class TMonthlyQualityCommentServiceImpl implements ITMonthlyQualityCommentService
{
    @Autowired
    private TMonthlyQualityCommentMapper tMonthlyQualityCommentMapper;

    /**
     * 查询质量月报评价
     *
     * @param id 质量月报评价ID
     * @return 质量月报评价
     */
    @Override
    public TMonthlyQualityComment selectTMonthlyQualityCommentById(Long id)
    {
        return tMonthlyQualityCommentMapper.selectTMonthlyQualityCommentById(id);
    }

    /**
     * 查询质量月报评价列表
     *
     * @param tMonthlyQualityComment 质量月报评价
     * @return 质量月报评价
     */
    @Override
    public List<TMonthlyQualityComment> selectTMonthlyQualityCommentList(TMonthlyQualityComment tMonthlyQualityComment)
    {
        return tMonthlyQualityCommentMapper.selectTMonthlyQualityCommentList(tMonthlyQualityComment);
    }

    /**
     * 新增质量月报评价
     *
     * @param tMonthlyQualityComment 质量月报评价
     * @return 结果
     */
    @Override
    public int insertTMonthlyQualityComment(TMonthlyQualityComment tMonthlyQualityComment)
    {
        tMonthlyQualityComment.setCreateTime(DateUtils.getNowDate());
        return tMonthlyQualityCommentMapper.insertTMonthlyQualityComment(tMonthlyQualityComment);
    }

    /**
     * 修改质量月报评价
     *
     * @param tMonthlyQualityComment 质量月报评价
     * @return 结果
     */
    @Override
    public int updateTMonthlyQualityComment(TMonthlyQualityComment tMonthlyQualityComment)
    {
        tMonthlyQualityComment.setUpdateTime(DateUtils.getNowDate());
        return tMonthlyQualityCommentMapper.updateTMonthlyQualityComment(tMonthlyQualityComment);
    }

    /**
     * 批量删除质量月报评价
     *
     * @param ids 需要删除的质量月报评价ID
     * @return 结果
     */
    @Override
    public int deleteTMonthlyQualityCommentByIds(Long[] ids)
    {
        return tMonthlyQualityCommentMapper.deleteTMonthlyQualityCommentByIds(ids);
    }

    /**
     * 删除质量月报评价信息
     *
     * @param id 质量月报评价ID
     * @return 结果
     */
    @Override
    public int deleteTMonthlyQualityCommentById(Long id)
    {
        return tMonthlyQualityCommentMapper.deleteTMonthlyQualityCommentById(id);
    }

    /**
     * 获取质量月报评价详细信息
     */
    @Override
    public TMonthlyQualityComment selectTMonthlyQualityCommentByTypeAndDate(TMonthlyQualityComment tMonthlyQualityComment) {
        return tMonthlyQualityCommentMapper.selectTMonthlyQualityCommentByTypeAndDate(tMonthlyQualityComment);
    }
}
