Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
b8b0aefa
Commit
b8b0aefa
authored
Jun 09, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据权限配置初始提交(增删改查)
parent
f057f464
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1724 additions
and
0 deletions
+1724
-0
SysDataAuth.java
...yifu.cloud.plus.v1/yifu/admin/api/entity/SysDataAuth.java
+95
-0
SysDataAuthDeptRel.java
...oud.plus.v1/yifu/admin/api/entity/SysDataAuthDeptRel.java
+57
-0
SysDataAuthDiySql.java
...loud.plus.v1/yifu/admin/api/entity/SysDataAuthDiySql.java
+65
-0
SysDataAuthMenuRel.java
...oud.plus.v1/yifu/admin/api/entity/SysDataAuthMenuRel.java
+65
-0
SysDiySqlMenuRel.java
...cloud.plus.v1/yifu/admin/api/entity/SysDiySqlMenuRel.java
+64
-0
SysDataAuthVO.java
...m/yifu.cloud.plus.v1/yifu/admin/api/vo/SysDataAuthVO.java
+55
-0
DataAuthController.java
...oud.plus.v1/yifu/admin/controller/DataAuthController.java
+111
-0
SysDataAuthDeptRelMapper.java
...d.plus.v1/yifu/admin/mapper/SysDataAuthDeptRelMapper.java
+39
-0
SysDataAuthDiySqlMapper.java
...ud.plus.v1/yifu/admin/mapper/SysDataAuthDiySqlMapper.java
+39
-0
SysDataAuthMapper.java
...fu.cloud.plus.v1/yifu/admin/mapper/SysDataAuthMapper.java
+52
-0
SysDataAuthMenuRelMapper.java
...d.plus.v1/yifu/admin/mapper/SysDataAuthMenuRelMapper.java
+39
-0
SysDiySqlMenuRelMapper.java
...oud.plus.v1/yifu/admin/mapper/SysDiySqlMenuRelMapper.java
+39
-0
SysDataAuthDeptRelService.java
...plus.v1/yifu/admin/service/SysDataAuthDeptRelService.java
+47
-0
SysDataAuthDiySqlService.java
....plus.v1/yifu/admin/service/SysDataAuthDiySqlService.java
+47
-0
SysDataAuthMenuRelService.java
...plus.v1/yifu/admin/service/SysDataAuthMenuRelService.java
+47
-0
SysDataAuthService.java
....cloud.plus.v1/yifu/admin/service/SysDataAuthService.java
+77
-0
SysDiySqlMenuRelService.java
...d.plus.v1/yifu/admin/service/SysDiySqlMenuRelService.java
+47
-0
SysDataAuthDeptRelServiceImpl.java
...ifu/admin/service/impl/SysDataAuthDeptRelServiceImpl.java
+52
-0
SysDataAuthDiySqlServiceImpl.java
...yifu/admin/service/impl/SysDataAuthDiySqlServiceImpl.java
+52
-0
SysDataAuthMenuRelServiceImpl.java
...ifu/admin/service/impl/SysDataAuthMenuRelServiceImpl.java
+53
-0
SysDataAuthServiceImpl.java
...us.v1/yifu/admin/service/impl/SysDataAuthServiceImpl.java
+301
-0
SysDiySqlMenuRelServiceImpl.java
.../yifu/admin/service/impl/SysDiySqlMenuRelServiceImpl.java
+52
-0
SysDataAuthDeptRelMapper.xml
...iz/src/main/resources/mapper/SysDataAuthDeptRelMapper.xml
+38
-0
SysDataAuthDiySqlMapper.xml
...biz/src/main/resources/mapper/SysDataAuthDiySqlMapper.xml
+38
-0
SysDataAuthMapper.xml
...-upms-biz/src/main/resources/mapper/SysDataAuthMapper.xml
+72
-0
SysDataAuthMenuRelMapper.xml
...iz/src/main/resources/mapper/SysDataAuthMenuRelMapper.xml
+40
-0
SysDiySqlMenuRelMapper.xml
...-biz/src/main/resources/mapper/SysDiySqlMenuRelMapper.xml
+41
-0
No files found.
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysDataAuth.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
/**
* @Description: 数据权限主表
* @Author: hgw
* @Date: 2022/6/7 11:29
* @return:
**/
@Schema
(
description
=
"数据权限主表"
)
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
SysDataAuth
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
)
private
String
id
;
/**
* 关联对象类型:0分组;1用户
*/
@NotNull
(
message
=
"关联对象类型不能为空"
)
@Schema
(
description
=
"关联对象类型:0分组;1用户"
,
required
=
true
)
private
Integer
linkType
;
/**
* 关联对象id
*/
@NotBlank
(
message
=
"关联对象id不能为空"
)
@Schema
(
description
=
"关联对象id"
,
required
=
true
)
private
String
linkId
;
/**
* 关联对象名称
*/
@NotBlank
(
message
=
"关联对象名称不能为空"
)
@Schema
(
description
=
"关联对象名称"
,
required
=
true
)
private
String
linkName
;
/**
* 创建人权限:0否;1是
*/
@NotNull
(
message
=
"创建人权限:0否;1是不能为空"
)
@Schema
(
description
=
"创建人权限:0否;1是"
,
required
=
true
)
private
Integer
isCreateAuth
;
/**
* 部门权限:0无;1本部门;2自定义部门
*/
@NotNull
(
message
=
"部门权限:0无;1本部门;2自定义部门不能为空"
)
@Schema
(
description
=
"部门权限:0无;1本部门;2自定义部门"
,
required
=
true
)
private
Integer
isDeptAuth
;
/**
* 结算主体权限:0否;1是
*/
@NotNull
(
message
=
"结算主体权限:0否;1是不能为空"
)
@Schema
(
description
=
"结算主体权限:0否;1是"
,
required
=
true
)
private
Integer
isSettleAuth
;
/**
* 自定义sql:0否;1是
*/
@NotNull
(
message
=
"自定义sql:0否;1是不能为空"
)
@Schema
(
description
=
"自定义sql:0否;1是"
,
required
=
true
)
private
Integer
isDiySql
;
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysDataAuthDeptRel.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
/**
* @Description: 数据权限与组织部门的关联表
* @Author: hgw
* @Date: 2022-6-8 17:07:44
* @return:
**/
@Schema
(
description
=
"数据权限与组织部门的关联表"
)
@Data
public
class
SysDataAuthDeptRel
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
)
private
String
id
;
/**
* 数据权限表id
*/
@NotBlank
(
message
=
"数据权限表id不能为空"
)
@Schema
(
description
=
"数据权限表id"
,
required
=
true
)
private
String
sysDataAuthId
;
/**
* 组织部门id
*/
@NotBlank
(
message
=
"组织部门id不能为空"
)
@Schema
(
description
=
"组织部门id"
,
required
=
true
)
private
String
deptId
;
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysDataAuthDiySql.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @Description: 自定义sql表
* @Author: hgw
* @Date: 2022-6-8 17:07:44
* @return:
**/
@Schema
(
description
=
"自定义sql表"
)
@Data
public
class
SysDataAuthDiySql
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
)
private
String
id
;
/**
* 数据权限表id
*/
@NotBlank
(
message
=
"数据权限表id不能为空"
)
@Schema
(
description
=
"数据权限表id"
,
required
=
true
)
private
String
sysDataAuthId
;
/**
* 自定义sql
*/
@NotBlank
(
message
=
"自定义sql不能为空"
)
@Schema
(
description
=
"自定义sql"
,
required
=
true
)
private
String
diySql
;
/**
* 自定义sql对应的菜单list
*/
@TableField
(
exist
=
false
)
private
List
<
SysDiySqlMenuRel
>
sqlMenuList
;
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysDataAuthMenuRel.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* @Description: 数据权限与菜单的关联表
* @Author: hgw
* @Date: 2022-6-8 17:07:44
* @return:
**/
@Schema
(
description
=
"数据权限与菜单的关联表"
)
@Data
public
class
SysDataAuthMenuRel
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
)
private
String
id
;
/**
* 数据权限表id
*/
@NotBlank
(
message
=
"数据权限表id不能为空"
)
@Schema
(
description
=
"数据权限表id"
,
required
=
true
)
private
String
sysDataAuthId
;
/**
* 菜单id
*/
@NotBlank
(
message
=
"菜单id不能为空"
)
@Schema
(
description
=
"菜单id"
,
required
=
true
)
private
String
menuId
;
/**
* 类型:1:创建人;2:结算主体;3部门
*/
@NotNull
(
message
=
"类型:1:创建人;2:结算主体;3部门不能为空"
)
@Schema
(
description
=
"类型:1:创建人;2:结算主体;3部门"
,
required
=
true
)
private
Integer
type
;
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysDiySqlMenuRel.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
/**
* @Description: 自定义sql与菜单的关联表
* @Author: hgw
* @Date: 2022-6-8 17:07:44
* @return:
**/
@Schema
(
description
=
"自定义sql与菜单的关联表"
)
@Data
public
class
SysDiySqlMenuRel
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
)
private
String
id
;
/**
* 数据权限表id
*/
@NotBlank
(
message
=
"数据权限表id不能为空"
)
@Schema
(
description
=
"数据权限表id"
,
required
=
true
)
private
String
sysDataAuthId
;
/**
* SysDataAuthDiySql表的id
*/
@NotBlank
(
message
=
"自定义sql表id不能为空"
)
@Schema
(
description
=
"自定义sql表id"
,
required
=
true
)
private
String
sysDiySqlId
;
/**
* 菜单id
*/
@NotBlank
(
message
=
"菜单id不能为空"
)
@Schema
(
description
=
"菜单id"
,
required
=
true
)
private
String
menuId
;
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/SysDataAuthVO.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDeptRel
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDiySql
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthMenuRel
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @Description: 数据权限Vo
* @Author: hgw
* @Date: 2022/6/8 17:37
**/
@Schema
(
description
=
"数据权限-新增、修改、详情vo"
)
@Data
public
class
SysDataAuthVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Schema
(
description
=
"权限主表信息"
)
SysDataAuth
sysDataAuth
;
@Schema
(
description
=
"权限-部门列表"
)
List
<
SysDataAuthDeptRel
>
authDeptList
;
@Schema
(
description
=
"权限-sql列表"
)
List
<
SysDataAuthDiySql
>
authSqlList
;
// 1:创建人;2:结算主体;3部门
@Schema
(
description
=
"菜单-创建人列表"
)
List
<
SysDataAuthMenuRel
>
menuCreateList
;
@Schema
(
description
=
"菜单-结算主体(项目)列表"
)
List
<
SysDataAuthMenuRel
>
menuSettleList
;
@Schema
(
description
=
"菜单-组织部门列表"
)
List
<
SysDataAuthMenuRel
>
menuDeptList
;
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/DataAuthController.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDataAuthVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDataAuthService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @Description: 数据权限控制器
* @Author: hgw
* @Date: 2022/6/7 10:44
* @return:
**/
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"/dataAuth"
)
@Tag
(
name
=
"数据权限控制器"
)
public
class
DataAuthController
{
private
final
SysDataAuthService
sysDataAuthService
;
/**
* @Description: 分页查询
* @Author: hgw
* @Date: 2022/6/7 14:59
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.baomidou.mybatisplus.core.metadata.IPage < com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth>>
**/
@Operation
(
summary
=
"分页查询"
)
@GetMapping
(
"/getSysDataAuthPage"
)
public
R
<
IPage
<
SysDataAuth
>>
getSysDataAuthPage
(
Page
<
SysDataAuth
>
page
,
SysDataAuth
sysDataAuth
)
{
return
R
.
ok
(
sysDataAuthService
.
getSysDataAuthPage
(
page
,
sysDataAuth
));
}
/**
* @Description: 分页查询
* @Author: hgw
* @Date: 2022/6/7 14:59
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.baomidou.mybatisplus.core.metadata.IPage < com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth>>
**/
@Operation
(
summary
=
"获取list"
)
@GetMapping
(
"/getSysDataAuthList"
)
public
R
<
List
<
SysDataAuth
>>
getSysDataAuthList
(
SysDataAuth
sysDataAuth
)
{
return
R
.
ok
(
sysDataAuthService
.
getSysDataAuthList
(
sysDataAuth
));
}
/**
* @Description: 详情/编辑获取原数据
* @Author: hgw
* @Date: 2022/6/7 14:59
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth>
**/
@Operation
(
summary
=
"详情/编辑获取原数据"
)
@GetMapping
(
"/{id:\\d+}"
)
public
R
<
SysDataAuthVO
>
getById
(
@PathVariable
String
id
)
{
return
sysDataAuthService
.
getByMainId
(
id
);
}
/**
* @Description: 添加数据权限配置
* @Author: hgw
* @Date: 2022/6/7 14:57
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Operation
(
summary
=
"新增/编辑数据权限配置"
)
@SysLog
(
"系统管理-数据权限-新增/编辑数据权限配置"
)
@PostMapping
(
"/saveOrUpdate"
)
@PreAuthorize
(
"@pms.hasPermission('sys_data_auth_add')"
)
public
R
<
String
>
saveOrUpdate
(
@RequestBody
SysDataAuthVO
sysDataAuthVO
)
{
return
sysDataAuthService
.
saveDataAuth
(
sysDataAuthVO
);
}
/**
* @Description: 删除数据权限配置
* @Author: hgw
* @Date: 2022/6/7 14:58
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Operation
(
summary
=
"删除数据权限配置"
)
@SysLog
(
"系统管理-数据权限-删除数据权限配置"
)
@DeleteMapping
(
"/{id:\\d+}"
)
@PreAuthorize
(
"@pms.hasPermission('sys_data_auth_del')"
)
public
R
<
Boolean
>
removeById
(
@PathVariable
String
id
)
{
return
R
.
ok
(
sysDataAuthService
.
removeDataAuthById
(
id
));
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/mapper/SysDataAuthDeptRelMapper.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDeptRel
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Description: 数据权限配置相关mapper
* @Author: hgw
* @Date: 2022/6/7 14:40
* @return:
**/
@Mapper
public
interface
SysDataAuthDeptRelMapper
extends
BaseMapper
<
SysDataAuthDeptRel
>
{
// 清空
int
deleteAuthDeptRelByAuthId
(
@Param
(
"mainId"
)
String
mainId
);
// 根据权限主表id,查询全部
List
<
SysDataAuthDeptRel
>
getByMainId
(
@Param
(
"mainId"
)
String
mainId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/mapper/SysDataAuthDiySqlMapper.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDiySql
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Description: 数据权限配置相关mapper
* @Author: hgw
* @Date: 2022/6/7 14:40
* @return:
**/
@Mapper
public
interface
SysDataAuthDiySqlMapper
extends
BaseMapper
<
SysDataAuthDiySql
>
{
// 清空
int
deleteDiySqlByAuthId
(
@Param
(
"mainId"
)
String
mainId
);
// 根据权限主表id,查询全部
List
<
SysDataAuthDiySql
>
getByMainId
(
@Param
(
"mainId"
)
String
mainId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/mapper/SysDataAuthMapper.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Description: 数据权限配置mapper
* @Author: hgw
* @Date: 2022/6/7 14:40
* @return:
**/
@Mapper
public
interface
SysDataAuthMapper
extends
BaseMapper
<
SysDataAuth
>
{
/**
* 关联dept——relation
*
* @return 数据列表
*/
IPage
<
SysDataAuth
>
getSysDataAuthPage
(
Page
<
SysDataAuth
>
page
,
@Param
(
"sysDataAuth"
)
SysDataAuth
sysDataAuth
);
/**
* @Description: 获取list
* @Author: hgw
* @Date: 2022/6/9 16:47
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth>
**/
List
<
SysDataAuth
>
getSysDataAuthPage
(
@Param
(
"sysDataAuth"
)
SysDataAuth
sysDataAuth
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/mapper/SysDataAuthMenuRelMapper.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthMenuRel
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Description: 数据权限配置相关mapper
* @Author: hgw
* @Date: 2022/6/7 14:40
* @return:
**/
@Mapper
public
interface
SysDataAuthMenuRelMapper
extends
BaseMapper
<
SysDataAuthMenuRel
>
{
// 清空
int
deleteAuthMenuRelByAuthId
(
@Param
(
"mainId"
)
String
mainId
);
// 根据权限主表id,查询全部
List
<
SysDataAuthMenuRel
>
getByMainId
(
@Param
(
"mainId"
)
String
mainId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/mapper/SysDiySqlMenuRelMapper.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDiySqlMenuRel
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Description: 数据权限配置相关mapper
* @Author: hgw
* @Date: 2022/6/7 14:40
* @return:
**/
@Mapper
public
interface
SysDiySqlMenuRelMapper
extends
BaseMapper
<
SysDiySqlMenuRel
>
{
// 清空
int
deleteSqlMenuRelByAuthId
(
@Param
(
"mainId"
)
String
mainId
);
// 根据权限主表id,查询全部
List
<
SysDiySqlMenuRel
>
getByMainId
(
@Param
(
"mainId"
)
String
mainId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysDataAuthDeptRelService.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDeptRel
;
import
java.util.List
;
/**
* @Description: 数据权限与组织部门的关联接口
* @Author: hgw
* @Date: 2022/6/8 17:15
**/
public
interface
SysDataAuthDeptRelService
extends
IService
<
SysDataAuthDeptRel
>
{
/**
* @param mainId 权限主表id
* @Description: 删除
* @Author: hgw
* @Date: 2022/6/9 14:28
* @return: int
**/
int
deleteAuthDeptRelByAuthId
(
String
mainId
);
/**
* @param mainId 权限主表id
* @Description: 根据权限主表id查询
* @Author: hgw
* @Date: 2022/6/9 14:28
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDeptRel>
**/
List
<
SysDataAuthDeptRel
>
getByMainId
(
String
mainId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysDataAuthDiySqlService.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDiySql
;
import
java.util.List
;
/**
* @Description: 自定义sql接口
* @Author: hgw
* @Date: 2022/6/8 17:15
**/
public
interface
SysDataAuthDiySqlService
extends
IService
<
SysDataAuthDiySql
>
{
/**
* @param mainId 权限主表id
* @Description: 删除
* @Author: hgw
* @Date: 2022/6/9 14:28
* @return: int
**/
int
deleteDiySqlByAuthId
(
String
mainId
);
/**
* @param mainId 权限主表id
* @Description: 根据权限主表id查询
* @Author: hgw
* @Date: 2022/6/9 14:28
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDiySql>
**/
List
<
SysDataAuthDiySql
>
getByMainId
(
String
mainId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysDataAuthMenuRelService.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthMenuRel
;
import
java.util.List
;
/**
* @Description: 数据权限与菜单的关联接口
* @Author: hgw
* @Date: 2022/6/8 17:15
**/
public
interface
SysDataAuthMenuRelService
extends
IService
<
SysDataAuthMenuRel
>
{
/**
* @param mainId 权限主表id
* @Description: 删除
* @Author: hgw
* @Date: 2022/6/9 14:28
* @return: int
**/
int
deleteAuthMenuRelByAuthId
(
String
mainId
);
/**
* @param mainId 权限主表id
* @Description: 根据权限主表id查询
* @Author: hgw
* @Date: 2022/6/9 14:28
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthMenuRel>
**/
List
<
SysDataAuthMenuRel
>
getByMainId
(
String
mainId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysDataAuthService.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDataAuthVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
java.util.List
;
/**
* @Description: 数据权限配置接口
* @Author: hgw
* @Date: 2022/6/8 17:15
**/
public
interface
SysDataAuthService
extends
IService
<
SysDataAuth
>
{
/**
* @Description: 分页查询
* @Author: hgw
* @Date: 2022/6/7 14:45
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth>
**/
IPage
<
SysDataAuth
>
getSysDataAuthPage
(
Page
<
SysDataAuth
>
page
,
SysDataAuth
sysDataAuth
);
/**
* @Description: 获取list
* @Author: hgw
* @Date: 2022/6/9 16:47
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth>
**/
List
<
SysDataAuth
>
getSysDataAuthList
(
SysDataAuth
sysDataAuth
);
/**
* @Description: 新增
* @Author: hgw
* @Date: 2022/6/7 14:46
* @return: java.lang.Boolean
**/
R
<
String
>
saveDataAuth
(
SysDataAuthVO
sysDataAuthVO
);
/**
* @param id
* @Description: 删除
* @Author: hgw
* @Date: 2022/6/7 14:46
* @return: java.lang.Boolean
**/
Boolean
removeDataAuthById
(
String
id
);
/**
* @param mainId
* @Description: 查看
* @Author: hgw
* @Date: 2022/6/9 14:52
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDataAuthVO>
**/
R
<
SysDataAuthVO
>
getByMainId
(
String
mainId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysDiySqlMenuRelService.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDiySqlMenuRel
;
import
java.util.List
;
/**
* @Description: 自定义sql与菜单的关联表接口
* @Author: hgw
* @Date: 2022/6/8 17:15
**/
public
interface
SysDiySqlMenuRelService
extends
IService
<
SysDiySqlMenuRel
>
{
/**
* @param mainId 权限主表id
* @Description: 删除
* @Author: hgw
* @Date: 2022/6/9 14:28
* @return: int
**/
int
deleteSqlMenuRelByAuthId
(
String
mainId
);
/**
* @param mainId 权限主表id
* @Description: 根据权限主表id查询
* @Author: hgw
* @Date: 2022/6/9 14:28
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDiySqlMenuRel>
**/
List
<
SysDiySqlMenuRel
>
getByMainId
(
String
mainId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDataAuthDeptRelServiceImpl.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDeptRel
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDataAuthDeptRelMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDataAuthDeptRelService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @Description: 数据权限配置相关服务实现
* @Author: hgw
* @Date: 2022/6/8 17:20
**/
@Service
@RequiredArgsConstructor
public
class
SysDataAuthDeptRelServiceImpl
extends
ServiceImpl
<
SysDataAuthDeptRelMapper
,
SysDataAuthDeptRel
>
implements
SysDataAuthDeptRelService
{
// 清空
@Override
public
int
deleteAuthDeptRelByAuthId
(
String
mainId
)
{
return
baseMapper
.
deleteAuthDeptRelByAuthId
(
mainId
);
}
/**
* @param mainId 权限主表id
* @Description: 根据权限主表id查询
* @Author: hgw
* @Date: 2022/6/9 14:31
**/
@Override
public
List
<
SysDataAuthDeptRel
>
getByMainId
(
String
mainId
)
{
return
baseMapper
.
getByMainId
(
mainId
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDataAuthDiySqlServiceImpl.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDiySql
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDataAuthDiySqlMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDataAuthDiySqlService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @Description: 数据权限配置相关服务实现
* @Author: hgw
* @Date: 2022/6/8 17:20
**/
@Service
@RequiredArgsConstructor
public
class
SysDataAuthDiySqlServiceImpl
extends
ServiceImpl
<
SysDataAuthDiySqlMapper
,
SysDataAuthDiySql
>
implements
SysDataAuthDiySqlService
{
// 清空
@Override
public
int
deleteDiySqlByAuthId
(
String
mainId
)
{
return
baseMapper
.
deleteDiySqlByAuthId
(
mainId
);
}
/**
* @param mainId 权限主表id
* @Description: 根据权限主表id查询
* @Author: hgw
* @Date: 2022/6/9 14:31
**/
@Override
public
List
<
SysDataAuthDiySql
>
getByMainId
(
String
mainId
)
{
return
baseMapper
.
getByMainId
(
mainId
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDataAuthMenuRelServiceImpl.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthMenuRel
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDataAuthMenuRelMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDataAuthMenuRelService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @Description: 数据权限配置相关服务实现
* @Author: hgw
* @Date: 2022/6/8 17:20
**/
@Service
@RequiredArgsConstructor
public
class
SysDataAuthMenuRelServiceImpl
extends
ServiceImpl
<
SysDataAuthMenuRelMapper
,
SysDataAuthMenuRel
>
implements
SysDataAuthMenuRelService
{
// 清空
@Override
public
int
deleteAuthMenuRelByAuthId
(
String
mainId
)
{
return
baseMapper
.
deleteAuthMenuRelByAuthId
(
mainId
);
}
/**
* @param mainId 权限主表id
* @Description: 根据权限主表id查询
* @Author: hgw
* @Date: 2022/6/9 14:31
**/
@Override
public
List
<
SysDataAuthMenuRel
>
getByMainId
(
String
mainId
)
{
return
baseMapper
.
getByMainId
(
mainId
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDataAuthServiceImpl.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDataAuthVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDataAuthMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Description: 数据权限配置服务实现
* @Author: hgw
* @Date: 2022/6/8 17:20
**/
@Service
@RequiredArgsConstructor
public
class
SysDataAuthServiceImpl
extends
ServiceImpl
<
SysDataAuthMapper
,
SysDataAuth
>
implements
SysDataAuthService
{
// 权限-部门
private
final
SysDataAuthDeptRelService
authDeptRelService
;
// 权限-菜单(type:类型:1:创建人;2:结算主体;3部门)
private
final
SysDataAuthMenuRelService
authMenuRelService
;
// 权限-自定义sql
private
final
SysDataAuthDiySqlService
diySqlService
;
// 自定义sql-菜单
private
final
SysDiySqlMenuRelService
diySqlMenuRelService
;
/**
* @Description: 分页查询
* @Author: hgw
* @Date: 2022/6/7 14:49
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth>
**/
@Override
public
IPage
<
SysDataAuth
>
getSysDataAuthPage
(
Page
<
SysDataAuth
>
page
,
SysDataAuth
sysDataAuth
)
{
return
baseMapper
.
getSysDataAuthPage
(
page
,
sysDataAuth
);
}
/**
* @Description: 获取list
* @Author: hgw
* @Date: 2022/6/9 16:47
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth>
**/
@Override
public
List
<
SysDataAuth
>
getSysDataAuthList
(
SysDataAuth
sysDataAuth
)
{
return
baseMapper
.
getSysDataAuthPage
(
sysDataAuth
);
}
/**
* @Description: 新增
* @Author: hgw
* @Date: 2022/6/7 14:48
* @return: java.lang.Boolean
**/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
R
<
String
>
saveDataAuth
(
SysDataAuthVO
sysDataAuthVO
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
"请登录!"
);
}
if
(
sysDataAuthVO
!=
null
)
{
SysDataAuth
sysDataAuth
=
sysDataAuthVO
.
getSysDataAuth
();
// 校验参数
if
(
sysDataAuth
==
null
||
Common
.
isEmpty
(
sysDataAuth
.
getLinkType
())
||
Common
.
isEmpty
(
sysDataAuth
.
getLinkId
())
||
Common
.
isEmpty
(
sysDataAuth
.
getLinkName
())
||
Common
.
isEmpty
(
sysDataAuth
.
getIsDeptAuth
()))
{
return
R
.
failed
(
"请传参sysDataAuth以及参数!"
);
}
else
{
List
<
SysDataAuthMenuRel
>
saveMenuDeptList
=
new
ArrayList
<>();
// 编辑
String
mainId
=
sysDataAuth
.
getId
();
R
<
String
>
failed
=
null
;
if
(
mainId
==
null
)
{
// 新增
this
.
save
(
sysDataAuth
);
mainId
=
sysDataAuth
.
getId
();
}
else
{
// 删除之前的关系
this
.
deleteSubInfoByMainId
(
mainId
);
}
failed
=
doCore
(
sysDataAuth
,
saveMenuDeptList
,
sysDataAuthVO
,
mainId
);
if
(
failed
!=
null
)
{
return
failed
;
}
this
.
updateById
(
sysDataAuth
);
if
(!
saveMenuDeptList
.
isEmpty
())
{
authMenuRelService
.
saveOrUpdateBatch
(
saveMenuDeptList
);
}
return
R
.
ok
(
"保存成功"
);
}
}
else
{
return
R
.
failed
(
"请传参sysDataAuthVO!"
);
}
}
/**
* @Description: 核心保存
* @Author: hgw
* @Date: 2022/6/8 18:41
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
private
R
<
String
>
doCore
(
SysDataAuth
sysDataAuth
,
List
<
SysDataAuthMenuRel
>
saveMenuDeptList
,
SysDataAuthVO
sysDataAuthVO
,
String
mainId
)
{
List
<
SysDataAuthDeptRel
>
authDeptList
=
sysDataAuthVO
.
getAuthDeptList
();
List
<
SysDataAuthDiySql
>
authSqlList
=
sysDataAuthVO
.
getAuthSqlList
();
// 类型:1:创建人;2:结算主体;3部门
List
<
SysDataAuthMenuRel
>
menuCreateList
=
sysDataAuthVO
.
getMenuCreateList
();
List
<
SysDataAuthMenuRel
>
menuSettleList
=
sysDataAuthVO
.
getMenuSettleList
();
List
<
SysDataAuthMenuRel
>
menuDeptList
=
sysDataAuthVO
.
getMenuDeptList
();
// 处理权限部门
if
(
sysDataAuth
.
getIsDeptAuth
()
==
1
||
sysDataAuth
.
getIsDeptAuth
()
==
2
)
{
if
(
menuDeptList
==
null
||
menuDeptList
.
isEmpty
())
{
return
R
.
failed
(
"请选择部门关联的菜单!"
);
}
else
if
(
sysDataAuth
.
getIsDeptAuth
()
==
2
)
{
for
(
SysDataAuthDeptRel
dept
:
authDeptList
)
{
dept
.
setSysDataAuthId
(
mainId
);
}
authDeptRelService
.
saveOrUpdateBatch
(
authDeptList
);
}
for
(
SysDataAuthMenuRel
menu
:
menuDeptList
)
{
menu
.
setSysDataAuthId
(
mainId
);
menu
.
setType
(
3
);
}
saveMenuDeptList
.
addAll
(
menuSettleList
);
}
// 处理创建人
if
(
menuCreateList
!=
null
&&
!
menuCreateList
.
isEmpty
())
{
sysDataAuth
.
setIsCreateAuth
(
1
);
for
(
SysDataAuthMenuRel
menu
:
menuCreateList
)
{
menu
.
setType
(
1
);
menu
.
setSysDataAuthId
(
mainId
);
}
saveMenuDeptList
.
addAll
(
menuSettleList
);
}
// 处理结算主体
if
(
menuSettleList
!=
null
&&
!
menuSettleList
.
isEmpty
())
{
sysDataAuth
.
setIsSettleAuth
(
1
);
for
(
SysDataAuthMenuRel
menu
:
menuSettleList
)
{
menu
.
setType
(
2
);
menu
.
setSysDataAuthId
(
mainId
);
}
saveMenuDeptList
.
addAll
(
menuSettleList
);
}
// 处理自定义sql
if
(
authSqlList
!=
null
&&
!
authSqlList
.
isEmpty
())
{
sysDataAuth
.
setIsDiySql
(
1
);
List
<
SysDiySqlMenuRel
>
menuSqlList
;
for
(
SysDataAuthDiySql
sql
:
authSqlList
)
{
menuSqlList
=
sql
.
getSqlMenuList
();
if
(
menuSqlList
!=
null
&&
!
menuSqlList
.
isEmpty
())
{
sql
.
setSysDataAuthId
(
mainId
);
diySqlService
.
save
(
sql
);
for
(
SysDiySqlMenuRel
menuSql
:
menuSqlList
)
{
menuSql
.
setSysDataAuthId
(
mainId
);
menuSql
.
setSysDiySqlId
(
sql
.
getId
());
}
diySqlMenuRelService
.
saveBatch
(
menuSqlList
);
}
else
{
return
R
.
failed
(
"自定义Sql有内容,要选择菜单!"
);
}
}
}
return
null
;
}
/**
* @param mainId 数据权限主表id
* @Description: 删除数据权限关联表
* @Author: hgw
* @Date: 2022/6/9 11:47
* @return: void
**/
public
void
deleteSubInfoByMainId
(
String
mainId
)
{
authDeptRelService
.
deleteAuthDeptRelByAuthId
(
mainId
);
authMenuRelService
.
deleteAuthMenuRelByAuthId
(
mainId
);
diySqlService
.
deleteDiySqlByAuthId
(
mainId
);
diySqlMenuRelService
.
deleteSqlMenuRelByAuthId
(
mainId
);
}
/**
* 删除
*
* @param id 部门 ID
* @return 成功、失败
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
removeDataAuthById
(
String
id
)
{
this
.
deleteSubInfoByMainId
(
id
);
this
.
removeById
(
id
);
return
Boolean
.
TRUE
;
}
/**
* @param mainId 权限主表id
* @Description: 查看
* @Author: hgw
* @Date: 2022/6/9 14:52
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDataAuthVO>
**/
@Override
public
R
<
SysDataAuthVO
>
getByMainId
(
String
mainId
)
{
SysDataAuthVO
vo
=
new
SysDataAuthVO
();
SysDataAuth
main
=
this
.
getById
(
mainId
);
if
(
main
!=
null
)
{
vo
.
setSysDataAuth
(
main
);
// 部门树
vo
.
setAuthDeptList
(
authDeptRelService
.
getByMainId
(
mainId
));
// 菜单
List
<
SysDataAuthMenuRel
>
menuList
=
authMenuRelService
.
getByMainId
(
mainId
);
List
<
SysDataAuthMenuRel
>
menuCreateList
=
new
ArrayList
<>();
List
<
SysDataAuthMenuRel
>
menuSettleList
=
new
ArrayList
<>();
List
<
SysDataAuthMenuRel
>
menuDeptList
=
new
ArrayList
<>();
if
(
menuList
!=
null
&&
!
menuList
.
isEmpty
())
{
for
(
SysDataAuthMenuRel
menu
:
menuList
)
{
switch
(
menu
.
getType
())
{
case
1
:
menuCreateList
.
add
(
menu
);
break
;
case
2
:
menuSettleList
.
add
(
menu
);
break
;
case
3
:
menuDeptList
.
add
(
menu
);
break
;
default
:
break
;
}
}
vo
.
setMenuCreateList
(
menuCreateList
);
vo
.
setMenuSettleList
(
menuSettleList
);
vo
.
setMenuDeptList
(
menuDeptList
);
}
// 自定义sql
List
<
SysDataAuthDiySql
>
diyList
=
diySqlService
.
getByMainId
(
mainId
);
if
(
diyList
!=
null
&&
!
diyList
.
isEmpty
())
{
List
<
SysDiySqlMenuRel
>
diyMenuList
=
diySqlMenuRelService
.
getByMainId
(
mainId
);
if
(
diyMenuList
!=
null
&&
!
diyMenuList
.
isEmpty
())
{
Map
<
String
,
List
<
SysDiySqlMenuRel
>>
sqlMenuMap
=
new
HashMap
<>();
List
<
SysDiySqlMenuRel
>
baseList
;
for
(
SysDiySqlMenuRel
menu
:
diyMenuList
)
{
baseList
=
sqlMenuMap
.
get
(
menu
.
getSysDiySqlId
());
if
(
baseList
==
null
)
{
baseList
=
new
ArrayList
<>();
}
baseList
.
add
(
menu
);
sqlMenuMap
.
put
(
menu
.
getSysDiySqlId
(),
baseList
);
}
for
(
SysDataAuthDiySql
diy
:
diyList
)
{
if
(
sqlMenuMap
.
get
(
diy
.
getId
())
!=
null
)
{
diy
.
setSqlMenuList
(
sqlMenuMap
.
get
(
diy
.
getId
()));
}
}
}
vo
.
setAuthSqlList
(
diyList
);
}
return
new
R
<>(
vo
);
}
else
{
return
R
.
failed
(
"未找到!"
);
}
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDiySqlMenuRelServiceImpl.java
0 → 100644
View file @
b8b0aefa
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDiySqlMenuRel
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDiySqlMenuRelMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDiySqlMenuRelService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @Description: 数据权限配置相关服务实现
* @Author: hgw
* @Date: 2022/6/8 17:20
**/
@Service
@RequiredArgsConstructor
public
class
SysDiySqlMenuRelServiceImpl
extends
ServiceImpl
<
SysDiySqlMenuRelMapper
,
SysDiySqlMenuRel
>
implements
SysDiySqlMenuRelService
{
// 清空
@Override
public
int
deleteSqlMenuRelByAuthId
(
String
mainId
)
{
return
baseMapper
.
deleteSqlMenuRelByAuthId
(
mainId
);
}
/**
* @param mainId 权限主表id
* @Description: 根据权限主表id查询
* @Author: hgw
* @Date: 2022/6/9 14:31
**/
@Override
public
List
<
SysDiySqlMenuRel
>
getByMainId
(
String
mainId
)
{
return
baseMapper
.
getByMainId
(
mainId
);
}
}
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysDataAuthDeptRelMapper.xml
0 → 100644
View file @
b8b0aefa
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDataAuthDeptRelMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDeptRel"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"sysDataAuthId"
column=
"sys_data_auth_id"
/>
<result
property=
"deptId"
column=
"dept_id"
/>
</resultMap>
<!-- 通过权限ID,查询信息-->
<select
id=
"getByMainId"
resultMap=
"BaseResultMap"
>
SELECT id,
sys_data_auth_id,
dept_id
FROM sys_data_auth_dept_rel
WHERE sys_data_auth_id = #{mainId}
</select>
<delete
id=
"deleteAuthDeptRelByAuthId"
>
delete from sys_data_auth_dept_rel where sys_data_auth_id = #{mainId}
</delete>
</mapper>
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysDataAuthDiySqlMapper.xml
0 → 100644
View file @
b8b0aefa
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDataAuthDiySqlMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthDiySql"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"sysDataAuthId"
column=
"sys_data_auth_id"
/>
<result
property=
"diySql"
column=
"diy_sql"
/>
</resultMap>
<!-- 通过权限ID,查询信息-->
<select
id=
"getByMainId"
resultMap=
"BaseResultMap"
>
SELECT id,
sys_data_auth_id,
diy_sql
FROM sys_data_auth_diy_sql
WHERE sys_data_auth_id = #{mainId}
</select>
<delete
id=
"deleteDiySqlByAuthId"
>
delete from sys_data_auth_diy_sql where sys_data_auth_id = #{mainId}
</delete>
</mapper>
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysDataAuthMapper.xml
0 → 100644
View file @
b8b0aefa
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDataAuthMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"SysDataAuthMap"
type=
"com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"linkType"
column=
"link_type"
/>
<result
property=
"linkId"
column=
"link_id"
/>
<result
property=
"linkName"
column=
"link_name"
/>
<result
property=
"isCreateAuth"
column=
"is_create_auth"
/>
<result
property=
"isDeptAuth"
column=
"is_dept_auth"
/>
<result
property=
"isSettleAuth"
column=
"is_settle_auth"
/>
<result
property=
"isDiySql"
column=
"is_diy_sql"
/>
<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>
<sql
id=
"Base_Column_List"
>
a.id,
a.link_type,
a.link_id,
a.link_name,
a.is_create_auth,
a.is_dept_auth,
a.is_settle_auth,
a.is_diy_sql,
a.create_by,
a.create_time,
a.update_by,
a.update_time
</sql>
<sql
id=
"sysDataAuthMap_where"
>
<if
test=
"sysDataAuth != null"
>
<if
test=
"sysDataAuth.id != null and sysDataAuth.id.trim() != ''"
>
AND a.id = #{sysDataAuth.id}
</if>
<if
test=
"sysDataAuth.linkName != null and sysDataAuth.linkName.trim() != ''"
>
AND a.link_name like concat('%',#{sysDataAuth.linkName},'%')
</if>
</if>
</sql>
<!--简单分页查询-->
<select
id=
"getSysDataAuthPage"
resultMap=
"SysDataAuthMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM sys_data_auth a
<where>
1=1
<include
refid=
"sysDataAuthMap_where"
/>
</where>
</select>
</mapper>
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysDataAuthMenuRelMapper.xml
0 → 100644
View file @
b8b0aefa
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDataAuthMenuRelMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuthMenuRel"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"sysDataAuthId"
column=
"sys_data_auth_id"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"menuId"
column=
"menu_id"
/>
</resultMap>
<!-- 通过权限ID,查询信息-->
<select
id=
"getByMainId"
resultMap=
"BaseResultMap"
>
SELECT id,
sys_data_auth_id,
type,
menu_id
FROM sys_data_auth_menu_rel
WHERE sys_data_auth_id = #{mainId}
order by type asc
</select>
<delete
id=
"deleteAuthMenuRelByAuthId"
>
delete from sys_data_auth_menu_rel where sys_data_auth_id = #{mainId}
</delete>
</mapper>
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysDiySqlMenuRelMapper.xml
0 → 100644
View file @
b8b0aefa
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDiySqlMenuRelMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDiySqlMenuRel"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"sysDataAuthId"
column=
"sys_data_auth_id"
/>
<result
property=
"sysDiySqlId"
column=
"sys_diy_sql_id"
/>
<result
property=
"menuId"
column=
"menu_id"
/>
</resultMap>
<!-- 通过权限ID,查询信息-->
<select
id=
"getByMainId"
resultMap=
"BaseResultMap"
>
SELECT id,
sys_data_auth_id,
sys_diy_sql_id,
menu_id
FROM sys_diy_sql_menu_rel
WHERE sys_data_auth_id = #{mainId}
</select>
<delete
id=
"deleteSqlMenuRelByAuthId"
>
delete
from sys_diy_sql_menu_rel
where sys_data_auth_id = #{mainId}
</delete>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment