| | |
| | | import com.moral.entity.Sensor;
|
| | | import com.moral.mapper.DeviceMapper;
|
| | | import com.moral.mapper.HistoryMapper;
|
| | | import com.moral.mapper.OrganizationRelationMapper;
|
| | | import com.moral.mapper.SensorMapper;
|
| | | import com.moral.mapper.SensorUnitMapper;
|
| | | import com.moral.service.AccountService;
|
| | |
| | |
|
| | | @Resource
|
| | | private ProfessionService professionService;
|
| | | |
| | | @Resource
|
| | | private OrganizationRelationMapper organizationRelationMapper;
|
| | |
|
| | | @Override
|
| | | public Map<String, Object> getAllSensorAverageByDevice(Map<String, Object> parameters) throws Exception {
|
| | |
| | |
|
| | | return returnMap;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Map<String, Object> getMointorPointRankByOrganizationId(Map<String, Object> parameters) {
|
| | | //获取组织id
|
| | | String organizationId = parameters.get("organization_id").toString();
|
| | | //声明一个集合存放要查询站点数据的组织id
|
| | | List<Object> organizationIdList = new ArrayList<>();
|
| | | organizationIdList.add(organizationId);
|
| | | //声明一个集合存放父组织id
|
| | | List<Object> parentIdList = new ArrayList<>();
|
| | | parentIdList.add(organizationId);
|
| | | |
| | | //进行循环
|
| | | for(int i=0;i<10;i++) {
|
| | | if(!parentIdList.isEmpty()) {
|
| | | //或去该组织下的子组织
|
| | | System.out.println("parentIdList:"+parentIdList);
|
| | | List<Map<String, Object>> childIdList = organizationRelationMapper.getChildIdByParentId(parentIdList);
|
| | | //清空父组织id集合
|
| | | parentIdList.clear();
|
| | | System.out.println("childIdList:"+childIdList);
|
| | | //将子组织id放入到集合中
|
| | | for (Map<String, Object> map : childIdList) {
|
| | | organizationIdList.add(map.get("child_id"));
|
| | | parentIdList.add(map.get("child_id"));
|
| | | }
|
| | | }else {
|
| | | break;
|
| | | }
|
| | | }
|
| | | System.out.println(organizationIdList);
|
| | | |
| | | return null;
|
| | | }
|
| | | }
|