package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.complaintSuggestion.ComplaintSuggestion;
import com.ruoyi.system.mapper.ComplaintSuggestionMapper;
import com.ruoyi.system.service.IComplaintSuggestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 投诉建议Service业务层处理
 * 
 * @author boman
 * @date 2025-02-14
 */
@Service
public class ComplaintSuggestionServiceImpl implements IComplaintSuggestionService 
{
    @Autowired
    private ComplaintSuggestionMapper complaintSuggestionMapper;

    /**
     * 查询投诉建议
     * 
     * @param suggestionId 投诉建议主键
     * @return 投诉建议
     */
    @Override
    public ComplaintSuggestion selectComplaintSuggestionBySuggestionId(Long suggestionId)
    {
        return complaintSuggestionMapper.selectComplaintSuggestionBySuggestionId(suggestionId);
    }

    /**
     * 查询投诉建议列表
     * 
     * @param complaintSuggestion 投诉建议
     * @return 投诉建议
     */
    @Override
    public List<ComplaintSuggestion> selectComplaintSuggestionList(ComplaintSuggestion complaintSuggestion)
    {
        return complaintSuggestionMapper.selectComplaintSuggestionList(complaintSuggestion);
    }

    /**
     * 新增投诉建议
     * 
     * @param complaintSuggestion 投诉建议
     * @return 结果
     */
    @Override
    public int insertComplaintSuggestion(ComplaintSuggestion complaintSuggestion)
    {
        complaintSuggestion.setCreateTime(DateUtils.getNowDate());
        return complaintSuggestionMapper.insertComplaintSuggestion(complaintSuggestion);
    }

    /**
     * 修改投诉建议
     * 
     * @param complaintSuggestion 投诉建议
     * @return 结果
     */
    @Override
    public int updateComplaintSuggestion(ComplaintSuggestion complaintSuggestion)
    {
        complaintSuggestion.setUpdateTime(DateUtils.getNowDate());
        return complaintSuggestionMapper.updateComplaintSuggestion(complaintSuggestion);
    }

    /**
     * 批量删除投诉建议
     * 
     * @param suggestionIds 需要删除的投诉建议主键
     * @return 结果
     */
    @Override
    public int deleteComplaintSuggestionBySuggestionIds(Long[] suggestionIds)
    {
        return complaintSuggestionMapper.deleteComplaintSuggestionBySuggestionIds(suggestionIds);
    }

    /**
     * 删除投诉建议信息
     * 
     * @param suggestionId 投诉建议主键
     * @return 结果
     */
    @Override
    public int deleteComplaintSuggestionBySuggestionId(Long suggestionId)
    {
        return complaintSuggestionMapper.deleteComplaintSuggestionBySuggestionId(suggestionId);
    }
}
