forked from dyf/fys-Multi-tenant
Compare commits
4 Commits
a3d44a157a
...
740a638444
| Author | SHA1 | Date | |
|---|---|---|---|
| 740a638444 | |||
| cc23f082a6 | |||
| 1bc7dc676e | |||
| 5cdacad468 |
@ -262,12 +262,12 @@
|
||||
d.online_status,
|
||||
c.binding_time,
|
||||
d.create_time,
|
||||
ROW_NUMBER() OVER (PARTITION BY d.id ORDER BY c.binding_time) AS row_num
|
||||
ROW_NUMBER() OVER (PARTITION BY d.id ORDER BY d.id) AS row_num
|
||||
from device d
|
||||
inner join device_type dt on d.device_type = dt.id
|
||||
left join app_device_bind_record c on d.id = c.device_id
|
||||
left join app_personnel_info ap on ap.device_id = d.id
|
||||
where dt.communication_mode in (0, 2) ) a where a.row_num = 1
|
||||
where dt.communication_mode in (0, 2) ORDER BY (case when d.online_status = 1 then 2 else 1 end) DESC) a where a.row_num = 1
|
||||
<if test="criteria.deviceType != null">
|
||||
and a.device_type = #{criteria.deviceType}
|
||||
</if>
|
||||
@ -298,7 +298,7 @@
|
||||
<if test="criteria.onlineStatus != null">
|
||||
and a.online_status = #{criteria.onlineStatus}
|
||||
</if>
|
||||
ORDER BY (case when a.online_status = 1 then 2 else 1 end) DESC
|
||||
|
||||
</select>
|
||||
<select id="getLocationHistory" resultType="com.fuyuanshen.equipment.domain.vo.LocationHistoryVo">
|
||||
select a.id,a.device_name,a.device_type,b.type_name deviceTypeName,a.device_imei,a.device_mac from device a
|
||||
@ -478,7 +478,7 @@
|
||||
d.type_name AS deviceName,
|
||||
COUNT(*) AS frequency
|
||||
FROM device_log dl
|
||||
LEFT JOIN device d ON dl.device_id = d.id
|
||||
INNER JOIN device d ON dl.device_id = d.id
|
||||
WHERE dl.create_time >= DATE_SUB(NOW(), INTERVAL #{days} DAY)
|
||||
GROUP BY d.device_type, d.type_name
|
||||
ORDER BY frequency DESC
|
||||
|
||||
Reference in New Issue
Block a user