package com.ruoyi.project.production.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.production.controller.vo.MonthlyQualityRemoveVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.production.mapper.TMonthlyQualityReportS0501Mapper;
import com.ruoyi.project.production.domain.TMonthlyQualityReportS0501;
import com.ruoyi.project.production.service.ITMonthlyQualityReportS0501Service;

/**
 * 质量月报S0501Service业务层处理
 *
 * @author ruoyi
 * @date 2023-10-27
 */
@Service
public class TMonthlyQualityReportS0501ServiceImpl implements ITMonthlyQualityReportS0501Service
{
    @Autowired
    private TMonthlyQualityReportS0501Mapper tMonthlyQualityReportS0501Mapper;

    public String[] selectTMonthlyQualityReportYearMonth() {
        return tMonthlyQualityReportS0501Mapper.selectTMonthlyQualityReportYearMonth();
    }

    @Override
    public TMonthlyQualityReportS0501 selectTMonthlyQualityReportS0501ListMonth(TMonthlyQualityReportS0501 tMonthlyQualityReportS0501) {
        return tMonthlyQualityReportS0501Mapper.selectTMonthlyQualityReportS0501ListMonth(tMonthlyQualityReportS0501);
    }

    /**
     * 查询质量月报S0501
     *
     * @param id 质量月报S0501ID
     * @return 质量月报S0501
     */
    @Override
    public TMonthlyQualityReportS0501 selectTMonthlyQualityReportS0501ById(Long id)
    {
        return tMonthlyQualityReportS0501Mapper.selectTMonthlyQualityReportS0501ById(id);
    }

    /**
     * 查询质量月报S0501列表
     *
     * @param tMonthlyQualityReportS0501 质量月报S0501
     * @return 质量月报S0501
     */
    @Override
    public List<TMonthlyQualityReportS0501> selectTMonthlyQualityReportS0501List(TMonthlyQualityReportS0501 tMonthlyQualityReportS0501)
    {
        return tMonthlyQualityReportS0501Mapper.selectTMonthlyQualityReportS0501List(tMonthlyQualityReportS0501);
    }

    /**
     * 新增质量月报S0501
     *
     * @param tMonthlyQualityReportS0501 质量月报S0501
     * @return 结果
     */
    @Override
    public int insertTMonthlyQualityReportS0501(TMonthlyQualityReportS0501 tMonthlyQualityReportS0501)
    {
        tMonthlyQualityReportS0501.setCreateTime(DateUtils.getNowDate());
        return tMonthlyQualityReportS0501Mapper.insertTMonthlyQualityReportS0501(tMonthlyQualityReportS0501);
    }

    /**
     * 修改质量月报S0501
     *
     * @param tMonthlyQualityReportS0501 质量月报S0501
     * @return 结果
     */
    @Override
    public int updateTMonthlyQualityReportS0501(TMonthlyQualityReportS0501 tMonthlyQualityReportS0501)
    {
        tMonthlyQualityReportS0501.setUpdateTime(DateUtils.getNowDate());
        return tMonthlyQualityReportS0501Mapper.updateTMonthlyQualityReportS0501(tMonthlyQualityReportS0501);
    }

    /**
     * 批量删除质量月报S0501
     *
     * @param ids 需要删除的质量月报S0501ID
     * @return 结果
     */
    @Override
    public int deleteTMonthlyQualityReportS0501ByIds(Long[] ids)
    {
        return tMonthlyQualityReportS0501Mapper.deleteTMonthlyQualityReportS0501ByIds(ids);
    }

    /**
     * 删除质量月报S0501信息
     *
     * @param id 质量月报S0501ID
     * @return 结果
     */
    @Override
    public int deleteTMonthlyQualityReportS0501ById(Long id)
    {
        return tMonthlyQualityReportS0501Mapper.deleteTMonthlyQualityReportS0501ById(id);
    }

    public void deleteTMonthlyQualityReportBranch(MonthlyQualityRemoveVO vo) {
        tMonthlyQualityReportS0501Mapper.deleteTMonthlyQualityReportBranch(vo);
    }
}
