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.TSaiCategoryMapper;
import com.ruoyi.project.production.domain.TSaiCategory;
import com.ruoyi.project.production.service.ITSaiCategoryService;

/**
 * SAI类别Service业务层处理
 *
 * @author ruoyi
 * @date 2023-04-18
 */
@Service
public class TSaiCategoryServiceImpl implements ITSaiCategoryService
{
    @Autowired
    private TSaiCategoryMapper tSaiCategoryMapper;

    /**
     * 查询SAI类别
     *
     * @param saiCategoryId SAI类别ID
     * @return SAI类别
     */
    @Override
    public TSaiCategory selectTSaiCategoryById(Long saiCategoryId)
    {
        return tSaiCategoryMapper.selectTSaiCategoryById(saiCategoryId);
    }

    /**
     * 查询SAI类别列表
     *
     * @param tSaiCategory SAI类别
     * @return SAI类别
     */
    @Override
    public List<TSaiCategory> selectTSaiCategoryList(TSaiCategory tSaiCategory)
    {
        return tSaiCategoryMapper.selectTSaiCategoryList(tSaiCategory);
    }

    /**
     * 新增SAI类别
     *
     * @param tSaiCategory SAI类别
     * @return 结果
     */
    @Override
    public int insertTSaiCategory(TSaiCategory tSaiCategory)
    {
        tSaiCategory.setCreateTime(DateUtils.getNowDate());
        return tSaiCategoryMapper.insertTSaiCategory(tSaiCategory);
    }

    /**
     * 修改SAI类别
     *
     * @param tSaiCategory SAI类别
     * @return 结果
     */
    @Override
    public int updateTSaiCategory(TSaiCategory tSaiCategory)
    {
        tSaiCategory.setUpdateTime(DateUtils.getNowDate());
        return tSaiCategoryMapper.updateTSaiCategory(tSaiCategory);
    }

    /**
     * 批量删除SAI类别
     *
     * @param saiCategoryIds 需要删除的SAI类别ID
     * @return 结果
     */
    @Override
    public int deleteTSaiCategoryByIds(Long[] saiCategoryIds)
    {
        return tSaiCategoryMapper.deleteTSaiCategoryByIds(saiCategoryIds);
    }

    /**
     * 删除SAI类别信息
     *
     * @param saiCategoryId SAI类别ID
     * @return 结果
     */
    @Override
    public int deleteTSaiCategoryById(Long saiCategoryId)
    {
        return tSaiCategoryMapper.deleteTSaiCategoryById(saiCategoryId);
    }
}
