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.QuestionFeedbackMapper;
import com.ruoyi.mall.domain.QuestionFeedback;
import com.ruoyi.mall.service.IQuestionFeedbackService;

/**
 * 问题反馈Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-25
 */
@Service
public class QuestionFeedbackServiceImpl implements IQuestionFeedbackService 
{
    @Autowired
    private QuestionFeedbackMapper questionFeedbackMapper;

    /**
     * 查询问题反馈
     * 
     * @param feedbackId 问题反馈主键
     * @return 问题反馈
     */
    @Override
    public QuestionFeedback selectQuestionFeedbackByFeedbackId(Long feedbackId)
    {
        return questionFeedbackMapper.selectQuestionFeedbackByFeedbackId(feedbackId);
    }

    /**
     * 查询问题反馈列表
     * 
     * @param questionFeedback 问题反馈
     * @return 问题反馈
     */
    @Override
    public List<QuestionFeedback> selectQuestionFeedbackList(QuestionFeedback questionFeedback)
    {
        return questionFeedbackMapper.selectQuestionFeedbackList(questionFeedback);
    }

    /**
     * 新增问题反馈
     * 
     * @param questionFeedback 问题反馈
     * @return 结果
     */
    @Override
    public int insertQuestionFeedback(QuestionFeedback questionFeedback)
    {
        questionFeedback.setCreateTime(DateUtils.getNowDate());
        return questionFeedbackMapper.insertQuestionFeedback(questionFeedback);
    }

    /**
     * 修改问题反馈
     * 
     * @param questionFeedback 问题反馈
     * @return 结果
     */
    @Override
    public int updateQuestionFeedback(QuestionFeedback questionFeedback)
    {
        questionFeedback.setUpdateTime(DateUtils.getNowDate());
        return questionFeedbackMapper.updateQuestionFeedback(questionFeedback);
    }

    /**
     * 批量删除问题反馈
     * 
     * @param feedbackIds 需要删除的问题反馈主键
     * @return 结果
     */
    @Override
    public int deleteQuestionFeedbackByFeedbackIds(Long[] feedbackIds)
    {
        return questionFeedbackMapper.deleteQuestionFeedbackByFeedbackIds(feedbackIds);
    }

    /**
     * 删除问题反馈信息
     * 
     * @param feedbackId 问题反馈主键
     * @return 结果
     */
    @Override
    public int deleteQuestionFeedbackByFeedbackId(Long feedbackId)
    {
        return questionFeedbackMapper.deleteQuestionFeedbackByFeedbackId(feedbackId);
    }
}
