大气质量监测模块修改

This commit is contained in:
machao 2023-02-27 11:59:15 +08:00
parent d27dad982b
commit 41ad8eebc3
15 changed files with 422 additions and 14 deletions

View File

@ -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<PmYearConcentrationRatioVo> pmYearConcentrationRatioVos = pmDataService.changeRateRatio(region);
public AjaxResult changeRateRatio(@RequestParam(value = "year") String year,
@RequestParam(value = "region") String region) {
List<PmYearConcentrationRatioVo> 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);
}
}

View File

@ -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 + "}";
}

View File

@ -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 + "}";
}
}

View File

@ -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 + "}";
}

View File

@ -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 + "}";
}
}

View File

@ -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 + "}";
}
}

View File

@ -50,6 +50,7 @@ public class ESNOImpactSubzoneLineVo {
this.vai = vai;
}
@Override
public String toString() {
return "ESNOImpactSubzoneLineVo{year = " + year + ", vai = " + vai + "}";
}

View File

@ -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 + "}";
}

View File

@ -88,6 +88,7 @@ public class ForestProvinceChangeVo {
this.percentageLoss = percentageLoss;
}
@Override
public String toString() {
return "ForestProvinceChangeVo{province = " + province + ", provinceEn = " + provinceEn + ", percentageGain = " + percentageGain + ", percentageLoss = " + percentageLoss + "}";
}

View File

@ -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<TypeTable> selectType(@Param("year1") String year1);

View File

@ -12,6 +12,7 @@ public interface PmDataMapper {
/**
* pm2.5年平均浓度
*
* @param region
* @return
*/
@ -19,12 +20,14 @@ public interface PmDataMapper {
/**
* 2016-2020年澜湄5国PM2.5年平均浓度变化率
*
* @return
*/
List<PmChangeRateEntity> changRate();
/**
* PM2.5年平均浓度占比
*
* @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<PmChangeRateRatioEntity> changeRateRatio(@Param("region") String region);
List<PmChangeRateRatioEntity> changeRateRatio(@Param("year") String year,
@Param("region") String region);
/**
* PM2.5月平均浓度
*
* @param year 年份
* @param region 地区
* @return
*/
List<PmMonthConcentrationEntity> monthAverage(@Param("year") String year,
@Param("region") String region);
/**
* 各省PM2.5年平均浓度
*
* @param year
* @param country
* @return
*/
List<PmYearAverageProvinceConcentrationEntity> provinceAverage(@Param("year") String year,
@Param("country") String country);
/**
* 各省PM2.5年之间浓度变化
* @param year
* @param country
* @return
*/
List<PmProvinceChangeRateEntity> provinceChangeRate(@Param("year") String year,
@Param("country") String country);
}

View File

@ -14,6 +14,7 @@ import java.util.List;
* @Author: JinSheng Song
* @Date: 2022/9/9 13:52
*/
public interface IForestDetectionService {
List<TypeTable> selectType(@Param("year1") String year1);

View File

@ -44,7 +44,7 @@ public interface PmDataService {
* @param region 地区
* @return
*/
List<PmYearConcentrationRatioVo> changeRateRatio(String region);
List<PmYearConcentrationRatioVo> 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);
}

View File

@ -75,8 +75,8 @@ public class PmDataImpl implements PmDataService {
}
@Override
public List<PmYearConcentrationRatioVo> changeRateRatio(String region) {
List<PmChangeRateRatioEntity> list = pmDataMapper.changeRateRatio(region);
public List<PmYearConcentrationRatioVo> changeRateRatio(String year,String region) {
List<PmChangeRateRatioEntity> list = pmDataMapper.changeRateRatio(year,region);
List<PmYearConcentrationRatioVo> 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<PmYearAverageProvinceConcentrationEntity> list = pmDataMapper.provinceAverage(year, country);
List<String> key = new ArrayList<>();
List<String> keyEn = new ArrayList<>();
List<Double> 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<PmProvinceChangeRateEntity> list = pmDataMapper.provinceChangeRate(year, country);
List<String> key = new ArrayList<>();
List<String> keyEn = new ArrayList<>();
List<Double> value = new ArrayList<>();
list.forEach(v->{
key.add(v.getProvince());
keyEn.add(v.getProvinceEn());
value.add(v.getRate());
});
return new PmKeyValueEnVo(key,keyEn,value);
}
}

View File

@ -37,6 +37,7 @@
<resultMap id="change_rate_ratio" type="com.ruoyi.system.domain_yada.entity.PmChangeRateRatioEntity">
<result property="id" column="id"/>
<result property="year" column="year"/>
<result property="region" column="region"/>
<result property="regionEn" column="region_en"/>
<result property="level" column="level"/>
@ -53,6 +54,26 @@
<result property="value" column="value"/>
</resultMap>
<resultMap id="province_average"
type="com.ruoyi.system.domain_yada.entity.PmYearAverageProvinceConcentrationEntity">
<result property="id" column="id"/>
<result property="year" column="year"/>
<result property="country" column="country"/>
<result property="province" column="province"/>
<result property="provinceEn" column="province_en"/>
<result property="value" column="value"/>
</resultMap>
<resultMap id="province_change_rate"
type="com.ruoyi.system.domain_yada.entity.PmProvinceChangeRateEntity">
<result property="id" column="id"/>
<result property="year" column="year"/>
<result property="country" column="country"/>
<result property="province" column="province"/>
<result property="provinceEn" column="province_en"/>
<result property="rate" column="rate"/>
</resultMap>
<select id="findByRegion" resultMap="year_average">
select id, year, region, region_en, value
from pm_year_average_concentration
@ -78,9 +99,10 @@
</select>
<select id="changeRateRatio" resultMap="change_rate_ratio">
select id, region, region_en, level, value
select id, year, region, region_en, level, value
from pm_change_rate_ratio
where region = #{region}
where year = #{year}
and region = #{region}
</select>
<select id="monthAverage" resultMap="month_average">
@ -89,4 +111,18 @@
where year = #{year}
and region = #{region}
</select>
<select id="provinceAverage" resultMap="province_average">
select id, year, country, province, province_en, cast (value as decimal (10, 2)) as value
from pm_year_province_average_concentration
where year = #{year}
and country = #{country}
</select>
<select id="provinceChangeRate" resultMap="province_change_rate">
select id, year, country, province, province_en, cast (rate as decimal (10, 2)) as rate
from pm_province_change_rate
where year = #{year}
and country = #{country}
</select>
</mapper>