feat: 水温基础数据数量和基础数据查询
This commit is contained in:
parent
67bed1d3e7
commit
cc80318c23
@ -59,7 +59,7 @@ public class SecurityConfig {
|
||||
.requestMatchers("/system/user/auditUser").permitAll()
|
||||
.requestMatchers("/eng/**").permitAll()
|
||||
.requestMatchers("/env/**").permitAll()
|
||||
.requestMatchers("/sw/**").permitAll()
|
||||
.requestMatchers("/wt/**").permitAll()
|
||||
.requestMatchers("/data/**").permitAll()
|
||||
.requestMatchers("/sms/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/").permitAll()
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
package com.yfd.platform.env.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.env.service.AlongListService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 沿程水温变化一级折线图
|
||||
*
|
||||
* @author lyl
|
||||
* @date 2023/04/18 19:22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sw/alongList")
|
||||
@Tag(name = "沿程水温变化一级折线图")
|
||||
@Validated
|
||||
public class SdAlongListController{
|
||||
|
||||
@Resource
|
||||
private AlongListService alongListService;
|
||||
|
||||
|
||||
@PostMapping({"/limit"})
|
||||
@Operation(summary = "获取流域沿程水温限值")
|
||||
public ResponseResult getWtLimit(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(alongListService.getWtLimit(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping({"/default/rvcd"})
|
||||
@Operation(summary = "获取沿程水温变化默认有数据的河流")
|
||||
public ResponseResult getDefaultStcd(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
|
||||
return ResponseResult.successData(alongListService.getDefaultRvcd(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping({"/qgc/GetKendoListCust"})
|
||||
@Operation(summary = "按时间范围查询沿程水温站最新数据时间的数据")
|
||||
public ResponseResult getALongKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(this.alongListService.getALongKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
}
|
||||
@ -10,6 +10,8 @@ import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.env.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.env.entity.vo.WtrvInfo;
|
||||
import com.yfd.platform.env.service.AlongDetailService;
|
||||
import com.yfd.platform.env.service.AlongListService;
|
||||
import com.yfd.platform.env.service.SdWtMonitorService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -17,54 +19,63 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sw/alongDetail")
|
||||
@Tag(name = "沿程水温变化二级数据接口")
|
||||
@RequestMapping("/wt")
|
||||
@Tag(name = "水温监测")
|
||||
@Validated
|
||||
public class SdAlongDetailController {
|
||||
public class SdWTMonitorController {
|
||||
|
||||
|
||||
@Resource
|
||||
private AlongDetailService alongDetailService;
|
||||
|
||||
@Resource
|
||||
private AlongListService alongListService;
|
||||
|
||||
@PostMapping("/GetKendoListCust")
|
||||
@Resource
|
||||
private SdWtMonitorService sdWtMonitorService;
|
||||
|
||||
|
||||
@PostMapping("/alongDetail/GetKendoListCust")
|
||||
@Operation(summary = "查询沿程水温变化二级数据列表")
|
||||
public ResponseResult getKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult result = alongDetailService.processKendoList(dataSourceRequest, null, new Page<>());
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/updateWtrvRData")
|
||||
@PostMapping("/alongDetail/updateWtrvRData")
|
||||
@Operation(summary = "修改表层水温日数据")
|
||||
public ResponseResult updateWtrvRData(@RequestBody Map<String, Object> updateData) {
|
||||
alongDetailService.updateWtrvRData(updateData);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/day/GetKendoListCust")
|
||||
@PostMapping("/alongDetail/day/GetKendoListCust")
|
||||
@Operation(summary = "查询出库水温日数据")
|
||||
public ResponseResult getKendoDayListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult result = alongDetailService.processDayKendoList(dataSourceRequest, null, new Page<>(), null);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/drtp/GetKendoListCust")
|
||||
@PostMapping("/alongDetail/drtp/GetKendoListCust")
|
||||
@Operation(summary = "查询出库水温周旬月季年数据")
|
||||
public ResponseResult getKendoDrtpListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult result = alongDetailService.processDrtpKendoList(dataSourceRequest, null, new Page<>(), null);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/drtp/removeKendoByIds")
|
||||
@PostMapping("/alongDetail/drtp/removeKendoByIds")
|
||||
@Operation(summary = "删除出库水温周旬月季年数据")
|
||||
public ResponseResult removeKendoByIds(@RequestBody BatchDeleteAo batchDeleteAo) {
|
||||
alongDetailService.removeKendoByIds(batchDeleteAo);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/qgc/GetKendoListCust")
|
||||
@PostMapping("/alongDetail/qgc/GetKendoListCust")
|
||||
@Operation(summary = "环保部查询出入库水温、出入库流量、入库水温、天然水温、降雨、气温数据")
|
||||
public ResponseResult getQgcKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
@ -84,17 +95,50 @@ public class SdAlongDetailController {
|
||||
return ResponseResult.successData(qgcResult);
|
||||
}
|
||||
|
||||
@GetMapping("/qgc/stcdCheck")
|
||||
@GetMapping("/alongDetail/qgc/stcdCheck")
|
||||
@Operation(summary = "判断出库水温站、垂向水温站或者低温水减缓设施所属的电站是否有出库水温站、垂向水温站和低温水减缓设施")
|
||||
public ResponseResult getQgcStcdCheck(@RequestParam String stcd) {
|
||||
WtrvInfo result = alongDetailService.getWtrvInfoByStcd2(stcd);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@GetMapping("/qgc/stcdCheck2")
|
||||
@GetMapping("/alongDetail/qgc/stcdCheck2")
|
||||
@Operation(summary = "判断出库水温站、垂向水温站所属的电站是否有出库水温站、垂向水温站")
|
||||
public ResponseResult getQgcStcdCheck2(@RequestParam String stcd) {
|
||||
WtrvInfo result = alongDetailService.getWtrvInfoByStcd3(stcd);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping({"/alongList/limit"})
|
||||
@Operation(summary = "获取流域沿程水温限值")
|
||||
public ResponseResult getWtLimit(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(alongListService.getWtLimit(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping({"/alongList/default/rvcd"})
|
||||
@Operation(summary = "获取沿程水温变化默认有数据的河流")
|
||||
public ResponseResult getDefaultStcd(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
|
||||
return ResponseResult.successData(alongListService.getDefaultRvcd(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping({"/alongList/qgc/GetKendoListCust"})
|
||||
@Operation(summary = "按时间范围查询沿程水温站最新数据时间的数据")
|
||||
public ResponseResult getALongKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(this.alongListService.getALongKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/base/evnmAutoMonitor/GetKendoListCust")
|
||||
@Operation(summary = "查询水温监测数量")
|
||||
public ResponseResult getWTDataCount(@RequestBody(required = false) DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getEvnmAutoMonitorList());
|
||||
}
|
||||
|
||||
@PostMapping("/base/vmsstbprpt/GetKendoList")
|
||||
@Operation(summary = "根据类型查询水温表基本数据")
|
||||
public ResponseResult getVmsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(sdWtMonitorService.getVmsstbprptList(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
50
backend/src/main/java/com/yfd/platform/env/entity/vo/SdWtBaseInfoVO.java
vendored
Normal file
50
backend/src/main/java/com/yfd/platform/env/entity/vo/SdWtBaseInfoVO.java
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
package com.yfd.platform.env.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 SdWtBaseInfoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "站名")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "建成日期")
|
||||
private Date jcdt;
|
||||
|
||||
@Schema(description = "监测指标")
|
||||
private String stindx;
|
||||
|
||||
@Schema(description = "开展环保自动检测工作状态:1=正常 0=暂无数据")
|
||||
private Integer coenvwState;
|
||||
|
||||
@Schema(description = "站类")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属测站编码")
|
||||
private String stCode;
|
||||
|
||||
@Schema(description = "所属测站名称")
|
||||
private String stName;
|
||||
|
||||
@Schema(description = "开发方式")
|
||||
private String dvtp;
|
||||
}
|
||||
31
backend/src/main/java/com/yfd/platform/env/entity/vo/SdWtMonitorCountVO.java
vendored
Normal file
31
backend/src/main/java/com/yfd/platform/env/entity/vo/SdWtMonitorCountVO.java
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水温监测数量统计")
|
||||
public class SdWtMonitorCountVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Long cnt;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer orderInx;
|
||||
|
||||
@Schema(description = "排序号名称")
|
||||
private String orderInxName;
|
||||
|
||||
@Schema(description = "站类完整路径")
|
||||
private String sttpFullPath;
|
||||
|
||||
@Schema(description = "站类编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "站类名称")
|
||||
private String sttpName;
|
||||
}
|
||||
22
backend/src/main/java/com/yfd/platform/env/mapper/SdWtMonitorMapper.java
vendored
Normal file
22
backend/src/main/java/com/yfd/platform/env/mapper/SdWtMonitorMapper.java
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
package com.yfd.platform.env.mapper;
|
||||
|
||||
import com.yfd.platform.env.entity.vo.SdWtMonitorCountVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SdWtMonitorMapper {
|
||||
|
||||
@Select("SELECT COUNT(1) AS cnt, 26 AS orderInx, '26' AS orderInxName, " +
|
||||
" 'ENV,ENVM,WT,' AS sttpFullPath, NULL AS sttpCode, '表层水温监测' AS sttpName " +
|
||||
"FROM SD_WT_B_H " +
|
||||
"WHERE IS_DELETED = 0 AND STTP = 'WTRV' AND DTIN_TYPE = 0 " +
|
||||
"UNION ALL " +
|
||||
"SELECT COUNT(1) AS cnt, 27 AS orderInx, '27' AS orderInxName, " +
|
||||
" 'ENV,ENVM,WT,' AS sttpFullPath, NULL AS sttpCode, '垂向水温监测' AS sttpName " +
|
||||
"FROM SD_WT_B_H " +
|
||||
"WHERE IS_DELETED = 0 AND STTP = 'WTVT' AND DTIN_TYPE = 0")
|
||||
List<SdWtMonitorCountVO> getMonitorCountList();
|
||||
}
|
||||
11
backend/src/main/java/com/yfd/platform/env/service/SdWtMonitorService.java
vendored
Normal file
11
backend/src/main/java/com/yfd/platform/env/service/SdWtMonitorService.java
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
package com.yfd.platform.env.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
|
||||
public interface SdWtMonitorService {
|
||||
|
||||
DataSourceResult getEvnmAutoMonitorList();
|
||||
|
||||
DataSourceResult getVmsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
147
backend/src/main/java/com/yfd/platform/env/service/impl/SdWtMonitorServiceImpl.java
vendored
Normal file
147
backend/src/main/java/com/yfd/platform/env/service/impl/SdWtMonitorServiceImpl.java
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
package com.yfd.platform.env.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.common.*;
|
||||
import com.yfd.platform.env.entity.vo.SdWtMonitorCountVO;
|
||||
import com.yfd.platform.env.entity.vo.SdWtBaseInfoVO;
|
||||
import com.yfd.platform.env.mapper.SdWtMonitorMapper;
|
||||
import com.yfd.platform.env.service.SdWtMonitorService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
||||
|
||||
@Resource
|
||||
private SdWtMonitorMapper sdWtMonitorMapper;
|
||||
|
||||
@Resource
|
||||
private MicroservicDynamicSQLMapper microservicDynamicSQLMapper;
|
||||
|
||||
@Override
|
||||
public DataSourceResult getEvnmAutoMonitorList() {
|
||||
List<SdWtMonitorCountVO> list = sdWtMonitorMapper.getMonitorCountList();
|
||||
DataSourceResult<SdWtMonitorCountVO> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(list == null ? 0 : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult getVmsstbprptList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String mway = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "mway");
|
||||
String sttpCode = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "sttpCode");
|
||||
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rstcd");
|
||||
String stnm = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stnm");
|
||||
String coenvwState = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "coenvwState");
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append("hb.BASENAME AS baseName, ")
|
||||
.append("wt.STNM AS stnm, ")
|
||||
.append("eng.ENNM AS ennm, ")
|
||||
.append("wt.JCDT AS jcdt, ")
|
||||
.append("wt.STINDX AS stindx, ")
|
||||
.append("CASE ")
|
||||
.append("WHEN wt.STTP = 'WTRV' AND rvRecent.STCD IS NOT NULL THEN 1 ")
|
||||
.append("WHEN wt.STTP = 'WTVT' AND vtRecent.STCD IS NOT NULL THEN 1 ")
|
||||
.append("ELSE 0 END AS coenvwState, ")
|
||||
.append("wt.STTP AS sttpCode, ")
|
||||
.append("wt.STCD AS stcd, ")
|
||||
.append("wt.RSTCD AS rstcd, ")
|
||||
.append("CAST(NULL AS VARCHAR2(200)) AS stCode, ")
|
||||
.append("CAST(NULL AS VARCHAR2(200)) AS stName, ")
|
||||
.append("eng.DVTP AS dvtp, ")
|
||||
.append("hb.ORDER_INDEX AS baseStepSort, ")
|
||||
.append("eng.HBRVCD AS hbrvcd, ")
|
||||
.append("eng.ORDER_INDEX AS rstcdStepSort, ")
|
||||
.append("wt.ORDER_INDEX AS siteStepSort ")
|
||||
.append("FROM SD_WT_B_H wt ")
|
||||
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = wt.RSTCD ")
|
||||
.append("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = eng.BASE_ID ")
|
||||
.append("LEFT JOIN (SELECT DISTINCT STCD FROM SD_WTRV_R WHERE IS_DELETED = 0 AND TM >= SYSDATE - 1) rvRecent ON rvRecent.STCD = wt.STCD ")
|
||||
.append("LEFT JOIN (SELECT DISTINCT STCD FROM SD_WTVT_R WHERE IS_DELETED = 0 AND TM >= SYSDATE - 1) vtRecent ON vtRecent.STCD = wt.STCD ")
|
||||
.append("WHERE wt.IS_DELETED = 0 AND wt.DTIN_TYPE = 0");
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
if (mway != null && !mway.isBlank()) {
|
||||
paramMap.put("mway", mway);
|
||||
sql.append("AND wt.MWAY = #{map.mway} ");
|
||||
}
|
||||
if (sttpCode != null && !sttpCode.isBlank()) {
|
||||
paramMap.put("sttpCode", sttpCode);
|
||||
sql.append("AND wt.STTP = #{map.sttpCode} ");
|
||||
}
|
||||
if (rstcd != null && !rstcd.isBlank()) {
|
||||
paramMap.put("rstcd", rstcd);
|
||||
sql.append("AND wt.RSTCD = #{map.rstcd} ");
|
||||
}
|
||||
if (stnm != null && !stnm.isBlank()) {
|
||||
paramMap.put("stnm", "%" + stnm + "%");
|
||||
sql.append("AND wt.STNM LIKE #{map.stnm} ");
|
||||
}
|
||||
if (coenvwState != null && !coenvwState.isBlank()) {
|
||||
paramMap.put("coenvwState", coenvwState);
|
||||
sql.append("AND CASE ")
|
||||
.append("WHEN wt.STTP = 'WTRV' AND rvRecent.STCD IS NOT NULL THEN 1 ")
|
||||
.append("WHEN wt.STTP = 'WTVT' AND vtRecent.STCD IS NOT NULL THEN 1 ")
|
||||
.append("ELSE 0 END = #{map.coenvwState} ");
|
||||
}
|
||||
|
||||
sql.append(buildVmsstbprptOrderBySql(dataSourceRequest.getSort()));
|
||||
Page<?> page = buildPage(loadOptions);
|
||||
List<SdWtBaseInfoVO> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, SdWtBaseInfoVO.class);
|
||||
|
||||
DataSourceResult<SdWtBaseInfoVO> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(page != null ? page.getTotal() : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
private Page<?> buildPage(DataSourceLoadOptionsBase loadOptions) {
|
||||
PageInfo pageInfo = QgcQueryWrapperUtil.getPageInfo(loadOptions);
|
||||
if (Boolean.TRUE.equals(pageInfo.getHasPageInfo())) {
|
||||
return pageInfo.getPage();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String buildVmsstbprptOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
List<String> orderColumns = new ArrayList<>();
|
||||
if (sortList != null) {
|
||||
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||
String field = sortDescriptor.getField();
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
if ("baseStepSort".equals(field)) {
|
||||
orderColumns.add("NVL(hb.ORDER_INDEX, 999999) " + dir);
|
||||
} else if ("hbrvcd".equals(field)) {
|
||||
orderColumns.add("NVL(eng.HBRVCD, '~') " + dir);
|
||||
} else if ("rstcdStepSort".equals(field)) {
|
||||
orderColumns.add("NVL(eng.ORDER_INDEX, 999999) " + dir);
|
||||
} else if ("siteStepSort".equals(field)) {
|
||||
orderColumns.add("NVL(wt.ORDER_INDEX, 999999) " + dir);
|
||||
} else if ("stnm".equals(field)) {
|
||||
orderColumns.add("wt.STNM " + dir);
|
||||
} else if ("ennm".equals(field)) {
|
||||
orderColumns.add("eng.ENNM " + dir);
|
||||
} else if ("stcd".equals(field)) {
|
||||
orderColumns.add("wt.STCD " + dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (orderColumns.isEmpty()) {
|
||||
return " ORDER BY NVL(hb.ORDER_INDEX, 999999) ASC, NVL(eng.HBRVCD, '~') ASC, NVL(eng.ORDER_INDEX, 999999) ASC, NVL(wt.ORDER_INDEX, 999999) ASC";
|
||||
}
|
||||
return " ORDER BY " + String.join(", ", orderColumns);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user