129 lines
5.3 KiB
XML

<?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="com.ruoyi.system.mapper_yada.PmDataMapper">
<resultMap id="year_average" type="com.ruoyi.system.domain_yada.entity.PmAverageConcentrationEntity">
<result property="id" column="id"/>
<result property="year" column="year"/>
<result property="region" column="region"/>
<result property="regionEn" column="region_en"/>
<result property="value" column="value"/>
</resultMap>
<resultMap id="change_rate" type="com.ruoyi.system.domain_yada.entity.PmChangeRateEntity">
<result property="id" column="id"/>
<result property="country" column="country"/>
<result property="countryEn" column="country_en"/>
<result property="ratio" column="ratio"/>
</resultMap>
<resultMap id="year_ratio" type="com.ruoyi.system.domain_yada.entity.PmYearConcentrationRatioEntity">
<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"/>
<result property="value" column="value"/>
</resultMap>
<resultMap id="year_five_average" type="com.ruoyi.system.domain_yada.entity.PmYearConcentrationEntity">
<result property="id" column="id"/>
<result property="year" column="year"/>
<result property="country" column="country"/>
<result property="countryEn" column="country_en"/>
<result property="ratio" column="ratio"/>
</resultMap>
<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"/>
<result property="value" column="value"/>
</resultMap>
<resultMap id="month_average" type="com.ruoyi.system.domain_yada.entity.PmMonthConcentrationEntity">
<result property="id" column="id"/>
<result property="year" column="year"/>
<result property="month" column="month"/>
<result property="monthEn" column="month_en"/>
<result property="region" column="region"/>
<result property="regionEn" column="region_en"/>
<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
where region = #{region}
</select>
<select id="changRate" resultMap="change_rate">
select id, country, country_en, ratio
from pm_five_country_pm_change_rate
</select>
<select id="yearRatio" resultMap="year_ratio">
select pm.id, pm.year, pm.region, pm.region_en, pm.level, pm.value
from pm_year_concentration_ratio pm
where pm.year = #{year}
and pm.region = #{region}
</select>
<select id="average" resultMap="year_five_average">
select id, year, country, country_en, ratio
from pm_five_country_year_concentration
where year = #{year}
</select>
<select id="changeRateRatio" resultMap="change_rate_ratio">
select id, year, region, region_en, level, value
from pm_change_rate_ratio
where year = #{year}
and region = #{region}
</select>
<select id="monthAverage" resultMap="month_average">
select id, year, month, month_en, region, region_en, value
from pm_month_average_concentration
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>