package com.ruoyi.ems.service.impl;

import com.ruoyi.ems.domain.MeterDevice;
import com.ruoyi.ems.mapper.MeterDeviceMapper;
import com.ruoyi.ems.service.IMeterDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 计量设备Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-08
 */
@Service
public class MeterDeviceServiceImpl implements IMeterDeviceService {
    @Autowired
    private MeterDeviceMapper meterDeviceMapper;

    /**
     * 查询计量设备
     *
     * @param id 计量设备主键
     * @return 计量设备
     */
    @Override
    public MeterDevice selectMeterDeviceById(Long id) {
        return meterDeviceMapper.selectMeterDeviceById(id);
    }

    /**
     * 查询计量设备列表
     *
     * @param meterDevice 计量设备
     * @return 计量设备
     */
    @Override
    public List<MeterDevice> selectMeterDeviceList(MeterDevice meterDevice) {
        return meterDeviceMapper.selectMeterDeviceList(meterDevice);
    }

    /**
     * 新增计量设备
     *
     * @param meterDevice 计量设备
     * @return 结果
     */
    @Override
    public int insertMeterDevice(MeterDevice meterDevice) {
        return meterDeviceMapper.insertMeterDevice(meterDevice);
    }

    /**
     * 修改计量设备
     *
     * @param meterDevice 计量设备
     * @return 结果
     */
    @Override
    public int updateMeterDevice(MeterDevice meterDevice) {
        return meterDeviceMapper.updateMeterDevice(meterDevice);
    }

    /**
     * 批量删除计量设备
     *
     * @param ids 需要删除的计量设备主键
     * @return 结果
     */
    @Override
    public int deleteMeterDeviceByIds(Long[] ids) {
        return meterDeviceMapper.deleteMeterDeviceByIds(ids);
    }

    /**
     * 删除计量设备信息
     *
     * @param id 计量设备主键
     * @return 结果
     */
    @Override
    public int deleteMeterDeviceById(Long id) {
        return meterDeviceMapper.deleteMeterDeviceById(id);
    }
}
