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}