package com.ruoyi.manage.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.manage.domain.WarnManage;
import com.ruoyi.manage.mapper.WarnManageMapper;
import com.ruoyi.manage.service.IWarnManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 告警管理Service业务层处理
 * 
 * @author boman
 * @date 2025-05-07
 */
@Service
public class WarnManageServiceImpl implements IWarnManageService 
{
    @Autowired
    private WarnManageMapper warnManageMapper;

    /**
     * 查询告警管理
     * 
     * @param warnId 告警管理主键
     * @return 告警管理
     */
    @Override
    public WarnManage selectWarnManageByWarnId(Long warnId)
    {
        return warnManageMapper.selectWarnManageByWarnId(warnId);
    }

    /**
     * 查询告警管理列表
     * 
     * @param warnManage 告警管理
     * @return 告警管理
     */
    @Override
    public List<WarnManage> selectWarnManageList(WarnManage warnManage)
    {
        return warnManageMapper.selectWarnManageList(warnManage);
    }

    /**
     * 新增告警管理
     * 
     * @param warnManage 告警管理
     * @return 结果
     */
    @Override
    public int insertWarnManage(WarnManage warnManage)
    {
        warnManage.setCreateTime(DateUtils.getNowDate());
        return warnManageMapper.insertWarnManage(warnManage);
    }

    /**
     * 修改告警管理
     * 
     * @param warnManage 告警管理
     * @return 结果
     */
    @Override
    public int updateWarnManage(WarnManage warnManage)
    {
        warnManage.setUpdateTime(DateUtils.getNowDate());
        return warnManageMapper.updateWarnManage(warnManage);
    }

    /**
     * 批量删除告警管理
     * 
     * @param warnIds 需要删除的告警管理主键
     * @return 结果
     */
    @Override
    public int deleteWarnManageByWarnIds(Long[] warnIds)
    {
        return warnManageMapper.deleteWarnManageByWarnIds(warnIds);
    }

    /**
     * 删除告警管理信息
     * 
     * @param warnId 告警管理主键
     * @return 结果
     */
    @Override
    public int deleteWarnManageByWarnId(Long warnId)
    {
        return warnManageMapper.deleteWarnManageByWarnId(warnId);
    }
}
