feat: 查询水减缓设施类型介绍
This commit is contained in:
parent
584f1fa7f8
commit
c85e2d916d
@ -173,6 +173,12 @@ public class SdWTMonitorController {
|
|||||||
return ResponseResult.successData(sdWtMonitorService.getDfltkwFacilityCount(dataSourceRequest));
|
return ResponseResult.successData(sdWtMonitorService.getDfltkwFacilityCount(dataSourceRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/sttpb/GetKendoList")
|
||||||
|
@Operation(summary = "查询水减缓设施类型介绍")
|
||||||
|
public ResponseResult getSttpbList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(sdWtMonitorService.getSttpbList(dataSourceRequest));
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/vmsstbprpt/GetKendoList")
|
@PostMapping("/vmsstbprpt/GetKendoList")
|
||||||
@Operation(summary = "根据类型查询水温表基本数据")
|
@Operation(summary = "根据类型查询水温表基本数据")
|
||||||
public ResponseResult getVmsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult getVmsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
|||||||
41
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/SttpInfoVo.java
vendored
Normal file
41
backend/src/main/java/com/yfd/platform/env/wt/entity/vo/SttpInfoVo.java
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
package com.yfd.platform.env.wt.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "站类信息表")
|
||||||
|
public class SttpInfoVo implements Serializable {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String recordUser;
|
||||||
|
private Date recordTime;
|
||||||
|
private Date modifyTime;
|
||||||
|
private String displayRecordUser;
|
||||||
|
private String isolateType;
|
||||||
|
private Integer stbprpCnt;
|
||||||
|
private String recordUserName;
|
||||||
|
private String modifyUserName;
|
||||||
|
private String displayDepartment;
|
||||||
|
private String sttpCode;
|
||||||
|
private String sttpName;
|
||||||
|
private String description;
|
||||||
|
private String parentId;
|
||||||
|
private Integer enable;
|
||||||
|
private Integer treeLevel;
|
||||||
|
private Integer hasChildren;
|
||||||
|
private String fullPath;
|
||||||
|
private Integer internal;
|
||||||
|
private String introduce;
|
||||||
|
private String logo;
|
||||||
|
private String inffile;
|
||||||
|
private Integer orderIndex;
|
||||||
|
private String filterContent;
|
||||||
|
private Integer isTempStorage;
|
||||||
|
private String departmentId;
|
||||||
|
private String systemId;
|
||||||
|
private String platformId;
|
||||||
|
}
|
||||||
@ -5,6 +5,7 @@ import com.yfd.platform.common.DataSourceResult;
|
|||||||
import com.yfd.platform.env.wt.entity.vo.DfltkwFacilityCountVo;
|
import com.yfd.platform.env.wt.entity.vo.DfltkwFacilityCountVo;
|
||||||
import com.yfd.platform.env.wt.entity.vo.RstcdTreeInfoVo;
|
import com.yfd.platform.env.wt.entity.vo.RstcdTreeInfoVo;
|
||||||
import com.yfd.platform.env.wt.entity.vo.SdYearDetailVO;
|
import com.yfd.platform.env.wt.entity.vo.SdYearDetailVO;
|
||||||
|
import com.yfd.platform.env.wt.entity.vo.SttpInfoVo;
|
||||||
import com.yfd.platform.env.wt.entity.vo.WbsbVo;
|
import com.yfd.platform.env.wt.entity.vo.WbsbVo;
|
||||||
import com.yfd.platform.env.wt.entity.vo.WtrvVo;
|
import com.yfd.platform.env.wt.entity.vo.WtrvVo;
|
||||||
|
|
||||||
@ -26,6 +27,8 @@ public interface SdWtMonitorService {
|
|||||||
|
|
||||||
DataSourceResult<DfltkwFacilityCountVo> getDfltkwFacilityCount(DataSourceRequest dataSourceRequest);
|
DataSourceResult<DfltkwFacilityCountVo> getDfltkwFacilityCount(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<SttpInfoVo> getSttpbList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
DataSourceResult<SdYearDetailVO> getYearDetailList(DataSourceRequest dataSourceRequest);
|
DataSourceResult<SdYearDetailVO> getYearDetailList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
List<RstcdTreeInfoVo> getWtvtDefaultTreeStcd(DataSourceRequest dataSourceRequest);
|
List<RstcdTreeInfoVo> getWtvtDefaultTreeStcd(DataSourceRequest dataSourceRequest);
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import com.yfd.platform.env.wt.entity.vo.RstcdTreeInfoVo;
|
|||||||
import com.yfd.platform.env.wt.entity.vo.SdYearDetailVO;
|
import com.yfd.platform.env.wt.entity.vo.SdYearDetailVO;
|
||||||
import com.yfd.platform.env.wt.entity.vo.SdWtBaseInfoVO;
|
import com.yfd.platform.env.wt.entity.vo.SdWtBaseInfoVO;
|
||||||
import com.yfd.platform.env.wt.entity.vo.SdWtMonitorCountVO;
|
import com.yfd.platform.env.wt.entity.vo.SdWtMonitorCountVO;
|
||||||
|
import com.yfd.platform.env.wt.entity.vo.SttpInfoVo;
|
||||||
import com.yfd.platform.env.wt.entity.vo.WbsbVo;
|
import com.yfd.platform.env.wt.entity.vo.WbsbVo;
|
||||||
import com.yfd.platform.env.wt.entity.vo.WtFishVo;
|
import com.yfd.platform.env.wt.entity.vo.WtFishVo;
|
||||||
import com.yfd.platform.env.wt.entity.vo.WtTreeStcdVo;
|
import com.yfd.platform.env.wt.entity.vo.WtTreeStcdVo;
|
||||||
@ -176,6 +177,56 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<SttpInfoVo> getSttpbList(DataSourceRequest dataSourceRequest) {
|
||||||
|
StringBuilder sql = new StringBuilder();
|
||||||
|
sql.append("SELECT ")
|
||||||
|
.append("t.ID AS id, ")
|
||||||
|
.append("t.RECORD_USER AS recordUser, ")
|
||||||
|
.append("t.RECORD_TIME AS recordTime, ")
|
||||||
|
.append("t.MODIFY_TIME AS modifyTime, ")
|
||||||
|
.append("NULL AS displayRecordUser, ")
|
||||||
|
.append("NULL AS isolateType, ")
|
||||||
|
.append("NULL AS stbprpCnt, ")
|
||||||
|
.append("NULL AS recordUserName, ")
|
||||||
|
.append("NULL AS modifyUserName, ")
|
||||||
|
.append("NULL AS displayDepartment, ")
|
||||||
|
.append("t.STTP_CODE AS sttpCode, ")
|
||||||
|
.append("t.STTP_NAME AS sttpName, ")
|
||||||
|
.append("t.DESCRIPTION AS description, ")
|
||||||
|
.append("t.PARENT_ID AS parentId, ")
|
||||||
|
// .append("t.ENABLED AS enable, ")
|
||||||
|
.append("t.TREE_LEVEL AS treeLevel, ")
|
||||||
|
.append("t.HAS_CHILDREN AS hasChildren, ")
|
||||||
|
.append("t.FULL_PATH AS fullPath, ")
|
||||||
|
.append("t.INTERNAL AS internal, ")
|
||||||
|
.append("t.INTRODUCE AS introduce, ")
|
||||||
|
.append("t.LOGO AS logo, ")
|
||||||
|
.append("t.INFFILE AS inffile, ")
|
||||||
|
.append("t.ORDER_INDEX AS orderIndex, ")
|
||||||
|
.append("NULL AS filterContent, ")
|
||||||
|
.append("NULL AS isTempStorage, ")
|
||||||
|
.append("NULL AS departmentId, ")
|
||||||
|
.append("NULL AS systemId, ")
|
||||||
|
.append("NULL AS platformId ")
|
||||||
|
.append("FROM SD_STTP_B t ")
|
||||||
|
.append("WHERE NVL(t.IS_DELETED, 0) = 0 ");
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
String filterSql = buildSttpInfoFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||||
|
if (StrUtil.isNotBlank(filterSql)) {
|
||||||
|
sql.append(" AND ").append(filterSql).append(" ");
|
||||||
|
}
|
||||||
|
sql.append(buildSttpInfoOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||||
|
|
||||||
|
Page<?> page = buildPage(dataSourceRequest == null ? null : dataSourceRequest.toDevRequest());
|
||||||
|
List<SttpInfoVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, SttpInfoVo.class);
|
||||||
|
DataSourceResult<SttpInfoVo> result = new DataSourceResult<>();
|
||||||
|
result.setData(list);
|
||||||
|
result.setTotal(page != null ? page.getTotal() : list.size());
|
||||||
|
result.setAggregates(new HashMap<>());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataSourceResult<SdYearDetailVO> getYearDetailList(DataSourceRequest dataSourceRequest) {
|
public DataSourceResult<SdYearDetailVO> getYearDetailList(DataSourceRequest dataSourceRequest) {
|
||||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||||
@ -1186,6 +1237,119 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
return " ORDER BY " + String.join(", ", orderColumns);
|
return " ORDER BY " + String.join(", ", orderColumns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String buildSttpInfoFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
if (filter == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(filter.getField())) {
|
||||||
|
return buildSttpInfoLeafCondition(filter, paramMap, indexHolder);
|
||||||
|
}
|
||||||
|
if (filter.getFilters() == null || filter.getFilters().isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<String> conditions = new ArrayList<>();
|
||||||
|
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||||
|
String childCondition = buildSttpInfoFilterCondition(child, paramMap, indexHolder);
|
||||||
|
if (StrUtil.isNotBlank(childCondition)) {
|
||||||
|
conditions.add("(" + childCondition + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (conditions.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String logic = StrUtil.blankToDefault(filter.getLogic(), "and").trim().toUpperCase();
|
||||||
|
return String.join(" " + logic + " ", conditions);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildSttpInfoLeafCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
String column = mapSttpInfoColumn(filter.getField());
|
||||||
|
if (column == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String operator = StrUtil.blankToDefault(filter.getOperator(), "eq").toLowerCase();
|
||||||
|
Object value = filter.getValue();
|
||||||
|
if ("isnull".equals(operator)) {
|
||||||
|
return column + " IS NULL";
|
||||||
|
}
|
||||||
|
if ("isnotnull".equals(operator)) {
|
||||||
|
return column + " IS NOT NULL";
|
||||||
|
}
|
||||||
|
if ("doesnotcontain".equals(operator)) {
|
||||||
|
String paramKey = "sttpP" + indexHolder[0]++;
|
||||||
|
paramMap.put(paramKey, "%" + value + "%");
|
||||||
|
return "(" + column + " IS NULL OR " + column + " NOT LIKE #{map." + paramKey + "})";
|
||||||
|
}
|
||||||
|
|
||||||
|
String paramKey = "sttpP" + indexHolder[0]++;
|
||||||
|
switch (operator) {
|
||||||
|
case "eq":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " = #{map." + paramKey + "}";
|
||||||
|
case "neq":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " <> #{map." + paramKey + "}";
|
||||||
|
case "contains":
|
||||||
|
paramMap.put(paramKey, "%" + value + "%");
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
case "startswith":
|
||||||
|
paramMap.put(paramKey, value + "%");
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
case "endswith":
|
||||||
|
paramMap.put(paramKey, "%" + value);
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String mapSttpInfoColumn(String field) {
|
||||||
|
if (StrUtil.isBlank(field)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return switch (field) {
|
||||||
|
case "id" -> "t.ID";
|
||||||
|
case "sttpCode" -> "t.STTP_CODE";
|
||||||
|
case "sttpName" -> "t.STTP_NAME";
|
||||||
|
case "description" -> "t.DESCRIPTION";
|
||||||
|
case "parentId" -> "t.PARENT_ID";
|
||||||
|
// case "enable" -> "t.ENABLED";
|
||||||
|
case "treeLevel" -> "t.TREE_LEVEL";
|
||||||
|
case "hasChildren" -> "t.HAS_CHILDREN";
|
||||||
|
case "fullPath" -> "t.FULL_PATH";
|
||||||
|
case "internal" -> "t.INTERNAL";
|
||||||
|
case "introduce" -> "t.INTRODUCE";
|
||||||
|
case "logo" -> "t.LOGO";
|
||||||
|
case "inffile" -> "t.INFFILE";
|
||||||
|
case "orderIndex" -> "t.ORDER_INDEX";
|
||||||
|
case "recordUser" -> "t.RECORD_USER";
|
||||||
|
case "recordTime" -> "t.RECORD_TIME";
|
||||||
|
case "modifyTime" -> "t.MODIFY_TIME";
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildSttpInfoOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||||
|
List<String> orderColumns = new ArrayList<>();
|
||||||
|
if (sortList != null) {
|
||||||
|
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||||
|
String column = mapSttpInfoColumn(sortDescriptor.getField());
|
||||||
|
if (StrUtil.isBlank(column)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||||
|
orderColumns.add(column + " " + dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (orderColumns.isEmpty()) {
|
||||||
|
return " ORDER BY NVL(t.ORDER_INDEX, 999999), t.STTP_CODE";
|
||||||
|
}
|
||||||
|
return " ORDER BY " + String.join(", ", orderColumns);
|
||||||
|
}
|
||||||
|
|
||||||
private Page<?> buildPage(DataSourceLoadOptionsBase loadOptions) {
|
private Page<?> buildPage(DataSourceLoadOptionsBase loadOptions) {
|
||||||
PageInfo pageInfo = QgcQueryWrapperUtil.getPageInfo(loadOptions);
|
PageInfo pageInfo = QgcQueryWrapperUtil.getPageInfo(loadOptions);
|
||||||
if (Boolean.TRUE.equals(pageInfo.getHasPageInfo())) {
|
if (Boolean.TRUE.equals(pageInfo.getHasPageInfo())) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user