mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update 简化查询部门功能
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.ruoyi.common.annotation.DataColumn;
|
||||
import com.ruoyi.common.annotation.DataPermission;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
@ -18,13 +20,13 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDeptMapper, SysDept, Sy
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "d.dept_id")
|
||||
@DataColumn(key = "deptName", value = "dept_id")
|
||||
})
|
||||
List<SysDept> selectDeptList(SysDept dept);
|
||||
List<SysDept> selectDeptList(@Param(Constants.WRAPPER) Wrapper<SysDept> queryWrapper);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
|
@ -46,7 +46,15 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||
*/
|
||||
@Override
|
||||
public List<SysDept> selectDeptList(SysDept dept) {
|
||||
return baseMapper.selectDeptList(dept);
|
||||
LambdaQueryWrapper<SysDept> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(SysDept::getDelFlag, "0")
|
||||
.eq(ObjectUtil.isNotNull(dept.getDeptId()), SysDept::getDeptId, dept.getDeptId())
|
||||
.eq(ObjectUtil.isNotNull(dept.getParentId()), SysDept::getParentId, dept.getParentId())
|
||||
.like(StringUtils.isNotBlank(dept.getDeptName()), SysDept::getDeptName, dept.getDeptName())
|
||||
.eq(StringUtils.isNotBlank(dept.getStatus()), SysDept::getStatus, dept.getStatus())
|
||||
.orderByAsc(SysDept::getParentId)
|
||||
.orderByAsc(SysDept::getOrderNum);
|
||||
return baseMapper.selectDeptList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user