package com.ruoyi.mall.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.mall.mapper.BusinessTutorialMapper;
import com.ruoyi.mall.domain.BusinessTutorial;
import com.ruoyi.mall.service.IBusinessTutorialService;

import javax.annotation.Resource;

/**
 * 使用教程Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-23
 */
@Service
public class BusinessTutorialServiceImpl implements IBusinessTutorialService 
{
    @Resource
    private BusinessTutorialMapper businessTutorialMapper;

    /**
     * 查询使用教程
     * 
     * @param tutorialId 使用教程主键
     * @return 使用教程
     */
    @Override
    public BusinessTutorial selectBusinessTutorialByTutorialId(Long tutorialId)
    {
        return businessTutorialMapper.selectBusinessTutorialByTutorialId(tutorialId);
    }

    /**
     * 查询使用教程列表
     * 
     * @param businessTutorial 使用教程
     * @return 使用教程
     */
    @Override
    public List<BusinessTutorial> selectBusinessTutorialList(BusinessTutorial businessTutorial)
    {
        return businessTutorialMapper.selectBusinessTutorialList(businessTutorial);
    }

    /**
     * 新增使用教程
     * 
     * @param businessTutorial 使用教程
     * @return 结果
     */
    @Override
    public int insertBusinessTutorial(BusinessTutorial businessTutorial)
    {
        businessTutorial.setCreateTime(DateUtils.getNowDate());
        return businessTutorialMapper.insertBusinessTutorial(businessTutorial);
    }

    /**
     * 修改使用教程
     * 
     * @param businessTutorial 使用教程
     * @return 结果
     */
    @Override
    public int updateBusinessTutorial(BusinessTutorial businessTutorial)
    {
        businessTutorial.setUpdateTime(DateUtils.getNowDate());
        return businessTutorialMapper.updateBusinessTutorial(businessTutorial);
    }

    /**
     * 批量删除使用教程
     * 
     * @param tutorialIds 需要删除的使用教程主键
     * @return 结果
     */
    @Override
    public int deleteBusinessTutorialByTutorialIds(Long[] tutorialIds)
    {
        return businessTutorialMapper.deleteBusinessTutorialByTutorialIds(tutorialIds);
    }

    /**
     * 删除使用教程信息
     * 
     * @param tutorialId 使用教程主键
     * @return 结果
     */
    @Override
    public int deleteBusinessTutorialByTutorialId(Long tutorialId)
    {
        return businessTutorialMapper.deleteBusinessTutorialByTutorialId(tutorialId);
    }
}
