Merge remote-tracking branch 'origin/station' into station
This commit is contained in:
commit
9ac2d70cac
|
@ -25,9 +25,10 @@ public class GardsSampleDataController {
|
||||||
|
|
||||||
@GetMapping("findPage")
|
@GetMapping("findPage")
|
||||||
@ApiOperation(value = "分页查询DATA_BASE数据", notes = "分页查询DATA_BASE数据")
|
@ApiOperation(value = "分页查询DATA_BASE数据", notes = "分页查询DATA_BASE数据")
|
||||||
public Result<IPage<GardsSampleDataSystem>> findPage(QueryRequest queryRequest, GardsSampleDataSystem gardsSampleData){
|
public Result<IPage<GardsSampleDataSystem>> findPage(QueryRequest queryRequest,
|
||||||
Result<IPage<GardsSampleDataSystem>> result = gardsSampleDataService.findPage(queryRequest, gardsSampleData);
|
GardsSampleDataSystem gardsSampleData,
|
||||||
return result;
|
boolean collectStopCheck, boolean acqDotStartCheck){
|
||||||
|
return gardsSampleDataService.findPage(queryRequest, gardsSampleData, collectStopCheck, acqDotStartCheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("findStations")
|
@GetMapping("findStations")
|
||||||
|
|
|
@ -16,6 +16,9 @@ public interface GardsSampleDataMapper extends BaseMapper<GardsSampleDataSystem>
|
||||||
void delTables(@Param("tableName") String tableName,
|
void delTables(@Param("tableName") String tableName,
|
||||||
@Param("sampleId") Integer sampleId);
|
@Param("sampleId") Integer sampleId);
|
||||||
|
|
||||||
|
void delBatch(@Param("tableNames") List<String> tableNames,
|
||||||
|
@Param("sampleId") Integer sampleId);
|
||||||
|
|
||||||
AnalysesDto getAnalysis(@Param("owner") String owner,
|
AnalysesDto getAnalysis(@Param("owner") String owner,
|
||||||
@Param("sampleId") Integer sampleId);
|
@Param("sampleId") Integer sampleId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,14 @@
|
||||||
DELETE FROM ${tableName} WHERE SAMPLE_ID = #{sampleId}
|
DELETE FROM ${tableName} WHERE SAMPLE_ID = #{sampleId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="delBatch">
|
||||||
|
BEGIN
|
||||||
|
<foreach collection = "tableNames" item = "tableName" index = "index" >
|
||||||
|
DELETE FROM ${tableName} WHERE SAMPLE_ID = #{sampleId};
|
||||||
|
</foreach>
|
||||||
|
END;
|
||||||
|
</delete>
|
||||||
|
|
||||||
<select id="containSampleId" resultType="org.jeecg.modules.base.dto.OwnerDto">
|
<select id="containSampleId" resultType="org.jeecg.modules.base.dto.OwnerDto">
|
||||||
SELECT
|
SELECT
|
||||||
OWNER,
|
OWNER,
|
||||||
|
@ -14,6 +22,7 @@
|
||||||
WHERE
|
WHERE
|
||||||
COLUMN_NAME = #{filed}
|
COLUMN_NAME = #{filed}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAnalysis" resultType="org.jeecg.modules.base.dto.AnalysesDto">
|
<select id="getAnalysis" resultType="org.jeecg.modules.base.dto.AnalysesDto">
|
||||||
SELECT
|
SELECT
|
||||||
BASELINE_PATH,
|
BASELINE_PATH,
|
||||||
|
|
|
@ -17,7 +17,9 @@ public interface IGardsSampleDataService extends IService<GardsSampleDataSystem>
|
||||||
* @param gardsSampleData
|
* @param gardsSampleData
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result<IPage<GardsSampleDataSystem>> findPage(QueryRequest queryRequest, GardsSampleDataSystem gardsSampleData);
|
Result<IPage<GardsSampleDataSystem>> findPage(QueryRequest queryRequest,
|
||||||
|
GardsSampleDataSystem gardsSampleData,
|
||||||
|
boolean collectStopCheck, boolean acqDotStartCheck);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除DATA BASE数据
|
* 删除DATA BASE数据
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
|
||||||
import org.jeecg.common.api.QueryRequest;
|
import org.jeecg.common.api.QueryRequest;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.constant.enums.FileTypeEnum;
|
import org.jeecg.common.constant.enums.FileTypeEnum;
|
||||||
|
@ -54,7 +55,9 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
private PlatformTransactionManager transactionManager;
|
private PlatformTransactionManager transactionManager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<IPage<GardsSampleDataSystem>> findPage(QueryRequest queryRequest, GardsSampleDataSystem gardsSampleData) {
|
public Result<IPage<GardsSampleDataSystem>> findPage(QueryRequest queryRequest,
|
||||||
|
GardsSampleDataSystem gardsSampleData,
|
||||||
|
boolean collectStopCheck, boolean acqDotStartCheck) {
|
||||||
//查询全部台站信息
|
//查询全部台站信息
|
||||||
HashMap<String, String> stationMap = (HashMap<String, String>) redisUtil.get("stationMap");
|
HashMap<String, String> stationMap = (HashMap<String, String>) redisUtil.get("stationMap");
|
||||||
//查询全部监测器信息
|
//查询全部监测器信息
|
||||||
|
@ -65,8 +68,18 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
queryWrapper.like(Objects.nonNull(gardsSampleData.getSampleId()) ,GardsSampleDataSystem::getSampleId, gardsSampleData.getSampleId());
|
queryWrapper.like(Objects.nonNull(gardsSampleData.getSampleId()) ,GardsSampleDataSystem::getSampleId, gardsSampleData.getSampleId());
|
||||||
queryWrapper.eq(Objects.nonNull(gardsSampleData.getStationId()) ,GardsSampleDataSystem::getStationId, gardsSampleData.getStationId());
|
queryWrapper.eq(Objects.nonNull(gardsSampleData.getStationId()) ,GardsSampleDataSystem::getStationId, gardsSampleData.getStationId());
|
||||||
queryWrapper.eq(Objects.nonNull(gardsSampleData.getDetectorId()) ,GardsSampleDataSystem::getDetectorId, gardsSampleData.getDetectorId());
|
queryWrapper.eq(Objects.nonNull(gardsSampleData.getDetectorId()) ,GardsSampleDataSystem::getDetectorId, gardsSampleData.getDetectorId());
|
||||||
queryWrapper.ge(Objects.nonNull(gardsSampleData.getCollectStart()) ,GardsSampleDataSystem::getCollectStart, gardsSampleData.getCollectStart());
|
Date start = gardsSampleData.getCollectStart();
|
||||||
queryWrapper.le(Objects.nonNull(gardsSampleData.getCollectStop()) ,GardsSampleDataSystem::getCollectStop, gardsSampleData.getCollectStop());
|
Date stop = gardsSampleData.getCollectStop();
|
||||||
|
boolean startNotNull = ObjectUtil.isNotNull(start);
|
||||||
|
boolean stopNotNull = ObjectUtil.isNotNull(stop);
|
||||||
|
if (collectStopCheck){
|
||||||
|
queryWrapper.ge(startNotNull ,GardsSampleDataSystem::getCollectStop, start);
|
||||||
|
queryWrapper.le(stopNotNull ,GardsSampleDataSystem::getCollectStop, stop);
|
||||||
|
}
|
||||||
|
if (acqDotStartCheck){
|
||||||
|
queryWrapper.ge(startNotNull ,GardsSampleDataSystem::getAcquisitionStart, start);
|
||||||
|
queryWrapper.le(stopNotNull ,GardsSampleDataSystem::getAcquisitionStart, stop);
|
||||||
|
}
|
||||||
queryWrapper.orderByAsc(GardsSampleDataSystem::getSampleId);
|
queryWrapper.orderByAsc(GardsSampleDataSystem::getSampleId);
|
||||||
Page<GardsSampleDataSystem> sampleDataPage = this.baseMapper.selectPage(page, queryWrapper);
|
Page<GardsSampleDataSystem> sampleDataPage = this.baseMapper.selectPage(page, queryWrapper);
|
||||||
sampleDataPage.getRecords().forEach(item->{
|
sampleDataPage.getRecords().forEach(item->{
|
||||||
|
@ -119,6 +132,7 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
// 删除表数据
|
// 删除表数据
|
||||||
if (CollUtil.isNotEmpty(allTables))
|
if (CollUtil.isNotEmpty(allTables))
|
||||||
delTables(allTables, sampleId);
|
delTables(allTables, sampleId);
|
||||||
|
// baseMapper.delBatch(allTables, sampleId);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (rnAuto){
|
if (rnAuto){
|
||||||
|
@ -132,6 +146,7 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
// 删除表数据
|
// 删除表数据
|
||||||
if (CollUtil.isNotEmpty(autoTables))
|
if (CollUtil.isNotEmpty(autoTables))
|
||||||
delTables(autoTables, sampleId);
|
delTables(autoTables, sampleId);
|
||||||
|
// baseMapper.delBatch(autoTables, sampleId);
|
||||||
}
|
}
|
||||||
if (rnMan){
|
if (rnMan){
|
||||||
// 收集人工交互库所有表名
|
// 收集人工交互库所有表名
|
||||||
|
@ -144,6 +159,7 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
// 删除表数据
|
// 删除表数据
|
||||||
if (CollUtil.isNotEmpty(manTables))
|
if (CollUtil.isNotEmpty(manTables))
|
||||||
delTables(manTables, sampleId);
|
delTables(manTables, sampleId);
|
||||||
|
// baseMapper.delBatch(manTables, sampleId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
transactionManager.commit(txStatus);
|
transactionManager.commit(txStatus);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user