添加导出数据工具类

This commit is contained in:
duwenyuan 2026-07-21 13:40:45 +08:00
parent a7710c1bcb
commit ce2817d168
17 changed files with 1773 additions and 3900 deletions

View File

@ -0,0 +1,40 @@
package org.jeecg.config;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@Component
public class SchemaMappingConfig {
private static final Map<Integer, String> SOURCE_SCHEMA_MAP = new HashMap<Integer, String>() {
{
put(1, "RNAUTO");
put(2, "RNMAN");
put(3, "RMSAUTO");
put(4, "RMSMAN");
}
};
/**
* 获取数据库
*
* @param source 标识
* @return 数据库名
*/
public String getSourceSchema(Integer source) {
return SOURCE_SCHEMA_MAP.get(source);
}
public boolean isValid(Integer source) {
return SOURCE_SCHEMA_MAP.containsKey(source);
}
public Set<Integer> getAllSources() {
return SOURCE_SCHEMA_MAP.keySet();
}
}

View File

@ -1,187 +1,148 @@
package org.jeecg.controller; package org.jeecg.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.dto.SampleQueryRequestDTO;
import org.jeecg.entity.GardsStations; import org.jeecg.entity.GardsStations;
import org.jeecg.entity.SysDefaultNuclide; import org.jeecg.entity.SysDefaultNuclide;
import org.jeecg.service.ISampleStatAnalysisService; import org.jeecg.service.ISampleStatAnalysisService;
import org.jeecg.service.impl.ExcelExportService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@Slf4j
@RestController @RestController
@RequestMapping("dataAnalysis") @RequestMapping("dataAnalysis")
@Api(value = "数据分析", tags = "数据分析") @Api(value = "数据分析", tags = "数据分析")
public class DataAnalysisController { public class DataAnalysisController {
@Autowired @Autowired
private ISampleStatAnalysisService sampleStatAnalysisService; private ISampleStatAnalysisService sampleStatAnalysisService;
@Autowired
private ExcelExportService excelExportService;
/*** 样品监测结果回放 /*** 样品监测结果回放
* *
* @param sampleType
* @param dataSource
* @param startDate
* @param endDate
* @return * @return
*/ */
@AutoLog(value = "样品监测结果回放")
@GetMapping("/getSampleMonitorResult") @GetMapping("/getSampleMonitorResult")
@ApiOperation(value = "样品监测结果回放", notes = "样品监测结果回放") @ApiOperation(value = "样品监测结果回放", notes = "样品监测结果回放")
public Result<?> getSampleMonitorResult(String sampleType, Integer dataSource, public Result<?> getSampleMonitorResult(@Valid SampleQueryRequestDTO reqDTO) {
@RequestParam("startDate") return Result.OK(
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, sampleStatAnalysisService.getSampleMonitorResult(reqDTO));
@RequestParam("endDate")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
return sampleStatAnalysisService.getSampleMonitorResult(sampleType, dataSource, startDate,
endDate);
} }
/*** 样品统计分析 /*** 样品统计分析
* *
* @param station
* @param dataSource
* @param startDate
* @param endDate
* @return * @return
*/ */
@AutoLog(value = "样品统计分析")
@GetMapping("/getSampleStatAnalysis") @GetMapping("/getSampleStatAnalysis")
@ApiOperation(value = "样品统计分析", notes = "样品统计分析") @ApiOperation(value = "样品统计分析", notes = "样品统计分析")
public Result<?> getSampleStatAnalysis(String station, Integer dataSource, public Result<?> getSampleStatAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
@RequestParam("startDate") return Result.OK(
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, sampleStatAnalysisService.getSampleStatAnalysis(reqDTO));
@RequestParam("endDate") //return sampleStatAnalysisService.getSampleStatAnalysis(station, dataSource, startDate,
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) { // endDate);
return sampleStatAnalysisService.getSampleStatAnalysis(station, dataSource, startDate,
endDate);
} }
@AutoLog(value = "样品统计分析-核素等级时序分析")
@GetMapping("/getNuclideActConcChartData") @GetMapping("/getNuclideActConcChartData")
@ApiOperation(value = "样品统计分析-核素等级时序分析", notes = "样品统计分析-核素等级时序分析") @ApiOperation(value = "样品统计分析-核素等级时序分析", notes = "样品统计分析-核素等级时序分析")
public Result<?> getNuclideActConcChartData( public Result<?> getNuclideActConcChartData(@Valid SampleQueryRequestDTO reqDTO) {
@RequestParam(value = "sampleType") String sampleType,
@RequestParam("station") String station,
@RequestParam("nuclideName") String nuclideName, return Result.OK(sampleStatAnalysisService.getNuclideActConcChartData(reqDTO));
@RequestParam("dataSource") Integer dataSource,
@RequestParam("startDate")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
@RequestParam("endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate)
throws JsonProcessingException {
return sampleStatAnalysisService.getNuclideActConcChartData(sampleType, station,
nuclideName, dataSource, startDate, endDate);
} }
/*** 样品等级时序分析 /*** 样品等级时序分析
* 样品等级时序分析 * 样品等级时序分析
* @param sampleType 样品类型
* @param station 台站编码
* @param dataSource 数据源
* @param startDate 开始时间
* @param endDate 结束时间
* @return 返回样品等级信息 * @return 返回样品等级信息
*/ */
@AutoLog(value = "样品等级时序分析")
@GetMapping("/getSampleGradeAnalysis") @GetMapping("/getSampleGradeAnalysis")
@ApiOperation(value = "样品等级时序分析", notes = "样品等级时序分析") @ApiOperation(value = "样品等级时序分析", notes = "样品等级时序分析")
public Result<?> getSampleGradeAnalysis(String sampleType, String station, Integer dataSource, public Result<?> getSampleGradeAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
@RequestParam("startDate") return Result.OK(
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, sampleStatAnalysisService.getSampleGradeAnalysis(reqDTO));
@RequestParam("endDate")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
return sampleStatAnalysisService.getSampleGradeAnalysis(sampleType, station, startDate,
endDate, dataSource);
} }
/*** 样品活度浓度区间频率分析 /*** 样品活度浓度区间频率分析
* *
* @param sampleType 样品类型-颗粒物气体
* @param station 台站编码
* @param nuclideName 核素名称
* @param dataSource 数据源
* @param startDate 开始时间
* @param endDate 结束时间
* @return 返回样品获取浓度区间信息 * @return 返回样品获取浓度区间信息
*/ */
@AutoLog(value = "样品活度浓度区间频率分析")
@GetMapping("/getActConcIntvlAnalysis") @GetMapping("/getActConcIntvlAnalysis")
@ApiOperation(value = "样品活度浓度区间频率分析", notes = "样品活度浓度区间频率分析") @ApiOperation(value = "样品活度浓度区间频率分析", notes = "样品活度浓度区间频率分析")
public Result<?> getSampleActConcIntvlAnalysis(String sampleType, String station, public Result<?> getSampleActConcIntvlAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
String nuclideName, Integer dataSource, return Result.OK(
@RequestParam("startDate") sampleStatAnalysisService.getSampleActConcIntvlAnalysis(reqDTO));
@DateTimeFormat(pattern = "yyyy-MM-dd")
Date startDate,
@RequestParam("endDate")
@DateTimeFormat(pattern = "yyyy-MM-dd")
Date endDate) {
return sampleStatAnalysisService.getSampleActConcIntvlAnalysis(sampleType, station,
nuclideName, dataSource, startDate, endDate);
} }
/*** 样品活度浓度时序分析 /*** 样品活度浓度时序分析
* *
* @param sampleType 样品类型-颗粒物气体
* @param station 台站编码
* @param nuclideName 核素名称
* @param dataSource 数据源
* @param startDate 开始时间
* @param endDate 结束时间
* @return 返回样品获取浓度时序信息 * @return 返回样品获取浓度时序信息
*/ */
@AutoLog(value = "样品活度浓度时序分析")
@GetMapping("/getActConcTimeSeqAnalysis") @GetMapping("/getActConcTimeSeqAnalysis")
@ApiOperation(value = "样品活度浓度时序分析", notes = "样品活度浓度时序分析") @ApiOperation(value = "样品活度浓度时序分析", notes = "样品活度浓度时序分析")
public Result<?> getSampleActConcTimeSeqAnalysis(String sampleType, String station, public Result<?> getSampleActConcTimeSeqAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
String nuclideName, Integer dataSource, return Result.OK(sampleStatAnalysisService.getNuclideActConcChartData(reqDTO));
@RequestParam("startDate")
@DateTimeFormat(pattern = "yyyy-MM-dd")
Date startDate,
@RequestParam("endDate")
@DateTimeFormat(pattern = "yyyy-MM-dd")
Date endDate) throws JsonProcessingException {
return sampleStatAnalysisService.getNuclideActConcChartData(sampleType, station,
nuclideName, dataSource, startDate, endDate);
} }
/*** 核素活度浓度对比分析 /*** 核素活度浓度对比分析
* *
* @param sampleType
* @param stationIds
* @param nuclideName
* @param dataSource
* @param startDate
* @param endDate
* @return * @return
*/ */
@AutoLog(value = "样品活度浓度时序分析")
@GetMapping("/getNuclideActivityConcAnalyze") @GetMapping("/getNuclideActivityConcAnalyze")
@ApiOperation(value = "核素活度浓度对比分析", notes = "核素活度浓度对比分析") @ApiOperation(value = "核素活度浓度对比分析", notes = "核素活度浓度对比分析")
public Result<?> getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds, public Result<?> getNuclideActivityConcAnalyze(@Valid SampleQueryRequestDTO reqDTO) {
String nuclideName, Integer dataSource, return Result.OK(
@RequestParam("startDate") sampleStatAnalysisService.getNuclideActivityConcAnalyze(reqDTO));
@DateTimeFormat(pattern = "yyyy-MM-dd")
Date startDate,
@RequestParam("endDate")
@DateTimeFormat(pattern = "yyyy-MM-dd")
Date endDate) {
return sampleStatAnalysisService.getNuclideActivityConcAnalyze(sampleType, stationIds,
nuclideName, dataSource, startDate, endDate);
} }
@AutoLog(value = "导出数据")
@GetMapping("/exportData")
public void exportData(@RequestParam("type") String type, @Valid SampleQueryRequestDTO reqDTO,HttpServletResponse response) {
try {
excelExportService.exportSingle(type, reqDTO, response);
} catch (Exception e) {
log.error("导出失败, type={}", type, e);
}
}
@AutoLog(value = "获取台站信息")
@GetMapping("/findStationList") @GetMapping("/findStationList")
public Result<?> findStationList(String systemType) { public Result<?> findStationList(@RequestParam("systemType") String systemType, @RequestParam("dataSource") Integer dataSource) {
List<GardsStations> gardsStations = List<GardsStations> gardsStations =
sampleStatAnalysisService.findStationListByMenuName(systemType); sampleStatAnalysisService.findStationListByMenuName(systemType, dataSource);
return Result.OK(gardsStations); return Result.OK(gardsStations);
} }
@AutoLog(value = "获取核素信息")
@GetMapping("/findNuclideList") @GetMapping("/findNuclideList")
public Result<?> findNuclideList(String systemType) { public Result<?> findNuclideList(@RequestParam("systemType") String systemType) {
List<SysDefaultNuclide> defaultNuclides = List<SysDefaultNuclide> defaultNuclides =
sampleStatAnalysisService.findNuclideList(systemType); sampleStatAnalysisService.findNuclideList(systemType);
return Result.OK(defaultNuclides); return Result.OK(defaultNuclides);

View File

@ -0,0 +1,22 @@
package org.jeecg.dto;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
@Data
public class SampleQueryRequestDTO {
private String sampleType;
private List<Integer> stationIds;
private String nuclideName;
private Integer dataSource;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date startDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endDate;
}

View File

@ -0,0 +1,24 @@
package org.jeecg.entity;
public final class ExportType {
private ExportType() {}
/** 样品等级时序分析 */
public static final String SAMPLE_LEVEL_TIME = "sampleLevelTime";
/** 样品统计分析 */
public static final String SAMPLE_STAT = "sampleStat";
/** 样品活度浓度区间频率分析 */
public static final String SAMPLE_RANGE_FREQ = "sampleRangeFreq";
/** 核素活度浓度时序分析 */
public static final String NUCLIDE_TIME = "nuclideTime";
/** 核素活度浓度对比分析 */
public static final String NUCLIDE_COMPARE = "nuclideCompare";
/** 全部类型 */
public static final String ALL = "all";
}

View File

@ -13,6 +13,9 @@ public class SampleLevelData {
* 样品ID * 样品ID
*/ */
private Integer sampleId; private Integer sampleId;
private String stationId;
/** 收集停止时间 /** 收集停止时间
* *
*/ */

View File

@ -5,281 +5,150 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.jeecg.entity.*; import org.jeecg.entity.*;
import org.jeecg.modules.base.entity.original.GardsSampleData; import org.jeecg.modules.base.entity.original.GardsSampleData;
import org.jeecg.vo.NuclideActConcRawVO;
import org.jeecg.vo.SampleStatExcelVO;
import java.util.Date;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleData> { public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleData> {
List<GardsSampleData> getSampleStatAnalysis(String station, String startDate, String endDate);
List<ThresholdMetric> selectByStationIds(@Param("stationIds") List<String> stationIds,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
//region 样品等级时序分析 //region 样品等级时序分析
List<SampleLevelData> getSampleGradeAnalysis(
@Param("sampleType") String sampleType,
List<GardsSampleData> getSampleGradeAnalysis(String sampleType, String station, @Param("stations") List<Integer> stations,
@Param("startTime") String startTime, @Param("startTime") Date startTime,
@Param("endTime") String endTime, @Param("endTime") Date endTime,
Integer dataSource); @Param("dsType") String dsType);
List<SampleLevelData> getRnAutoSampleGradeAnalysis(String sampleType, String station,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
List<SampleLevelData> getRnManSampleGradeAnalysis(String sampleType, String station,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
List<NuclideActConcIntvl> getIdentifiedNuclides(@Param("schemaName") String schemaName, List<NuclideActConcIntvl> getIdentifiedNuclides(@Param("schemaName") String schemaName,
@Param("nuclideName") String nuclideName, @Param("nuclideName") String nuclideName,
String station, @Param("stations") List<Integer> stations,
@Param("startTime") String startTime, @Param("startTime") Date startTime,
@Param("endTime") String endTime); @Param("endTime") Date endTime);
List<NuclideActConcIntvl> getRMSIdentifiedNuclides(@Param("schemaName") String schemaName,
//endregion
/*** 获取样品类型P中元素的浓度活度MDC信息
* 获取样品中元素的浓度活度MDC信息
* @param station 台站编码
* @param startTime 开始时间
* @param endTime 结束时间
* @return 返回List<NuclideActConcIntvl>
*/
List<NuclideActConcIntvl> getSamplePNuclideActConcIntvl(String station,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
//region 获取样品的级别和阈值
List<SampleLevelData> getRnAutoSampleLevel(String station, @Param("startTime") String startTime,
@Param("endTime") String endTime);
List<SampleLevelData> getRnManSampleLevel(String station, @Param("startTime") String startTime,
@Param("endTime") String endTime);
List<SampleLevelData> getNuclideTimeSeriesAnalysis(@Param("schemaName") String schemaName,
@Param("station") String station,
@Param("nuclideName") String nuclideName, @Param("nuclideName") String nuclideName,
@Param("startTime") String startTime, @Param("stations") List<Integer> stations,
@Param("endTime") String endTime); @Param("startTime") Date startTime,
@Param("endTime") Date endTime);
//endregion //endregion
List<SampleLevelData> getNuclideTimeSeriesAnalysis(@Param("schemaName") String schemaName,
@Param("stations") List<Integer> stations,
@Param("nuclideName") String nuclideName,
@Param("startTime") Date startTime,
@Param("endTime") Date endTime);
//endregion
//region RNAUTO 获取样品中元素的浓度活度MDC信息 //region RNAUTO 获取样品中元素的浓度活度MDC信息
/*** 获取样品中元素的浓度活度MDC信息
* 查询RNAUTO.GARDS_NUCL_IDED中的活度浓度MDC信息
* @param station 台站编码
* @param startTime 开始时间
* @param endTime 结束时间
* @return 返回List<NuclideActConcIntvl>
*/
List<NuclideActConcIntvl> getRnautoPNuclideActConcIntvl(String sampleType, String station,
String nuclideName,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/*** 获取样品中元素的浓度活度MDC信息
* 查询RNAUTO.GARDS_XE_RESULTS中的活度浓度MDC信息
* @param station
* @param startTime
* @param endTime
* @return
*/
List<NuclideActConcIntvl> getRnautoNuclideActConcIntvl(String sampleType, String station,
String nuclideName,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/** /**
* 样品活度浓度区间频率分析
* 获取样品中元素的浓度活度MDC信息
* *
* @param schemaName * @param schemaName 模式名
* @return * @param sampleType 样品类型
*/ * @param stations 台站
List<NuclideActConcIntvl>getNuclideActConcIntvl(@Param("schemaName") String schemaName); * @param nuclideName 核素名称
//endregion
//region RNMAN 获取样品中元素的浓度活度MDC信息
/*** 获取样品中元素的浓度活度MDC信息
* 查询RNAUTO.GARDS_NUCL_IDED中的活度浓度MDC信息
* @param station 台站编码
* @param startTime 开始时间 * @param startTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @return 返回List<NuclideActConcIntvl> * @return List<NuclideActConcIntvl>
*/ */
List<NuclideActConcIntvl> getRnmanPNuclideActConcIntvl(String sampleType, String station, List<NuclideActConcIntvl> getNuclideActConcIntvl(@Param("schemaName") String schemaName,
String nuclideName, @Param("sampleType") String sampleType,
@Param("startTime") String startTime, @Param("stations") List<Integer> stations,
@Param("endTime") String endTime); @Param("nuclideName") String nuclideName,
@Param("startTime") Date startTime,
@Param("endTime") Date endTime);
/*** 获取样品中元素的浓度活度MDC信息 List<NuclideActConcIntvl> getRMSNuclideActConcIntvl(@Param("schemaName") String schemaName,
* 查询RNAUTO.GARDS_XE_RESULTS中的活度浓度MDC信息 @Param("sampleType") String sampleType,
* @param station @Param("stations") List<Integer> stations,
* @param startTime @Param("nuclideName") String nuclideName,
* @param endTime @Param("startTime") Date startTime,
* @return @Param("endTime") Date endTime);
*/
List<NuclideActConcIntvl> getRnmanNuclideActConcIntvl(String sampleType, String station,
String nuclideName,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
//endregion //endregion
//region 样品统计分析 //region 样品统计分析
/** /**
* RnAuto--获取样品中识别到的核素集合 * RnAuto--获取样品中识别到的核素集合
*/ */
List<NuclideActConcIntvl> getSampleNuclides(
List<NuclideActConcIntvl> getRnAutoIdentifiedNuclides(String station, @Param("dbType") String dbType,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/**
* RnAuto-- 核素等级时序分析
*/
List<SampleLevelData> getRnAutoNuclideTimeSeriesAnalysis(String station,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/**
* RnMan--获取样品中识别到的核素集合
*/
List<NuclideActConcIntvl> getRnManIdentifiedNuclides(String station,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/**
* RnMan--核素等级时序分析
*
* @return List<SampleLevelData>
*/
List<SampleLevelData> getRnManNuclideTimeSeriesAnalysis(String station,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/**
* 精确查询单个站点 + 单个核素
*
* @param stationId 站点ID (必填)
* @param nuclideName 核素名称 (必填)
* @return 匹配的记录列表
*/
List<GardsThresholdResultHis> selectByStationAndNuclide(
@Param("schemaName") String schemaName, @Param("schemaName") String schemaName,
@Param("stationId") Integer stationId, @Param("stations") List<Integer> stations,
@Param("startTime") Date startTime,
@Param("endTime") Date endTime);
List<SampleStatExcelVO> getSampleStatPData(@Param("schemaName") String schemaName,
@Param("stations") List<Integer> stations,
@Param("startTime") Date startTime,
@Param("endTime") Date endTime);
List<SampleStatExcelVO> getSampleStatBData(@Param("schemaName") String schemaName,
@Param("stations") List<Integer> stations,
@Param("startTime") Date startTime,
@Param("endTime") Date endTime);
List<NuclideActConcIntvl> getIdentifiedNuclidesBatch(
@Param("schema") String schema,
@Param("nuclideName") String nuclideName, @Param("nuclideName") String nuclideName,
@Param("startTime") String startTime, @Param("stations") List<Integer> stations,
@Param("endTime") String endTime @Param("startTime") Date startTime,
); @Param("endTime") Date endTime);
/**
* 多站点 + 多核素查询
*
* @param stationIds 站点ID集合 (非空)
* @param nuclideNames 核素名称集合 (非空)
* @return 匹配的记录列表
*/
List<GardsThresholdResultHis> selectByStationsAndNuclides(
@Param("schemaName") String schemaName,
@Param("stationIds") List<Integer> stationIds,
@Param("nuclideNames") List<String> nuclideNames,
@Param("startTime") String startTime,
@Param("endTime") String endTime
);
/**
* 多站点 + 单核素查询
*
* @param stationIds 站点ID集合 (非空)
* @param nuclideName 单个核素名称 (必填)
* @return 匹配的记录列表
*/
List<GardsThresholdResultHis> selectByStationsAndNuclide(
@Param("schemaName") String schemaName,
@Param("stationIds") List<Integer> stationIds,
@Param("nuclideName") String nuclideName,
@Param("startTime") String startTime,
@Param("endTime") String endTime
);
/**
* 单站点 + 多核素查询
*
* @param stationId 单个站点ID (必填)
* @param nuclideNames 核素名称集合 (非空)
* @return 匹配的记录列表
*/
List<GardsThresholdResultHis> selectByStationAndNuclides(
@Param("schemaName") String schemaName,
@Param("stationId") Integer stationId,
@Param("nuclideNames") List<String> nuclideNames,
@Param("startTime") String startTime,
@Param("endTime") String endTime
);
/**
* 动态条件查询所有参数均可为空
*
* @param stationIds 站点ID集合 (可选)
* @param nuclideNames 核素名称集合 (可选)
* @param startTime 开始时间 (可选)
* @param endTime 结束时间 (可选)
* @return 匹配的记录列表
*/
List<GardsThresholdResultHis> selectByCondition(
@Param("schemaName") String schemaName,
@Param("stationIds") List<Integer> stationIds,
@Param("nuclideNames") List<String> nuclideNames,
@Param("startTime") String startTime,
@Param("endTime") String endTime
);
//endregion //endregion
//region 核素活度浓度对比分析 //region 核素活度浓度对比分析
List<NuclideActConcIntvl> getRnAutoAnalyzeNuclideActivityConc( List<NuclideActConcIntvl> getRnAutoAnalyzeNuclideActivityConc(
@Param("sampleType") String sampleType, @Param("nuclideName") String nuclideName, @Param("sampleType") String sampleType, @Param("nuclideName") String nuclideName,
@Param("stationIds") Integer[] stationIds, @Param("startTime") String startTime, @Param("stations") List<Integer> stations, @Param("startTime") Date startTime,
@Param("endTime") String endTime); @Param("endTime") Date endTime);
List<NuclideActConcIntvl> getRnManAnalyzeNuclideActivityConc( List<NuclideActConcIntvl> getRnManAnalyzeNuclideActivityConc(
@Param("sampleType") String sampleType, @Param("nuclideName") String nuclideName, @Param("sampleType") String sampleType, @Param("nuclideName") String nuclideName,
@Param("stationIds") Integer[] stationIds, @Param("startTime") String startTime, @Param("stations") List<Integer> stations, @Param("startTime") Date startTime,
@Param("endTime") String endTime); @Param("endTime") Date endTime);
List<NuclideActConcIntvl> getRnAnalyzeNuclideActivityConc(
@Param("schemaName") String schemaName, @Param("sampleType") String sampleType,
@Param("nuclideName") String nuclideName, @Param("stations") List<Integer> stations,
@Param("startTime") Date startTime,@Param("endTime") Date endTime);
List<NuclideActConcIntvl> getRMSAnalyzeNuclideActivityConc(
@Param("schemaName") String schemaName, @Param("sampleType") String sampleType,
@Param("nuclideName") String nuclideName,@Param("stations") List<Integer> stations,
@Param("startTime") Date startTime, @Param("endTime") Date endTime);
//endregion //endregion
//region 样品监测结果 //region 样品监测结果
List<StationInfoData> getRnAutoSampleResult(String sampleType, List<StationInfoData> getRnAutoSampleResult(String sampleType,
@Param("startTime") String startTime, @Param("startTime") Date startTime,
@Param("endTime") String endTime); @Param("endTime") Date endTime);
List<StationInfoData> getRnManSampleResult(String sampleType, List<StationInfoData> getRnManSampleResult(String sampleType,
@Param("startTime") String startTime, @Param("startTime") Date startTime,
@Param("endTime") String endTime); @Param("endTime") Date endTime);
//endregion //endregion
//region 查询台站信息 //region 查询台站信息
List<GardsStations> findStationListByMenuName(@Param("systemType") String systemType); List<GardsStations> findStationListByMenuName(@Param("systemType") String systemType);
List<GardsStations> findRMSStationListByMenuName(@Param("systemType") String systemType);
//endregion //endregion
/**
* 查询各站点核素的活度浓度用于区间频率分析
*/
List<NuclideActConcRawVO> getNuclideActConcList(
@Param("schema") String schema,
@Param("stations") List<Integer> stations,
@Param("sampleType") String sampleType,
@Param("startTime") Date startTime,
@Param("endTime") Date endTime);
} }

View File

@ -8,10 +8,11 @@
GRADING GRADING
FROM ORIGINAL.GARDS_SAMPLE_DATA FROM ORIGINAL.GARDS_SAMPLE_DATA
WHERE STATION_CODE = #{ stationCode } WHERE STATION_CODE = #{ stationCode }
AND ACQUISITION_START BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS') AND ACQUISITION_START BETWEEN #{ startTime }
AND TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS') AND #{ endTime }
ORDER BY ACQUISITION_START ORDER BY ACQUISITION_START
</select> </select>
<select id="selectByStationIds" resultType="org.jeecg.entity.ThresholdMetric"> <select id="selectByStationIds" resultType="org.jeecg.entity.ThresholdMetric">
SELECT SELECT
a.STATION_ID as STATION_ID, a.STATION_ID as STATION_ID,
@ -24,71 +25,58 @@
<where> <where>
a.STATION_ID IN a.STATION_ID IN
<foreach item="stationId" collection="stationIds" open="(" close=")" separator=","> <foreach item="stationId" collection="stationIds" open="(" close=")" separator=",">
'${stationId}' #{stationId}
</foreach> </foreach>
AND a.ACQUISITION_START BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS') AND a.ACQUISITION_START BETWEEN #{ startTime }
AND TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS') AND #{ endTime }
</where> </where>
</select> </select>
<select id="getRnAutoSampleGradeAnalysis" resultType="org.jeecg.entity.SampleLevelData"> <select id="getSampleGradeAnalysis" resultType="org.jeecg.entity.SampleLevelData">
SELECT t1.SAMPLE_ID, SELECT t1.SAMPLE_ID,
t1.COLLECT_STOP, t1.COLLECT_STOP,
t1.STATION_ID, t1.STATION_ID,
<choose>
<when test="dsType == 'RNAUTO' or dsType == 'RNMAN'">
t2.CATEGORY t2.CATEGORY
FROM ORIGINAL.GARDS_SAMPLE_DATA t1 </when>
LEFT JOIN RNAUTO.GARDS_ANALYSES t2 <when test="dsType == 'RMSAUTO' or dsType == 'RMSMAN'">
t2.AUTO_CATEGORY AS CATEGORY
</when>
</choose>
FROM
<choose>
<when test="dsType == 'RNAUTO' or dsType == 'RNMAN'">
ORIGINAL.GARDS_SAMPLE_DATA t1
</when>
<when test="dsType == 'RMSAUTO'">
RMSAUTO.GARDS_SAMPLE_DATA t1
</when>
<when test="dsType == 'RMSMAN'">
RMSMAN.GARDS_SAMPLE_DATA t1
</when>
</choose>
INNER JOIN
<choose>
<when test="dsType == 'RNAUTO'">RNAUTO.GARDS_ANALYSES t2</when>
<when test="dsType == 'RNMAN'">RNMAN.GARDS_ANALYSES t2</when>
<when test="dsType == 'RMSAUTO'">RMSAUTO.GARDS_SAMPLE_STATUS t2</when>
<when test="dsType == 'RMSMAN'">RMSMAN.GARDS_SAMPLE_STATUS t2</when>
</choose>
ON t1.SAMPLE_ID = t2.SAMPLE_ID ON t1.SAMPLE_ID = t2.SAMPLE_ID
WHERE t1.STATION_ID = #{station} WHERE t1.STATION_ID IN
AND t1.SAMPLE_TYPE = #{sampleType} <foreach collection="stations" item="s" open="(" separator="," close=")">
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') #{s}
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') </foreach>
AND t1.SAMPLE_TYPE = '${sampleType}'
</select> AND t1.COLLECT_STOP BETWEEN #{startTime}
AND #{endTime}
<select id="getRnManSampleGradeAnalysis" resultType="org.jeecg.entity.SampleLevelData">
SELECT t1.SAMPLE_ID,
t1.COLLECT_STOP,
t1.STATION_ID,
t2.CATEGORY
FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN RNMAN.GARDS_ANALYSES t2
ON t1.SAMPLE_ID = t2.SAMPLE_ID
WHERE t1.STATION_ID = #{station}
AND t1.SAMPLE_TYPE = #{sampleType}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS')
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
</select> </select>
<!-- 数据源 RNAUTO--> <!-- 数据源 RNAUTO-->
<!-- 获取样品的级别和阈值--> <!-- 获取样品的级别和阈值-->
<select id="getRnAutoSampleLevel" resultType="org.jeecg.entity.SampleLevelData">
select a.SAMPLE_ID,
a.COLLECT_STOP,
b.CATEGORY
from ORIGINAL.GARDS_SAMPLE_DATA a,
RNAUTO.GARDS_ANALYSES b
WHERE a.SAMPLE_ID = b.SAMPLE_ID
AND a.STATION_ID = #{station}
AND a.COLLECT_STOP BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS')
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
</select>
<select id="getRnManSampleLevel" resultType="org.jeecg.entity.SampleLevelData">
select a.SAMPLE_ID,
a.COLLECT_STOP,
b.CATEGORY
from ORIGINAL.GARDS_SAMPLE_DATA a,
RNMAN.GARDS_ANALYSES b
WHERE a.SAMPLE_ID = b.SAMPLE_ID
AND a.STATION_ID = #{station}
AND a.COLLECT_STOP BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS')
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
</select>
<!-- 获取样品中元素的浓度活度、MDC信息--> <!-- 获取样品中元素的浓度活度、MDC信息-->
<select id="getRnautoPNuclideActConcIntvl" resultType="org.jeecg.entity.NuclideActConcIntvl"> <select id="getRnautoPNuclideActConcIntvl" resultType="org.jeecg.entity.NuclideActConcIntvl">
@ -112,8 +100,8 @@
WHERE a.SAMPLE_TYPE = #{sampleType} WHERE a.SAMPLE_TYPE = #{sampleType}
AND a.STATION_ID = #{station} AND a.STATION_ID = #{station}
AND b.NUCLIDENAME = #{nuclideName} AND b.NUCLIDENAME = #{nuclideName}
AND a.COLLECT_START BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND a.COLLECT_START BETWEEN #{startTime}
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND #{endTime}
</select> </select>
<!-- 获取样品类型=气体 元素的浓度活度、MDC信息--> <!-- 获取样品类型=气体 元素的浓度活度、MDC信息-->
@ -134,10 +122,128 @@
WHERE a.SAMPLE_TYPE = #{sampleType} WHERE a.SAMPLE_TYPE = #{sampleType}
AND a.STATION_ID = #{station} AND a.STATION_ID = #{station}
AND b.NUCLIDE_NAME = #{nuclideName} AND b.NUCLIDE_NAME = #{nuclideName}
AND a.COLLECT_START BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND a.COLLECT_START BETWEEN #{startTime}
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND #{endTime}
</select> </select>
<select id="getNuclideActConcIntvl" resultType="org.jeecg.entity.NuclideActConcIntvl">
<if test='sampleType == "P"'>
SELECT a.SAMPLE_ID,
a.COLLECT_STOP,
a.SAMPLE_TYPE,
a.STATION_ID,
a.STATUS,
c.CATEGORY,
b.NUCLIDENAME NUCLIDE_NAME,
b.CONCENTRATION AS conc,
b.MDC,
b.ACTIV_KEY_ERR AS concErr
FROM ORIGINAL.GARDS_SAMPLE_DATA a
INNER JOIN
${schemaName}.GARDS_ANALYSES c
ON a.SAMPLE_ID = c.SAMPLE_ID
INNER JOIN
${schemaName}.GARDS_NUCL_IDED b
ON a.SAMPLE_ID = b.SAMPLE_ID
WHERE a.SAMPLE_TYPE = #{sampleType}
AND a.STATION_ID IN
<foreach collection="stations" item="s" open="(" separator="," close=")">
#{s}
</foreach>
AND b.NUCLIDENAME = #{nuclideName}
AND a.COLLECT_STOP BETWEEN #{startTime} AND #{endTime}
</if>
<if test='sampleType == "B"'>
SELECT a.SAMPLE_ID,
a.COLLECT_STOP,
a.SAMPLE_TYPE,
a.STATION_ID,
a.STATUS,
c.CATEGORY,
b.NUCLIDE_NAME,
b.CONC,
b.MDC,
b.CONC_ERR
FROM ORIGINAL.GARDS_SAMPLE_DATA a
INNER JOIN
${schemaName}.GARDS_ANALYSES c
ON a.SAMPLE_ID = c.SAMPLE_ID
INNER JOIN
${schemaName}.GARDS_XE_RESULTS b
ON a.SAMPLE_ID = b.SAMPLE_ID
WHERE a.SAMPLE_TYPE = #{sampleType}
AND a.STATION_ID IN
<foreach collection="stations" item="s" open="(" separator="," close=")">
#{s}
</foreach>
AND b.NUCLIDE_NAME = #{nuclideName}
AND a.COLLECT_STOP BETWEEN #{startTime} AND #{endTime}
</if>
</select>
<select id="getRMSNuclideActConcIntvl" resultType="org.jeecg.entity.NuclideActConcIntvl">
SELECT
s.SAMPLE_ID,
s.COLLECT_STOP,
s.SAMPLE_TYPE,
s.STATION_ID,
ss.AUTO_CATEGORY AS CATEGORY,
n.NAME AS NUCLIDENAME,
n.ACTIV_DECAY AS CONC,
n.MDA AS MDC,
NULL AS CONC_ERR
FROM ${schemaName}.GARDS_SAMPLE_DATA s
LEFT JOIN ${schemaName}.GARDS_SAMPLE_STATUS ss
ON s.SAMPLE_ID = ss.SAMPLE_ID
LEFT JOIN ${schemaName}.GARDS_NUCL_IDED n
ON s.SAMPLE_ID = n.SAMPLE_ID
WHERE s.COLLECT_STOP &gt;= #{startTime}
AND s.COLLECT_STOP &lt; #{endTime}
AND s.STATION_ID IN
<foreach collection="stations" item="s" open="(" separator="," close=")">
#{s}
</foreach>
<if test="nuclideName != null and nuclideName != ''">
AND n.NAME = #{nuclideName}
</if>
UNION ALL
SELECT
s.SAMPLE_ID,
s.COLLECT_STOP,
s.SAMPLE_TYPE,
s.STATION_ID,
ss.AUTO_CATEGORY AS CATEGORY,
CASE x.NUCLIDE_ID
WHEN 8 THEN 'Xe131m'
WHEN 9 THEN 'Xe133'
WHEN 10 THEN 'Xe133m'
WHEN 11 THEN 'Xe135'
END AS NUCLIDENAME,
x.CONC AS CONC,
x.MDC AS MDC,
x.CONC_ERR AS CONC_ERR
FROM ${schemaName}.GARDS_SAMPLE_DATA s
LEFT JOIN ${schemaName}.GARDS_SAMPLE_STATUS ss
ON s.SAMPLE_ID = ss.SAMPLE_ID
LEFT JOIN ${schemaName}.GARDS_XE_RESULTS x
ON s.SAMPLE_ID = x.SAMPLE_ID
WHERE s.COLLECT_STOP &gt;= #{startTime}
AND s.COLLECT_STOP &lt; #{endTime}
AND s.STATION_ID IN
<foreach collection="stations" item="s" open="(" separator="," close=")">
#{s}
</foreach>
<if test="nuclideName != null and nuclideName != ''">
AND x.NUCLIDE_ID = CASE #{nuclideName}
WHEN 'Xe131m' THEN 8
WHEN 'Xe133' THEN 9
WHEN 'Xe133m' THEN 10
WHEN 'Xe135' THEN 11
END
</if>
</select>
<!-- 数据源 RNMAN--> <!-- 数据源 RNMAN-->
<!-- 获取样品中元素的浓度活度、MDC信息--> <!-- 获取样品中元素的浓度活度、MDC信息-->
@ -158,8 +264,8 @@
WHERE a.SAMPLE_TYPE = #{sampleType} WHERE a.SAMPLE_TYPE = #{sampleType}
AND a.STATION_ID = #{station} AND a.STATION_ID = #{station}
AND b.NUCLIDE_NAME = #{nuclideName} AND b.NUCLIDE_NAME = #{nuclideName}
AND a.COLLECT_START BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND a.COLLECT_START BETWEEN #{startTime}
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND #{endTime}
</select> </select>
<!-- 获取样品类型=气体 元素的浓度活度、MDC信息--> <!-- 获取样品类型=气体 元素的浓度活度、MDC信息-->
@ -177,11 +283,11 @@
INNER JOIN INNER JOIN
RNMAN.GARDS_XE_RESULTS b RNMAN.GARDS_XE_RESULTS b
ON a.SAMPLE_ID = b.SAMPLE_ID ON a.SAMPLE_ID = b.SAMPLE_ID
WHERE a.SAMPLE_TYPE = '#{sampleType}' WHERE a.SAMPLE_TYPE = #{sampleType}
AND a.STATION_ID = #{station} AND a.STATION_ID = #{station}
AND b.NUCLIDENAME = #{nuclideName} AND b.NUCLIDENAME = #{nuclideName}
AND a.COLLECT_START BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND a.COLLECT_START BETWEEN #{startTime}
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND #{endTime}
</select> </select>
@ -189,63 +295,9 @@
<!-- RnAuto 获取样品中识别到的核素集合--> <!-- RnAuto 获取样品中识别到的核素集合-->
<select id="getRnAutoIdentifiedNuclides" resultType="org.jeecg.entity.NuclideActConcIntvl"> <select id="getRnAutoIdentifiedNuclides1" resultType="org.jeecg.entity.NuclideActConcIntvl">
SELECT * FROM ( SELECT *
<!-- P类型数据 --> FROM (SELECT t1.SAMPLE_ID AS sampleId,
SELECT
t1.SAMPLE_ID AS sampleId,
t1.COLLECT_STOP AS collectStop,
t1.SAMPLE_TYPE AS sampleType,
t1.STATION_ID AS stationId,
t1.STATUS AS status,
COALESCE(s1.category, 0) AS category,
t2.NUCLIDENAME AS nuclideName,
CAST(REGEXP_REPLACE(t2.CONCENTRATION, '[^0-9.Ee-]', '') AS BINARY_DOUBLE) AS conc,
0 as concErr,
CAST(REGEXP_REPLACE(t2.MDC, '[^0-9.Ee-]', '') AS BINARY_DOUBLE) AS mdc
FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN RNAUTO.GARDS_ANALYSES s1 ON t1.SAMPLE_ID = s1.SAMPLE_ID
INNER JOIN RNAUTO.GARDS_NUCL_IDED t2 ON t1.SAMPLE_ID = t2.SAMPLE_ID
WHERE t1.STATION_ID = #{station}
AND t1.STATUS != 'F'
AND t1.COLLECT_STOP &gt;= TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS')
AND t1.COLLECT_STOP &lt; TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
AND t1.SAMPLE_TYPE = 'P'
UNION ALL
<!-- B类型数据 -->
SELECT
t1.SAMPLE_ID AS sampleId,
t1.COLLECT_STOP AS collectStop,
t1.SAMPLE_TYPE AS sampleType,
t1.STATION_ID AS stationId,
t1.STATUS AS status,
COALESCE(s1.category, 0) AS category,
t3.NUCLIDE_NAME AS nuclideName,
t3.CONC AS conc,
t3.CONC_ERR as concErr,
t3.MDC AS mdc
FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN RNAUTO.GARDS_ANALYSES s1 ON t1.SAMPLE_ID = s1.SAMPLE_ID
INNER JOIN RNAUTO.GARDS_XE_RESULTS t3 ON t1.SAMPLE_ID = t3.SAMPLE_ID
WHERE t1.STATION_ID = #{station}
AND t1.STATUS != 'F'
AND t1.COLLECT_STOP &gt;= TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS')
AND t1.COLLECT_STOP &lt; TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
AND t1.SAMPLE_TYPE = 'B'
) t
ORDER BY collectStop DESC
</select>
<select id="getIdentifiedNuclides" resultType="org.jeecg.entity.NuclideActConcIntvl">
SELECT * FROM (
<!-- P类型数据 -->
SELECT
t1.SAMPLE_ID AS sampleId,
t1.COLLECT_STOP AS collectStop, t1.COLLECT_STOP AS collectStop,
t1.SAMPLE_TYPE AS sampleType, t1.SAMPLE_TYPE AS sampleType,
t1.STATION_ID AS stationId, t1.STATION_ID AS stationId,
@ -259,44 +311,324 @@
LEFT JOIN ${schemaName}.GARDS_ANALYSES s1 ON t1.SAMPLE_ID = s1.SAMPLE_ID LEFT JOIN ${schemaName}.GARDS_ANALYSES s1 ON t1.SAMPLE_ID = s1.SAMPLE_ID
INNER JOIN ${schemaName}.GARDS_NUCL_IDED t2 ON t1.SAMPLE_ID = t2.SAMPLE_ID INNER JOIN ${schemaName}.GARDS_NUCL_IDED t2 ON t1.SAMPLE_ID = t2.SAMPLE_ID
WHERE t1.STATION_ID = #{station} WHERE t1.STATION_ID = #{station}
AND t2.NUCLIDENAME=#{nuclideName}
AND s1.category in(3,4)
AND t1.STATUS != 'F' AND t1.STATUS != 'F'
AND t1.COLLECT_STOP &gt;= TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND t1.COLLECT_STOP &gt;= #{startTime}
AND t1.COLLECT_STOP &lt; TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND t1.COLLECT_STOP
AND t1.SAMPLE_TYPE = 'P' &lt; #{endTime}
UNION ALL UNION ALL
<!-- B类型数据 -->
SELECT SELECT
t1.SAMPLE_ID AS sampleId, t1.SAMPLE_ID AS sampleId, t1.COLLECT_STOP AS collectStop, t1.SAMPLE_TYPE AS sampleType, t1.STATION_ID AS stationId, t1.STATUS AS status, COALESCE (s1.category, 0) AS category, t3.NUCLIDE_NAME AS nuclideName, t3.CONC AS conc, t3.CONC_ERR as concErr, t3.MDC AS mdc
t1.COLLECT_STOP AS collectStop,
t1.SAMPLE_TYPE AS sampleType,
t1.STATION_ID AS stationId,
t1.STATUS AS status,
COALESCE(s1.category, 0) AS category,
t3.NUCLIDE_NAME AS nuclideName,
t3.CONC AS conc,
t3.CONC_ERR as concErr,
t3.MDC AS mdc
FROM ORIGINAL.GARDS_SAMPLE_DATA t1 FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN ${schemaName}.GARDS_ANALYSES s1 ON t1.SAMPLE_ID = s1.SAMPLE_ID LEFT JOIN ${schemaName}.GARDS_ANALYSES s1
ON t1.SAMPLE_ID = s1.SAMPLE_ID
INNER JOIN ${schemaName}.GARDS_XE_RESULTS t3 ON t1.SAMPLE_ID = t3.SAMPLE_ID INNER JOIN ${schemaName}.GARDS_XE_RESULTS t3 ON t1.SAMPLE_ID = t3.SAMPLE_ID
WHERE t1.STATION_ID = #{station} WHERE t1.STATION_ID = #{station}
AND t3.NUCLIDE_NAME=#{nuclideName}
AND s1.category in(1,2,3)
AND t1.STATUS != 'F' AND t1.STATUS != 'F'
AND t1.COLLECT_STOP &gt;= TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND t1.COLLECT_STOP &gt;=#{startTime}
AND t1.COLLECT_STOP &lt; TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND t1.COLLECT_STOP
AND t1.SAMPLE_TYPE = 'B' &lt; #{endTime}) t
) t
ORDER BY collectStop DESC ORDER BY collectStop DESC
</select> </select>
<select id="getRnAutoIdentifiedNuclides"
resultType="org.jeecg.entity.NuclideActConcIntvl">
SELECT a.SAMPLE_ID AS sampleId,
a.COLLECT_STOP AS collectStop,
a.SAMPLE_TYPE AS sampleType,
a.STATION_ID AS stationId,
a.STATUS AS status,
COALESCE(s1.category, 0) AS category,
COALESCE(
n.NUCLIDENAME,
x.NUCLIDE_NAME
) AS nuclideName,
COALESCE(
CAST(REGEXP_REPLACE(n.CONCENTRATION, '[^0-9.Ee-]', '')
AS BINARY_DOUBLE),
x.CONC
) AS conc,
COALESCE(x.CONC_ERR, 0) AS concErr,
COALESCE(
CAST(REGEXP_REPLACE(n.MDC, '[^0-9.Ee-]', '')
AS BINARY_DOUBLE),
x.MDC
) AS mdc
FROM ORIGINAL.GARDS_SAMPLE_DATA a
LEFT JOIN ${schemaName}.GARDS_ANALYSES s1
ON a.SAMPLE_ID = s1.SAMPLE_ID
LEFT JOIN ${schemaName}.GARDS_NUCL_IDED n
ON a.SAMPLE_ID = n.SAMPLE_ID
LEFT JOIN ${schemaName}.GARDS_XE_RESULTS x
ON a.SAMPLE_ID = x.SAMPLE_ID
WHERE a.STATION_ID = #{station}
AND a.STATUS != 'F'
AND a.COLLECT_STOP &gt;= #{startTime}
AND a.COLLECT_STOP
&lt; #{endTime}
ORDER BY a.COLLECT_STOP DESC
</select>
<select id="getSampleNuclides" resultType="org.jeecg.entity.NuclideActConcIntvl">
SELECT
a.SAMPLE_ID AS sampleId,
a.COLLECT_STOP AS collectStop,
a.SAMPLE_TYPE AS sampleType,
a.STATION_ID AS stationId,
COALESCE(
<choose>
<when test="dbType == 'RN'">n.NUCLIDENAME</when>
<otherwise>n.NAME</otherwise>
</choose>
,
<choose>
<when test="dbType == 'RN'">x.NUCLIDE_NAME</when>
<otherwise>
CASE x.NUCLIDE_ID
WHEN 8 THEN 'Xe131m'
WHEN 9 THEN 'Xe133'
WHEN 10 THEN 'Xe133m'
WHEN 11 THEN 'Xe135'
END
</otherwise>
</choose>
) AS nuclideName
FROM
<choose>
<when test="dbType == 'RN'">ORIGINAL</when>
<otherwise>${schemaName}</otherwise>
</choose>
.GARDS_SAMPLE_DATA a
-- GARDS_ANALYSES 仅 RN 环境存在RMS 跳过此 JOIN
<if test="dbType == 'RN'">
LEFT JOIN ${schemaName}.GARDS_ANALYSES s1
ON a.SAMPLE_ID = s1.SAMPLE_ID
</if>
LEFT JOIN ${schemaName}.GARDS_NUCL_IDED n
ON a.SAMPLE_ID = n.SAMPLE_ID
LEFT JOIN ${schemaName}.GARDS_XE_RESULTS x
ON a.SAMPLE_ID = x.SAMPLE_ID
WHERE
a.COLLECT_STOP &gt;= #{startTime}
AND a.COLLECT_STOP &lt; #{endTime}
<if test="stations != null and stations != ''">
AND a.STATION_ID IN
<foreach collection="stations" item="s" open="(" separator="," close=")">
#{s}
</foreach>
</if>
<if test="dbType == 'RN'">
AND a.STATUS != 'F'
</if>
ORDER BY a.COLLECT_STOP DESC
</select>
<select id="getIdentifiedNuclides" resultType="org.jeecg.entity.NuclideActConcIntvl">
WITH FilteredSamples AS (SELECT SAMPLE_ID,
COLLECT_STOP,
SAMPLE_TYPE,
STATION_ID,
STATUS
FROM ORIGINAL.GARDS_SAMPLE_DATA
WHERE STATION_ID IN
<foreach collection="stations" item="s" open="(" separator="," close=")">
#{s}
</foreach>
AND STATUS != 'F'
AND COLLECT_STOP BETWEEN #{startTime}
AND #{endTime}
)
, AnalysedSamples AS (
SELECT fs.*, s1.category
FROM FilteredSamples fs INNER JOIN ${schemaName}.GARDS_ANALYSES s1
ON fs.SAMPLE_ID = s1.SAMPLE_ID),
CombinedData AS (
SELECT
a.SAMPLE_ID, a.COLLECT_STOP, a.SAMPLE_TYPE, a.STATION_ID, a.STATUS, a.category, t2.NUCLIDENAME nuclideName, CAST
(REGEXP_REPLACE(t2.CONCENTRATION, '[^0-9.Ee-]', '') AS BINARY_DOUBLE) AS conc, 0 AS concErr, CAST
(REGEXP_REPLACE(t2.MDC, '[^0-9.Ee-]', '') AS BINARY_DOUBLE) AS mdc
FROM
AnalysedSamples a
INNER JOIN ${schemaName}.GARDS_NUCL_IDED t2
ON a.SAMPLE_ID = t2.SAMPLE_ID
WHERE
t2.NUCLIDENAME = #{nuclideName}
AND a.category IN (3
, 4)
UNION ALL
SELECT
a.SAMPLE_ID, a.COLLECT_STOP, a.SAMPLE_TYPE, a.STATION_ID, a.STATUS, a.category, t3.NUCLIDE_NAME AS nuclideName,
t3.CONC AS conc, t3.CONC_ERR AS concErr, t3.MDC AS mdc
FROM
AnalysedSamples a
INNER JOIN ${schemaName}.GARDS_XE_RESULTS t3
ON a.SAMPLE_ID = t3.SAMPLE_ID
WHERE
t3.NUCLIDE_NAME = #{nuclideName}
AND a.category IN (1
, 2
, 3)
)
SELECT c.*,
h.THRESHOLD_VALUE
FROM CombinedData c
LEFT JOIN ${schemaName}.GARDS_THRESHOLD_RESULT_HIS h ON c.STATION_ID = h.STATION_ID
AND c.nuclideName = h.NUCLIDENAME
AND c.COLLECT_STOP = h.COLLECT_STOP
ORDER BY c.COLLECT_STOP DESC;
</select>
<select id="getRMSIdentifiedNuclides" resultType="org.jeecg.entity.NuclideActConcIntvl">
SELECT
s.SAMPLE_ID,
s.COLLECT_STOP,
s.SAMPLE_TYPE,
s.STATION_ID,
ss.STATUS,
ss.AUTO_CATEGORY AS CATEGORY,
COALESCE(n.NAME, CASE x.NUCLIDE_ID
WHEN 8 THEN 'Xe131m'
WHEN 9 THEN 'Xe133'
WHEN 10 THEN 'Xe133m'
WHEN 11 THEN 'Xe135'
END) AS NUCLIDENAME,
COALESCE(n.ACTIV_DECAY, x.CONC) AS CONC,
COALESCE(n.ACTIV_DECAY_ERR, x.CONC_ERR) AS CONC_ERR,
n.MDA AS MDC
FROM RMSAUTO.GARDS_SAMPLE_DATA s
LEFT JOIN RMSAUTO.GARDS_SAMPLE_STATUS ss
ON s.SAMPLE_ID = ss.SAMPLE_ID
LEFT JOIN RMSAUTO.GARDS_NUCL_IDED n
ON s.SAMPLE_ID = n.SAMPLE_ID
LEFT JOIN RMSAUTO.GARDS_XE_RESULTS x
ON s.SAMPLE_ID = x.SAMPLE_ID
WHERE s.COLLECT_STOP &gt;= #{startTime}
AND s.COLLECT_STOP &lt; #{endTime}
AND s.SAMPLE_TYPE != 'B'
AND ss.STATUS = 'P'
<if test="nuclideName != null and nuclideName != ''">
AND (
n.NAME = #{nuclideName}
OR x.NUCLIDE_ID = CASE #{nuclideName}
WHEN 'Xe131m' THEN 8
WHEN 'Xe133' THEN 9
WHEN 'Xe133m' THEN 10
WHEN 'Xe135' THEN 11
END
)
</if>
UNION ALL
SELECT
s.SAMPLE_ID,
s.COLLECT_STOP,
s.SAMPLE_TYPE,
s.STATION_ID,
ss.STATUS,
ss.AUTO_CATEGORY AS CATEGORY,
CASE n.NUCLIDE_ID
WHEN 8 THEN 'Xe131m'
WHEN 9 THEN 'Xe133'
WHEN 10 THEN 'Xe133m'
WHEN 11 THEN 'Xe135'
END AS NUCLIDENAME,
n.CONC AS CONC,
n.CONC_ERR AS CONC_ERR,
n.MDC AS MDC
FROM RMSAUTO.GARDS_SAMPLE_DATA s
LEFT JOIN RMSAUTO.GARDS_SAMPLE_STATUS ss
ON s.SAMPLE_ID = ss.SAMPLE_ID
LEFT JOIN RMSAUTO.GARDS_BG_ISOTOPE_CONCS n
ON s.SAMPLE_ID = n.SAMPLE_ID
WHERE s.COLLECT_STOP &gt;= #{startTime}
AND s.COLLECT_STOP &lt; #{endTime}
AND s.SAMPLE_TYPE = 'B'
AND ss.STATUS = 'P'
<if test="nuclideName != null and nuclideName != ''">
AND n.NUCLIDE_ID = CASE #{nuclideName}
WHEN 'Xe131m' THEN 8
WHEN 'Xe133' THEN 9
WHEN 'Xe133m' THEN 10
WHEN 'Xe135' THEN 11
END
</if>
</select>
<!--新添加-->
<select id="getIdentifiedNuclidesBatch" resultType="org.jeecg.entity.NuclideActConcIntvl">
SELECT t1.SAMPLE_ID,
t1.COLLECT_STOP,
t1.STATION_ID,
t2.NUCLIDE_NAME,
t2.CONC,
t2.CONC_ERR,
t2.MDC,
t2.THRESHOLD_VALUE,
t2.CATEGORY
FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN ${schema}.GARDS_ANALYSES t2
ON t1.SAMPLE_ID = t2.SAMPLE_ID
WHERE t1.STATION_ID IN
<foreach collection="stations" item="s" open="(" separator="," close=")">
#{s}
</foreach>
AND t2.NUCLIDE_NAME = #{nuclideName}
AND t1.COLLECT_STOP BETWEEN #{startTime}
AND #{endTime}
ORDER BY t1.STATION_ID, t1.COLLECT_STOP
</select>
<select id="getSampleStatPData" resultType="org.jeecg.vo.SampleStatExcelVO">
SELECT
t2.NUCLIDENAME AS nuclideName,
COUNT(*) AS count
FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN ${schemaName}.GARDS_ANALYSES s1 ON t1.SAMPLE_ID = s1.SAMPLE_ID
INNER JOIN ${schemaName}.GARDS_NUCL_IDED t2 ON t1.SAMPLE_ID = t2.SAMPLE_ID
WHERE t1.STATION_ID IN
<foreach collection="stations" item="s" open="(" separator="," close=")">
#{s}
</foreach>
AND t1.STATUS != 'F'
AND t1.COLLECT_STOP &gt;= #{startTime}
AND t1.COLLECT_STOP &lt;#{endTime}
GROUP BY t2.NUCLIDENAME
ORDER BY COUNT(*) DESC
</select>
<select id="getSampleStatBData" resultType="org.jeecg.vo.SampleStatExcelVO">
SELECT
t2.NUCLIDE_NAME AS nuclideName,
COUNT(*) AS count
FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN ${schemaName}.GARDS_ANALYSES s1 ON t1.SAMPLE_ID = s1.SAMPLE_ID
INNER JOIN ${schemaName}.GARDS_XE_RESULTS t2 ON t1.SAMPLE_ID = t2.SAMPLE_ID
WHERE t1.STATION_ID IN
<foreach collection="stations" item="s" open="(" separator="," close=")">
#{s}
</foreach>
AND t1.STATUS != 'F'
AND t1.COLLECT_STOP &gt;= #{startTime}
AND t1.COLLECT_STOP &lt; #{endTime}
GROUP BY t2.NUCLIDE_NAME
ORDER BY COUNT(*) DESC
</select>
<!-- RnAuto 核素等级时序分析--> <!-- RnAuto 核素等级时序分析-->
@ -310,8 +642,8 @@
RNAUTO.GARDS_ANALYSES B RNAUTO.GARDS_ANALYSES B
ON A.SAMPLE_ID = B.SAMPLE_ID ON A.SAMPLE_ID = B.SAMPLE_ID
WHERE A.STATION_ID = #{station} WHERE A.STATION_ID = #{station}
AND A.COLLECT_STOP BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND A.COLLECT_STOP BETWEEN #{startTime}
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND #{endTime}
</select> </select>
<select id="getNuclideTimeSeriesAnalysis" resultType="org.jeecg.entity.SampleLevelData"> <select id="getNuclideTimeSeriesAnalysis" resultType="org.jeecg.entity.SampleLevelData">
@ -332,8 +664,8 @@
AND th1.NUCLIDENAME = #{nuclideName} AND th1.NUCLIDENAME = #{nuclideName}
WHERE a.STATION_ID = #{station} WHERE a.STATION_ID = #{station}
AND a.SAMPLE_TYPE = 'P' AND a.SAMPLE_TYPE = 'P'
AND a.COLLECT_STOP &gt;= TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND a.COLLECT_STOP &gt;= #{startTime}
AND a.COLLECT_STOP &lt; TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND a.COLLECT_STOP &lt; #{endTime}
UNION ALL UNION ALL
SELECT a.SAMPLE_ID, SELECT a.SAMPLE_ID,
a.COLLECT_STOP, a.COLLECT_STOP,
@ -352,8 +684,8 @@
AND th1.NUCLIDENAME = #{nuclideName} AND th1.NUCLIDENAME = #{nuclideName}
WHERE a.STATION_ID = #{station} WHERE a.STATION_ID = #{station}
AND a.SAMPLE_TYPE = 'B' AND a.SAMPLE_TYPE = 'B'
AND a.COLLECT_STOP &gt;= TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND a.COLLECT_STOP &gt;= #{startTime}
AND a.COLLECT_STOP &lt; TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND a.COLLECT_STOP &lt; #{endTime}
</select> </select>
@ -384,10 +716,8 @@
AND t1.SAMPLE_ID = t3.SAMPLE_ID AND t1.SAMPLE_ID = t3.SAMPLE_ID
WHERE t1.STATION_ID = #{station} WHERE t1.STATION_ID = #{station}
AND t1.STATUS != 'F' AND t1.STATUS != 'F'
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{startTime} AND t1.COLLECT_STOP BETWEEN #{startTime}
, 'YYYY-MM-DD HH24:MI:SS') AND #{endTime}
AND TO_DATE(#{endTime}
, 'YYYY-MM-DD HH24:MI:SS')
</select> </select>
<!-- RnMan 核素等级时序分析--> <!-- RnMan 核素等级时序分析-->
<select id="getRnManNuclideTimeSeriesAnalysis" resultType="org.jeecg.entity.SampleLevelData"> <select id="getRnManNuclideTimeSeriesAnalysis" resultType="org.jeecg.entity.SampleLevelData">
@ -399,8 +729,8 @@
RNMAN.GARDS_ANALYSES B RNMAN.GARDS_ANALYSES B
ON A.SAMPLE_ID = B.SAMPLE_ID ON A.SAMPLE_ID = B.SAMPLE_ID
WHERE A.STATION_ID = #{station} WHERE A.STATION_ID = #{station}
AND A.COLLECT_STOP BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND A.COLLECT_STOP BETWEEN #{startTime}
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND #{endTime}
</select> </select>
<select id="selectByStationAndNuclide" resultType="org.jeecg.entity.GardsThresholdResultHis"> <select id="selectByStationAndNuclide" resultType="org.jeecg.entity.GardsThresholdResultHis">
@ -447,8 +777,7 @@
<foreach collection="nuclideNames" item="nuclideName" open="(" separator="," close=")"> <foreach collection="nuclideNames" item="nuclideName" open="(" separator="," close=")">
#{nuclideName} #{nuclideName}
</foreach> </foreach>
AND CALCULATION_TIME BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE(#{ endTime }, AND CALCULATION_TIME BETWEEN #{startTime} AND #{ endTime }
'YYYY-MM-DD HH24:MI:SS')
ORDER BY CALCULATION_TIME DESC ORDER BY CALCULATION_TIME DESC
</select> </select>
@ -468,10 +797,10 @@
</foreach> </foreach>
</if> </if>
<if test="startTime != null and startTime != ''"> <if test="startTime != null and startTime != ''">
AND CALCULATION_TIME &gt; TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS') AND CALCULATION_TIME &gt; #{ startTime }
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
AND CALCULATION_TIME &lt; TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS') AND CALCULATION_TIME &lt; #{ endTime }
</if> </if>
</where> </where>
ORDER BY CALCULATION_TIME DESC ORDER BY CALCULATION_TIME DESC
@ -506,8 +835,8 @@
</foreach> </foreach>
AND t1.SAMPLE_TYPE=#{sampleType} AND t1.SAMPLE_TYPE=#{sampleType}
AND t2.NUCLIDENAME = #{nuclideName} AND t2.NUCLIDENAME = #{nuclideName}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS') AND t1.COLLECT_STOP BETWEEN #{ startTime }
AND TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS') AND #{ endTime }
</where> </where>
</if> </if>
<if test='sampleType == "B"'> <if test='sampleType == "B"'>
@ -535,8 +864,8 @@
</foreach> </foreach>
AND t1.SAMPLE_TYPE=#{sampleType} AND t1.SAMPLE_TYPE=#{sampleType}
AND t3.NUCLIDE_NAME = #{nuclideName} AND t3.NUCLIDE_NAME = #{nuclideName}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS') AND t1.COLLECT_STOP BETWEEN #{ startTime }
AND TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS') AND #{ endTime }
</where> </where>
</if> </if>
@ -571,8 +900,8 @@
</foreach> </foreach>
AND t1.SAMPLE_TYPE=#{sampleType} AND t1.SAMPLE_TYPE=#{sampleType}
AND t2.NUCLIDENAME = #{nuclideName} AND t2.NUCLIDENAME = #{nuclideName}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS') AND t1.COLLECT_STOP BETWEEN #{ startTime }
AND TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS') AND #{ endTime }
</where> </where>
</if> </if>
<if test='sampleType == "B"'> <if test='sampleType == "B"'>
@ -600,13 +929,123 @@
</foreach> </foreach>
AND t1.SAMPLE_TYPE=#{sampleType} AND t1.SAMPLE_TYPE=#{sampleType}
AND t3.NUCLIDE_NAME = #{nuclideName} AND t3.NUCLIDE_NAME = #{nuclideName}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS') AND t1.COLLECT_STOP BETWEEN #{ startTime }
AND TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS') AND #{ endTime }
</where> </where>
</if> </if>
</select> </select>
<select id="getRnAnalyzeNuclideActivityConc" resultType="org.jeecg.entity.NuclideActConcIntvl">
SELECT
t1.SAMPLE_ID AS sampleId,
t1.COLLECT_STOP AS collectStop,
t1.SAMPLE_TYPE AS sampleType,
t1.STATION_ID AS stationId,
s.STATION_CODE AS stationCode,
t1.STATUS AS status,
CASE WHEN t1.SAMPLE_TYPE = 'P'
THEN CAST(REGEXP_REPLACE(t2.MDC, '[^0-9.Ee+-]', '') AS BINARY_DOUBLE)
ELSE t3.MDC
END AS MDC,
CASE WHEN t1.SAMPLE_TYPE = 'P'
THEN t2.NUCLIDENAME
ELSE t3.NUCLIDE_NAME
END AS NUCLIDE_NAME,
CASE WHEN t1.SAMPLE_TYPE = 'P'
THEN CAST(REGEXP_REPLACE(t2.CONCENTRATION, '[^0-9.Ee+-]', '') AS BINARY_DOUBLE)
ELSE t3.CONC
END AS conc,
CASE WHEN t1.SAMPLE_TYPE = 'P'
THEN 0
ELSE t3.CONC_ERR
END AS concErr
FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN CONFIGURATION.GARDS_STATIONS s
ON t1.STATION_ID = s.STATION_ID
LEFT JOIN ${schemaName}.GARDS_NUCL_IDED t2
ON t1.SAMPLE_ID = t2.SAMPLE_ID
AND t2.NUCLIDENAME = #{nuclideName}
LEFT JOIN ${schemaName}.GARDS_XE_RESULTS t3
ON t1.SAMPLE_ID = t3.SAMPLE_ID
AND t3.NUCLIDE_NAME = #{nuclideName}
<where>
t1.STATION_ID IN
<foreach item="stationId" collection="stations" open="(" close=")" separator=",">
#{stationId}
</foreach>
AND t1.SAMPLE_TYPE = #{sampleType}
AND (t2.NUCLIDENAME IS NOT NULL OR t3.NUCLIDE_NAME IS NOT NULL)
AND t1.COLLECT_STOP BETWEEN #{startTime}
AND #{endTime}
</where>
</select>
<select id="getRMSAnalyzeNuclideActivityConc" resultType="org.jeecg.entity.NuclideActConcIntvl">
SELECT
s.SAMPLE_ID,
s.COLLECT_STOP,
s.SAMPLE_TYPE,
s.STATION_ID,
s1.STATION_CODE AS stationCode,
COALESCE(
CASE n.NUCLIDE_ID
WHEN 8 THEN 'Xe131m'
WHEN 9 THEN 'Xe133'
WHEN 10 THEN 'Xe133m'
WHEN 11 THEN 'Xe135'
END,
CASE x.NUCLIDE_ID
WHEN 8 THEN 'Xe131m'
WHEN 9 THEN 'Xe133'
WHEN 10 THEN 'Xe133m'
WHEN 11 THEN 'Xe135'
END
) AS NUCLIDE_NAME,
ss.STATUS,
COALESCE(n.CONC, x.CONC) AS conc,
COALESCE(n.CONC_ERR, x.CONC_ERR) AS concErr,
COALESCE(n.MDC, x.MDC) AS MDC
FROM ${schemaName}.GARDS_SAMPLE_DATA s
LEFT JOIN ${schemaName}.GARDS_SAMPLE_STATUS ss
ON s.SAMPLE_ID = ss.SAMPLE_ID
LEFT JOIN ${schemaName}.GARDS_BG_ISOTOPE_CONCS n
ON s.SAMPLE_ID = n.SAMPLE_ID
LEFT JOIN ${schemaName}.GARDS_XE_RESULTS x
ON s.SAMPLE_ID = x.SAMPLE_ID
LEFT JOIN RMSMAN.GARDS_STATIONS s1
ON s.STATION_ID = s1.STATION_ID
WHERE s.COLLECT_STOP &gt;= #{startTime}
AND s.COLLECT_STOP &lt; #{endTime}
AND s.SAMPLE_TYPE != 'P'
AND ss.STATUS = 'P'
<if test="stations != null and stations.size() > 0">
AND s1.STATION_ID IN
<foreach collection="stations" item="stationId" open="(" separator="," close=")">
#{stationId}
</foreach>
</if>
<if test="nuclideName != null and nuclideName != ''">
AND (n.NUCLIDE_ID = CASE #{nuclideName}
WHEN 'Xe131m' THEN 8
WHEN 'Xe133' THEN 9
WHEN 'Xe133m' THEN 10
WHEN 'Xe135' THEN 11
END
OR x.NUCLIDE_ID = CASE #{nuclideName}
WHEN 'Xe131m' THEN 8
WHEN 'Xe133' THEN 9
WHEN 'Xe133m' THEN 10
WHEN 'Xe135' THEN 11
END
)
</if>
</select>
<!--样品监测结果--> <!--样品监测结果-->
<!-- 先查出台站信息--> <!-- 先查出台站信息-->
<!-- 再根据台站级别信息--> <!-- 再根据台站级别信息-->
@ -629,8 +1068,8 @@
LEFT JOIN CONFIGURATION.GARDS_STATIONS c1 LEFT JOIN CONFIGURATION.GARDS_STATIONS c1
ON t1.STATION_ID = c1.STATION_ID ON t1.STATION_ID = c1.STATION_ID
WHERE t1.SAMPLE_TYPE = #{sampleType} WHERE t1.SAMPLE_TYPE = #{sampleType}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND t1.COLLECT_STOP BETWEEN #{startTime}
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND #{endTime}
ORDER BY t1.COLLECT_STOP ASC ORDER BY t1.COLLECT_STOP ASC
</select> </select>
@ -653,8 +1092,8 @@
LEFT JOIN CONFIGURATION.GARDS_STATIONS c1 LEFT JOIN CONFIGURATION.GARDS_STATIONS c1
ON t1.STATION_ID = c1.STATION_ID ON t1.STATION_ID = c1.STATION_ID
WHERE t1.SAMPLE_TYPE = #{sampleType} WHERE t1.SAMPLE_TYPE = #{sampleType}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND t1.COLLECT_STOP BETWEEN #{startTime}
AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS') AND #{endTime}
ORDER BY t1.COLLECT_STOP ASC ORDER BY t1.COLLECT_STOP ASC
</select> </select>
@ -669,6 +1108,42 @@
('SAUNA', 'ARIX-4', 'ARIX-2', 'SPALAX') ('SAUNA', 'ARIX-4', 'ARIX-2', 'SPALAX')
</if> </if>
</where> </where>
</select> </select>
<select id="findRMSStationListByMenuName" resultType="org.jeecg.entity.GardsStations">
SELECT * FROM RMSMAN.GARDS_STATIONS
<where>
TYPE IN
<if test='systemType == "P"'>
('Manual', 'CINDER', 'RASA', 'LAB')
</if>
<if test='systemType == "B"'>
('SAUNA', 'ARIX-4', 'ARIX-2', 'SPALAX')
</if>
</where>
</select>
<select id="getNuclideActConcList" resultType="org.jeecg.vo.NuclideActConcRawVO">
SELECT
t1.STATION_ID AS stationId,
t2.NUCLIDE_NAME AS nuclideName,
t2.CONC AS conc
FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN ${schema}.GARDS_ANALYSES t2
ON t1.SAMPLE_ID = t2.SAMPLE_ID
WHERE t1.STATION_ID IN
<foreach collection="stations" item="s" open="(" separator="," close=")">
#{s}
</foreach>
AND t1.SAMPLE_TYPE = #{sampleType}
AND t2.NUCLIDE_NAME IS NOT NULL
AND t2.CONC IS NOT NULL
AND t1.COLLECT_STOP BETWEEN #{startTime}
AND #{endTime}
ORDER BY t1.STATION_ID, t2.NUCLIDE_NAME
</select>
</mapper> </mapper>

View File

@ -0,0 +1,23 @@
package org.jeecg.service;
import org.jeecg.dto.SampleQueryRequestDTO;
import java.util.List;
/**
* 导出处理器接口 每种数据类型实现一个
*/
public interface ExportHandler {
/** 数据类型标识 */
String getType();
/** Sheet 名称 */
String getSheetName();
/** 查询数据 */
List<?> queryData(SampleQueryRequestDTO reqDTO);
/** 返回 VO 的 Class */
Class<?> getExcelClass();
}

View File

@ -3,40 +3,35 @@ package org.jeecg.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.dto.SampleQueryRequestDTO;
import org.jeecg.entity.GardsStations; import org.jeecg.entity.GardsStations;
import org.jeecg.entity.SampleLevelData;
import org.jeecg.entity.SysDefaultNuclide; import org.jeecg.entity.SysDefaultNuclide;
import org.jeecg.modules.base.entity.original.GardsSampleData; import org.jeecg.modules.base.entity.original.GardsSampleData;
import org.jeecg.vo.SampleStatExcelVO;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
public interface ISampleStatAnalysisService extends IService<GardsSampleData> { public interface ISampleStatAnalysisService extends IService<GardsSampleData> {
Result getSampleMonitorResult(String sampleType, Integer dataSource, Date startDate, Date endDate); Map<String, Object> getSampleMonitorResult(SampleQueryRequestDTO reqDTO);
/*** 样品统计分析 /*** 样品统计分析
* 样品统计分析 * 样品统计分析
* @param station
* @param startDate
* @param endDate
* @return * @return
*/ */
Result getSampleStatAnalysis(String station, Integer dataSource, Date startDate, Date endDate); Map<String, Object> getSampleStatAnalysis(SampleQueryRequestDTO reqDTO);
List<SampleStatExcelVO> getSampleStatData(SampleQueryRequestDTO reqDTO);
/** /**
* 样品统计分析--核素浓度时序分析 * 样品统计分析--核素浓度时序分析
* @param sampleType *
* @param stationCode
* @param nuclideName
* @param dataSource
* @param startDate
* @param endDate
* @return * @return
*/ */
Result getNuclideActConcChartData (String sampleType,String stationCode, String nuclideName,Integer dataSource, Date startDate, Date endDate) throws JsonProcessingException; Map<String, Object> getNuclideActConcChartData(SampleQueryRequestDTO reqDTO);
/** /**
@ -44,54 +39,40 @@ public interface ISampleStatAnalysisService extends IService<GardsSampleData> {
* *
* *
*/ */
Result getSampleGradeAnalysis(String sampleType, String station, Date startDate, Date endDate, Integer dataSource); Map<String, Object> getSampleGradeAnalysis(SampleQueryRequestDTO reqDTO);
List<SampleLevelData> getSampleGradeAnalysisData(SampleQueryRequestDTO reqDTO);
/*** 样品活度浓度区间频率分析 /*** 样品活度浓度区间频率分析
* 样品活度浓度区间频率分析 * 样品活度浓度区间频率分析
* @param sampleType 样品类型
* @param station 台站编码
* @param nuclideName 核素名称
* @param dataSource 数据源
* @param startDate 开始时间
* @param endDate 结束时间
* @return 返回样品活度浓度区间信息 * @return 返回样品活度浓度区间信息
*/ */
Result getSampleActConcIntvlAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, Date startDate, Date endDate); Map<String, Object> getSampleActConcIntvlAnalysis(SampleQueryRequestDTO reqDTO);
/*** 核素活度浓度时序分析 /*** 核素活度浓度时序分析
* 核素活度浓度时序分析 * 核素活度浓度时序分析
* @param sampleType 样品类型
* @param station 台站编码
* @param nuclideName 核素名
* @param dataSource 数据源
* @param startDate 开始时间
* @param endDate 结束时间
* @return 返回核素活度浓度信息 * @return 返回核素活度浓度信息
*/ */
Result getSampleActConcTimeSeqAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, Date startDate, Date endDate); Result getSampleActConcTimeSeqAnalysis(SampleQueryRequestDTO reqDTO);
/*** 核素活度浓度对比分析 /*** 核素活度浓度对比分析
* 核素活度浓度对比分析 * 核素活度浓度对比分析
* @param sampleType 样品类型
* @param stationIds 台站ID集合
* @param nuclideName 核素名
* @param dataSource 数据源
* @param startDate 开始时间
* @param endDate 结束时间
* @return * @return
*/ */
Result getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds, String nuclideName, Integer dataSource, Date startDate, Date endDate); Map<String, Object> getNuclideActivityConcAnalyze(SampleQueryRequestDTO reqDTO);
/** /**
* 查询台站信息 * 查询台站信息
*
* @param systemType * @param systemType
* @return * @return
*/ */
List<GardsStations> findStationListByMenuName(String systemType); List<GardsStations> findStationListByMenuName(String systemType,Integer dataSource);
/** /**
* 查询核素信息 * 查询核素信息
*
* @param systemType * @param systemType
* @return * @return
*/ */

View File

@ -0,0 +1,58 @@
package org.jeecg.service.impl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.jeecg.dto.SampleQueryRequestDTO;
import org.jeecg.service.ExportHandler;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.List;
@Slf4j
@Service
@RequiredArgsConstructor
public class ExcelExportService {
private final ExportHandlerRegistry registry;
/**
* 单类型导出
*
* @param type 导出类型
* @param reqDTO 请求实体
* @param response 响应
*/
public void exportSingle(String type, SampleQueryRequestDTO reqDTO, HttpServletResponse response) throws
IOException {
ExportHandler handler = registry.getHandler(type);
List<?> data = handler.queryData(reqDTO);
if (CollectionUtils.isEmpty(data)) {
throw new IOException("暂无导出数据");
}
ExportParams params = new ExportParams(handler.getSheetName(), handler.getSheetName(), ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(params,handler.getExcelClass(), data);
download(workbook, handler.getSheetName(), response);
}
private void download(Workbook workbook,
String fileName,
HttpServletResponse response) throws IOException {
response.setContentType(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Disposition",
"attachment;filename*=utf-8''" +
URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20") + ".xlsx");
workbook.write(response.getOutputStream());
}
}

View File

@ -0,0 +1,43 @@
package org.jeecg.service.impl;
import org.jeecg.service.ExportHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component
public class ExportHandlerRegistry {
private final Map<String, ExportHandler> handlerMap = new HashMap<String, ExportHandler>();
@Autowired
public ExportHandlerRegistry(List<ExportHandler> handlers) {
handlers.forEach(handler -> {
handlerMap.put(handler.getType(), handler);
});
}
/**
* 获取指定类型的处理类
*/
public ExportHandler getHandler(String type) {
ExportHandler exportHandler = handlerMap.get(type);
if (exportHandler == null) {
throw new IllegalArgumentException("不支持的导出类型: " + type);
}
return exportHandler;
}
/**
* 获取全部处理类
* @return ExportHandler集合
*/
public Collection<ExportHandler> getHandlers() {
return handlerMap.values();
}
}

View File

@ -0,0 +1,37 @@
package org.jeecg.service.impl;
import org.jeecg.dto.SampleQueryRequestDTO;
import org.jeecg.entity.ExportType;
import org.jeecg.service.ExportHandler;
import org.jeecg.vo.NuclideCompareExcelVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class NuclideCompareExportHandler implements ExportHandler {
@Autowired
private SampleStatAnalysisService sampleStatAnalysisService;
@Override
public String getType() {
return ExportType.NUCLIDE_COMPARE;
}
@Override
public String getSheetName() {
return "核素对比分析";
}
@Override
public Class<?> getExcelClass() {
return NuclideCompareExcelVO.class;
}
@Override
public List<?> queryData(SampleQueryRequestDTO reqDTO) {
return sampleStatAnalysisService.getNuclideCompareExportData(reqDTO);
}
}

View File

@ -0,0 +1,37 @@
package org.jeecg.service.impl;
import org.jeecg.dto.SampleQueryRequestDTO;
import org.jeecg.entity.ExportType;
import org.jeecg.service.ExportHandler;
import org.jeecg.vo.NuclideTimeExcelVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class NuclideTimeExportHandler implements ExportHandler {
@Autowired
private SampleStatAnalysisService sampleStatAnalysisService;
@Override
public String getType() {
return ExportType.NUCLIDE_TIME;
}
@Override
public String getSheetName() {
return "核素时序分析";
}
@Override
public Class<?> getExcelClass() {
return NuclideTimeExcelVO.class;
}
@Override
public List<?> queryData(SampleQueryRequestDTO reqDTO) {
return sampleStatAnalysisService.getNuclideActConcExportData(reqDTO);
}
}

View File

@ -0,0 +1,52 @@
package org.jeecg.service.impl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import org.jeecg.dto.SampleQueryRequestDTO;
import org.jeecg.entity.ExportType;
import org.jeecg.entity.SampleLevelData;
import org.jeecg.service.ExportHandler;
import org.jeecg.service.ISampleStatAnalysisService;
import org.jeecg.vo.SampleAnalysisExcelVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@Component
public class SampleAnalysisExportHandler implements ExportHandler {
@Autowired
private ISampleStatAnalysisService sampleStatAnalysisService;
@Override
public String getType() {
return ExportType.SAMPLE_LEVEL_TIME;
}
@Override
public String getSheetName() {
return "样品等级时序分析";
}
@Override
public List<?> queryData(SampleQueryRequestDTO reqDTO) {
List<SampleLevelData> dataList =
sampleStatAnalysisService.getSampleGradeAnalysisData(reqDTO);
if (CollectionUtils.isEmpty(dataList)) {
return Collections.emptyList();
}
return dataList.stream().map(data -> {
SampleAnalysisExcelVO vo = new SampleAnalysisExcelVO();
BeanUtils.copyProperties(data, vo);
return vo;
}).collect(Collectors.toList());
}
@Override
public Class<?> getExcelClass() {
return SampleAnalysisExcelVO.class;
}
}

View File

@ -0,0 +1,39 @@
package org.jeecg.service.impl;
import org.jeecg.dto.SampleQueryRequestDTO;
import org.jeecg.entity.ExportType;
import org.jeecg.service.ExportHandler;
import org.jeecg.vo.SampleRangeFreqExcelVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class SampleRangeFreqExportHandler implements ExportHandler {
@Autowired
private SampleStatAnalysisService sampleStatAnalysisService;
@Override
public String getType() {
return ExportType.SAMPLE_RANGE_FREQ;
}
@Override
public String getSheetName() {
return "浓度区间频率";
}
@Override
public Class<?> getExcelClass() {
return SampleRangeFreqExcelVO.class;
}
@Override
public List<?> queryData(SampleQueryRequestDTO reqDTO) {
return sampleStatAnalysisService.getSampleRangeFreqExportData(reqDTO,
null // 区间宽度默认 10
);
}
}

View File

@ -0,0 +1,45 @@
package org.jeecg.service.impl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import org.jeecg.dto.SampleQueryRequestDTO;
import org.jeecg.entity.ExportType;
import org.jeecg.service.ExportHandler;
import org.jeecg.service.ISampleStatAnalysisService;
import org.jeecg.vo.SampleStatExcelVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.List;
@Component
public class SampleStatExportHandler implements ExportHandler {
@Autowired
private ISampleStatAnalysisService sampleStatAnalysisService;
@Override
public String getType() {
return ExportType.SAMPLE_STAT;
}
@Override
public String getSheetName() {
return "样品统计分析";
}
@Override
public List<?> queryData(SampleQueryRequestDTO reqDTO) {
List<SampleStatExcelVO> dataList =
sampleStatAnalysisService.getSampleStatData(reqDTO);
if (CollectionUtils.isEmpty(dataList)) {
return Collections.emptyList();
}
return dataList;
}
@Override
public Class<?> getExcelClass() {
return SampleStatExcelVO.class;
}
}