From 82988f338589ace9b4e2344fe49386554b239d8c Mon Sep 17 00:00:00 2001 From: dataprince Date: Mon, 18 Sep 2023 11:19:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8mybatis-flex=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E5=90=84=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81=EF=BC=9A?= =?UTF-8?q?=E5=B2=97=E4=BD=8D=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysUserController.java | 3 +- .../resources/mapper/system/SysPostMapper.xml | 95 ++----------------- 2 files changed, 11 insertions(+), 87 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysUserController.java index 22afee0..af8ee02 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysUserController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysUserController.java @@ -14,6 +14,7 @@ import com.ruoyi.system.domain.SysDept; import com.ruoyi.system.domain.SysPost; import com.ruoyi.system.domain.SysRole; import com.ruoyi.system.domain.SysUser; +import com.ruoyi.system.domain.bo.SysPostBo; import com.ruoyi.system.service.*; import jakarta.annotation.Resource; import jakarta.servlet.http.HttpServletResponse; @@ -114,7 +115,7 @@ public class SysUserController extends BaseController { SysRole sysRole = new SysRole(); sysRole.setStatus(UserConstants.ROLE_NORMAL); List roles = roleService.selectRoleList(sysRole); - SysPost sysPost = new SysPost(); + SysPostBo sysPost = new SysPostBo(); sysPost.setStatus(UserConstants.POST_NORMAL); ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); ajax.put("posts", postService.selectPostList(sysPost)); diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml index 227c459..1816aff 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -16,36 +16,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark + select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark from sys_post - - - - - - - + + + - + - - - - - - - update sys_post - - post_code = #{postCode}, - post_name = #{postName}, - post_sort = #{postSort}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where post_id = #{postId} - - - - insert into sys_post( - post_id, - post_code, - post_name, - post_sort, - status, - remark, - create_by, - create_time - )values( - #{postId}, - #{postCode}, - #{postName}, - #{postSort}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - delete from sys_post where post_id = #{postId} - - - - delete from sys_post where post_id in - - #{postId} - - - \ No newline at end of file + + +