添加getDBSpectrumListByLeftJoin方法

This commit is contained in:
duwenyuan 2025-05-19 10:33:32 +08:00
parent 53b7df9297
commit a685ca021d
3 changed files with 78 additions and 1 deletions

View File

@ -24,6 +24,14 @@ public interface SpectrumAnalysisMapper {
Page<GardsSampleDataSpectrum> getDBSpectrumList(IPage<GardsSampleDataSpectrum> page, GardsSampleDataSpectrum gardsSampleData, String dbName, List<String> stationTypes, boolean CollectStopB, boolean AcqStartB, String startTime, String endTime, List<String> userStations, boolean AllUsers, String orderField, String orderType); Page<GardsSampleDataSpectrum> getDBSpectrumList(IPage<GardsSampleDataSpectrum> page, GardsSampleDataSpectrum gardsSampleData, String dbName, List<String> stationTypes, boolean CollectStopB, boolean AcqStartB, String startTime, String endTime, List<String> userStations, boolean AllUsers, String orderField, String orderType);
Page<GardsSampleDataSpectrum> getDBSpectrumListByLeftJoin(IPage<GardsSampleDataSpectrum> page,
GardsSampleDataSpectrum gardsSampleData, String dbName,
List<String> stationTypes, boolean CollectStopB,
boolean AcqStartB, String startTime, String endTime,
List<String> userStations, boolean AllUsers,
String orderField, String orderType);
Page<GardsSampleDataSpectrum> loadSampleData(IPage<GardsSampleDataSpectrum> page, GardsSampleDataSpectrum gardsSampleData, List<String> stationTypes, boolean CollectStopB, boolean AcqStartB, String startTime, String endTime, List<String> userStations, boolean AllUsers, String orderField, String orderType); Page<GardsSampleDataSpectrum> loadSampleData(IPage<GardsSampleDataSpectrum> page, GardsSampleDataSpectrum gardsSampleData, List<String> stationTypes, boolean CollectStopB, boolean AcqStartB, String startTime, String endTime, List<String> userStations, boolean AllUsers, String orderField, String orderType);
SpectrumFileRecord getDBSpectrumFilePath(String dbName, Integer sampleId, Integer analysisID); SpectrumFileRecord getDBSpectrumFilePath(String dbName, Integer sampleId, Integer analysisID);

View File

@ -106,6 +106,75 @@
</if> </if>
</select> </select>
<select id="getDBSpectrumListByLeftJoin" resultType="org.jeecg.modules.entity.GardsSampleDataSpectrum">
select c.sample_id sampleId,
b.station_code stationName,
a.detector_code detectorsName,
c.sample_type sampleType,
c.data_type dataType,
c.spectral_qualifie spectralQualifie,
c.collect_stop collectStop,
c.acquisition_start acquisitionStart,
c.acquisition_real_sec acquisitionRealSec,
c.acquisition_live_sec acquisitionLiveSec,
d.IDANALYSIS analysitId,
d.analyst analyst,
c.status status,
c.input_file_name inputFileName
from
ORIGINAL.GARDS_SAMPLE_DATA c
left JOIN ${dbName} d on c.sample_id = d.sample_id
left JOIN CONFIGURATION.GARDS_DETECTORS a on c.detector_id = a.detector_id
left JOIN CONFIGURATION.GARDS_STATIONS b on c.station_id = b.station_id
<where>
c.data_type = 'S'
<if test=" gardsSampleData.sampleId != null ">
and c.sample_id = #{gardsSampleData.sampleId}
</if>
<if test=" gardsSampleData.stationName != null and gardsSampleData.stationName != '' ">
and b.station_code = #{gardsSampleData.stationName}
</if>
<if test=" gardsSampleData.detectorsName != null and gardsSampleData.detectorsName != '' ">
and a.detector_code = #{gardsSampleData.detectorsName}
</if>
<if test=" gardsSampleData.sampleType != null and gardsSampleData.sampleType != '' ">
and c.sample_type = #{gardsSampleData.sampleType}
</if>
<if test=" gardsSampleData.dataType != null and gardsSampleData.dataType != '' ">
and c.data_type = #{gardsSampleData.dataType}
</if>
<if test=" gardsSampleData.spectralQualifie != null and gardsSampleData.spectralQualifie != '' ">
and c.spectral_qualifie = #{gardsSampleData.spectralQualifie}
</if>
<if test=" gardsSampleData.status != null and gardsSampleData.status != '' ">
and c.status = #{gardsSampleData.status}
</if>
<if test=" CollectStopB == true ">
and c.collect_stop between TO_DATE(#{startTime}, 'yyyy-mm-dd hh24:mi:ss') and TO_DATE(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test=" AcqStartB == true ">
and c.acquisition_start between TO_DATE(#{startTime}, 'yyyy-mm-dd hh24:mi:ss') and TO_DATE(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="AllUsers == false">
<if test=" userStations.size == 0 and userStations != null ">
and c.station_id in ('')
</if>
<if test=" userStations.size > 0 and userStations != null ">
and c.station_id in
<foreach collection="userStations" item="userStation" open="(" close=")" separator=",">
#{userStation}
</foreach>
</if>
</if>
</where>
<if test=" orderField != 'createTime' and orderField != '' and orderField != null and orderType != '' and orderType != null ">
ORDER BY ${orderField} ${orderType},acquisitionRealSec DESC
</if>
<if test=" orderField == 'createTime' or orderField == '' or orderField == null or orderType == '' or orderType == null ">
ORDER BY collectStop DESC,acquisitionRealSec DESC
</if>
</select>
<select id="loadSampleData" resultType="org.jeecg.modules.entity.GardsSampleDataSpectrum"> <select id="loadSampleData" resultType="org.jeecg.modules.entity.GardsSampleDataSpectrum">
select select
c.sample_id sampleId, c.sample_id sampleId,

View File

@ -290,7 +290,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
} }
//声明分页page //声明分页page
Page<GardsSampleDataSpectrum> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize()); Page<GardsSampleDataSpectrum> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
Page<GardsSampleDataSpectrum> sampleDataPage = spectrumAnalysisMapper.getDBSpectrumList(page, gardsSampleData, dbName, stationTypes, CollectStopB, AcqStartB, startTime, endTime, userStations, AllUsers, queryRequest.getField(), queryRequest.getOrder()); Page<GardsSampleDataSpectrum> sampleDataPage = spectrumAnalysisMapper.getDBSpectrumListByLeftJoin(page, gardsSampleData, dbName, stationTypes, CollectStopB, AcqStartB, startTime, endTime, userStations, AllUsers, queryRequest.getField(), queryRequest.getOrder());
sampleDataPage.getRecords().stream().forEach(item->{item.setDbName(tempDBName);}); sampleDataPage.getRecords().stream().forEach(item->{item.setDbName(tempDBName);});
result.setSuccess(true); result.setSuccess(true);
result.setResult(sampleDataPage); result.setResult(sampleDataPage);