修改核素活度浓度对比分析SQL

This commit is contained in:
duwenyuan 2025-10-17 17:07:51 +08:00
parent 12ae5b0e99
commit dd7f721dc0
2 changed files with 124 additions and 94 deletions

View File

@ -119,9 +119,9 @@ public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleDat
List<SampleLevelData> getRnManNuclideTimeSeriesAnalysis(String station, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 精确查询单个站点 + 单个核素
*
* @param stationId 站点ID (必填)
* @param nuclideName 核素名称 (必填)
* @return 匹配的记录列表
@ -136,6 +136,7 @@ public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleDat
/**
* 多站点 + 多核素查询
*
* @param stationIds 站点ID集合 (非空)
* @param nuclideNames 核素名称集合 (非空)
* @return 匹配的记录列表
@ -150,6 +151,7 @@ public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleDat
/**
* 多站点 + 单核素查询
*
* @param stationIds 站点ID集合 (非空)
* @param nuclideName 单个核素名称 (必填)
* @return 匹配的记录列表
@ -164,6 +166,7 @@ public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleDat
/**
* 单站点 + 多核素查询
*
* @param stationId 单个站点ID (必填)
* @param nuclideNames 核素名称集合 (非空)
* @return 匹配的记录列表
@ -179,6 +182,7 @@ public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleDat
/**
* 动态条件查询所有参数均可为空
*
* @param stationIds 站点ID集合 (可选)
* @param nuclideNames 核素名称集合 (可选)
* @param startTime 开始时间 (可选)
@ -194,22 +198,13 @@ public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleDat
);
//endregion
//region 核素活度浓度对比分析
List<NuclideActConcIntvl> getRnAutoAnalyzeNuclideActivityConc(String sampleType, String nuclideName, @Param("stationIds") Integer[] stationIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<NuclideActConcIntvl> getRnAutoAnalyzeNuclideActivityConc(@Param("sampleType")String sampleType, @Param("nuclideName")String nuclideName, @Param("stationIds") Integer[] stationIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<NuclideActConcIntvl> getRnManAnalyzeNuclideActivityConc(String sampleType, String nuclideName, @Param("stationIds") Integer[] stationIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<NuclideActConcIntvl> getRnManAnalyzeNuclideActivityConc(@Param("sampleType")String sampleType, @Param("nuclideName")String nuclideName, @Param("stationIds") Integer[] stationIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
//endregion
//region 样品监测结果
@ -218,8 +213,9 @@ public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleDat
List<StationInfoData> getRnManSampleResult(String sampleType, @Param("startTime") String startTime, @Param("endTime") String endTime);
//endregion
//region 查询台站信息
List<GardsStations> findStationListByMenuName();
//endregion
}

View File

@ -398,78 +398,114 @@
<!-- 核素活度浓度对比分析-->
<select id="getRnAutoAnalyzeNuclideActivityConc" resultType="org.jeecg.entity.NuclideActConcIntvl">
<if test='sampleType == "P"'>
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,
CASE
WHEN t1.SAMPLE_TYPE = 'P' THEN
t2.NUCLIDENAME
WHEN t1.SAMPLE_TYPE = 'B' THEN
t3.NUCLIDE_NAME
END AS NUCLIDE_NAME,
CASE
WHEN t1.SAMPLE_TYPE = 'P' THEN
TO_NUMBER(REGEXP_REPLACE(t2.CONCENTRATION, '[^0-9.Ee-]', ''))
WHEN t1.SAMPLE_TYPE = 'B' THEN
t3.CONC
END AS conc
TO_NUMBER(REGEXP_REPLACE(t2.MDC, '[^0-9.Ee-]', '')) AS MDC,
t2.NUCLIDENAME AS NUCLIDE_NAME,
TO_NUMBER(REGEXP_REPLACE(t2.CONCENTRATION, '[^0-9.Ee-]', '')) AS conc
FROM
ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN RNAUTO.GARDS_NUCL_IDED t2 ON t1.SAMPLE_TYPE = 'P'
AND t1.SAMPLE_ID = t2.SAMPLE_ID
LEFT JOIN RNAUTO.GARDS_XE_RESULTS t3 ON t1.SAMPLE_TYPE = 'B'
AND t1.SAMPLE_ID = t3.SAMPLE_ID
LEFT JOIN RNAUTO.GARDS_NUCL_IDED t2 ON
t1.SAMPLE_ID = t2.SAMPLE_ID
<where>
t1.STATION_ID IN
<foreach item="stationId" collection="stationIds" open="(" close=")" separator=",">
'${stationId}'
</foreach>
AND t1.SAMPLE_TYPE=#{sampleType}
AND t2.NUCLIDENAME = #{nuclideName}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS')
AND TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS')
</where>
</if>
<if test='sampleType == "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,
t3.MDC AS MDC,
t3.NUCLIDE_NAME AS NUCLIDE_NAME,
t3.CONC AS conc
FROM
ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN RNAUTO.GARDS_XE_RESULTS t3 ON
t1.SAMPLE_ID = t3.SAMPLE_ID
<where>
t1.STATION_ID IN
<foreach item="stationId" collection="stationIds" open="(" close=")" separator=",">
'${stationId}'
</foreach>
AND t1.SAMPLE_TYPE=#{sampleType}
AND t3.NUCLIDE_NAME = #{nuclideName}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS')
AND TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS')
</where>
</if>
</select>
<select id="getRnManAnalyzeNuclideActivityConc" resultType="org.jeecg.entity.NuclideActConcIntvl">
<if test='sampleType == "P"'>
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,
CASE
WHEN t1.SAMPLE_TYPE = 'P' THEN
t2.NUCLIDENAME
WHEN t1.SAMPLE_TYPE = 'B' THEN
t3.NUCLIDE_NAME
END AS NUCLIDE_NAME,
CASE
WHEN t1.SAMPLE_TYPE = 'P' THEN
TO_NUMBER(REGEXP_REPLACE(t2.CONCENTRATION, '[^0-9.Ee-]', ''))
WHEN t1.SAMPLE_TYPE = 'B' THEN
t3.CONC
END AS conc
TO_NUMBER(REGEXP_REPLACE(t2.MDC, '[^0-9.Ee-]', '')) AS MDC,
t2.NUCLIDENAME AS NUCLIDE_NAME,
TO_NUMBER(REGEXP_REPLACE(t2.CONCENTRATION, '[^0-9.Ee-]', '')) AS conc
FROM
ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN RNMAN.GARDS_NUCL_IDED t2 ON t1.SAMPLE_TYPE = 'P'
AND t1.SAMPLE_ID = t2.SAMPLE_ID
LEFT JOIN RNMAN.GARDS_XE_RESULTS t3 ON t1.SAMPLE_TYPE = 'B'
AND t1.SAMPLE_ID = t3.SAMPLE_ID
LEFT JOIN RNMAN.GARDS_NUCL_IDED t2 ON
t1.SAMPLE_ID = t2.SAMPLE_ID
<where>
t1.STATION_ID IN
<foreach item="stationId" collection="stationIds" open="(" close=")" separator=",">
'${stationId}'
</foreach>
AND t1.SAMPLE_TYPE=#{sampleType}
AND t2.NUCLIDENAME = #{nuclideName}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS')
AND TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS')
</where>
</if>
<if test='sampleType == "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,
t3.MDC AS MDC,
t3.NUCLIDE_NAME AS NUCLIDE_NAME,
t3.CONC AS conc
FROM
ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN RNMAN.GARDS_XE_RESULTS t3 ON
t1.SAMPLE_ID = t3.SAMPLE_ID
<where>
t1.STATION_ID IN
<foreach item="stationId" collection="stationIds" open="(" close=")" separator=",">
'${stationId}'
</foreach>
AND t1.SAMPLE_TYPE=#{sampleType}
AND t3.NUCLIDE_NAME = #{nuclideName}
AND t1.COLLECT_STOP BETWEEN TO_DATE(#{ startTime }, 'YYYY-MM-DD HH24:MI:SS')
AND TO_DATE(#{ endTime }, 'YYYY-MM-DD HH24:MI:SS')
</where>
</if>
</select>
@ -533,6 +569,4 @@
</select>
</mapper>