feat:台站管理,核设施管理,探测器管理,DATA BASE管理页面增加查询条件相关代码
This commit is contained in:
parent
24764593f5
commit
141387c979
|
@ -14,7 +14,7 @@ import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("gardsStations")
|
@RequestMapping("/gardsStations")
|
||||||
@Api(value = "台站管理", tags = "台站管理")
|
@Api(value = "台站管理", tags = "台站管理")
|
||||||
public class GardsStationsController {
|
public class GardsStationsController {
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public class GardsStationsController {
|
||||||
* @param gardsStations
|
* @param gardsStations
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("findPage")
|
@GetMapping("/findPage")
|
||||||
@ApiOperation(value = "分页查询台站管理信息", notes = "分页查询台站管理信息")
|
@ApiOperation(value = "分页查询台站管理信息", notes = "分页查询台站管理信息")
|
||||||
public Result<IPage<GardsStations>> findPage(QueryRequest queryRequest, GardsStations gardsStations){
|
public Result<IPage<GardsStations>> findPage(QueryRequest queryRequest, GardsStations gardsStations){
|
||||||
Result<IPage<GardsStations>> result = gardsStationsService.findPage(queryRequest, gardsStations);
|
Result<IPage<GardsStations>> result = gardsStationsService.findPage(queryRequest, gardsStations);
|
||||||
|
@ -39,7 +39,7 @@ public class GardsStationsController {
|
||||||
* @param stationId
|
* @param stationId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("findInfo")
|
@GetMapping("/findInfo")
|
||||||
@ApiOperation(value = "查询台站管理详情信息", notes = "查询台站管理详情信息")
|
@ApiOperation(value = "查询台站管理详情信息", notes = "查询台站管理详情信息")
|
||||||
public GardsStations findInfo(Integer stationId){
|
public GardsStations findInfo(Integer stationId){
|
||||||
GardsStations result = gardsStationsService.findInfo(stationId);
|
GardsStations result = gardsStationsService.findInfo(stationId);
|
||||||
|
@ -49,7 +49,7 @@ public class GardsStationsController {
|
||||||
/**
|
/**
|
||||||
* 新增台站信息接口
|
* 新增台站信息接口
|
||||||
*/
|
*/
|
||||||
@PostMapping("create")
|
@PostMapping("/create")
|
||||||
@ApiOperation(value = "新增台站管理信息", notes = "新增台站管理信息")
|
@ApiOperation(value = "新增台站管理信息", notes = "新增台站管理信息")
|
||||||
public Result create(@RequestBody @Validated(value = InsertGroup.class) GardsStations gardsStations){
|
public Result create(@RequestBody @Validated(value = InsertGroup.class) GardsStations gardsStations){
|
||||||
Result result = gardsStationsService.create(gardsStations);
|
Result result = gardsStationsService.create(gardsStations);
|
||||||
|
@ -59,7 +59,7 @@ public class GardsStationsController {
|
||||||
/**
|
/**
|
||||||
* 修改台站信息接口
|
* 修改台站信息接口
|
||||||
*/
|
*/
|
||||||
@PutMapping("update")
|
@PutMapping("/update")
|
||||||
@ApiOperation(value = "修改台站管理信息", notes = "修改台站管理信息")
|
@ApiOperation(value = "修改台站管理信息", notes = "修改台站管理信息")
|
||||||
public Result update(@RequestBody @Validated(value = UpdateGroup.class) GardsStations gardsStations){
|
public Result update(@RequestBody @Validated(value = UpdateGroup.class) GardsStations gardsStations){
|
||||||
Result result = gardsStationsService.update(gardsStations);
|
Result result = gardsStationsService.update(gardsStations);
|
||||||
|
@ -70,7 +70,7 @@ public class GardsStationsController {
|
||||||
* 删除台站信息接口
|
* 删除台站信息接口
|
||||||
* @param stationId
|
* @param stationId
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("deleteById")
|
@DeleteMapping("/deleteById")
|
||||||
@ApiOperation(value = "删除台站管理信息", notes = "删除台站管理信息")
|
@ApiOperation(value = "删除台站管理信息", notes = "删除台站管理信息")
|
||||||
public Result deleteById(Integer stationId){
|
public Result deleteById(Integer stationId){
|
||||||
Result result = gardsStationsService.deleteById(stationId);
|
Result result = gardsStationsService.deleteById(stationId);
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
package org.jeecg.modules.system.mapper;
|
package org.jeecg.modules.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.jeecg.modules.system.entity.GardsDetectors;
|
import org.jeecg.modules.system.entity.GardsDetectors;
|
||||||
|
|
||||||
public interface GardsDetectorsMapper extends BaseMapper<GardsDetectors> {
|
public interface GardsDetectorsMapper extends BaseMapper<GardsDetectors> {
|
||||||
|
|
||||||
|
Page<GardsDetectors> findPage(Page<GardsDetectors> page, GardsDetectors gardsDetectors);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?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.system.mapper.GardsDetectorsMapper">
|
||||||
|
|
||||||
|
<select id="findPage" resultType="org.jeecg.modules.system.entity.GardsDetectors" parameterType="org.jeecg.modules.system.entity.GardsDetectors">
|
||||||
|
SELECT
|
||||||
|
DETECTOR_ID,
|
||||||
|
DETECTOR_CODE,
|
||||||
|
LON,
|
||||||
|
LAT,
|
||||||
|
TYPE,
|
||||||
|
CHANNELS,
|
||||||
|
RATED_EFFICIENCY,
|
||||||
|
RATED_RESOLUTION,
|
||||||
|
ECAL_RANGE_MAX,
|
||||||
|
DATE_BEGIN,
|
||||||
|
DATE_END,
|
||||||
|
STATUS,
|
||||||
|
DESCRIPTION,
|
||||||
|
MODDATE,
|
||||||
|
STATION_ID
|
||||||
|
FROM
|
||||||
|
GARDS_DETECTORS
|
||||||
|
<where>
|
||||||
|
<if test="gardsDetectors.detectorCode != '' and gardsDetectors.detectorCode != null">
|
||||||
|
and DETECTOR_CODE like CONCAT('%',#{gardsDetectors.detectorCode},'%')
|
||||||
|
</if>
|
||||||
|
<if test="gardsDetectors.type != '' and gardsDetectors.type != null">
|
||||||
|
and RTRIM(TYPE, ' ') = #{gardsDetectors.type}
|
||||||
|
</if>
|
||||||
|
<if test="gardsDetectors.status != '' and gardsDetectors.status != null">
|
||||||
|
and RTRIM(STATUS, ' ') = #{gardsDetectors.status}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -10,6 +10,7 @@ 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 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.util.RedisUtil;
|
||||||
import org.jeecg.modules.system.entity.GardsDetectors;
|
import org.jeecg.modules.system.entity.GardsDetectors;
|
||||||
import org.jeecg.modules.system.entity.GardsStations;
|
import org.jeecg.modules.system.entity.GardsStations;
|
||||||
import org.jeecg.modules.system.mapper.GardsDetectorsMapper;
|
import org.jeecg.modules.system.mapper.GardsDetectorsMapper;
|
||||||
|
@ -24,6 +25,7 @@ import java.sql.Timestamp;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@ -33,22 +35,22 @@ public class GardsDetectorsServiceImpl extends ServiceImpl<GardsDetectorsMapper,
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IGardsStationsService gardsStationsService;
|
private IGardsStationsService gardsStationsService;
|
||||||
|
@Autowired
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<IPage<GardsDetectors>> findPage(QueryRequest queryRequest, GardsDetectors gardsDetectors) {
|
public Result<IPage<GardsDetectors>> findPage(QueryRequest queryRequest, GardsDetectors gardsDetectors) {
|
||||||
Result<IPage<GardsDetectors>> result = new Result<>();
|
Result<IPage<GardsDetectors>> result = new Result<>();
|
||||||
//查询台站信息接口
|
//查询台站信息接口
|
||||||
List<GardsStations> gardsStations = gardsStationsService.getGardsStations();
|
HashMap<Integer, String> stationMap = (HashMap<Integer, String>)redisUtil.get("stationMap");
|
||||||
//分页查询
|
//分页查询
|
||||||
Page<GardsDetectors> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
Page<GardsDetectors> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
||||||
LambdaQueryWrapper<GardsDetectors> queryWrapper = new LambdaQueryWrapper<>();
|
Page<GardsDetectors> detectorsPage = this.baseMapper.findPage(page, gardsDetectors);
|
||||||
Page<GardsDetectors> detectorsPage = this.baseMapper.selectPage(page, queryWrapper);
|
|
||||||
detectorsPage.getRecords().forEach(item->{
|
detectorsPage.getRecords().forEach(item->{
|
||||||
if (CollectionUtils.isNotEmpty(gardsStations)) {
|
if (CollectionUtils.isNotEmpty(stationMap)) {
|
||||||
for (GardsStations gardsStation:gardsStations) {
|
String stationValue = stationMap.get(item.getStationId());
|
||||||
if (gardsStation.getStationId().equals(item.getStationId())){
|
if (StringUtils.isNotBlank(stationValue)){
|
||||||
item.setStationName(gardsStation.getStationCode());
|
item.setStationName(stationValue);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -60,18 +62,17 @@ public class GardsDetectorsServiceImpl extends ServiceImpl<GardsDetectorsMapper,
|
||||||
@Override
|
@Override
|
||||||
public GardsDetectors findInfo(Integer id) {
|
public GardsDetectors findInfo(Integer id) {
|
||||||
//查询台站信息接口
|
//查询台站信息接口
|
||||||
List<GardsStations> gardsStations = gardsStationsService.getGardsStations();
|
HashMap<Integer, String> stationMap = (HashMap<Integer, String>) redisUtil.get("stationMap");
|
||||||
LambdaQueryWrapper<GardsDetectors> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsDetectors> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(GardsDetectors::getDetectorId, id);
|
queryWrapper.eq(GardsDetectors::getDetectorId, id);
|
||||||
GardsDetectors gardsDetectors = this.baseMapper.selectOne(queryWrapper);
|
GardsDetectors gardsDetectors = this.baseMapper.selectOne(queryWrapper);
|
||||||
if (Objects.isNull(gardsDetectors)) {
|
if (Objects.isNull(gardsDetectors)) {
|
||||||
throw new RuntimeException("当前数据不存在");
|
throw new RuntimeException("当前数据不存在");
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(gardsStations)){
|
if (CollectionUtils.isNotEmpty(stationMap)){
|
||||||
for (GardsStations gardsStation:gardsStations) {
|
String stationValue = stationMap.get(gardsDetectors.getStationId());
|
||||||
if (gardsStation.getStationId().equals(gardsDetectors.getStationId())) {
|
if (StringUtils.isNotBlank(stationValue)){
|
||||||
gardsDetectors.setStationName(gardsStation.getStationCode());
|
gardsDetectors.setStationName(stationValue);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return gardsDetectors;
|
return gardsDetectors;
|
||||||
|
|
|
@ -26,6 +26,10 @@ public class GardsNuclearfacilityServiceImpl extends ServiceImpl<GardsNuclearfac
|
||||||
Result<IPage<GardsNuclearfacility>> result = new Result<>();
|
Result<IPage<GardsNuclearfacility>> result = new Result<>();
|
||||||
Page<GardsNuclearfacility> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
Page<GardsNuclearfacility> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
||||||
LambdaQueryWrapper<GardsNuclearfacility> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsNuclearfacility> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.like(StringUtils.isNotBlank(gardsNuclearfacility.getFacilityName()), GardsNuclearfacility::getFacilityName, gardsNuclearfacility.getFacilityName());
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(gardsNuclearfacility.getType()), GardsNuclearfacility::getType, gardsNuclearfacility.getType());
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(gardsNuclearfacility.getLocation()), GardsNuclearfacility::getLocation, gardsNuclearfacility.getLocation());
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(gardsNuclearfacility.getStatus()), GardsNuclearfacility::getStatus, gardsNuclearfacility.getStatus());
|
||||||
Page<GardsNuclearfacility> gardsNuclearfacilityPage = this.baseMapper.selectPage(page, queryWrapper);
|
Page<GardsNuclearfacility> gardsNuclearfacilityPage = this.baseMapper.selectPage(page, queryWrapper);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(gardsNuclearfacilityPage);
|
result.setResult(gardsNuclearfacilityPage);
|
||||||
|
|
|
@ -4,10 +4,12 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
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 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.util.RedisUtil;
|
||||||
import org.jeecg.modules.system.entity.GardsDetectors;
|
import org.jeecg.modules.system.entity.GardsDetectors;
|
||||||
import org.jeecg.modules.system.entity.GardsSampleData;
|
import org.jeecg.modules.system.entity.GardsSampleData;
|
||||||
import org.jeecg.modules.system.entity.GardsStations;
|
import org.jeecg.modules.system.entity.GardsStations;
|
||||||
|
@ -19,7 +21,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Service("gardsSampleDataService")
|
@Service("gardsSampleDataService")
|
||||||
@DS("ori")
|
@DS("ori")
|
||||||
|
@ -27,26 +31,31 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IGardsStationsService gardsStationsService;
|
private IGardsStationsService gardsStationsService;
|
||||||
|
@Autowired
|
||||||
|
private RedisUtil redisUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IGardsDetectorsService gardsDetectorsService;
|
private IGardsDetectorsService gardsDetectorsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<IPage<GardsSampleData>> findPage(QueryRequest queryRequest, GardsSampleData gardsSampleData) {
|
public Result<IPage<GardsSampleData>> findPage(QueryRequest queryRequest, GardsSampleData gardsSampleData) {
|
||||||
//查询全部台站信息
|
//查询全部台站信息
|
||||||
List<GardsStations> gardsStations = gardsStationsService.getGardsStations();
|
HashMap<Integer, String> stationMap = (HashMap<Integer, String>) redisUtil.get("stationMap");
|
||||||
//查询全部监测器信息
|
//查询全部监测器信息
|
||||||
List<GardsDetectors> detectors = gardsDetectorsService.findDetectors();
|
List<GardsDetectors> detectors = gardsDetectorsService.findDetectors();
|
||||||
Result<IPage<GardsSampleData>> result = new Result<>();
|
Result<IPage<GardsSampleData>> result = new Result<>();
|
||||||
Page<GardsSampleData> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
Page<GardsSampleData> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
||||||
LambdaQueryWrapper<GardsSampleData> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsSampleData> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.like(Objects.nonNull(gardsSampleData.getSampleId()) ,GardsSampleData::getSampleId, gardsSampleData.getSampleId());
|
||||||
|
queryWrapper.eq(Objects.nonNull(gardsSampleData.getStationId()) ,GardsSampleData::getStationId, gardsSampleData.getStationId());
|
||||||
|
queryWrapper.eq(Objects.nonNull(gardsSampleData.getDetectorId()) ,GardsSampleData::getDetectorId, gardsSampleData.getDetectorId());
|
||||||
|
queryWrapper.eq(Objects.nonNull(gardsSampleData.getCollectStart()) ,GardsSampleData::getCollectStart, gardsSampleData.getCollectStart());
|
||||||
|
queryWrapper.eq(Objects.nonNull(gardsSampleData.getCollectStop()) ,GardsSampleData::getCollectStop, gardsSampleData.getCollectStop());
|
||||||
Page<GardsSampleData> sampleDataPage = this.baseMapper.selectPage(page, queryWrapper);
|
Page<GardsSampleData> sampleDataPage = this.baseMapper.selectPage(page, queryWrapper);
|
||||||
sampleDataPage.getRecords().forEach(item->{
|
sampleDataPage.getRecords().forEach(item->{
|
||||||
if (CollectionUtils.isNotEmpty(gardsStations)){
|
if (CollectionUtils.isNotEmpty(stationMap)){
|
||||||
for (GardsStations stations:gardsStations) {
|
String stationValue = stationMap.get(item.getStationId());
|
||||||
if (stations.getStationId().equals(item.getStationId())){
|
if (StringUtils.isNotBlank(stationValue)){
|
||||||
item.setStationName(stations.getStationCode());
|
item.setStationName(stationValue);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(detectors)){
|
if (CollectionUtils.isNotEmpty(detectors)){
|
||||||
|
|
|
@ -9,13 +9,16 @@ 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 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.util.RedisUtil;
|
||||||
import org.jeecg.modules.system.entity.GardsStations;
|
import org.jeecg.modules.system.entity.GardsStations;
|
||||||
import org.jeecg.modules.system.mapper.GardsStationsMapper;
|
import org.jeecg.modules.system.mapper.GardsStationsMapper;
|
||||||
import org.jeecg.modules.system.service.IGardsStationsService;
|
import org.jeecg.modules.system.service.IGardsStationsService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@ -23,6 +26,9 @@ import java.util.Objects;
|
||||||
@DS("ora")
|
@DS("ora")
|
||||||
public class GardsStationsServiceImpl extends ServiceImpl<GardsStationsMapper, GardsStations> implements IGardsStationsService {
|
public class GardsStationsServiceImpl extends ServiceImpl<GardsStationsMapper, GardsStations> implements IGardsStationsService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询台站信息接口
|
* 分页查询台站信息接口
|
||||||
* @param queryRequest
|
* @param queryRequest
|
||||||
|
@ -34,6 +40,9 @@ public class GardsStationsServiceImpl extends ServiceImpl<GardsStationsMapper, G
|
||||||
Result<IPage<GardsStations>> result = new Result<>();
|
Result<IPage<GardsStations>> result = new Result<>();
|
||||||
Page<GardsStations> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
Page<GardsStations> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
||||||
LambdaQueryWrapper<GardsStations> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsStations> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(gardsStations.getCountryCode()), GardsStations::getCountryCode, gardsStations.getCountryCode());
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(gardsStations.getType()), GardsStations::getType, gardsStations.getType());
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(gardsStations.getStatus()), GardsStations::getStatus, gardsStations.getStatus());
|
||||||
Page<GardsStations> pageList = this.baseMapper.selectPage(page, queryWrapper);
|
Page<GardsStations> pageList = this.baseMapper.selectPage(page, queryWrapper);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(pageList);
|
result.setResult(pageList);
|
||||||
|
@ -136,6 +145,11 @@ public class GardsStationsServiceImpl extends ServiceImpl<GardsStationsMapper, G
|
||||||
public List<GardsStations> getGardsStations() {
|
public List<GardsStations> getGardsStations() {
|
||||||
LambdaQueryWrapper<GardsStations> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsStations> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
List<GardsStations> gardsStations = this.baseMapper.selectList(queryWrapper);
|
List<GardsStations> gardsStations = this.baseMapper.selectList(queryWrapper);
|
||||||
|
HashMap<Integer, String> map = new HashMap<>();
|
||||||
|
for (GardsStations station:gardsStations) {
|
||||||
|
map.put(station.getStationId(),station.getStationCode());
|
||||||
|
}
|
||||||
|
redisUtil.set("stationMap",map);
|
||||||
return gardsStations;
|
return gardsStations;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user