package com.tongran.rocketmq.service.impl;

import java.util.List;
import com.tongran.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tongran.rocketmq.mapper.RmAlarmLogMapper;
import com.tongran.rocketmq.domain.RmAlarmLog;
import com.tongran.rocketmq.service.IRmAlarmLogService;

/**
 * 客户端告警信息Service业务层处理
 * 
 * @author tongran
 * @date 2025-11-10
 */
@Service
public class RmAlarmLogServiceImpl implements IRmAlarmLogService 
{
    @Autowired
    private RmAlarmLogMapper rmAlarmLogMapper;

    /**
     * 查询客户端告警信息
     * 
     * @param id 客户端告警信息主键
     * @return 客户端告警信息
     */
    @Override
    public RmAlarmLog selectRmAlarmLogById(Long id)
    {
        return rmAlarmLogMapper.selectRmAlarmLogById(id);
    }

    /**
     * 查询客户端告警信息列表
     * 
     * @param rmAlarmLog 客户端告警信息
     * @return 客户端告警信息
     */
    @Override
    public List<RmAlarmLog> selectRmAlarmLogList(RmAlarmLog rmAlarmLog)
    {
        return rmAlarmLogMapper.selectRmAlarmLogList(rmAlarmLog);
    }

    /**
     * 新增客户端告警信息
     * 
     * @param rmAlarmLog 客户端告警信息
     * @return 结果
     */
    @Override
    public int insertRmAlarmLog(RmAlarmLog rmAlarmLog)
    {
        rmAlarmLog.setCreateTime(DateUtils.getNowDate());
        return rmAlarmLogMapper.insertRmAlarmLog(rmAlarmLog);
    }

    /**
     * 修改客户端告警信息
     * 
     * @param rmAlarmLog 客户端告警信息
     * @return 结果
     */
    @Override
    public int updateRmAlarmLog(RmAlarmLog rmAlarmLog)
    {
        rmAlarmLog.setUpdateTime(DateUtils.getNowDate());
        return rmAlarmLogMapper.updateRmAlarmLog(rmAlarmLog);
    }

    /**
     * 批量删除客户端告警信息
     * 
     * @param ids 需要删除的客户端告警信息主键
     * @return 结果
     */
    @Override
    public int deleteRmAlarmLogByIds(Long[] ids)
    {
        return rmAlarmLogMapper.deleteRmAlarmLogByIds(ids);
    }

    /**
     * 删除客户端告警信息信息
     * 
     * @param id 客户端告警信息主键
     * @return 结果
     */
    @Override
    public int deleteRmAlarmLogById(Long id)
    {
        return rmAlarmLogMapper.deleteRmAlarmLogById(id);
    }
}
