diff --git a/fys-modules/fys-equipment/src/main/resources/mapper/equipment/DeviceMapper.xml b/fys-modules/fys-equipment/src/main/resources/mapper/equipment/DeviceMapper.xml index 3879beab..ed240a50 100644 --- a/fys-modules/fys-equipment/src/main/resources/mapper/equipment/DeviceMapper.xml +++ b/fys-modules/fys-equipment/src/main/resources/mapper/equipment/DeviceMapper.xml @@ -259,12 +259,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 and a.device_type = #{criteria.deviceType} @@ -295,7 +295,7 @@ and a.online_status = #{criteria.onlineStatus} - ORDER BY (case when a.online_status = 1 then 2 else 1 end) DESC +