| | |
| | | public List<String> selectDbOverflowDep4Wkt(UserEntity ue, DownloadReqEntity dr) { |
| | | List<String> rs = new ArrayList<>(); |
| | | for (String entity : dr.getEntities()) { |
| | | try { |
| | | GeomBaseMapper<?> baseMapper = ClassHelper.getGeoBaseMapper(entity); |
| | | if (null == baseMapper) { |
| | | continue; |
| | | } |
| | | |
| | | QueryWrapper wrapper = getWrapper4DbOverflow(ue, dr); |
| | | Integer srid = baseQueryService.getSrid(baseMapper); |
| | | if (null != srid) { |
| | | wrapper.apply(String.format("ST_Intersects(ST_PolygonFromText('%s', %d), geom)", dr.getWkt(), srid)); |
| | | } |
| | | |
| | | List<String> ids = baseMapper.selectObjs(wrapper); |
| | | addDepCodes(rs, ids); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | GeomBaseMapper<?> baseMapper = ClassHelper.getGeoBaseMapper(entity); |
| | | if (null == baseMapper) { |
| | | continue; |
| | | } |
| | | |
| | | QueryWrapper wrapper = getWrapper4DbOverflow(ue, dr); |
| | | Integer srid = baseQueryService.getSrid(baseMapper); |
| | | if (null != srid) { |
| | | wrapper.apply(String.format("ST_Intersects(ST_PolygonFromText('%s', %d), geom)", dr.getWkt(), srid)); |
| | | } |
| | | |
| | | List<String> ids = baseMapper.selectObjs(wrapper); |
| | | addDepCodes(rs, ids); |
| | | } |
| | | |
| | | return rs; |
| | |
| | | */ |
| | | public List<String> selectDbOverflowDep4Prop(UserEntity ue, DownloadReqEntity dr) { |
| | | List<String> rs = new ArrayList<>(); |
| | | try { |
| | | BasicMapper<?> baseMapper = ClassHelper.getBasicMapper(dr.getEntities().get(0)); |
| | | if (null == baseMapper) { |
| | | return rs; |
| | | } |
| | | |
| | | QueryWrapper wrapper = getWrapper4DbOverflow(ue, dr); |
| | | |
| | | List<String> ids = baseMapper.selectObjs(wrapper); |
| | | addDepCodes(rs, ids); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | BasicMapper<?> baseMapper = ClassHelper.getBasicMapper(dr.getEntities().get(0)); |
| | | if (null == baseMapper) { |
| | | return rs; |
| | | } |
| | | |
| | | QueryWrapper wrapper = getWrapper4DbOverflow(ue, dr); |
| | | List<String> ids = baseMapper.selectObjs(wrapper); |
| | | addDepCodes(rs, ids); |
| | | |
| | | return rs; |
| | | } |
| | |
| | | * 查询数据+附件 |
| | | */ |
| | | private void queryData(DownloadReqEntity dr, Map<String, List<?>> dataMap, Map<String, List<AttachEntity>> annexMap) { |
| | | for (String enity : dr.getEntities()) { |
| | | for (String entity : dr.getEntities()) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(enity); |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(entity); |
| | | if (null == baseMapper) { |
| | | continue; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | String tab = BaseQueryService.getTabName(baseMapper); |
| | | if (!dataMap.containsKey(enity)) { |
| | | dataMap.put(enity, list); |
| | | if (!dataMap.containsKey(entity)) { |
| | | dataMap.put(entity, list); |
| | | } else { |
| | | dataMap.get(enity).addAll(list); |
| | | dataMap.get(entity).addAll(list); |
| | | } |
| | | if ("bborehole".equals(enity)){ |
| | | if ("bborehole".equals(entity)) { |
| | | continue; |
| | | } |
| | | if (wrapper.isEmptyOfWhere()) { |
| | | wrapper.apply("1 = 1"); |
| | | } |
| | | |
| | | String tab = BaseQueryService.getTabName(baseMapper); |
| | | List<AttachEntity> annex = baseMapper.selectAnnex(tab, wrapper); |
| | | if (null == annex || annex.isEmpty()) { |
| | | continue; |
| | | } |
| | | |
| | | if (!annexMap.containsKey(enity)) { |
| | | annexMap.put(enity, annex); |
| | | if (!annexMap.containsKey(entity)) { |
| | | annexMap.put(entity, annex); |
| | | } else { |
| | | annexMap.get(enity).addAll(annex); |
| | | annexMap.get(entity).addAll(annex); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |