package com.ruoyi.voluntary.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.voluntary.mapper.BusiGradeMapper;
import com.ruoyi.voluntary.domain.BusiGrade;
import com.ruoyi.voluntary.service.IBusiGradeService;

/**
 * 年级Service业务层处理
 * 
 * @author voluntary
 * @date 2022-11-25
 */
@Service
public class BusiGradeServiceImpl implements IBusiGradeService 
{
    @Autowired
    private BusiGradeMapper busiGradeMapper;

    /**
     * 查询年级
     * 
     * @param id 年级主键
     * @return 年级
     */
    @Override
    public BusiGrade selectBusiGradeById(Long id)
    {
        return busiGradeMapper.selectBusiGradeById(id);
    }

    /**
     * 查询年级列表
     * 
     * @param busiGrade 年级
     * @return 年级
     */
    @Override
    public List<BusiGrade> selectBusiGradeList(BusiGrade busiGrade)
    {
        return busiGradeMapper.selectBusiGradeList(busiGrade);
    }

    /**
     * 新增年级
     * 
     * @param busiGrade 年级
     * @return 结果
     */
    @Override
    public int insertBusiGrade(BusiGrade busiGrade)
    {
        return busiGradeMapper.insertBusiGrade(busiGrade);
    }

    /**
     * 修改年级
     * 
     * @param busiGrade 年级
     * @return 结果
     */
    @Override
    public int updateBusiGrade(BusiGrade busiGrade)
    {
        busiGrade.setUpdateTime(DateUtils.getNowDate());
        return busiGradeMapper.updateBusiGrade(busiGrade);
    }

    /**
     * 批量删除年级
     * 
     * @param ids 需要删除的年级主键
     * @return 结果
     */
    @Override
    public int deleteBusiGradeByIds(Long[] ids)
    {
        return busiGradeMapper.deleteBusiGradeByIds(ids);
    }

    /**
     * 删除年级信息
     * 
     * @param id 年级主键
     * @return 结果
     */
    @Override
    public int deleteBusiGradeById(Long id)
    {
        return busiGradeMapper.deleteBusiGradeById(id);
    }
}
