添加计算阈值相关Mapper

This commit is contained in:
duwenyuan 2025-09-28 10:58:32 +08:00
parent 23b5e3e375
commit 715076b012
6 changed files with 203 additions and 0 deletions

View File

@ -0,0 +1,12 @@
package org.jeecg.modules.base.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.base.entity.rnauto.GardsThresholdResultHistory;
@Mapper
public interface RnAutoThresholdResultHisMapper extends BaseMapper<GardsThresholdResultHistory> {
}

View File

@ -0,0 +1,9 @@
package org.jeecg.modules.base.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.base.entity.rnman.GardsThresholdResultHistory;
@Mapper
public interface RnManThresholdResultHisMapper extends BaseMapper<GardsThresholdResultHistory> {
}

View File

@ -0,0 +1,21 @@
package org.jeecg.modules.base.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.base.entity.ThresholdMetric;
import org.jeecg.modules.base.entity.rnauto.GardsThresholdResult;
import java.util.List;
@Mapper
public interface ThresholdRnAutoResultMapper extends BaseMapper<GardsThresholdResult> {
List<GardsThresholdResult> selectByStationId(String stationId);
void deleteByStationId(String stationId);
int batchInsert(List<GardsThresholdResult> subList);
List<ThresholdMetric> selectByRnAutoStationIds(@Param("stationIds") List<String> stationIds, @Param("oneYearAgo") String oneYearAgo);
}

View File

@ -0,0 +1,21 @@
package org.jeecg.modules.base.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.base.entity.ThresholdMetric;
import org.jeecg.modules.base.entity.rnman.GardsThresholdResult;
import java.util.List;
@Mapper
public interface ThresholdRnManResultMapper extends BaseMapper<GardsThresholdResult> {
int batchInsertRnMan(@Param("list") List<GardsThresholdResult> results);
void deleteByStationId(String stationId);
List<GardsThresholdResult> selectByStationId(String stationId);
List<ThresholdMetric> selectByRnManStationIds(@Param("stationIds") List<String> stationIds, @Param("oneYearAgo") String oneYearAgo);
}

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.base.mapper.ThresholdRnAutoResultMapper">
<insert id="batchInsert" parameterType="java.util.List">
INSERT ALL
<foreach collection="list" item="result" separator="">
INTO RNAUTO.GARDS_THRESHOLD_RESULT (id, station_id, nuclidename, threshold_value, median, percentile25,
percentile75)
VALUES (#{result.id}, #{result.stationId}, #{result.nuclideName}, #{result.thresholdValue},#{result.median},
#{result.percentile25}, #{result.percentile75})
</foreach>
SELECT 1 FROM DUAL
</insert>
<delete id="deleteByStationId" parameterType="String">
DELETE
FROM RNAUTO.GARDS_THRESHOLD_RESULT
WHERE STATION_ID = #{stationId}
</delete>
<select id="selectByStationId" resultType="org.jeecg.modules.base.entity.rnauto.GardsThresholdResult">
SELECT t.ID,
t.STATION_ID,
t.NUCLIDENAME,
t.THRESHOLD_VALUE,
t.MEDIAN,
t.PERCENTILE25,
t.PERCENTILE75,
t.CALCULATION_TIME
FROM RNAUTO.GARDS_THRESHOLD_RESULT t
WHERE t.station_id = #{stationId}
ORDER BY t.CALCULATION_TIME DESC
</select>
<select id="selectByRnAutoStationIds" resultType="org.jeecg.modules.base.entity.ThresholdMetric">
SELECT
a.STATION_ID as STATION_ID,
a.SAMPLE_ID as SAMPLE_ID,
CASE
WHEN a.SAMPLE_TYPE = 'P' THEN
b.NUCLIDENAME
WHEN a.SAMPLE_TYPE = 'B' THEN
c.NUCLIDE_NAME
END AS NUCLIDE_NAME,
CASE
WHEN a.SAMPLE_TYPE = 'P' THEN
TO_NUMBER(REGEXP_REPLACE(b.CONCENTRATION, '[^0-9.Ee-]', ''))
WHEN a.SAMPLE_TYPE = 'B' THEN
c.CONC
END AS CONCENTRATION
FROM ORIGINAL.GARDS_SAMPLE_DATA a
JOIN RNAUTO.GARDS_NUCL_IDED b ON a.SAMPLE_ID = b.SAMPLE_ID
AND a.SAMPLE_TYPE = 'P'
LEFT JOIN RNAUTO.GARDS_XE_RESULTS c ON a.SAMPLE_TYPE = 'B'
AND a.SAMPLE_ID = c.SAMPLE_ID
<where>
a.STATION_ID IN
<foreach item="stationId" collection="stationIds" open="(" close=")" separator=",">
'${stationId}'
</foreach>
AND a.TRANSMIT_DTG > TO_DATE(#{oneYearAgo}, 'yyyy-mm-dd hh24:mi:ss')
</where>
</select>
</mapper>

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.mapper.threshold.ThresholdResultMapper">
<insert id="batchInsertRnMan" parameterType="java.util.List">
INSERT INTO RN_MAN_TABLE (
RNMAN.GARDS_THRESHOLD_RESULT (id, station_id, nuclidename, threshold_value, median, percentile25, percentile75)
) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},
#{item.station_id},
#{item.nuclidename},
#{item.median},
#{item.percentile25},
#{item.percentile75}
)
</foreach>
</insert>
<delete id="deleteByStationId" parameterType="String">
DELETE
FROM RNMAN.GARDS_THRESHOLD_RESULT
WHERE STATION_ID = #{stationId}
</delete>
<select id="selectByStationId" resultType="org.jeecg.modules.base.entity.rnman.GardsThresholdResult">
SELECT t.ID,
t.STATION_ID,
t.NUCLIDENAME,
t.THRESHOLD_VALUE,
t.MEDIAN,
t.PERCENTILE25,
t.PERCENTILE75,
t.CALCULATION_TIME
FROM RNMAN.GARDS_THRESHOLD_RESULT t
WHERE t.station_id = #{stationId}
ORDER BY t.CALCULATION_TIME DESC
</select>
<select id="selectByRnManStationIds" resultType="org.jeecg.modules.base.entity.ThresholdMetric">
SELECT
a.STATION_ID as STATION_ID,
a.SAMPLE_ID as SAMPLE_ID,
CASE
WHEN a.SAMPLE_TYPE = 'P' THEN
b.NUCLIDENAME
WHEN a.SAMPLE_TYPE = 'B' THEN
c.NUCLIDE_NAME
END AS NUCLIDE_NAME,
CASE
WHEN a.SAMPLE_TYPE = 'P' THEN
TO_NUMBER(REGEXP_REPLACE(b.CONCENTRATION, '[^0-9.Ee-]', ''))
WHEN a.SAMPLE_TYPE = 'B' THEN
c.CONC
END AS CONCENTRATION
FROM ORIGINAL.GARDS_SAMPLE_DATA a
JOIN RNMAN.GARDS_NUCL_IDED b ON a.SAMPLE_ID = b.SAMPLE_ID
AND a.SAMPLE_TYPE = 'P'
LEFT JOIN RNMAN.GARDS_XE_RESULTS c ON a.SAMPLE_TYPE = 'B'
AND a.SAMPLE_ID = c.SAMPLE_ID
<where>
a.STATION_ID IN
<foreach item="stationId" collection="stationIds" open="(" close=")" separator=",">
'${stationId}'
</foreach>
AND a.TRANSMIT_DTG > TO_DATE(#{oneYearAgo}, 'yyyy-mm-dd hh24:mi:ss')
</where>
</select>
</mapper>