@ -30,19 +30,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * from ${tableName}
<where>
<iftest="sensorId != null and sensorId != ''">and sensorId = #{sensorId}</if>
<iftest="params.beginCollectTime != null and params.endCollectTime != null ">and collectTime between #{params.beginCollectTime} and #{params.endCollectTime}
<iftest="params.beginCollectTime != null and params.endCollectTime != null ">and collectTime between
#{params.beginCollectTime} and #{params.endCollectTime}
select t1.sensorId,t2.Sensor_Name as sensorName,t1.value,DATE_FORMAT(t1.collectTime,'%Y-%m-%d %H:%i') as collectTime
select t1.sensorId,t2.Sensor_Name as sensorName,t1.value,DATE_FORMAT(t1.collectTime,'%Y-%m-%d %H:%i') as
collectTime
from record_temperature t1
left join base_sensor_info t2 on t1.sensorId = t2.Sensor_Id
<where>
<iftest="sensorId != null and sensorId != ''">and t1.sensorId = #{sensorId}</if>
<iftest="params.beginCollectTime != null and params.endCollectTime != null ">and t1.collectTime between #{params.beginCollectTime} and #{params.endCollectTime}
<iftest="params.beginCollectTime != null and params.endCollectTime != null ">and t1.collectTime between
#{params.beginCollectTime} and #{params.endCollectTime}
</if>
</where>
group by DATE_FORMAT(t1.collectTime,'%Y-%m-%d %H:%i')