package com.inspect.metadata.prodevmnt.service.impl;

import com.inspect.metadata.prodevmnt.domain.BasedataModelDevice;
import com.inspect.metadata.prodevmnt.mapper.BasedataModelDeviceMapper;
import com.inspect.metadata.prodevmnt.service.IBasedataModelDeviceService;
import com.inspect.base.core.utils.DateUtils;

import java.util.List;

import org.springframework.stereotype.Service;

@Service
public class BasedataModelDeviceServiceImpl implements IBasedataModelDeviceService {
    private final BasedataModelDeviceMapper basedataModelDeviceMapper;

    public BasedataModelDeviceServiceImpl(BasedataModelDeviceMapper basedataModelDeviceMapper) {
        this.basedataModelDeviceMapper = basedataModelDeviceMapper;
    }

    public BasedataModelDevice selectBasedataModelDeviceByModelDeviceId(String modelDeviceId) {
        return this.basedataModelDeviceMapper.selectBasedataModelDeviceByModelDeviceId(modelDeviceId);
    }

    public List<BasedataModelDevice> selectBasedataModelDeviceList(BasedataModelDevice basedataModelDevice) {
        return this.basedataModelDeviceMapper.selectBasedataModelDeviceList(basedataModelDevice);
    }

    public int insertBasedataModelDevice(BasedataModelDevice basedataModelDevice) {
        basedataModelDevice.setCreateTime(DateUtils.getNowDate());
        return this.basedataModelDeviceMapper.insertBasedataModelDevice(basedataModelDevice);
    }

    public int updateBasedataModelDevice(BasedataModelDevice basedataModelDevice) {
        basedataModelDevice.setUpdateTime(DateUtils.getNowDate());
        return this.basedataModelDeviceMapper.updateBasedataModelDevice(basedataModelDevice);
    }

    public int deleteBasedataModelDeviceByModelDeviceIds(String[] modelDeviceIds) {
        return this.basedataModelDeviceMapper.deleteBasedataModelDeviceByModelDeviceIds(modelDeviceIds);
    }

    public int deleteBasedataModelDeviceByModelDeviceId(String modelDeviceId) {
        return this.basedataModelDeviceMapper.deleteBasedataModelDeviceByModelDeviceId(modelDeviceId);
    }
}
