| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.moral.api.config.Interceptor.UserHelper; |
| | | import com.moral.api.config.mybatis.MybatisPlusConfig; |
| | | import com.moral.api.entity.*; |
| | | import com.moral.api.mapper.DeviceMapper; |
| | |
| | | import com.moral.api.mapper.HistoryHourlyMapper; |
| | | import com.moral.api.mapper.OrganizationUnitAlarmMapper; |
| | | import com.moral.api.mapper.UnitConversionMapper; |
| | | import com.moral.api.pojo.vo.device.AppDeviceVo; |
| | | import com.moral.api.pojo.vo.user.QxUser; |
| | | import com.moral.api.service.DeviceService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.moral.api.service.SensorService; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Device> getFuzzySearch(String mac) { |
| | | LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>(); |
| | | if (ObjectUtils.isEmpty(mac)){ |
| | | return null; |
| | | public List<AppDeviceVo> getFuzzySearch(String mac) { |
| | | QxUser user = UserHelper.getCurrentUser(); |
| | | Integer organizationId = user.getOrganizationId(); |
| | | // Integer organizationId = 24; |
| | | List<AppDeviceVo> devices; |
| | | if (organizationId!=24){ |
| | | devices = deviceMapper.getDevices(mac,organizationId); |
| | | }else { |
| | | devices = deviceMapper.getDevices(mac,null); |
| | | } |
| | | wrapper.eq(Device::getIsDelete,Constants.NOT_DELETE); |
| | | wrapper.like(Device::getMac,mac); |
| | | List<Device> devices = deviceMapper.selectList(wrapper); |
| | | return devices; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据站点查询设备 |
| | | * |