4x/irrigation-drought-predicti.../irrigation-drought-predicti.../target/classes/mapper/moi/MoistureIndexMapper.xml

47 lines
1.8 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.MoistureIndexMapper">
<sql id="moi">
SELECT
t1.id,
t2.point_name as siteName,
t2.irrigate_name as address,
t1.index_date as timeRange,
t1.surface_index_value as surfaceIndexValue,
t1.surface_index as surfaceIndex,
t1.ten_index_value as tenIndexValue,
t1.ten_index as tenIndex,
t1.twenty_index_value as twentyIndexValue,
t1.twenty_index as twentyIndex,
t1.thirty_index_value as thirtyIndexValue,
t1.thirty_index as thirtyIndex,
t1.forty_index_value as fortyIndexValue,
t1.forty_index as fortyIndex,
t1.avg_index_value as avgIndexValue,
t1.avg_index as avgIndex
FROM
moisture_index t1
left join moisture_info t2 on t1.moisture_id = t2.id
WHERE #{endDate} >= index_date and index_date >= #{startDate}
</sql>
<select id="moiDrought" resultType="com.fourfaith.iot.drought.pojo.vo.MoistureDroughtVO">
<include refid="moi"></include>
</select>
<select id="exportMoiDrought" resultType="com.fourfaith.iot.drought.pojo.vo.MoistureDroughtVO">
<include refid="moi"></include>
</select>
<select id="grid" resultType="com.fourfaith.iot.drought.pojo.vo.HeatMapPoint">
SELECT
t2.lon,
t2.lat,
t1.avg_index as indexValue,
t2.id as hqPointId
FROM
moisture_index t1
LEFT JOIN hq_point t2 on t1.moisture_id = t2.trsq_id
WHERE #{endDate} = index_date
</select>
</mapper>