From 9f88bd089c54f1d29a2a5827d2d5c1f98b162941 Mon Sep 17 00:00:00 2001 From: gaoben Date: Mon, 25 Sep 2023 15:24:57 +0800 Subject: [PATCH] =?UTF-8?q?v8:=E4=BF=AE=E6=94=B9=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=87=8D=E5=A4=8D=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shapelight/modules/ten/dao/TenPersonSyncDao.java | 6 ++++++ .../modules/ten/service/TenPersonSyncService.java | 4 ++++ .../ten/service/impl/TenPersonSyncServiceImpl.java | 10 ++++++++++ .../main/resources/mapper/ten/TenPersonSyncDao.xml | 12 ++++++++++++ 4 files changed, 32 insertions(+) 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 + + + +