// 根据时间获取一小时数据
SELECT
*
FROM
t_fylighting
where
to_days(currentTime)=to_days(#{time})
and
type=#{type}
and
hour(currentTime)=hour(#{time})
//获取一天内小时数据
select
any_value(currentTime)currentTime
from
t_fylighting
where
to_days(currentTime)=to_days(#{time})
and
type=#{type}
group by
currentTime
//每6小时数据
SELECT
any_value (filePath) filePath
FROM
t_fylighting
where
to_days(currentTime)=to_days(#{time})
and
<![CDATA[ TRUNCATE(hour(currentTime)/6,0)=TRUNCATE(hour(#{time})/6,0)]]>
and
type=#{type}
//获取当天6小时时间list
SELECT
any_value (currentTime) currentTime
FROM
t_fylighting
where
to_days(currentTime)=to_days(#{time})
and
type=#{type}
GROUP BY
<![CDATA[ TRUNCATE(hour(currentTime)/6,0)]]>
mybati时间
最新推荐文章于 2023-07-26 21:42:57 发布