From 764d883b5ea3bdc06abbec548b6df0511e567978 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Tue, 03 Sep 2024 09:46:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/binlog' into binlog
---
src/main/java/org/springblade/modules/system/mapper/RoleMapper.xml | 33 +++++++++++++++++++++++++++------
1 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/springblade/modules/system/mapper/RoleMapper.xml b/src/main/java/org/springblade/modules/system/mapper/RoleMapper.xml
index 57e1edd..f702df4 100644
--- a/src/main/java/org/springblade/modules/system/mapper/RoleMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/RoleMapper.xml
@@ -53,12 +53,18 @@
role_alias
FROM
blade_role
- WHERE
- id IN
- <foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
- #{ids}
- </foreach>
- and is_deleted = 0
+ WHERE is_deleted = 0
+ <choose>
+ <when test="array!=null and array.length>0">
+ and id IN
+ <foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
+ #{ids}
+ </foreach>
+ </when>
+ <otherwise>
+ and id IN ('')
+ </otherwise>
+ </choose>
</select>
<select id="getRoleListByIds" resultType="org.springblade.modules.system.entity.Role">
SELECT * FROM BLADE_ROLE
@@ -68,6 +74,21 @@
</foreach>
</select>
+ <!--查询对应的角色id-->
+ <select id="getRoleIdStrByRoleIdAndType" resultType="java.lang.String">
+ SELECT id FROM BLADE_ROLE
+ WHERE id IN
+ <foreach collection="ids.split(',')" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ <if test="types!=null and types.size()>0">
+ and type in
+ <foreach collection="types" item="type" open="(" separator="," close=")">
+ #{type}
+ </foreach>
+ </if>
+ </select>
+
<!--角色查询-->
<select id="getRoleList" resultType="org.springblade.modules.system.entity.Role">
SELECT br.* FROM blade_role br
--
Gitblit v1.9.3