|
|
@@ -35,11 +35,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <!--
|
|
|
+ tm 为 TIMESTAMPTZ,插入时已按各自来源时区归一化为 UTC 时刻存储,
|
|
|
+ 因此与 startTime/endTime(unix秒,绝对时刻)直接按时刻比较即可,
|
|
|
+ 不依赖任何固定时区(如 GMT+8)。to_timestamp(double precision) 以
|
|
|
+ UTC 为基准,与会话时区无关。
|
|
|
+ -->
|
|
|
<select id="selectDataWeatherLocalListByTimeRange" resultMap="DataWeatherLocalResult">
|
|
|
<include refid="selectDataWeatherLocalVo"/>
|
|
|
where config_station_id = #{stationId}
|
|
|
- and (tm at time zone 'Asia/Shanghai') >= (to_timestamp(#{startTime}::double precision) at time zone 'Asia/Shanghai')
|
|
|
- and (tm at time zone 'Asia/Shanghai') <= (to_timestamp(#{endTime}::double precision) at time zone 'Asia/Shanghai')
|
|
|
+ and tm >= to_timestamp(#{startTime})
|
|
|
+ and tm <= to_timestamp(#{endTime})
|
|
|
order by tm asc
|
|
|
</select>
|
|
|
|