From 95eb94f88544e60010a060b20277ed6b033e07f8 Mon Sep 17 00:00:00 2001 From: yitonglei Date: Tue, 2 Aug 2022 09:23:13 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81=E5=87=BA=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E8=AE=BE=E6=96=BD-=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E8=B5=84=E6=BA=90=EF=BC=8C=E7=82=B9=E5=87=BB=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E6=A0=91=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E6=98=AFsql=E8=AF=AD=E5=8F=A5=E5=8E=BB?= =?UTF-8?q?=E7=BB=84=E7=BB=87cache=E8=A1=A8=E4=B8=AD=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/monitor/mapper/CameraOrgenizationMapper.java | 4 +++- .../io/renren/modules/monitor/service/MonitorService.java | 2 +- .../resources/mapper/monitor/CameraOrganizationMapper.xml | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraOrgenizationMapper.java b/renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraOrgenizationMapper.java index 32ecc0d6..d5b05df0 100644 --- a/renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraOrgenizationMapper.java +++ b/renren-admin/src/main/java/io/renren/modules/monitor/mapper/CameraOrgenizationMapper.java @@ -25,9 +25,11 @@ public interface CameraOrgenizationMapper extends BaseDao { void batchSaveOrgenization(List list); - @Select("SELECT name,parent_id,id,path FROM t_camera_organization_cache WHERE id = #{id}") + @Select("SELECT name,parent_id,id,path FROM t_camera_organization WHERE id = #{id}") Map selectOrgenizationById(@Param("id") String id); + Map selectOrgenizationCacheById(@Param("id") String id); + @Update("UPDATE t_camera_organization SET path = TRIM( TRAILING '->' FROM #{path}) where id = #{id}") void updateOrganizationPaht(@Param("path") String path,@Param("id") String id); diff --git a/renren-admin/src/main/java/io/renren/modules/monitor/service/MonitorService.java b/renren-admin/src/main/java/io/renren/modules/monitor/service/MonitorService.java index 22b24ac9..2281b220 100644 --- a/renren-admin/src/main/java/io/renren/modules/monitor/service/MonitorService.java +++ b/renren-admin/src/main/java/io/renren/modules/monitor/service/MonitorService.java @@ -1251,7 +1251,7 @@ public class MonitorService { //更新组织的path public void setOrganizationPath(Map map ,String parentId){ - Map map2 = cameraOrgenMapper.selectOrgenizationById(parentId); + Map map2 = cameraOrgenMapper.selectOrgenizationCacheById(parentId); if(map2 != null){ String path = map2.get("name").toString(); String newNodeName = path + "->" + (map.get("path")==null?"":map.get("path").toString()); diff --git a/renren-admin/src/main/resources/mapper/monitor/CameraOrganizationMapper.xml b/renren-admin/src/main/resources/mapper/monitor/CameraOrganizationMapper.xml index c2635911..8dbb0255 100644 --- a/renren-admin/src/main/resources/mapper/monitor/CameraOrganizationMapper.xml +++ b/renren-admin/src/main/resources/mapper/monitor/CameraOrganizationMapper.xml @@ -65,4 +65,8 @@ ) SELECT id,name,parent_id,sort,subCount,is_parent,path,is_root,channelCount,count FROM t_camera_organization_cache + + \ No newline at end of file