package com.ruoyi.mall.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mall.domain.Vo.BusinessQuestionVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.BusinessQuestionMapper;
import com.ruoyi.mall.domain.BusinessQuestion;
import com.ruoyi.mall.service.IBusinessQuestionService;

/**
 * 助手问题Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-24
 */
@Service
public class BusinessQuestionServiceImpl implements IBusinessQuestionService 
{
    @Autowired
    private BusinessQuestionMapper businessQuestionMapper;

    /**
     * 查询助手问题
     * 
     * @param questionId 助手问题主键
     * @return 助手问题
     */
    @Override
    public BusinessQuestionVo selectBusinessQuestionByQuestionId(Long questionId)
    {
        return businessQuestionMapper.selectBusinessQuestionByQuestionId(questionId);
    }

    /**
     * 查询助手问题列表
     * 
     * @param businessQuestion 助手问题
     * @return 助手问题
     */
    @Override
    public List<BusinessQuestionVo> selectBusinessQuestionList(BusinessQuestion businessQuestion)
    {
        return businessQuestionMapper.selectBusinessQuestionList(businessQuestion);
    }

    /**
     * 新增助手问题
     * 
     * @param businessQuestion 助手问题
     * @return 结果
     */
    @Override
    public int insertBusinessQuestion(BusinessQuestion businessQuestion)
    {
        businessQuestion.setCreateTime(DateUtils.getNowDate());
        return businessQuestionMapper.insertBusinessQuestion(businessQuestion);
    }

    /**
     * 修改助手问题
     * 
     * @param businessQuestion 助手问题
     * @return 结果
     */
    @Override
    public int updateBusinessQuestion(BusinessQuestion businessQuestion)
    {
        businessQuestion.setUpdateTime(DateUtils.getNowDate());
        return businessQuestionMapper.updateBusinessQuestion(businessQuestion);
    }

    /**
     * 批量删除助手问题
     * 
     * @param questionIds 需要删除的助手问题主键
     * @return 结果
     */
    @Override
    public int deleteBusinessQuestionByQuestionIds(Long[] questionIds)
    {
        return businessQuestionMapper.deleteBusinessQuestionByQuestionIds(questionIds);
    }

    /**
     * 删除助手问题信息
     * 
     * @param questionId 助手问题主键
     * @return 结果
     */
    @Override
    public int deleteBusinessQuestionByQuestionId(Long questionId)
    {
        return businessQuestionMapper.deleteBusinessQuestionByQuestionId(questionId);
    }
}
