package com.ruoyi.ems.record.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ems.record.mapper.EmsRecordAlarmRuleMapper;
import com.ruoyi.ems.record.domain.EmsRecordAlarmRule;
import com.ruoyi.ems.record.service.IEmsRecordAlarmRuleService;

/**
 * 异常告警规则Service业务层处理
 * 
 * @author Yinq
 * @date 2024-05-15
 */
@Service
public class EmsRecordAlarmRuleServiceImpl implements IEmsRecordAlarmRuleService 
{
    @Autowired
    private EmsRecordAlarmRuleMapper emsRecordAlarmRuleMapper;

    /**
     * 查询异常告警规则
     * 
     * @param objId 异常告警规则主键
     * @return 异常告警规则
     */
    @Override
    public EmsRecordAlarmRule selectEmsRecordAlarmRuleByObjId(Long objId)
    {
        return emsRecordAlarmRuleMapper.selectEmsRecordAlarmRuleByObjId(objId);
    }

    /**
     * 查询异常告警规则列表
     * 
     * @param emsRecordAlarmRule 异常告警规则
     * @return 异常告警规则
     */
    @Override
    public List<EmsRecordAlarmRule> selectEmsRecordAlarmRuleList(EmsRecordAlarmRule emsRecordAlarmRule)
    {
        return emsRecordAlarmRuleMapper.selectEmsRecordAlarmRuleList(emsRecordAlarmRule);
    }

    /**
     * 新增异常告警规则
     * 
     * @param emsRecordAlarmRule 异常告警规则
     * @return 结果
     */
    @Override
    public int insertEmsRecordAlarmRule(EmsRecordAlarmRule emsRecordAlarmRule)
    {
        emsRecordAlarmRule.setCreateTime(DateUtils.getNowDate());
        return emsRecordAlarmRuleMapper.insertEmsRecordAlarmRule(emsRecordAlarmRule);
    }

    /**
     * 修改异常告警规则
     * 
     * @param emsRecordAlarmRule 异常告警规则
     * @return 结果
     */
    @Override
    public int updateEmsRecordAlarmRule(EmsRecordAlarmRule emsRecordAlarmRule)
    {
        emsRecordAlarmRule.setUpdateTime(DateUtils.getNowDate());
        return emsRecordAlarmRuleMapper.updateEmsRecordAlarmRule(emsRecordAlarmRule);
    }

    /**
     * 批量删除异常告警规则
     * 
     * @param objIds 需要删除的异常告警规则主键
     * @return 结果
     */
    @Override
    public int deleteEmsRecordAlarmRuleByObjIds(Long[] objIds)
    {
        return emsRecordAlarmRuleMapper.deleteEmsRecordAlarmRuleByObjIds(objIds);
    }

    /**
     * 删除异常告警规则信息
     * 
     * @param objId 异常告警规则主键
     * @return 结果
     */
    @Override
    public int deleteEmsRecordAlarmRuleByObjId(Long objId)
    {
        return emsRecordAlarmRuleMapper.deleteEmsRecordAlarmRuleByObjId(objId);
    }
}
