package com.tykj.dev.device.apply.service.impl;

import com.tykj.dev.device.apply.repository.DeviceApplyBillDao;
import com.tykj.dev.device.apply.service.DeviceApplyBillService;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @author dengdiyi
 */
@Service
public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {

    @Autowired
    private DeviceApplyBillDao deviceApplyBillDao;

    @Override
    public DeviceApplyBill addEntity(DeviceApplyBill deviceApplyBillEntity) {
        return deviceApplyBillDao.save(deviceApplyBillEntity);
    }

    @Override
    public DeviceApplyBill update(DeviceApplyBill deviceApplyBillEntity) {
        return deviceApplyBillDao.save(deviceApplyBillEntity);
    }

    @Override
    public DeviceApplyBill getOne(Integer id) {
        Optional<DeviceApplyBill> deviceApplyBillEntity = deviceApplyBillDao.findById(id);
        return deviceApplyBillEntity.orElse(null);
    }

}
