fix: 申报可用时间按东八区判断,写入时显式使用北京时间

避免容器 JVM/库会话仍为 UTC 时 createTime 偏 8 小时,以及 usable 查询把刚开放的申报滤掉。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-25 12:19:56 +08:00
parent 0a2801850d
commit 5626cdd679
3 changed files with 20 additions and 3 deletions
@@ -52,8 +52,10 @@
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.usable != null">
AND a.start_time &lt;= now() AND a.end_time &gt;= now()
<!-- start/end 存的是北京时间字符串;库会话若为 UTC,直接 now() 会把「刚开始」的申报滤掉 -->
<if test="param.usable != null and param.usable == true">
AND a.start_time &lt;= DATE_FORMAT(CONVERT_TZ(UTC_TIMESTAMP(), '+00:00', '+08:00'), '%Y-%m-%d %H:%i:%s')
AND a.end_time &gt;= DATE_FORMAT(CONVERT_TZ(UTC_TIMESTAMP(), '+00:00', '+08:00'), '%Y-%m-%d %H:%i:%s')
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}