diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenPersonSyncDao.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenPersonSyncDao.java index 717b8ed..eec9713 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenPersonSyncDao.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenPersonSyncDao.java @@ -38,4 +38,10 @@ public interface TenPersonSyncDao { void removePersonSyncId(@Param("personSyncId")Long personSyncId,@Param("tenantId")Long tenantId); + List findTwo(@Param("tenantId")Long tenantId); + + List findByDeviceIdAndPersonIdTwo(@Param("deviceId")Long deviceId, @Param("personId")Long personId, @Param("tenantId")Long tenantId); + + + } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonSyncService.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonSyncService.java index 1a59ff4..dbd5223 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonSyncService.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenPersonSyncService.java @@ -38,6 +38,10 @@ public interface TenPersonSyncService { List findDeviceAllAddPersons(Long deviceId, Long tenantId); + List findTwo(Long tenantId); + + List findByDeviceIdAndPersonIdList(Long deviceId, Long personId,Long tenantId); + } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonSyncServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonSyncServiceImpl.java index 4377f7d..22b1886 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonSyncServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonSyncServiceImpl.java @@ -94,4 +94,14 @@ public class TenPersonSyncServiceImpl implements TenPersonSyncService { public List findDeviceAllAddPersons(Long deviceId, Long tenantId) { return tenPersonSyncDao.findDeviceAllAddPersons(deviceId,tenantId); } + + @Override + public List findTwo(Long tenantId) { + return tenPersonSyncDao.findTwo(tenantId); + } + + @Override + public List findByDeviceIdAndPersonIdList(Long deviceId, Long personId, Long tenantId) { + return tenPersonSyncDao.findByDeviceIdAndPersonIdTwo(deviceId, personId, tenantId); + } } diff --git a/shapelight-admin/src/main/resources/mapper/ten/TenPersonSyncDao.xml b/shapelight-admin/src/main/resources/mapper/ten/TenPersonSyncDao.xml index 534b3d2..a069ac1 100644 --- a/shapelight-admin/src/main/resources/mapper/ten/TenPersonSyncDao.xml +++ b/shapelight-admin/src/main/resources/mapper/ten/TenPersonSyncDao.xml @@ -150,6 +150,8 @@ select * from ten_person_sync_${tenantId} where device_id = #{deviceId} and person_id = #{personId} + order by last_update_time desc + limit 1 + + + +