package com.ruoyi.abuwx.service.impl;

import com.ruoyi.abuwx.domain.QuestionSpecial;
import com.ruoyi.abuwx.mapper.QuestionSpecialMapper;
import com.ruoyi.abuwx.service.IQuestionSpecialService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 专项管理Service业务层处理
 *
 * @author lujie
 * @date 2025-01-07
 */
@Service
public class QuestionSpecialServiceImpl implements IQuestionSpecialService {
    @Autowired
    private QuestionSpecialMapper questionSpecialMapper;

    /**
     * 查询专项管理
     *
     * @param id 专项管理主键
     * @return 专项管理
     */
    @Override
    public QuestionSpecial selectQuestionSpecialById(Long id) {
        return questionSpecialMapper.selectQuestionSpecialById(id);
    }

    /**
     * 查询专项管理列表
     *
     * @param questionSpecial 专项管理
     * @return 专项管理
     */
    @Override
    public List<QuestionSpecial> selectQuestionSpecialList(QuestionSpecial questionSpecial) {
        return questionSpecialMapper.selectQuestionSpecialList(questionSpecial);
    }

    /**
     * 新增专项管理
     *
     * @param questionSpecial 专项管理
     * @return 结果
     */
    @Override
    public int insertQuestionSpecial(QuestionSpecial questionSpecial) {
        questionSpecial.setCreateTime(DateUtils.getNowDate());
        return questionSpecialMapper.insertQuestionSpecial(questionSpecial);
    }

    /**
     * 修改专项管理
     *
     * @param questionSpecial 专项管理
     * @return 结果
     */
    @Override
    public int updateQuestionSpecial(QuestionSpecial questionSpecial) {
        questionSpecial.setUpdateTime(DateUtils.getNowDate());
        return questionSpecialMapper.updateQuestionSpecial(questionSpecial);
    }

    /**
     * 批量删除专项管理
     *
     * @param ids 需要删除的专项管理主键
     * @return 结果
     */
    @Override
    public int deleteQuestionSpecialByIds(Long[] ids) {
        return questionSpecialMapper.deleteQuestionSpecialByIds(ids);
    }

    /**
     * 删除专项管理信息
     *
     * @param id 专项管理主键
     * @return 结果
     */
    @Override
    public int deleteQuestionSpecialById(Long id) {
        return questionSpecialMapper.deleteQuestionSpecialById(id);
    }
}
