| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | 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.mybatis.MybatisPlusConfig; |
| | | import com.moral.api.entity.*; |
| | |
| | | return device; |
| | | } |
| | | |
| | | /** |
| | | * 模糊查询 |
| | | * |
| | | * @param mac |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Device> getFuzzySearch(String mac) { |
| | | LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>(); |
| | | if (ObjectUtils.isEmpty(mac)){ |
| | | return null; |
| | | } |
| | | wrapper.eq(Device::getIsDelete,Constants.NOT_DELETE); |
| | | wrapper.like(Device::getMac,mac); |
| | | List<Device> devices = deviceMapper.selectList(wrapper); |
| | | return devices; |
| | | } |
| | | |
| | | /** |
| | | * 根据组织查询设备 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Device> getOrganizationDevice(Integer id) { |
| | | LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Device::getOrganizationId,id); |
| | | wrapper.eq(Device::getIsDelete,Constants.NOT_DELETE); |
| | | wrapper.orderByAsc(Device::getCreateTime); |
| | | List<Device> devices = deviceMapper.selectList(wrapper); |
| | | return devices; |
| | | } |
| | | |
| | | private Device getDeviceUnitAlramInforByMacFromDb(String mac){ |
| | | QueryWrapper<Device> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("mac",mac); |