diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/PmDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/PmDataController.java index b382c2956..df61ca3b0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/PmDataController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/PmDataController.java @@ -56,8 +56,9 @@ public class PmDataController { @RequestMapping(value = "/ChangeRateRatio", method = {RequestMethod.GET}) @ApiOperation(value = "2016-2020年PM2.5年平均浓度变化率占比", httpMethod = "GET") - public AjaxResult changeRateRatio(@RequestParam(value = "region") String region) { - List pmYearConcentrationRatioVos = pmDataService.changeRateRatio(region); + public AjaxResult changeRateRatio(@RequestParam(value = "year") String year, + @RequestParam(value = "region") String region) { + List pmYearConcentrationRatioVos = pmDataService.changeRateRatio(year,region); return AjaxResult.success(pmYearConcentrationRatioVos); } @@ -68,4 +69,20 @@ public class PmDataController { PmKeyValueEnVo pmKeyValueEnVo = pmDataService.monthAverage(year, region); return AjaxResult.success(pmKeyValueEnVo); } + + @RequestMapping(value = "/ProvinceAverage", method = {RequestMethod.GET}) + @ApiOperation(value = "各省PM2.5平均浓度", httpMethod = "GET") + public AjaxResult provinceAverage(@RequestParam(value = "year") String year, + @RequestParam(value = "country") String country) { + PmKeyValueEnVo pmKeyValueEnVo = pmDataService.provinceAverage(year, country); + return AjaxResult.success(pmKeyValueEnVo); + } + + @RequestMapping(value = "/ProvinceChangeRate", method = {RequestMethod.GET}) + @ApiOperation(value = "各省PM2.5年之间变化", httpMethod = "GET") + public AjaxResult provinceChangeRate(@RequestParam(value = "year") String year, + @RequestParam(value = "country") String country) { + PmKeyValueEnVo pmKeyValueEnVo = pmDataService.provinceChangeRate(year, country); + return AjaxResult.success(pmKeyValueEnVo); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/MonitorKEQIAsiaRateEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/MonitorKEQIAsiaRateEntity.java index 6faa1f256..6a05d3b5e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/MonitorKEQIAsiaRateEntity.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/MonitorKEQIAsiaRateEntity.java @@ -186,6 +186,7 @@ public class MonitorKEQIAsiaRateEntity { 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 + "}"; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmChangeRateRatioEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmChangeRateRatioEntity.java index df65550a8..26829d0fa 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmChangeRateRatioEntity.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmChangeRateRatioEntity.java @@ -7,6 +7,8 @@ package com.ruoyi.system.domain_yada.entity; public class PmChangeRateRatioEntity { private Integer id; + private String year; + private String region; private String regionEn; @@ -19,8 +21,9 @@ public class PmChangeRateRatioEntity { public PmChangeRateRatioEntity() { } - public PmChangeRateRatioEntity(Integer id, String region, String regionEn, String level, Double value) { + public PmChangeRateRatioEntity(Integer id, String year, String region, String regionEn, String level, Double value) { this.id = id; + this.year = year; this.region = region; this.regionEn = regionEn; this.level = level; @@ -43,6 +46,22 @@ public class PmChangeRateRatioEntity { this.id = id; } + /** + * 获取 + * @return year + */ + public String getYear() { + return year; + } + + /** + * 设置 + * @param year + */ + public void setYear(String year) { + this.year = year; + } + /** * 获取 * @return region @@ -109,6 +128,6 @@ public class PmChangeRateRatioEntity { @Override public String toString() { - return "PmChangeRateRatioEntity{id = " + id + ", region = " + region + ", regionEn = " + regionEn + ", level = " + level + ", value = " + value + "}"; + return "PmChangeRateRatioEntity{id = " + id + ", year = " + year + ", region = " + region + ", regionEn = " + regionEn + ", level = " + level + ", value = " + value + "}"; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmMonthConcentrationEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmMonthConcentrationEntity.java index bf69bf72b..b2e3244a2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmMonthConcentrationEntity.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmMonthConcentrationEntity.java @@ -145,6 +145,7 @@ public class PmMonthConcentrationEntity { this.value = value; } + @Override public String toString() { return "PmMonthConcentrationEntity{id = " + id + ", year = " + year + ", month = " + month + ", monthEn = " + monthEn + ", region = " + region + ", regionEn = " + regionEn + ", value = " + value + "}"; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmProvinceChangeRateEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmProvinceChangeRateEntity.java new file mode 100644 index 000000000..cedd31435 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmProvinceChangeRateEntity.java @@ -0,0 +1,128 @@ +package com.ruoyi.system.domain_yada.entity; + +/** + * 各省PM2.5年平均浓度 + * @author Mr.C + */ +public class PmProvinceChangeRateEntity { + private Integer id; + private String year; + private String country; + private String province; + private String provinceEn; + private Double rate; + + + public PmProvinceChangeRateEntity() { + } + + public PmProvinceChangeRateEntity(Integer id, String year, String country, String province, String provinceEn, Double rate) { + this.id = id; + this.year = year; + this.country = country; + this.province = province; + this.provinceEn = provinceEn; + this.rate = rate; + } + + /** + * 获取 + * @return id + */ + public Integer getId() { + return id; + } + + /** + * 设置 + * @param id + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * 获取 + * @return year + */ + public String getYear() { + return year; + } + + /** + * 设置 + * @param year + */ + public void setYear(String year) { + this.year = year; + } + + /** + * 获取 + * @return country + */ + public String getCountry() { + return country; + } + + /** + * 设置 + * @param country + */ + public void setCountry(String country) { + this.country = country; + } + + /** + * 获取 + * @return province + */ + public String getProvince() { + return province; + } + + /** + * 设置 + * @param province + */ + public void setProvince(String province) { + this.province = province; + } + + /** + * 获取 + * @return provinceEn + */ + public String getProvinceEn() { + return provinceEn; + } + + /** + * 设置 + * @param provinceEn + */ + public void setProvinceEn(String provinceEn) { + this.provinceEn = provinceEn; + } + + /** + * 获取 + * @return rate + */ + public Double getRate() { + return rate; + } + + /** + * 设置 + * @param rate + */ + public void setRate(Double rate) { + this.rate = rate; + } + + @Override + public String toString() { + return "PmProvinceChangeRateEntity{id = " + id + ", year = " + year + ", country = " + country + ", province = " + province + ", provinceEn = " + provinceEn + ", rate = " + rate + "}"; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmYearAverageProvinceConcentrationEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmYearAverageProvinceConcentrationEntity.java new file mode 100644 index 000000000..86a1d4639 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/PmYearAverageProvinceConcentrationEntity.java @@ -0,0 +1,128 @@ +package com.ruoyi.system.domain_yada.entity; + +/** + * 各省PM2.5年平均浓度 + * @author Mr.C + */ +public class PmYearAverageProvinceConcentrationEntity { + private Integer id; + private String year; + private String country; + private String province; + private String provinceEn; + private Double value; + + + public PmYearAverageProvinceConcentrationEntity() { + } + + public PmYearAverageProvinceConcentrationEntity(Integer id, String year, String country, String province, String provinceEn, Double value) { + this.id = id; + this.year = year; + this.country = country; + this.province = province; + this.provinceEn = provinceEn; + this.value = value; + } + + /** + * 获取 + * @return id + */ + public Integer getId() { + return id; + } + + /** + * 设置 + * @param id + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * 获取 + * @return year + */ + public String getYear() { + return year; + } + + /** + * 设置 + * @param year + */ + public void setYear(String year) { + this.year = year; + } + + /** + * 获取 + * @return country + */ + public String getCountry() { + return country; + } + + /** + * 设置 + * @param country + */ + public void setCountry(String country) { + this.country = country; + } + + /** + * 获取 + * @return province + */ + public String getProvince() { + return province; + } + + /** + * 设置 + * @param province + */ + public void setProvince(String province) { + this.province = province; + } + + /** + * 获取 + * @return provinceEn + */ + public String getProvinceEn() { + return provinceEn; + } + + /** + * 设置 + * @param provinceEn + */ + public void setProvinceEn(String provinceEn) { + this.provinceEn = provinceEn; + } + + /** + * 获取 + * @return value + */ + public Double getValue() { + return value; + } + + /** + * 设置 + * @param value + */ + public void setValue(Double value) { + this.value = value; + } + + @Override + public String toString() { + return "PmYearAverageProvinceConcentrationEntity{id = " + id + ", year = " + year + ", country = " + country + ", province = " + province + ", provinceEn = " + provinceEn + ", value = " + value + "}"; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneLineVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneLineVo.java index dd53aeb3c..1d91e7045 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneLineVo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneLineVo.java @@ -50,6 +50,7 @@ public class ESNOImpactSubzoneLineVo { this.vai = vai; } + @Override public String toString() { return "ESNOImpactSubzoneLineVo{year = " + year + ", vai = " + vai + "}"; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneVo.java index a089544f2..f1a0e1998 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneVo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneVo.java @@ -104,6 +104,7 @@ public class ESNOImpactSubzoneVo { this.obviouslyWorse = obviouslyWorse; } + @Override public String toString() { return "ESNOImpactSubzoneVo{obviouslyBetter = " + obviouslyBetter + ", slightlyBetter = " + slightlyBetter + ", unchanged = " + unchanged + ", slightlyWorse = " + slightlyWorse + ", obviouslyWorse = " + obviouslyWorse + "}"; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ForestProvinceChangeVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ForestProvinceChangeVo.java index 9cae4498e..ff5a81c2c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ForestProvinceChangeVo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ForestProvinceChangeVo.java @@ -88,6 +88,7 @@ public class ForestProvinceChangeVo { this.percentageLoss = percentageLoss; } + @Override public String toString() { return "ForestProvinceChangeVo{province = " + province + ", provinceEn = " + provinceEn + ", percentageGain = " + percentageGain + ", percentageLoss = " + percentageLoss + "}"; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ForestDetectionMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ForestDetectionMapper.java index 6595e44f5..1fbc68481 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ForestDetectionMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ForestDetectionMapper.java @@ -6,6 +6,7 @@ import com.ruoyi.system.domain_yada.TypeConversion; import com.ruoyi.system.domain_yada.TypeTable; import com.ruoyi.system.domain_yada.entity.ForestProvinceChangeEntity; import com.ruoyi.system.domain_yada.entity.ForestProvinceCoverageEntity; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -14,6 +15,7 @@ import java.util.List; * @Author: JinSheng Song * @Date: 2022/9/9 13:54 */ +@Mapper public interface ForestDetectionMapper { List selectType(@Param("year1") String year1); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/PmDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/PmDataMapper.java index 0ba61633d..6bb09024e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/PmDataMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/PmDataMapper.java @@ -12,6 +12,7 @@ public interface PmDataMapper { /** * pm2.5年平均浓度 + * * @param region * @return */ @@ -19,13 +20,15 @@ public interface PmDataMapper { /** * 2016-2020年澜湄5国PM2.5年平均浓度变化率 + * * @return */ List changRate(); /** * PM2.5年平均浓度占比 - * @param year 年份 + * + * @param year 年份 * @param region 地区 * @return */ @@ -34,6 +37,7 @@ public interface PmDataMapper { /** * 澜湄5国PM2.5年平均浓度 + * * @param year 年份 * @return */ @@ -41,17 +45,39 @@ public interface PmDataMapper { /** * 2016-2020年PM2.5年平均浓度变化率占比 + * * @param region 地区 * @return */ - List changeRateRatio(@Param("region") String region); + List changeRateRatio(@Param("year") String year, + @Param("region") String region); /** * PM2.5月平均浓度 - * @param year 年份 + * + * @param year 年份 * @param region 地区 * @return */ - List monthAverage(@Param("year") String year, - @Param("region") String region); + List monthAverage(@Param("year") String year, + @Param("region") String region); + + /** + * 各省PM2.5年平均浓度 + * + * @param year + * @param country + * @return + */ + List provinceAverage(@Param("year") String year, + @Param("country") String country); + + /** + * 各省PM2.5年之间浓度变化 + * @param year + * @param country + * @return + */ + List provinceChangeRate(@Param("year") String year, + @Param("country") String country); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/IForestDetectionService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/IForestDetectionService.java index 87392d373..d73c27a3e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/IForestDetectionService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/IForestDetectionService.java @@ -14,6 +14,7 @@ import java.util.List; * @Author: JinSheng Song * @Date: 2022/9/9 13:52 */ + public interface IForestDetectionService { List selectType(@Param("year1") String year1); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/PmDataService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/PmDataService.java index 4a33b28ab..008d192eb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/PmDataService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/PmDataService.java @@ -44,7 +44,7 @@ public interface PmDataService { * @param region 地区 * @return */ - List changeRateRatio(String region); + List changeRateRatio(String year,String region); /** * PM2.5月平均浓度 @@ -53,4 +53,20 @@ public interface PmDataService { * @return */ PmKeyValueEnVo monthAverage(String year,String region); + + /** + * 各省PM2.5平均浓度 + * @param year + * @param country + * @return + */ + PmKeyValueEnVo provinceAverage(String year,String country); + + /** + * 各省PM2.5年之间浓度变化 + * @param year + * @param country + * @return + */ + PmKeyValueEnVo provinceChangeRate(String year,String country); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/PmDataImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/PmDataImpl.java index 962d7441b..b7cb1db8d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/PmDataImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/PmDataImpl.java @@ -75,8 +75,8 @@ public class PmDataImpl implements PmDataService { } @Override - public List changeRateRatio(String region) { - List list = pmDataMapper.changeRateRatio(region); + public List changeRateRatio(String year,String region) { + List list = pmDataMapper.changeRateRatio(year,region); List lists = new ArrayList<>(); list.forEach(v->{ PmYearConcentrationRatioVo vo = new PmYearConcentrationRatioVo(v.getRegion(),v.getRegionEn(), v.getLevel(), v.getValue()); @@ -100,4 +100,34 @@ public class PmDataImpl implements PmDataService { }); return new PmKeyValueEnVo(key,keyEn,value); } + + @Override + public PmKeyValueEnVo provinceAverage(String year, String country) { + List list = pmDataMapper.provinceAverage(year, country); + List key = new ArrayList<>(); + List keyEn = new ArrayList<>(); + List value = new ArrayList<>(); + list.forEach(v->{ + key.add(v.getProvince()); + keyEn.add(v.getProvinceEn()); + value.add(v.getValue()); + }); + return new PmKeyValueEnVo(key,keyEn,value); + } + + @Override + public PmKeyValueEnVo provinceChangeRate(String year, String country) { + List list = pmDataMapper.provinceChangeRate(year, country); + List key = new ArrayList<>(); + List keyEn = new ArrayList<>(); + List value = new ArrayList<>(); + list.forEach(v->{ + key.add(v.getProvince()); + keyEn.add(v.getProvinceEn()); + value.add(v.getRate()); + }); + return new PmKeyValueEnVo(key,keyEn,value); + } + + } diff --git a/ruoyi-system/src/main/resources/mapper/system/PmDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/PmDataMapper.xml index 9e42ab3e8..fbab07aa1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/PmDataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/PmDataMapper.xml @@ -37,6 +37,7 @@ + @@ -53,6 +54,26 @@ + + + + + + + + + + + + + + + + + + + + + +