mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 08:55:53 +08:00
设备统计接口
This commit is contained in:
@@ -53,6 +53,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectDeviceLogVo"/>
|
||||
where log_id = #{logId}
|
||||
</select>
|
||||
|
||||
<select id="selectCategoryLogCount" parameterType="Long" resultType="com.ruoyi.iot.model.DeviceStatistic">
|
||||
SELECT
|
||||
(select count(log_id) from iot_device_log where log_type=1) as propertyCount,
|
||||
(select count(log_id) from iot_device_log where log_type=2) as functionCount,
|
||||
(select count(log_id) from iot_device_log where log_type=3) as eventCount,
|
||||
(select count(log_id) from iot_device_log where log_type=1 and is_monitor=1) as monitorCount
|
||||
from iot_device_log
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDeviceLog" parameterType="com.ruoyi.iot.domain.DeviceLog" useGeneratedKeys="true" keyProperty="logId">
|
||||
insert into iot_device_log
|
||||
|
||||
@@ -192,6 +192,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where device_id = #{deviceId}
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceProductAlertCount" resultType="com.ruoyi.iot.model.DeviceStatistic">
|
||||
SELECT count(device_id) as deviceCount,
|
||||
(select count(product_id) from iot_product) as productCount,
|
||||
(select count(alert_log_id) from iot_alert_log) as alertCount
|
||||
from iot_device
|
||||
</select>
|
||||
|
||||
<select id="selectProductAuthenticate" parameterType="com.ruoyi.iot.model.AuthenticateInputModel" resultMap="DeviceAuthenticateResult">
|
||||
SELECT p.mqtt_password,p.mqtt_account, p.mqtt_secret,p.is_authorize,p.product_id,p.product_name,p.vertificate_method,p.STATUS as product_status,d.device_id,d.device_name,d.STATUS,d.serial_number
|
||||
FROM iot_product p
|
||||
|
||||
Reference in New Issue
Block a user