package com.goomood.phm.service.impl;

import java.util.List;
import com.goomood.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.goomood.phm.mapper.FaultSettingMapper;
import com.goomood.phm.domain.FaultSetting;
import com.goomood.phm.service.IFaultSettingService;

/**
 * 预警设置Service业务层处理
 * 
 * @author goomood
 * @date 2024-11-17
 */
@Service
public class FaultSettingServiceImpl implements IFaultSettingService 
{
    @Autowired
    private FaultSettingMapper faultSettingMapper;

    /**
     * 查询预警设置
     * 
     * @param id 预警设置主键
     * @return 预警设置
     */
    @Override
    public FaultSetting selectFaultSettingById(Long id)
    {
        return faultSettingMapper.selectFaultSettingById(id);
    }

    /**
     * 查询预警设置列表
     * 
     * @param faultSetting 预警设置
     * @return 预警设置
     */
    @Override
    public List<FaultSetting> selectFaultSettingList(FaultSetting faultSetting)
    {
        return faultSettingMapper.selectFaultSettingList(faultSetting);
    }

    /**
     * 新增预警设置
     * 
     * @param faultSetting 预警设置
     * @return 结果
     */
    @Override
    public int insertFaultSetting(FaultSetting faultSetting)
    {
        faultSetting.setCreateTime(DateUtils.getNowDate());
        return faultSettingMapper.insertFaultSetting(faultSetting);
    }

    /**
     * 修改预警设置
     * 
     * @param faultSetting 预警设置
     * @return 结果
     */
    @Override
    public int updateFaultSetting(FaultSetting faultSetting)
    {
        faultSetting.setUpdateTime(DateUtils.getNowDate());
        return faultSettingMapper.updateFaultSetting(faultSetting);
    }

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

    /**
     * 删除预警设置信息
     * 
     * @param id 预警设置主键
     * @return 结果
     */
    @Override
    public int deleteFaultSettingById(Long id)
    {
        return faultSettingMapper.deleteFaultSettingById(id);
    }
}
