feat: 根据增殖站编码查询相关业务年份
This commit is contained in:
parent
77db8a1264
commit
c708daef17
@ -0,0 +1,30 @@
|
|||||||
|
package com.yfd.platform.qgc_env.fb.controller;
|
||||||
|
|
||||||
|
import com.yfd.platform.config.ResponseResult;
|
||||||
|
import com.yfd.platform.qgc_env.fb.service.FbStationService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/fb/fbrdmr")
|
||||||
|
@Tag(name = "鱼类增殖站年度鱼类标记数据")
|
||||||
|
@Validated
|
||||||
|
public class FbFbrdmrController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FbStationService fbStationService;
|
||||||
|
|
||||||
|
@GetMapping("/getFbRelatedYrByStcd")
|
||||||
|
@Operation(summary = "根据增殖站编码查询相关业务年份")
|
||||||
|
public ResponseResult getFbRelatedYrByStcd(@Parameter(description = "增殖站编码")
|
||||||
|
@RequestParam("stcd") String stcd) {
|
||||||
|
return ResponseResult.successData(fbStationService.getFbRelatedYrByStcd(stcd));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.yfd.platform.qgc_env.fb.entity.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FbRelatedYrVo {
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private String subType;
|
||||||
|
|
||||||
|
private String yr;
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package com.yfd.platform.qgc_env.fb.service;
|
|||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbFlDataVo;
|
import com.yfd.platform.qgc_env.fb.entity.vo.FbFlDataVo;
|
||||||
|
import com.yfd.platform.qgc_env.fb.entity.vo.FbRelatedYrVo;
|
||||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbStInfoResultVo;
|
import com.yfd.platform.qgc_env.fb.entity.vo.FbStInfoResultVo;
|
||||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbStationStaticsDataVo;
|
import com.yfd.platform.qgc_env.fb.entity.vo.FbStationStaticsDataVo;
|
||||||
import com.yfd.platform.qgc_env.fb.entity.vo.YearRpStatisticsVo;
|
import com.yfd.platform.qgc_env.fb.entity.vo.YearRpStatisticsVo;
|
||||||
@ -18,6 +19,8 @@ public interface FbStationService {
|
|||||||
|
|
||||||
DataSourceResult<FbFlDataVo> getFbFlDataKendoListCust(DataSourceRequest dataSourceRequest);
|
DataSourceResult<FbFlDataVo> getFbFlDataKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<FbRelatedYrVo> getFbRelatedYrByStcd(String stcd);
|
||||||
|
|
||||||
FbStInfoResultVo getStInfoByStcd(String stcd);
|
FbStInfoResultVo getStInfoByStcd(String stcd);
|
||||||
|
|
||||||
DataSourceResult<FbStationStaticsDataVo> getQgcFbStaticsData(DataSourceRequest dataSourceRequest);
|
DataSourceResult<FbStationStaticsDataVo> getQgcFbStaticsData(DataSourceRequest dataSourceRequest);
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import com.yfd.platform.common.GroupingInfo;
|
|||||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbFtpStatisticsVo;
|
import com.yfd.platform.qgc_env.fb.entity.vo.FbFtpStatisticsVo;
|
||||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbFlDataVo;
|
import com.yfd.platform.qgc_env.fb.entity.vo.FbFlDataVo;
|
||||||
|
import com.yfd.platform.qgc_env.fb.entity.vo.FbRelatedYrVo;
|
||||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbStBaseInfoVo;
|
import com.yfd.platform.qgc_env.fb.entity.vo.FbStBaseInfoVo;
|
||||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbStInfoResultVo;
|
import com.yfd.platform.qgc_env.fb.entity.vo.FbStInfoResultVo;
|
||||||
import com.yfd.platform.qgc_env.fb.entity.vo.FbStationOverviewSecondVo;
|
import com.yfd.platform.qgc_env.fb.entity.vo.FbStationOverviewSecondVo;
|
||||||
@ -74,6 +75,29 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
return queryFbFlDataDetailList(dataSourceRequest, loadOptions);
|
return queryFbFlDataDetailList(dataSourceRequest, loadOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<FbRelatedYrVo> getFbRelatedYrByStcd(String stcd) {
|
||||||
|
DataSourceResult<FbRelatedYrVo> result = new DataSourceResult<>();
|
||||||
|
if (StrUtil.isBlank(stcd)) {
|
||||||
|
result.setData(Collections.emptyList());
|
||||||
|
result.setTotal(0);
|
||||||
|
result.setAggregates(new HashMap<>());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("stcd", stcd.trim());
|
||||||
|
List<FbRelatedYrVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||||
|
null,
|
||||||
|
buildFbRelatedYrByStcdSql(),
|
||||||
|
paramMap,
|
||||||
|
FbRelatedYrVo.class
|
||||||
|
);
|
||||||
|
result.setData(list);
|
||||||
|
result.setTotal(list.size());
|
||||||
|
result.setAggregates(new HashMap<>());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FbStInfoResultVo getStInfoByStcd(String stcd) {
|
public FbStInfoResultVo getStInfoByStcd(String stcd) {
|
||||||
FbStInfoResultVo result = new FbStInfoResultVo();
|
FbStInfoResultVo result = new FbStInfoResultVo();
|
||||||
@ -654,6 +678,78 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
return sql.toString();
|
return sql.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String buildFbRelatedYrByStcdSql() {
|
||||||
|
return """
|
||||||
|
SELECT type, subType, yr
|
||||||
|
FROM (
|
||||||
|
SELECT '1' AS type, '1-1' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBBSMF_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '1' AS type, '1-2' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBBSDEATH_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '1' AS type, '1-3' AS subType, NULL AS yr
|
||||||
|
FROM SD_FBBSCTMO_B
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
UNION
|
||||||
|
SELECT '1' AS type, '1-4' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBBWT_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '1' AS type, '1-5' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBCWQ_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '1' AS type, '1-6' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBBSRFI_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '1' AS type, '1-7' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBOUTFISH_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '2' AS type, '2-1' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBFISHARTINL_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '2' AS type, '2-2' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBFISHHATCHREC_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '2' AS type, '2-3' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBFISHHATCHPRO_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '3' AS type, '3-1' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBSCWEM_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '3' AS type, '3-2' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBFISHBREED_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
UNION
|
||||||
|
SELECT '4' AS type, '4-1' AS subType, TO_CHAR(TM, 'yyyy') AS yr
|
||||||
|
FROM SD_FBFISHDPAC_R
|
||||||
|
WHERE STCD = #{map.stcd}
|
||||||
|
GROUP BY TO_CHAR(TM, 'yyyy')
|
||||||
|
)
|
||||||
|
ORDER BY type, subType, yr DESC
|
||||||
|
""";
|
||||||
|
}
|
||||||
|
|
||||||
private String buildFbFlDataDetailSelectSql(List<String> select) {
|
private String buildFbFlDataDetailSelectSql(List<String> select) {
|
||||||
List<String> fields = CollUtil.isEmpty(select)
|
List<String> fields = CollUtil.isEmpty(select)
|
||||||
? List.of("stcd", "stnm", "rstcd", "ennm", "baseId", "baseName", "yr", "ftpName", "targetFcnt", "realFcnt")
|
? List.of("stcd", "stnm", "rstcd", "ennm", "baseId", "baseName", "yr", "ftpName", "targetFcnt", "realFcnt")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user