综合监测模块字段修改

This commit is contained in:
machao 2022-11-09 15:25:03 +08:00
parent 53b00a7d28
commit 96f4881285
8 changed files with 345 additions and 113 deletions

View File

@ -2,6 +2,8 @@ package com.ruoyi.web.controller.yada;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain_yada.entity.*;
import com.ruoyi.system.domain_yada.vo.PmKeyValueEnVo;
import com.ruoyi.system.domain_yada.vo.PmKeyValueVo;
import com.ruoyi.system.domain_yada.vo.PmYearConcentrationRatioVo;
import com.ruoyi.system.service_yada.MonitorService;
import io.swagger.annotations.Api;
@ -42,61 +44,62 @@ public class MonitorController {
@RequestMapping(value = "/eqiGrading", method = {RequestMethod.GET})
@ApiOperation(value = "亚大区域地理亚区EQI分级", httpMethod = "GET")
public AjaxResult eqiGrading(@RequestParam(value = "year") String year,
@RequestParam(value = "type") String type,
@RequestParam(value = "region") String region) {
List<MonitorEQIGradingEntity> list = monitorService.eqiGrading(year, region);
if (list.isEmpty()) {
return AjaxResult.error("未查找到信息");
}
return AjaxResult.success(list);
MonitorEQIGradingEntity monitorEQIGradingEntity = monitorService.eqiGrading(year, type, region);
return AjaxResult.success(monitorEQIGradingEntity);
}
@RequestMapping(value = "/eqiAsia", method = {RequestMethod.GET})
@ApiOperation(value = "地理亚区平均EQI分布", httpMethod = "GET")
public AjaxResult eqiAsia(@RequestParam(value = "year") String year) {
List<MonitorEQIAsiaEntity> list = monitorService.eqiAsia(year);
if (list.isEmpty()) {
return AjaxResult.error("未查找到信息");
}
return AjaxResult.success(list);
public AjaxResult eqiAsia(@RequestParam(value = "year") String year,
@RequestParam(value = "type") String type) {
PmKeyValueEnVo pmKeyValueEnVo = monitorService.eqiAsia(year, type);
return AjaxResult.success(pmKeyValueEnVo);
}
@RequestMapping(value = "/eqiCountry", method = {RequestMethod.GET})
@ApiOperation(value = "各国家平均EQI分布", httpMethod = "GET")
public AjaxResult eqiCountry(@RequestParam(value = "year") String year,
@RequestParam(value = "region") String region) {
List<MonitorEQICountryEntity> list = monitorService.eqiCountry(year, region);
if (list.isEmpty()) {
return AjaxResult.error("未查找到信息");
}
return AjaxResult.success(list);
@RequestParam(value = "region") String region,
@RequestParam(value = "type") String type) {
PmKeyValueEnVo pmKeyValueEnVo = monitorService.eqiCountry(year, region, type);
return AjaxResult.success(pmKeyValueEnVo);
}
@RequestMapping(value = "/keqi", method = {RequestMethod.GET})
@ApiOperation(value = "各地理亚区平均KEQI分布", httpMethod = "GET")
public AjaxResult keqi(@RequestParam(value = "region") String region) {
List<MonitorKEQIEntity> list = monitorService.keqi(region);
if (list.isEmpty()) {
return AjaxResult.error("未查找到信息");
}
return AjaxResult.success(list);
public AjaxResult keqi(@RequestParam(value = "region") String region,
@RequestParam(value = "type") String type) {
MonitorKEQIEntity keqi = monitorService.keqi(type, region);
return AjaxResult.success(keqi);
}
@RequestMapping(value = "/keqiAsiaRate", method = {RequestMethod.GET})
@ApiOperation(value = "各地理亚区平均KEQI变化率", httpMethod = "GET")
public AjaxResult keqiAsiaRate() {
List<MonitorKEQIAsiaRateEntity> list = monitorService.keqiAsiaRate();
if (list.isEmpty()) {
return AjaxResult.error("未查找到信息");
}
return AjaxResult.success(list);
public AjaxResult keqiAsiaRate(@RequestParam(value = "type") String type) {
PmKeyValueEnVo pmKeyValueEnVo = monitorService.keqiAsiaRate(type);
return AjaxResult.success(pmKeyValueEnVo);
}
@RequestMapping(value = "/keqiCountryRate", method = {RequestMethod.GET})
@ApiOperation(value = "各国平均KEQI变化率", httpMethod = "GET")
public AjaxResult keqiCountryRate(@RequestParam(value = "region") String region) {
List<MonitorKEQICountryRateEntity> list = monitorService.keqiCountryRate(region);
if (list.isEmpty()) {
return AjaxResult.error("未查找到信息");
public AjaxResult keqiCountryRate(@RequestParam(value = "region") String region,
@RequestParam(value = "type") String type) {
PmKeyValueEnVo pmKeyValueEnVo = monitorService.keqiCountryRate(region, type);
return AjaxResult.success(pmKeyValueEnVo);
}
return AjaxResult.success(list);
@RequestMapping(value = "/eqiAsiaLine", method = {RequestMethod.GET})
@ApiOperation(value = "各地理亚区平均EQI分布折线图", httpMethod = "GET")
public AjaxResult eqiAsiaLine(@RequestParam(value = "region") String region,
@RequestParam(value = "type") String type,
@RequestParam(value = "start") String start,
@RequestParam(value = "end") String end) {
PmKeyValueVo pmKeyValueVo = monitorService.eqiAsiaLine(region, type, start, end);
return AjaxResult.success(pmKeyValueVo);
}
}

View File

@ -115,7 +115,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers("/*/api-docs").anonymous()
.antMatchers("/druid/**").anonymous()
// // 除上面外的所有请求全部需要鉴权认证
//.anyRequest().authenticated()
.anyRequest().authenticated()
.and()
.headers().frameOptions().disable();
httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);

View File

@ -14,23 +14,23 @@ public class MonitorKEQIAsiaRateEntity {
private String regionEn;
private BigDecimal vegetation;
private Double vegetation;
private BigDecimal forest;
private Double forest;
private BigDecimal shrub;
private Double shrub;
private BigDecimal grass;
private Double grass;
private BigDecimal farmland;
private Double farmland;
private BigDecimal mountain;
private Double mountain;
public MonitorKEQIAsiaRateEntity() {
}
public MonitorKEQIAsiaRateEntity(Integer id, String region, String regionEn, BigDecimal vegetation, BigDecimal forest, BigDecimal shrub, BigDecimal grass, BigDecimal farmland, BigDecimal mountain) {
public MonitorKEQIAsiaRateEntity(Integer id, String region, String regionEn, Double vegetation, Double forest, Double shrub, Double grass, Double farmland, Double mountain) {
this.id = id;
this.region = region;
this.regionEn = regionEn;
@ -94,7 +94,7 @@ public class MonitorKEQIAsiaRateEntity {
* 获取
* @return vegetation
*/
public BigDecimal getVegetation() {
public Double getVegetation() {
return vegetation;
}
@ -102,7 +102,7 @@ public class MonitorKEQIAsiaRateEntity {
* 设置
* @param vegetation
*/
public void setVegetation(BigDecimal vegetation) {
public void setVegetation(Double vegetation) {
this.vegetation = vegetation;
}
@ -110,7 +110,7 @@ public class MonitorKEQIAsiaRateEntity {
* 获取
* @return forest
*/
public BigDecimal getForest() {
public Double getForest() {
return forest;
}
@ -118,7 +118,7 @@ public class MonitorKEQIAsiaRateEntity {
* 设置
* @param forest
*/
public void setForest(BigDecimal forest) {
public void setForest(Double forest) {
this.forest = forest;
}
@ -126,7 +126,7 @@ public class MonitorKEQIAsiaRateEntity {
* 获取
* @return shrub
*/
public BigDecimal getShrub() {
public Double getShrub() {
return shrub;
}
@ -134,7 +134,7 @@ public class MonitorKEQIAsiaRateEntity {
* 设置
* @param shrub
*/
public void setShrub(BigDecimal shrub) {
public void setShrub(Double shrub) {
this.shrub = shrub;
}
@ -142,7 +142,7 @@ public class MonitorKEQIAsiaRateEntity {
* 获取
* @return grass
*/
public BigDecimal getGrass() {
public Double getGrass() {
return grass;
}
@ -150,7 +150,7 @@ public class MonitorKEQIAsiaRateEntity {
* 设置
* @param grass
*/
public void setGrass(BigDecimal grass) {
public void setGrass(Double grass) {
this.grass = grass;
}
@ -158,7 +158,7 @@ public class MonitorKEQIAsiaRateEntity {
* 获取
* @return farmland
*/
public BigDecimal getFarmland() {
public Double getFarmland() {
return farmland;
}
@ -166,7 +166,7 @@ public class MonitorKEQIAsiaRateEntity {
* 设置
* @param farmland
*/
public void setFarmland(BigDecimal farmland) {
public void setFarmland(Double farmland) {
this.farmland = farmland;
}
@ -174,7 +174,7 @@ public class MonitorKEQIAsiaRateEntity {
* 获取
* @return mountain
*/
public BigDecimal getMountain() {
public Double getMountain() {
return mountain;
}
@ -182,11 +182,10 @@ public class MonitorKEQIAsiaRateEntity {
* 设置
* @param mountain
*/
public void setMountain(BigDecimal mountain) {
public void setMountain(Double mountain) {
this.mountain = mountain;
}
@Override
public String toString() {
return "MonitorKEQIAsiaRateEntity{id = " + id + ", region = " + region + ", regionEn = " + regionEn + ", vegetation = " + vegetation + ", forest = " + forest + ", shrub = " + shrub + ", grass = " + grass + ", farmland = " + farmland + ", mountain = " + mountain + "}";
}

View File

@ -13,23 +13,23 @@ public class MonitorKEQICountryRateEntity {
private String countryEn;
private BigDecimal all;
private Double all;
private BigDecimal forest;
private Double forest;
private BigDecimal shrub;
private Double shrub;
private BigDecimal grass;
private Double grass;
private BigDecimal farmland;
private Double farmland;
private BigDecimal mountain;
private Double mountain;
public MonitorKEQICountryRateEntity() {
}
public MonitorKEQICountryRateEntity(Integer id, String country, String countryEn, BigDecimal all, BigDecimal forest, BigDecimal shrub, BigDecimal grass, BigDecimal farmland, BigDecimal mountain) {
public MonitorKEQICountryRateEntity(Integer id, String country, String countryEn, Double all, Double forest, Double shrub, Double grass, Double farmland, Double mountain) {
this.id = id;
this.country = country;
this.countryEn = countryEn;
@ -93,7 +93,7 @@ public class MonitorKEQICountryRateEntity {
* 获取
* @return all
*/
public BigDecimal getAll() {
public Double getAll() {
return all;
}
@ -101,7 +101,7 @@ public class MonitorKEQICountryRateEntity {
* 设置
* @param all
*/
public void setAll(BigDecimal all) {
public void setAll(Double all) {
this.all = all;
}
@ -109,7 +109,7 @@ public class MonitorKEQICountryRateEntity {
* 获取
* @return forest
*/
public BigDecimal getForest() {
public Double getForest() {
return forest;
}
@ -117,7 +117,7 @@ public class MonitorKEQICountryRateEntity {
* 设置
* @param forest
*/
public void setForest(BigDecimal forest) {
public void setForest(Double forest) {
this.forest = forest;
}
@ -125,7 +125,7 @@ public class MonitorKEQICountryRateEntity {
* 获取
* @return shrub
*/
public BigDecimal getShrub() {
public Double getShrub() {
return shrub;
}
@ -133,7 +133,7 @@ public class MonitorKEQICountryRateEntity {
* 设置
* @param shrub
*/
public void setShrub(BigDecimal shrub) {
public void setShrub(Double shrub) {
this.shrub = shrub;
}
@ -141,7 +141,7 @@ public class MonitorKEQICountryRateEntity {
* 获取
* @return grass
*/
public BigDecimal getGrass() {
public Double getGrass() {
return grass;
}
@ -149,7 +149,7 @@ public class MonitorKEQICountryRateEntity {
* 设置
* @param grass
*/
public void setGrass(BigDecimal grass) {
public void setGrass(Double grass) {
this.grass = grass;
}
@ -157,7 +157,7 @@ public class MonitorKEQICountryRateEntity {
* 获取
* @return farmland
*/
public BigDecimal getFarmland() {
public Double getFarmland() {
return farmland;
}
@ -165,7 +165,7 @@ public class MonitorKEQICountryRateEntity {
* 设置
* @param farmland
*/
public void setFarmland(BigDecimal farmland) {
public void setFarmland(Double farmland) {
this.farmland = farmland;
}
@ -173,7 +173,7 @@ public class MonitorKEQICountryRateEntity {
* 获取
* @return mountain
*/
public BigDecimal getMountain() {
public Double getMountain() {
return mountain;
}
@ -181,11 +181,10 @@ public class MonitorKEQICountryRateEntity {
* 设置
* @param mountain
*/
public void setMountain(BigDecimal mountain) {
public void setMountain(Double mountain) {
this.mountain = mountain;
}
@Override
public String toString() {
return "MonitorKEQICountryRateEntity{id = " + id + ", country = " + country + ", countryEn = " + countryEn + ", all = " + all + ", forest = " + forest + ", shrub = " + shrub + ", grass = " + grass + ", farmland = " + farmland + ", mountain = " + mountain + "}";
}

View File

@ -22,15 +22,18 @@ public interface MonitorMapper {
/**
* 亚大区域地理亚区EQI分级
*
* @param year 年份
* @param region 区域
* @return
*/
List<MonitorEQIGradingEntity> eqiGrading(@Param("year") String year,
MonitorEQIGradingEntity eqiGrading(@Param("year") String year,
@Param("type") String type,
@Param("region") String region);
/**
* 各地理亚区平均EQI分布
*
* @param year
* @return
*/
@ -38,6 +41,7 @@ public interface MonitorMapper {
/**
* 各国家平均EQI分布
*
* @param year
* @param country
* @return
@ -47,22 +51,35 @@ public interface MonitorMapper {
/**
* 各地理亚区平均KEQI分布
*
* @param region
* @return
*/
List<MonitorKEQIEntity> keqi(@Param("region") String region);
MonitorKEQIEntity keqi(@Param("type") String type,
@Param("region") String region);
/**
* 各地理亚区平均KEQI变化率
*
* @return
*/
List<MonitorKEQIAsiaRateEntity> keqiAsiaRate();
/**
* 各国平均KEQI变化率
*
* @param country 国家
* @return
*/
MonitorKEQICountryRateEntity keqiCountryRate(@Param("country") String country);
/**
* 各地理亚区平均EQI分布折线图
* @param region
* @return
*/
List<MonitorEQIAsiaEntity> eqiAsiaLine(@Param("region") String region,
@Param("start") String start,
@Param("end") String end);
}

View File

@ -1,12 +1,15 @@
package com.ruoyi.system.service_yada;
import com.ruoyi.system.domain_yada.entity.*;
import com.ruoyi.system.domain_yada.vo.PmKeyValueEnVo;
import com.ruoyi.system.domain_yada.vo.PmKeyValueVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 亚大综合监测
*
* @author Mr.C
*/
public interface MonitorService {
@ -14,6 +17,7 @@ public interface MonitorService {
/**
* 亚大区域地理亚区与国家对应关系
*
* @param region 区域
* @return
*/
@ -21,44 +25,63 @@ public interface MonitorService {
/**
* 亚大区域地理亚区EQI分级
*
* @param year 年份
* @param region 区域
* @return
*/
List<MonitorEQIGradingEntity> eqiGrading(String year,String region);
MonitorEQIGradingEntity eqiGrading(String year, String type, String region);
/**
* 各地理亚区平均EQI分布
*
* @param year 年份
* @param type 植被类型
* @return
*/
List<MonitorEQIAsiaEntity> eqiAsia(String year);
PmKeyValueEnVo eqiAsia(String year, String type);
/**
* 各国家平均EQI分布
*
* @param year 年份
* @param region 区域
* @param type 植被类型
* @return
*/
List<MonitorEQICountryEntity> eqiCountry(String year ,String region);
PmKeyValueEnVo eqiCountry(String year, String region, String type);
/**
* 各地理亚区平均KEQI分布
*
* @param region 区域
* @return
*/
List<MonitorKEQIEntity> keqi(@Param("region") String region);
MonitorKEQIEntity keqi(String type, String region);
/**
* 各地理亚区平均KEQI变化率
*
* @return
*/
List<MonitorKEQIAsiaRateEntity> keqiAsiaRate();
PmKeyValueEnVo keqiAsiaRate(String type);
/**
* 各国平均KEQI变化率
*
* @param region 区域
* @return
*/
List<MonitorKEQICountryRateEntity> keqiCountryRate(@Param("region") String region);
PmKeyValueEnVo keqiCountryRate(String region, String type);
/**
* 各地理亚区平均EQI分布折线图
*
* @param region
* @param type
* @param start
* @param end
* @return
*/
PmKeyValueVo eqiAsiaLine(String region, String type, String start, String end);
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.service_yada.impl;
import com.ruoyi.system.domain_yada.entity.*;
import com.ruoyi.system.domain_yada.vo.PmKeyValueEnVo;
import com.ruoyi.system.domain_yada.vo.PmKeyValueVo;
import com.ruoyi.system.mapper_yada.MonitorMapper;
import com.ruoyi.system.service_yada.MonitorService;
import org.springframework.beans.factory.annotation.Autowired;
@ -8,15 +10,25 @@ import org.springframework.stereotype.Service;
import org.yaml.snakeyaml.Yaml;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
/**
* 亚大综合监测
*
* @author Mr.C
*/
@Service
public class MonitorImpl implements MonitorService {
private static final String FOREST = "forest";
private static final String SHRUB = "shrub";
private static final String GRASS = "grass";
private static final String FARMLAND = "farmland";
private static final String MOUNTAIN = "mountain";
private static final String ALL = "all";
@Resource
private MonitorMapper monitorMapper;
@ -26,44 +38,199 @@ public class MonitorImpl implements MonitorService {
}
@Override
public List<MonitorEQIGradingEntity> eqiGrading(String year, String region) {
return monitorMapper.eqiGrading(year, region);
public MonitorEQIGradingEntity eqiGrading(String year, String type, String region) {
return monitorMapper.eqiGrading(year, type, region);
}
@Override
public List<MonitorEQIAsiaEntity> eqiAsia(String year) {
return monitorMapper.eqiAsia(year);
public PmKeyValueEnVo eqiAsia(String year, String type) {
List<MonitorEQIAsiaEntity> list = monitorMapper.eqiAsia(year);
List<String> key = new ArrayList<>();
List<String> keyEn = new ArrayList<>();
List<Double> value = new ArrayList<>();
list.forEach(v -> {
key.add(v.getRegion());
keyEn.add(v.getRegionEn());
});
switch (type) {
case FOREST:
list.forEach(v -> value.add(Double.valueOf(v.getForest())));
break;
case SHRUB:
list.forEach(v -> value.add(Double.valueOf(v.getShrub())));
break;
case GRASS:
list.forEach(v -> value.add(Double.valueOf(v.getGrass())));
break;
case FARMLAND:
list.forEach(v -> value.add(Double.valueOf(v.getFarmland())));
break;
case MOUNTAIN:
list.forEach(v -> value.add(Double.valueOf(v.getMountain())));
break;
case ALL:
list.forEach(v -> value.add(Double.valueOf(v.getAll())));
break;
default:
}
return new PmKeyValueEnVo(key, keyEn, value);
}
@Override
public List<MonitorEQICountryEntity> eqiCountry(String year, String region) {
public PmKeyValueEnVo eqiCountry(String year, String region, String type) {
List<MonitorCountryCorrespondingEntity> list = monitorMapper.countryCorresponding(region);
List<MonitorEQICountryEntity> lists = new ArrayList<>();
List<String> key = new ArrayList<>();
List<String> keyEn = new ArrayList<>();
List<Double> value = new ArrayList<>();
for (MonitorCountryCorrespondingEntity monitorCountryCorrespondingEntity : list) {
String country = monitorCountryCorrespondingEntity.getCountry();
lists.add(monitorMapper.eqiCountry(year, country));
key.add(monitorMapper.eqiCountry(year, country).getCountry());
keyEn.add(monitorMapper.eqiCountry(year, country).getCountryEn());
switch (type) {
case FOREST:
value.add(Double.valueOf(monitorMapper.eqiCountry(year, country).getForestEQI()));
break;
case SHRUB:
value.add(Double.valueOf(monitorMapper.eqiCountry(year, country).getShrubEQI()));
break;
case GRASS:
value.add(Double.valueOf(monitorMapper.eqiCountry(year, country).getGrassEQI()));
break;
case FARMLAND:
value.add(Double.valueOf(monitorMapper.eqiCountry(year, country).getFarmlandEQI()));
break;
case MOUNTAIN:
value.add(Double.valueOf(monitorMapper.eqiCountry(year, country).getMountainEQI()));
break;
case ALL:
value.add(Double.valueOf(monitorMapper.eqiCountry(year, country).getAllEQI()));
break;
default:
}
return lists;
}
return new PmKeyValueEnVo(key, keyEn, value);
}
@Override
public List<MonitorKEQIEntity> keqi(String region) {
return monitorMapper.keqi(region);
public MonitorKEQIEntity keqi(String type, String region) {
return monitorMapper.keqi(type, region);
}
@Override
public List<MonitorKEQIAsiaRateEntity> keqiAsiaRate() {
return monitorMapper.keqiAsiaRate();
public PmKeyValueEnVo keqiAsiaRate(String type) {
List<MonitorKEQIAsiaRateEntity> list = monitorMapper.keqiAsiaRate();
List<String> key = new ArrayList<>();
List<String> keyEn = new ArrayList<>();
List<Double> value = new ArrayList<>();
list.forEach(v -> {
key.add(v.getRegion());
keyEn.add(v.getRegionEn());
});
switch (type) {
case FOREST:
list.forEach(v -> value.add(v.getForest()));
break;
case SHRUB:
list.forEach(v -> value.add(v.getShrub()));
break;
case GRASS:
list.forEach(v -> value.add(v.getGrass()));
break;
case FARMLAND:
list.forEach(v -> value.add(v.getFarmland()));
break;
case MOUNTAIN:
list.forEach(v -> value.add(v.getMountain()));
break;
case ALL:
list.forEach(v -> value.add(v.getVegetation()));
break;
default:
}
return new PmKeyValueEnVo(key, keyEn, value);
}
@Override
public List<MonitorKEQICountryRateEntity> keqiCountryRate(String region) {
public PmKeyValueEnVo keqiCountryRate(String region, String type) {
List<MonitorCountryCorrespondingEntity> list = monitorMapper.countryCorresponding(region);
List<MonitorKEQICountryRateEntity> lists = new ArrayList<>();
List<String> key = new ArrayList<>();
List<String> keyEn = new ArrayList<>();
List<Double> value = new ArrayList<>();
for (MonitorCountryCorrespondingEntity monitorCountryCorrespondingEntity : list) {
lists.add(monitorMapper.keqiCountryRate(monitorCountryCorrespondingEntity.getCountry()));
String country = monitorCountryCorrespondingEntity.getCountry();
key.add(monitorMapper.keqiCountryRate(country).getCountry());
keyEn.add(monitorMapper.keqiCountryRate(country).getCountryEn());
switch (type) {
case FOREST:
value.add(monitorMapper.keqiCountryRate(country).getForest());
break;
case SHRUB:
value.add(monitorMapper.keqiCountryRate(country).getShrub());
break;
case GRASS:
value.add(monitorMapper.keqiCountryRate(country).getGrass());
break;
case FARMLAND:
value.add(monitorMapper.keqiCountryRate(country).getFarmland());
break;
case MOUNTAIN:
value.add(monitorMapper.keqiCountryRate(country).getMountain());
break;
case ALL:
value.add(monitorMapper.keqiCountryRate(country).getAll());
break;
default:
}
return lists;
}
return new PmKeyValueEnVo(key, keyEn, value);
}
@Override
public PmKeyValueVo eqiAsiaLine(String region, String type,String start ,String end) {
List<MonitorEQIAsiaEntity> list = monitorMapper.eqiAsiaLine(region,start,end);
list.sort(Comparator.comparing(MonitorEQIAsiaEntity::getYear));
List<String> key = new ArrayList<>();
List<Double> value = new ArrayList<>();
switch (type) {
case FOREST:
list.forEach(v -> {
key.add(v.getYear());
value.add(Double.valueOf(v.getForest()));
});
break;
case SHRUB:
list.forEach(v -> {
key.add(v.getYear());
value.add(Double.valueOf(v.getShrub()));
});
break;
case GRASS:
list.forEach(v -> {
key.add(v.getYear());
value.add(Double.valueOf(v.getGrass()));
});
break;
case FARMLAND:
list.forEach(v -> {
key.add(v.getYear());
value.add(Double.valueOf(v.getFarmland()));
});
break;
case MOUNTAIN:
list.forEach(v -> {
key.add(v.getYear());
value.add(Double.valueOf(v.getMountain()));
});
break;
case ALL:
list.forEach(v -> {
key.add(v.getYear());
value.add(Double.valueOf(v.getAll()));
});
break;
default:
}
return new PmKeyValueVo(key,value);
}
}

View File

@ -111,6 +111,7 @@
select id, year, type, region, region_en, excellent, good, middle, low, poor
from monitor_eqi_grading
where year = #{year}
and type = #{type}
and region = #{region}
</select>
@ -163,7 +164,8 @@
slight_rise,
significant_rise
from monitor_keqi
where region = #{region}
where type = #{type}
and region = #{region}
</select>
<select id="keqiAsiaRate" resultMap="Monitor_KEQI_Asia_Rate">
@ -192,4 +194,26 @@
from monitor_keqi_country_rate mkcr
where mkcr.country = #{country}
</select>
<select id="eqiAsiaLine" resultMap="Monitor_EQI_Asia">
select mea.id,
mea.year,
mea.region,
mea.region_en,
mea.all,
mea.forest,
mea.shrub,
mea.grass,
mea.farmland,
mea.mountain
from monitor_eqi_asia mea
where mea.region = #{region}
<if test="start != null and start != ''">
and mea.year >= #{start}
</if>
<if test="end != null and end != ''">
and #{end} >= mea.year
</if>
</select>
</mapper>