package com.ho.business.service.impl;

import com.ho.business.entity.ElecMeterConfig;
import com.ho.business.mapper.ElecMeterConfigMapper;
import com.ho.business.service.ElecMeterConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class ElecMeterConfigImpl implements ElecMeterConfigService {

    @Autowired
    ElecMeterConfigMapper elecMeterConfigMapper;


    @Override
    public ElecMeterConfig selectByParam(ElecMeterConfig ele) {
        ElecMeterConfig elecMeterConfig = elecMeterConfigMapper.selectByParam(ele);
        return elecMeterConfig;
    }

    @Override
    public int insertElecMeterConfig(ElecMeterConfig ele) {
        ele.setCreateTime(new Date());
        int count = elecMeterConfigMapper.insertElecMeterConfig(ele);
        return count;
    }

    @Override
    public int updateById(ElecMeterConfig ele) {
        ele.setUpdateTime(new Date());
        int count = elecMeterConfigMapper.updateById(ele);
        return count;
    }
}
