温度监测

This commit is contained in:
曹磊 2024-12-16 15:05:50 +08:00
parent dc421bf1ca
commit 4098ffa793
1 changed files with 11 additions and 6 deletions

View File

@ -20,21 +20,26 @@
create_time
FROM
${tableName}
WHERE
code = '867896071477072'
<where>
<if test="code != null and code != ''">
AND code = #{code}
</if>
</where>
ORDER BY
report_time DESC
LIMIT 1
</select>
<select id="findList" resultType="org.jeecg.modules.temperature.entity.Temperature">
SELECT
SELECT code,
max(room_temp) as roomTemp,
DATE_FORMAT(report_time, '%H') reportHour,
concat(DATE_FORMAT(now(), '%Y-%m-%d %H'),':00') reportTime
FROM ${tableName}
<where>
code = '867896071477072'
<if test="code != null and code != ''">
AND code = #{code}
</if>
<if test="SDate != null and SDate != ''">
AND report_time >= #{SDate}
</if>
@ -42,8 +47,8 @@
AND report_time &lt;#{EDate}
</if>
</where>
group by reportTime,reportHour
ORDER BY reportTime asc
group by reportTime,reportHour,code
ORDER BY reportHour asc,code asc
</select>
</mapper>