From 4974beff57772cc0602cb36e2c80694ca8d62094 Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期三, 31 一月 2024 15:39:50 +0800
Subject: [PATCH] app用户查询自身受约束的电子围栏提交
---
ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/impl/ArdWallServiceImpl.java | 6 ++++++
ard-work/src/main/resources/mapper/alarmpoints/ArdWallMapper.xml | 18 ++++++++++++++++++
ard-work/src/main/java/com/ruoyi/alarmpoints/wall/mapper/ArdWallMapper.java | 2 ++
ard-work/src/main/java/com/ruoyi/alarmpoints/wall/controller/ArdWallController.java | 14 ++++++++++++++
ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/IArdWallService.java | 2 ++
5 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/controller/ArdWallController.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/controller/ArdWallController.java
index c29951b..2de7b8f 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/controller/ArdWallController.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/controller/ArdWallController.java
@@ -3,6 +3,7 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
+import com.ruoyi.common.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -110,4 +111,17 @@
{
return toAjax(ardWallService.deleteArdWallByIds(ids));
}
+
+ @ApiOperation("鏍规嵁鐢ㄦ埛涓婚敭鏌ヨ鍏宠仈鐨勭數瀛愬洿鏍忓垪琛�")
+ @GetMapping("/getArdWallListByUserId")
+ public AjaxResult getArdWallListByUserId() {
+ String userId = SecurityUtils.getUserId();
+ try{
+ List<ArdWall> result = ardWallService.getArdWallListByUserId(userId);
+ return AjaxResult.success(result);
+ }catch(Exception e){
+ e.printStackTrace();
+ return AjaxResult.error();
+ }
+ }
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/mapper/ArdWallMapper.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/mapper/ArdWallMapper.java
index 3e075a6..6fb7f3b 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/mapper/ArdWallMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/mapper/ArdWallMapper.java
@@ -92,4 +92,6 @@
* @return 鐢靛瓙鍥存爮绠$悊闆嗗悎
*/
public List<ArdWall> selectArdWallListByUserId(String userId);
+
+ public List<ArdWall> getArdWallListByUserId(String userId);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/IArdWallService.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/IArdWallService.java
index 9946aae..a726f3b 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/IArdWallService.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/IArdWallService.java
@@ -58,4 +58,6 @@
* @return 缁撴灉
*/
public int deleteArdWallById(String id);
+
+ public List<ArdWall> getArdWallListByUserId(String userId);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/impl/ArdWallServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/impl/ArdWallServiceImpl.java
index 826108b..68dba82 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/impl/ArdWallServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/impl/ArdWallServiceImpl.java
@@ -125,4 +125,10 @@
}
}
}
+
+ @Override
+ public List<ArdWall> getArdWallListByUserId(String userId) {
+ List<ArdWall> result = ardWallMapper.getArdWallListByUserId(userId);
+ return result;
+ }
}
diff --git a/ard-work/src/main/resources/mapper/alarmpoints/ArdWallMapper.xml b/ard-work/src/main/resources/mapper/alarmpoints/ArdWallMapper.xml
index 5711613..5d0cf84 100644
--- a/ard-work/src/main/resources/mapper/alarmpoints/ArdWallMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarmpoints/ArdWallMapper.xml
@@ -19,6 +19,19 @@
<!-- 瀛愭煡璇紝鍏宠仈 ard_dispatch_police_user 琛� -->
<collection property="sysUserList" ofType="java.util.List" select="getSysUserListByMainTableId" column="id"/>
</resultMap>
+ <resultMap type="ArdWall" id="ArdWallOnlyResult">
+ <result property="id" column="id" />
+ <result property="wallName" column="wall_name" />
+ <result property="wallPoi" column="wall_poi" />
+ <result property="type" column="type" />
+ <result property="color" column="color" />
+ <result property="deptId" column="dept_id" />
+ <result property="userId" column="user_id" />
+ <result property="createBy" column="create_by" />
+ <result property="createTime" column="create_time" />
+ <result property="updateBy" column="update_by" />
+ <result property="updateTime" column="update_time" />
+ </resultMap>
<select id="getSysUserListByMainTableId" resultType="SysUser">
SELECT u.*
FROM ard_wall_user b
@@ -137,4 +150,9 @@
WHERE
awu.user_id = #{userId}
</select>
+ <select id="getArdWallListByUserId" parameterType="java.lang.String" resultMap="ArdWallOnlyResult">
+ select aw.* from ard_wall_user awu
+ inner join ard_wall aw on awu.wall_id = aw.id
+ where awu.user_id = #{userId}
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3