package com.easyproject.system.service.operate.impl;

import java.util.List;

import com.easyproject.common.utils.DateUtils;
import com.easyproject.service.domain.operate.OperateCommonQuestions;
import com.easyproject.service.mapper.operate.OperateCommonQuestionsMapper;
import com.easyproject.system.service.operate.IOperateCommonQuestionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 常见问题Service业务层处理
 *
 * @author easyproject
 * @date 2025-03-19
 */
@Service
public class OperateCommonQuestionsServiceImpl implements IOperateCommonQuestionsService {
    @Autowired
    private OperateCommonQuestionsMapper operateCommonQuestionsMapper;

    /**
     * 查询常见问题
     *
     * @param id 常见问题主键
     * @return 常见问题
     */
    @Override
    public OperateCommonQuestions selectOperateCommonQuestionsById(Long id) {
        return operateCommonQuestionsMapper.selectOperateCommonQuestionsById(id);
    }

    /**
     * 查询常见问题列表
     *
     * @param operateCommonQuestions 常见问题
     * @return 常见问题
     */
    @Override
    public List<OperateCommonQuestions> selectOperateCommonQuestionsList(OperateCommonQuestions operateCommonQuestions) {
        return operateCommonQuestionsMapper.selectOperateCommonQuestionsList(operateCommonQuestions);
    }

    /**
     * 新增常见问题
     *
     * @param operateCommonQuestions 常见问题
     * @return 结果
     */
    @Override
    public int insertOperateCommonQuestions(OperateCommonQuestions operateCommonQuestions) {
        operateCommonQuestions.setCreateTime(DateUtils.getNowDate());
        return operateCommonQuestionsMapper.insertOperateCommonQuestions(operateCommonQuestions);
    }

    /**
     * 修改常见问题
     *
     * @param operateCommonQuestions 常见问题
     * @return 结果
     */
    @Override
    public int updateOperateCommonQuestions(OperateCommonQuestions operateCommonQuestions) {
        operateCommonQuestions.setUpdateTime(DateUtils.getNowDate());
        return operateCommonQuestionsMapper.updateOperateCommonQuestions(operateCommonQuestions);
    }

    /**
     * 批量删除常见问题
     *
     * @param ids 需要删除的常见问题主键
     * @return 结果
     */
    @Override
    public int deleteOperateCommonQuestionsByIds(Long[] ids) {
        return operateCommonQuestionsMapper.deleteOperateCommonQuestionsByIds(ids);
    }

    /**
     * 删除常见问题信息
     *
     * @param id 常见问题主键
     * @return 结果
     */
    @Override
    public int deleteOperateCommonQuestionsById(Long id) {
        return operateCommonQuestionsMapper.deleteOperateCommonQuestionsById(id);
    }
}
