|  |  | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  |  | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.Date; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  | 
 |  |  |     public void judgeOffLineDevice() { | 
 |  |  |         QueryWrapper<Device> queryWrapper = new QueryWrapper<>(); | 
 |  |  |         queryWrapper.ne("state", Constants.DEVICE_STATE_OFFLINE); | 
 |  |  |         queryWrapper.eq("is_delete",Constants.NOT_DELETE); | 
 |  |  |         //获取所有在线设备 | 
 |  |  |         List<Device> devices = deviceMapper.selectList(queryWrapper); | 
 |  |  |         for (Device device : devices) { | 
 |  |  | 
 |  |  |         updateWrapper.eq("id", device.getId()).set("state", device.getState()); | 
 |  |  |         deviceMapper.update(null, updateWrapper); | 
 |  |  |     } | 
 |  |  | } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public List<Device> getDateByOrgId(int orgId) { | 
 |  |  |         QueryWrapper<Device> wrapper_device = new QueryWrapper<>(); | 
 |  |  |         wrapper_device.eq("is_delete",Constants.NOT_DELETE).eq("organization_id",orgId); | 
 |  |  |         List<Device> devices = new ArrayList<>(); | 
 |  |  |         devices = deviceMapper.selectList(wrapper_device); | 
 |  |  |         return devices; | 
 |  |  |     } | 
 |  |  | } |