温度监测

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