| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | |
| | | import com.sandu.ximon.dao.mapper.PoleBindingMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author chenjiantian |
| | |
| | | Integer deviceType = param.getDeviceType(); |
| | | // if (PoleBindingEnums.LIGHT.getCode().equals(deviceType)) { |
| | | // } |
| | | LambdaQueryWrapper<PoleBinding> eq = Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId); |
| | | List<PoleBinding> list = list(eq); |
| | | if (list.size() != 0){ |
| | | for (PoleBinding poleBinding : list) { |
| | | if (poleBinding.getDeviceType().equals(deviceType)) { |
| | | throw new BusinessException("该灯杆已绑定过相同类型设备"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | PoleBinding one = getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, param.getDeviceCode())); |
| | | if (one == null) { |
| | |
| | | } |
| | | } |
| | | |
| | | public PoleBinding getPoleIdByMac(String deviceCode){ |
| | | return getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, deviceCode)); |
| | | public PoleBinding getPoleIdByMac(String deviceCode) { |
| | | return getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, deviceCode)); |
| | | } |
| | | } |