| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.BufferedWriter; |
| | | import java.io.File; |
| | | import java.io.FileWriter; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | QueryWrapper<MonitorPoint> queryMonitorPointsWrapper = new QueryWrapper<>(); |
| | | |
| | | //如果region不为空,就查询当前组织,所选城市下所有站点及设备信息 |
| | | //如果region为空,则查询当前组织下所有的站点和设备 |
| | | if (region != null){ |
| | | queryMonitorPointsWrapper.eq(region, regionCode); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MonitorPoint> queryStateControlStationByRegionCode(Integer regionCode) { |
| | | //获取国控站组织 |
| | | Organization stateControlStationOrganization = organizationService.getStateControlStation(); |
| | | //获取国控站组织下的所有站点 |
| | | QueryWrapper<MonitorPoint> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_delete", Constants.NOT_DELETE); |
| | | queryWrapper.eq("organization_id", stateControlStationOrganization.getId()); |
| | | queryWrapper.eq(RegionCodeUtils.regionCodeConvertToName(regionCode), regionCode); |
| | | return monitorPointMapper.selectList(queryWrapper); |
| | | public List<MonitorPoint> queryAllMonitorPoints(Integer organizationId) { |
| | | //查询子组织 |
| | | List<Organization> childrenOrganization = organizationService.getChildrenOrganizationsById(organizationId); |
| | | List<Integer> organizationIds = new ArrayList<>(); |
| | | for (Organization organization : childrenOrganization) { |
| | | organizationIds.add(organization.getId()); |
| | | } |
| | | organizationIds.add(organizationId); |
| | | //查询站点 |
| | | QueryWrapper<MonitorPoint> queryMonitorPointsWrapper = new QueryWrapper<>(); |
| | | queryMonitorPointsWrapper.select("id","name"); |
| | | queryMonitorPointsWrapper.in("organization_id",organizationIds); |
| | | queryMonitorPointsWrapper.eq("is_delete", Constants.NOT_DELETE); |
| | | List<MonitorPoint> monitorPoints = monitorPointMapper.selectList(queryMonitorPointsWrapper); |
| | | return monitorPoints; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |