package com.ruoyi.ems.service.impl;

import com.ruoyi.ems.domain.MeterReading;
import com.ruoyi.ems.domain.vo.QueryMeterReading;
import com.ruoyi.ems.mapper.MeterReadingMapper;
import com.ruoyi.ems.service.IMeterReadingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 手动抄记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-28
 */
@Service
public class MeterReadingServiceImpl implements IMeterReadingService {
    @Autowired
    private MeterReadingMapper meterReadingMapper;

    @Override
    public MeterReading selectById(Long id) {
        return meterReadingMapper.selectById(id);
    }

    @Override
    public MeterReading selectLastItem(String areaCode, String deviceCode) {
        return meterReadingMapper.selectLastItem(areaCode, deviceCode);
    }

    @Override
    public List<MeterReading> selectList(QueryMeterReading queryMeterReading) {
        return meterReadingMapper.selectList(queryMeterReading);
    }

    @Override
    public int insert(MeterReading meterReadingManual) {
        return meterReadingMapper.insert(meterReadingManual);
    }

    @Override
    public int update(MeterReading meterReadingManual) {
        return meterReadingMapper.update(meterReadingManual);
    }

    @Override
    public int deleteById(Long id) {
        return meterReadingMapper.deleteById(id);
    }
}
