查询每个站点最新时间数据,按区域查询或全部查询
思路:按时间倒叙排列,再按站点分组,
select
<column1>, <column2>, ..
from (
select distinct
<column1>, <column2>,..
from <table>
where 1=1
<if test=" addvcd != null and addvcd != '' ">
and addvcd = #{addvcd}
</if>
order by <time> desc
) r
group by r.stnm