package com.srs.system.service.impl;

import java.util.List;
import com.srs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.srs.system.mapper.SysSuggestionMapper;
import com.srs.system.domain.SysSuggestion;
import com.srs.system.service.ISysSuggestionService;

/**
 * 优化建议Service业务层处理
 *
 * @author srs
 * @date 2025-04-29
 */
@Service
public class SysSuggestionServiceImpl extends ServiceImpl<SysSuggestionMapper,SysSuggestion> implements ISysSuggestionService {
    @Autowired
    private SysSuggestionMapper sysSuggestionMapper;

    /**
     * 查询优化建议
     *
     * @param id 优化建议主键
     * @return 优化建议
     */
    @Override
    public SysSuggestion selectSysSuggestionById(Long id) {
        return sysSuggestionMapper.selectSysSuggestionById(id);
    }

    /**
     * 查询优化建议列表
     *
     * @param sysSuggestion 优化建议
     * @return 优化建议
     */
    @Override
    public List<SysSuggestion> selectSysSuggestionList(SysSuggestion sysSuggestion) {
        return sysSuggestionMapper.selectSysSuggestionList(sysSuggestion);
    }

    /**
     * 新增优化建议
     *
     * @param sysSuggestion 优化建议
     * @return 结果
     */
    @Override
    public int insertSysSuggestion(SysSuggestion sysSuggestion) {
                sysSuggestion.setCreateTime(DateUtils.getNowDate());
            return sysSuggestionMapper.insertSysSuggestion(sysSuggestion);
    }

    /**
     * 修改优化建议
     *
     * @param sysSuggestion 优化建议
     * @return 结果
     */
    @Override
    public int updateSysSuggestion(SysSuggestion sysSuggestion) {
        return sysSuggestionMapper.updateSysSuggestion(sysSuggestion);
    }

    /**
     * 批量删除优化建议
     *
     * @param ids 需要删除的优化建议主键
     * @return 结果
     */
    @Override
    public int deleteSysSuggestionByIds(Long[] ids) {
        return sysSuggestionMapper.deleteSysSuggestionByIds(ids);
    }

    /**
     * 删除优化建议信息
     *
     * @param id 优化建议主键
     * @return 结果
     */
    @Override
    public int deleteSysSuggestionById(Long id) {
        return sysSuggestionMapper.deleteSysSuggestionById(id);
    }
}
