package com.inspect.alarminfo.service.impl;

import com.inspect.alarminfo.domain.AlarmInfo;
import com.inspect.alarminfo.mapper.AlarmInfoMapper;
import com.inspect.alarminfo.service.IAlarmInfoService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AlarmInfoServiceImpl implements IAlarmInfoService {
    private final AlarmInfoMapper alarmInfoMapper;

    public AlarmInfoServiceImpl(AlarmInfoMapper alarmInfoMapper) {
        this.alarmInfoMapper = alarmInfoMapper;
    }

    public AlarmInfo selectAlarmInfoByLineId(Long lineId) {
        return this.alarmInfoMapper.selectAlarmInfoByLineId(lineId);
    }

    public List<AlarmInfo> selectAlarmInfoList(AlarmInfo alarmInfo) {
        return this.alarmInfoMapper.selectAlarmInfoList(alarmInfo);
    }

    public int insertAlarmInfo(AlarmInfo alarmInfo) {
        this.alarmInfoMapper.insertAlarmInfo(alarmInfo);
        return alarmInfo.getLineId().intValue();
    }

    public int updateAlarmInfo(AlarmInfo alarmInfo) {
        return this.alarmInfoMapper.updateAlarmInfo(alarmInfo);
    }

    public int deleteAlarmInfoByLineIds(Long[] lineIds) {
        return this.alarmInfoMapper.deleteAlarmInfoByLineIds(lineIds);
    }

    public int deleteAlarmInfoByLineId(Long lineId) {
        return this.alarmInfoMapper.deleteAlarmInfoByLineId(lineId);
    }
}
