|
|
|
@ -4,13 +4,13 @@
|
|
|
|
|
<mapper namespace="com.ruoyi.tdengine.mapper.DeviceStatusMapper">
|
|
|
|
|
|
|
|
|
|
<select id="getOnlineDevicesGroupByDay" parameterType="com.ruoyi.tdengine.api.domain.DeviceStatus" resultType="com.ruoyi.tdengine.api.domain.DeviceStatus" >
|
|
|
|
|
select timetruncate(ts,1d) ts,devicetype,onlinestatus,devicecode from #{params.databaseName}.#{params.superTableName}
|
|
|
|
|
select timetruncate(ts,1d) ts,devicetype,onlinestatus,deviceid from #{params.databaseName}.#{params.superTableName}
|
|
|
|
|
where onlinestatus=1
|
|
|
|
|
<if test="{params.beginTime}!= null and {params.endTime} != null">
|
|
|
|
|
and ts BETWEEN #{params.beginTime} AND #{params.endTime}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="sceneId != null "> and scene_id = #{sceneId}</if>
|
|
|
|
|
group by timetruncate(ts,1d),devicetype,onlinestatus,devicecode
|
|
|
|
|
group by timetruncate(ts,1d),devicetype,onlinestatus,deviceid
|
|
|
|
|
order by ts
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|