| | |
| | | */
|
| | | @Override
|
| | | public List<Device> query(Map<String, Object> params) {
|
| | | List<Integer> dv = deviceMapper.getHasWindDirAndWindSpeedDeviceVersion();
|
| | | Object orgIdObj = params.get("orgId");
|
| | | List<Device> deviceList = null;
|
| | | if (orgIdObj != null) {
|
| | |
| | | params.put("orgIds", orgIds);
|
| | | deviceList = deviceMapper.selectByMap(params);
|
| | | // loadDeviceState(deviceList);
|
| | | }
|
| | | Example deviceExample = new Example(Device.class);//实例化
|
| | | Example.Criteria deviceCriteria = deviceExample.createCriteria();
|
| | | deviceCriteria.orEqualTo("isDelete", Constants.IS_DELETE_FALSE);
|
| | | List<Device> devicesInfo = deviceMapper.selectByExample(deviceExample);
|
| | | for (Device d : deviceList) {
|
| | | if (dv.contains(d.getDeviceVersionId())) {
|
| | | d.setHasWindInfo(true);
|
| | | } else {
|
| | | d.setHasWindInfo(false);
|
| | | }
|
| | | for (Device temp : devicesInfo) {
|
| | | if (d.getId().equals(temp.getId())) {
|
| | | d.setState(temp.getState());
|
| | | }
|
| | | }
|
| | | }
|
| | | return deviceList;
|
| | | }
|
| | |
| | | public List<String> getMacsByOrganizationId(List<Object> organizationIdList) {
|
| | | return deviceMapper.getMacsByOrganizationId(organizationIdList);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Device> getDeviceById1(int id) {
|
| | | return deviceMapper.getDeviceById1(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Device> getDeviceById2(int id) {
|
| | | return deviceMapper.getDeviceById2(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Device> getDeviceById3(int id) {
|
| | | return deviceMapper.getDeviceById3(id);
|
| | | }
|
| | | }
|