4x/irrigation-drought-predicti.../irrigation-drought-predicti.../target/classes/mapper/hydro/WaterCapacityIndexMapper.xml

40 lines
1.5 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.fourfaith.iot.drought.mapper.WaterCapacityIndexMapper">
<sql id="hydro">
SELECT
t1.id,
t1.lon,
t1.lat,
t1.reservoir_name AS siteName,
t1.reservoir_name AS address,
t2.index_value AS indexValue,
t2.yoy_value AS youValue,
t2.mom_value AS monValue,
t2.avg_value AS avgValue,
t2.mom,
t2.yoy,
t2.anomaly_value AS anomalyValue,
t2.index_date AS timeRange
FROM
reservoir_info t1
LEFT JOIN water_capacity_index t2 ON t1.id = t2.reservoir_id
WHERE t2.id is not null and t2.index_type = #{indexType}
and #{endDate} >= index_date and index_date >= #{startDate}
</sql>
<select id="capacityDrought" resultType="com.fourfaith.iot.drought.pojo.vo.HydroLogicDroughtVO">
<include refid="hydro"></include>
</select>
<select id="exportCapacityDrought" resultType="com.fourfaith.iot.drought.pojo.vo.HydroLogicDroughtVO">
<include refid="hydro"></include>
order by t2.index_date desc
</select>
<select id="analyse" resultType="com.fourfaith.iot.drought.pojo.vo.HydroLogicDroughtVO">
<include refid="hydro"></include>
order by t2.index_date asc
</select>
</mapper>