fix: 优化地图逻辑
This commit is contained in:
parent
db6f87ba71
commit
3ea58d0266
@ -1185,12 +1185,17 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
" fp.DTIN AS dtin\n" +
|
||||
"FROM SD_FPSS_B_H fp\n" +
|
||||
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = fp.RSTCD AND NVL(eng.IS_DELETED, 0) = 0\n" +
|
||||
"WHERE NVL(fp.IS_DELETED, 0) = 0 AND fp.BLDSTT_CODE = 1 AND fp.LGTD IS NOT NULL AND fp.LTTD IS NOT NULL ");
|
||||
"WHERE NVL(fp.IS_DELETED, 0) = 0 ");
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String filterSql = buildFpPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
||||
dataSourceRequest.getFilter(),
|
||||
paramMap,
|
||||
new int[]{0},
|
||||
this::mapFpColumn
|
||||
);
|
||||
// String filterSql = buildFpPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
@ -1227,6 +1232,19 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
private String mapFpColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
return switch (field.toLowerCase()) {
|
||||
case "bldsttccode" -> "fp.BLDSTT_CODE";
|
||||
case "lgtd" -> "fp.LGTD";
|
||||
case "lttd" -> "fp.LTTD";
|
||||
case "fhstcd" -> "fp.FHSTCD";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private String buildFpPointFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
|
||||
@ -143,17 +143,17 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
.append("TO_CHAR(aim.BLDSTT_CODE) AS bldstt, ")
|
||||
.append("aim.LTTD AS lttd, ")
|
||||
.append("aim.LGTD AS lgtd, ")
|
||||
.append("aim.DTMEL AS dtmel, ")
|
||||
// .append("aim.DTMEL AS dtmel, ")
|
||||
.append("aim.RSTCD AS rstcds, ")
|
||||
.append("eng.ENNM AS ennm, ")
|
||||
.append("aim.STTP AS sttpCode, ")
|
||||
.append("aim.DWTP AS dwtp, ")
|
||||
.append("aim.DWTP AS dwtpName, ")
|
||||
// .append("aim.DWTP AS dwtp, ")
|
||||
// .append("aim.DWTP AS dwtpName, ")
|
||||
.append("aim.STTP AS sttpMap, ")
|
||||
.append("aim.RVCD AS rvcd, ")
|
||||
.append("rv.RVNM AS rvcdName, ")
|
||||
.append("aim.ADDVCD AS addvcd, ")
|
||||
.append("addv.ADDVCD_NAME AS addvcdName, ")
|
||||
// .append("aim.ADDVCD AS addvcd, ")
|
||||
// .append("addv.ADDVCD_NAME AS addvcdName, ")
|
||||
.append("aim.HBRVCD AS hbrvcd, ")
|
||||
.append("hbrv.HBRVNM AS hbrvcdName, ")
|
||||
.append("aim.BASE_ID AS baseId, ")
|
||||
@ -163,7 +163,7 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
.append("'' AS anchoPointState, ")
|
||||
.append("aim.MWAY AS mway, ")
|
||||
.append("aim.DTIN AS dtin, ")
|
||||
.append("aim.STDSSTATE AS stdSstate, ")
|
||||
// .append("aim.STDSSTATE AS stdSstate, ")
|
||||
.append("aim.STLC AS stlc ")
|
||||
.append("FROM SD_AIMONITOR_B_H aim ")
|
||||
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = aim.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 ")
|
||||
@ -173,7 +173,7 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
||||
.append(" AND NVL(hbrv.IS_DELETED, 0) = 0 ")
|
||||
.append(" AND NVL(hbrv.ENABLED, 1) = 1 ")
|
||||
.append("LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = aim.RVCD ")
|
||||
.append("LEFT JOIN SD_ADDVCD_DIC addv ON addv.ADDVCD = aim.ADDVCD ")
|
||||
// .append("LEFT JOIN SD_ADDVCD_DIC addv ON addv.ADDVCD = aim.ADDVCD ")
|
||||
.append("LEFT JOIN SD_STTP_B sttp ON sttp.STTP_CODE = aim.STTP ")
|
||||
.append(" AND NVL(sttp.IS_DELETED, 0) = 0 ")
|
||||
.append(" AND NVL(sttp.ENABLE, 1) = 1 ")
|
||||
|
||||
@ -1948,7 +1948,7 @@ public class VpConstructionServiceImpl implements VpConstructionService {
|
||||
" t.STTP AS sttp,\n" +
|
||||
" t.DTIN AS dtin\n" +
|
||||
"FROM (\n" +
|
||||
" SELECT STCD, STNM, STTP, LGTD, LTTD, ELEV, RSTCD, BASE_ID, RVCD, ADDVCD, BLDSTT_CODE, DTIN\n" +
|
||||
" SELECT STCD, STNM, STTP, LGTD, LTTD, ELEV, RSTCD, BASE_ID,NULL RVCD,NULL ADDVCD, BLDSTT_CODE, DTIN\n" +
|
||||
" FROM SD_VP_B_H\n" +
|
||||
" WHERE NVL(IS_DELETED, 0) = 0 AND BLDSTT_CODE = 1 AND LGTD IS NOT NULL AND LTTD IS NOT NULL\n" +
|
||||
" UNION ALL\n" +
|
||||
@ -1960,10 +1960,16 @@ public class VpConstructionServiceImpl implements VpConstructionService {
|
||||
" FROM SD_FHBT_B_H\n" +
|
||||
" WHERE NVL(IS_DELETED, 0) = 0 AND LGTD IS NOT NULL AND LTTD IS NOT NULL\n" +
|
||||
") t\n" +
|
||||
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = t.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 ");
|
||||
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = t.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 WHERE 1=1");
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildFhvapPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
||||
dataSourceRequest.getFilter(),
|
||||
paramMap,
|
||||
new int[]{0},
|
||||
this::mapVpColumn
|
||||
);
|
||||
// String filterSql = buildFhvapPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql);
|
||||
}
|
||||
@ -1991,6 +1997,26 @@ public class VpConstructionServiceImpl implements VpConstructionService {
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
private String mapVpColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> columnMap = new HashMap<>();
|
||||
columnMap.put("stcd", "t.STCD");
|
||||
columnMap.put("stnm", "t.STNM");
|
||||
columnMap.put("sttpcode", "t.STTP");
|
||||
columnMap.put("bldsttccode", "t.BLDSTT_CODE");
|
||||
columnMap.put("lgtd", "t.LGTD");
|
||||
columnMap.put("lttd", "t.LTTD");
|
||||
columnMap.put("baseId", "t.BASE_ID");
|
||||
columnMap.put("rvcd", "t.RVCD");
|
||||
columnMap.put("addvcd", "t.ADDVCD");
|
||||
columnMap.put("rstcds", "t.RSTCD");
|
||||
columnMap.put("ennm", "eng.ENNM");
|
||||
return columnMap.get(field.toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
private String buildFhvapPointFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
@ -2149,19 +2175,25 @@ public class VpConstructionServiceImpl implements VpConstructionService {
|
||||
" we.ELEV AS dtmel,\n" +
|
||||
" we.RSTCD AS rstcds,\n" +
|
||||
" eng.ENNM AS ennm,\n" +
|
||||
" 'WVA' AS sttpMap,\n" +
|
||||
" we.STTP AS sttpMap,\n" +
|
||||
" we.RVCD AS rvcd,\n" +
|
||||
" we.ADDVCD AS addvcd,\n" +
|
||||
// " we.ADDVCD AS addvcd,\n" +
|
||||
" we.BASE_ID AS baseId,\n" +
|
||||
" 'WVA' AS sttp,\n" +
|
||||
" we.STTP AS sttp,\n" +
|
||||
" 'wild_animal_legend' AS anchoPointState,\n" +
|
||||
" 'WVA' AS sttpCode\n" +
|
||||
"FROM SD_WE_B_H we\n" +
|
||||
" we.STTP AS sttpCode\n" +
|
||||
"FROM SD_AIMONITOR_B_H we\n" +
|
||||
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = we.RSTCD AND NVL(eng.IS_DELETED, 0) = 0\n" +
|
||||
"WHERE we.LGTD IS NOT NULL AND we.LTTD IS NOT NULL ");
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildWvaPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
||||
dataSourceRequest.getFilter(),
|
||||
paramMap,
|
||||
new int[]{0},
|
||||
this::mapVapWvaColumn
|
||||
);
|
||||
// String filterSql = buildWvaPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql);
|
||||
}
|
||||
@ -2176,6 +2208,26 @@ public class VpConstructionServiceImpl implements VpConstructionService {
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
private String mapVapWvaColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> columnMap = new HashMap<>();
|
||||
columnMap.put("stcd", "we.STCD");
|
||||
columnMap.put("stnm", "we.STNM");
|
||||
columnMap.put("sttpcode", "we.STTP");
|
||||
columnMap.put("bldsttccode", "we.BLDSTT_CODE");
|
||||
columnMap.put("lgtd", "we.LGTD");
|
||||
columnMap.put("lttd", "we.LTTD");
|
||||
columnMap.put("baseId", "we.BASE_ID");
|
||||
columnMap.put("rvcd", "we.RVCD");
|
||||
columnMap.put("addvcd", "we.ADDVCD");
|
||||
columnMap.put("rstcds", "weRSTCD");
|
||||
columnMap.put("ennm", "eng.ENNM");
|
||||
return columnMap.get(field.toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
private String buildWvaPointFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
|
||||
@ -2425,7 +2425,13 @@ public class ZqMonitorServiceImpl implements ZqMonitorService {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String filterSql = buildMsstbprptFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
||||
dataSourceRequest.getFilter(),
|
||||
paramMap,
|
||||
new int[]{0},
|
||||
this::mapZqColumn
|
||||
);
|
||||
// String filterSql = buildMsstbprptFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
@ -2446,4 +2452,16 @@ public class ZqMonitorServiceImpl implements ZqMonitorService {
|
||||
dataSourceResult.setTotal(page == null ? resultList.size() : page.getTotal());
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
|
||||
private String mapZqColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
return switch (field.toLowerCase()) {
|
||||
case "dtintype" -> "rb.DTIN_TYPE";
|
||||
case "lgtd" -> "rb.LGTD";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user