|
@@ -96,10 +96,8 @@ public interface RoleInfoRepository extends JpaRepository<RoleInfo, Integer> {
|
96
|
96
|
|
97
|
97
|
@Modifying
|
98
|
98
|
@Query(nativeQuery = true,
|
99
|
|
- value = "with t1 as (delete from role_authority where role_id = :roleId and authority_id not in :authorityIds)" +
|
100
|
|
- "insert into role_authority(role_id, authority_id) " +
|
101
|
|
- "select :roleId, authority_id from authority_info where authority_id in :authorityIds " +
|
102
|
|
- "on conflict (role_id, authority_id) do nothing "
|
|
99
|
+ value = "insert into role_authority(role_id, authority_id) " +
|
|
100
|
+ "select :roleId, authority_id from authority_info where authority_id in :authorityIds "
|
103
|
101
|
)
|
104
|
102
|
void updateRoleAuthority(@Param("roleId") Integer roleId,
|
105
|
103
|
@Param("authorityIds") List<Integer> authorityIds);
|
|
@@ -131,4 +129,10 @@ public interface RoleInfoRepository extends JpaRepository<RoleInfo, Integer> {
|
131
|
129
|
value = "select string_agg(role_name, ',') from role_info where role_id in :hasUserRoleIds"
|
132
|
130
|
)
|
133
|
131
|
String findHasUserRoleNames(@Param("hasUserRoleIds") List<Integer> hasUserRoleIds);
|
|
132
|
+
|
|
133
|
+ @Modifying
|
|
134
|
+ @Query(nativeQuery = true,
|
|
135
|
+ value = "delete from role_authority where role_id = :roleId"
|
|
136
|
+ )
|
|
137
|
+ void deleteByRoleId(@Param("roleId") Integer roleId);
|
134
|
138
|
}
|