package com.agri.system.service.impl;

import com.agri.common.utils.DateUtils;
import com.agri.system.domain.SysAgriAlarmRelation;
import com.agri.system.mapper.SysAgriAlarmRelationMapper;
import com.agri.system.service.ISysAgriAlarmRelationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 告警方式设置Service业务层处理
 * 
 * @author agri
 * @date 2026-01-08
 */
@Service
public class SysAgriAlarmRelationServiceImpl extends ServiceImpl<SysAgriAlarmRelationMapper, SysAgriAlarmRelation> implements ISysAgriAlarmRelationService
{

    /**
     * 查询告警方式设置
     * 
     * @param id 告警方式设置主键
     * @return 告警方式设置
     */
    @Override
    public SysAgriAlarmRelation selectSysAgriAlarmRelationById(Long id)
    {
        return baseMapper.selectSysAgriAlarmRelationById(id);
    }

    /**
     * 查询告警方式设置列表
     * 
     * @param sysAgriAlarmRelation 告警方式设置
     * @return 告警方式设置
     */
    @Override
    public List<SysAgriAlarmRelation> selectSysAgriAlarmRelationList(SysAgriAlarmRelation sysAgriAlarmRelation)
    {
        return baseMapper.selectSysAgriAlarmRelationList(sysAgriAlarmRelation);
    }

    /**
     * 新增告警方式设置
     * 
     * @param sysAgriAlarmRelation 告警方式设置
     * @return 结果
     */
    @Override
    public int insertSysAgriAlarmRelation(SysAgriAlarmRelation sysAgriAlarmRelation)
    {
        sysAgriAlarmRelation.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertSysAgriAlarmRelation(sysAgriAlarmRelation);
    }

    /**
     * 修改告警方式设置
     * 
     * @param sysAgriAlarmRelation 告警方式设置
     * @return 结果
     */
    @Override
    public int updateSysAgriAlarmRelation(SysAgriAlarmRelation sysAgriAlarmRelation)
    {
        sysAgriAlarmRelation.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateSysAgriAlarmRelation(sysAgriAlarmRelation);
    }

    /**
     * 批量删除告警方式设置
     * 
     * @param ids 需要删除的告警方式设置主键
     * @return 结果
     */
    @Override
    public int deleteSysAgriAlarmRelationByIds(Long[] ids)
    {
        return baseMapper.deleteSysAgriAlarmRelationByIds(ids);
    }

    /**
     * 删除告警方式设置信息
     * 
     * @param id 告警方式设置主键
     * @return 结果
     */
    @Override
    public int deleteSysAgriAlarmRelationById(Long id)
    {
        return baseMapper.deleteSysAgriAlarmRelationById(id);
    }
}
