feat: 根据站点编码判断是否出入水温站且关联的电站是否有垂向水温站
This commit is contained in:
parent
c20eabc9c1
commit
14b2837db5
@ -24,6 +24,21 @@ public interface MicroservicDynamicSQLMapper<T> {
|
||||
return convertList(pageAllList(page, sql, map), resultType);
|
||||
}
|
||||
|
||||
@Select({"<script>", "${sql}", "</script>"})
|
||||
Map<String, Object> getOneBySql(@Param("sql") String sql, @Param("map") Map<String, Object> map);
|
||||
|
||||
|
||||
default <R> R getOneBySqlWithResultType(String sql,
|
||||
Map<String, Object> map,
|
||||
Class<R> resultType) {
|
||||
Map<String, Object> resultMap = getOneBySql(sql, map);
|
||||
CopyOptions copyOptions = CopyOptions.create()
|
||||
.setIgnoreCase(true)
|
||||
.setIgnoreError(true);
|
||||
return BeanUtil.fillBeanWithMap(resultMap, createTargetBean(resultType), copyOptions);
|
||||
}
|
||||
|
||||
|
||||
@Select({"<script>", "${sql}", "</script>"})
|
||||
List<Map<String, Object>> getAllList(@Param("sql") String sql, @Param("map") Map<String, Object> map);
|
||||
|
||||
|
||||
@ -187,6 +187,15 @@ public class SdWTMonitorController {
|
||||
return ResponseResult.successData(sdWtMonitorService.getWtFishAnalysis(dataSourceRequest));
|
||||
}
|
||||
|
||||
@GetMapping("/wtrv/getIoWtrvFlag")
|
||||
@Operation(summary = "根据站点编码判断是否出入水温站且关联的电站是否有垂向水温站")
|
||||
public ResponseResult getFlagByStcd(@RequestParam String stcd) {
|
||||
if (StrUtil.isBlank(stcd)) {
|
||||
throw new BizException("站点编码不能为空!");
|
||||
}
|
||||
return ResponseResult.successData(sdWtMonitorService.getFlagByStcd(stcd));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/inOutOne/GetKendoListCust")
|
||||
@Operation(summary = "查询出入库水温一级列表")
|
||||
|
||||
40
backend/src/main/java/com/yfd/platform/env/entity/vo/SdYearListVO.java
vendored
Normal file
40
backend/src/main/java/com/yfd/platform/env/entity/vo/SdYearListVO.java
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(description = "水温年内分布VO")
|
||||
public class SdYearListVO {
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "站名")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "年份")
|
||||
private String year;
|
||||
|
||||
@Schema(description = "月份排序值")
|
||||
private Integer monthInt;
|
||||
|
||||
@Schema(description = "月份")
|
||||
private String month;
|
||||
|
||||
@Schema(description = "实测值水温")
|
||||
private BigDecimal actualTemp;
|
||||
|
||||
@Schema(description = "天然水温")
|
||||
private BigDecimal naturalTemp;
|
||||
|
||||
@Schema(description = "维度类型")
|
||||
private String drtp;
|
||||
}
|
||||
27
backend/src/main/java/com/yfd/platform/env/entity/vo/WtrvVo.java
vendored
Normal file
27
backend/src/main/java/com/yfd/platform/env/entity/vo/WtrvVo.java
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
package com.yfd.platform.env.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class WtrvVo {
|
||||
|
||||
private String stcd;
|
||||
|
||||
private Date tm;
|
||||
|
||||
private Boolean isIoWtrv;
|
||||
|
||||
private Boolean hasRstcdWtvt;
|
||||
|
||||
private BigDecimal wt;
|
||||
|
||||
private BigDecimal avgwt;
|
||||
|
||||
private BigDecimal minwt;
|
||||
|
||||
private BigDecimal maxwt;
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.yfd.platform.env.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.env.entity.vo.WtrvVo;
|
||||
|
||||
public interface SdWtMonitorService {
|
||||
|
||||
@ -12,4 +13,6 @@ public interface SdWtMonitorService {
|
||||
DataSourceResult getCxDetailList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getWtFishAnalysis(DataSourceRequest dataSourceRequest);
|
||||
|
||||
WtrvVo getFlagByStcd(String stcd);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.yfd.platform.common.*;
|
||||
import com.yfd.platform.env.entity.vo.FishSpawnVo;
|
||||
import com.yfd.platform.env.entity.vo.SdWtMonitorCountVO;
|
||||
import com.yfd.platform.env.entity.vo.SdWtBaseInfoVO;
|
||||
import com.yfd.platform.env.entity.vo.WtrvVo;
|
||||
import com.yfd.platform.env.entity.vo.WtFishVo;
|
||||
import com.yfd.platform.env.mapper.SdWtMonitorMapper;
|
||||
import com.yfd.platform.env.service.SdWtMonitorService;
|
||||
@ -46,6 +47,31 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WtrvVo getFlagByStcd(String stcd) {
|
||||
String sql = "SELECT wt.STCD AS stcd, " +
|
||||
"CASE WHEN rel.ENG_IWT_CODE IS NOT NULL OR rel.ENG_DWT_CODE IS NOT NULL THEN 1 ELSE 0 END AS isIoWtrv, " +
|
||||
"CASE WHEN EXISTS ( " +
|
||||
" SELECT 1 FROM SD_WT_B_H vt " +
|
||||
" WHERE vt.RSTCD = wt.RSTCD " +
|
||||
" AND vt.STTP = 'WTVT' " +
|
||||
" AND vt.IS_DELETED = 0 " +
|
||||
" AND vt.MWAY = 2" +
|
||||
") THEN 1 ELSE 0 END AS hasRstcdWtvt " +
|
||||
"FROM SD_WT_B_H wt " +
|
||||
"LEFT JOIN SD_WTENGRLTN_B rel ON rel.STCD = wt.STCD AND rel.IS_DELETED = 0 " +
|
||||
"WHERE wt.STCD = #{map.stcd} " +
|
||||
" AND wt.STTP = 'WTRV' " +
|
||||
" AND wt.IS_DELETED = 0";
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", stcd);
|
||||
WtrvVo vo = (WtrvVo) microservicDynamicSQLMapper.getOneBySqlWithResultType(sql, paramMap, WtrvVo.class);
|
||||
if (vo == null ) {
|
||||
return buildDefaultWtrvVo(stcd);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult getWtFishAnalysis(DataSourceRequest dataSourceRequest) {
|
||||
List<DataSourceRequest.FilterDescriptor> filters = new ArrayList<>();
|
||||
@ -673,6 +699,28 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
||||
}
|
||||
}
|
||||
|
||||
private WtrvVo buildDefaultWtrvVo(String stcd) {
|
||||
WtrvVo vo = new WtrvVo();
|
||||
vo.setStcd(stcd);
|
||||
vo.setIsIoWtrv(false);
|
||||
vo.setHasRstcdWtvt(false);
|
||||
return vo;
|
||||
}
|
||||
|
||||
private Boolean toBooleanValue(Object value) {
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
if (value instanceof Boolean boolValue) {
|
||||
return boolValue;
|
||||
}
|
||||
if (value instanceof Number number) {
|
||||
return number.intValue() != 0;
|
||||
}
|
||||
String strValue = String.valueOf(value).trim();
|
||||
return "1".equals(strValue) || "true".equalsIgnoreCase(strValue) || "Y".equalsIgnoreCase(strValue);
|
||||
}
|
||||
|
||||
@Data
|
||||
private static class WtCxDetailRow {
|
||||
private String stcd;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user