package com.prolog.eis.service.device.impl;

import com.prolog.eis.constants.base.BaseLockConstants;
import com.prolog.eis.dao.device.DeviceInfoMapper;
import com.prolog.eis.model.device.DeviceInfo;
import com.prolog.eis.service.device.DeviceInfoService;
import com.prolog.framework.core.restriction.Criteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeviceInfoServiceImpl implements DeviceInfoService {

    @Autowired
    private DeviceInfoMapper deviceInfoMapper;

    @Override
    public List<DeviceInfo> findCanUseAreaByItemType(double deviceHeight, String belongArea) {
        Criteria criteria = Criteria.forClass(DeviceInfo.class);
        criteria.restrictionBuilder()
                .eq(DeviceInfo::getIsLock, BaseLockConstants.NO_LOCK)
                .build();
        List<DeviceInfo> deviceInfoList = deviceInfoMapper.findByCriteria(criteria);
        return deviceInfoList;
    }
}

