| | |
| | | * 请求DB数据下载 |
| | | */ |
| | | public String downloadDbReq(UserEntity ue, DownloadReqEntity dr) { |
| | | Map<String, String> annexMap = new HashMap<>(3); |
| | | Map<String, List<?>> dataMap = new HashMap<>(3); |
| | | Map<String, List<?>> dataMap = new HashMap<>(2); |
| | | Map<String, List<AttachEntity>> annexMap = new HashMap<>(2); |
| | | |
| | | queryData(dr, dataMap, annexMap); |
| | | if (dataMap.size() == 0) { |
| | |
| | | /** |
| | | * 查询数据 |
| | | */ |
| | | private void queryData(DownloadReqEntity dr, Map<String, List<?>> dataMap, Map<String, String> annexMap) { |
| | | private void queryData(DownloadReqEntity dr, Map<String, List<?>> dataMap, Map<String, List<AttachEntity>> annexMap) { |
| | | for (String enity : dr.getEntities()) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(enity); |
| | |
| | | continue; |
| | | } |
| | | |
| | | String tab = BaseQueryService.getTabName(baseMapper); |
| | | if (!dataMap.containsKey(enity)) { |
| | | dataMap.put(enity, list); |
| | | } else { |
| | | dataMap.get(enity).addAll(list); |
| | | } |
| | | 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); |
| | | } else { |
| | | annexMap.get(enity).addAll(annex); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |