36 lines
1.7 KiB
XML
36 lines
1.7 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.GridIndexPaiValueMapper">
|
||
|
|
||
|
<sql id="pai">
|
||
|
SELECT
|
||
|
t1.id,index_value as indexValue, t1.time_range AS timeRange,t3.irrigate_name as address,t3.id as siteName,
|
||
|
t3.lon,t3.lat,t1.time_type as timeType
|
||
|
FROM
|
||
|
grid_index_pai_value_primary t1
|
||
|
LEFT JOIN grid_setting t2 on t1.grid_setting_id = t2.id
|
||
|
LEFT JOIN hq_point t3 on t2.grid_id = t3.grid_id
|
||
|
WHERE t3.grid_id is not null and t1.time_type = #{timeType}
|
||
|
and #{endDate} >= index_date and index_date >= #{startDate}
|
||
|
</sql>
|
||
|
<select id="paiDrought" resultType="com.fourfaith.iot.drought.pojo.vo.MeteorologicDroughtVO">
|
||
|
<include refid="pai"/>
|
||
|
</select>
|
||
|
<select id="exportPaiDrought" resultType="com.fourfaith.iot.drought.pojo.vo.MeteorologicDroughtVO">
|
||
|
<include refid="pai"/>
|
||
|
order by index_date desc
|
||
|
</select>
|
||
|
<select id="gridPai" resultType="com.fourfaith.iot.drought.pojo.vo.HeatMapPoint">
|
||
|
SELECT
|
||
|
t1.id,index_value as indexValue,
|
||
|
t3.lon,t3.lat,t1.time_type as timeType,t3.irrigate_name as address,t3.id as hqPointId,t4.area
|
||
|
FROM
|
||
|
grid_index_pai_value_primary t1
|
||
|
LEFT JOIN grid_setting t2 on t1.grid_setting_id = t2.id
|
||
|
LEFT JOIN hq_point t3 on t2.grid_id = t3.grid_id
|
||
|
LEFT JOIN hq_generate_grid t4 on t3.id = t4.hq_point_id
|
||
|
WHERE t3.grid_id is not null and t1.time_type = #{timeType}
|
||
|
and #{endDate} = index_date
|
||
|
</select>
|
||
|
</mapper>
|