com.didiglobal.logi.security.dao.impl.DeptDaoImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of logi-security-spring-boot-starter Show documentation
Show all versions of logi-security-spring-boot-starter Show documentation
logi-security 提供项目大多都需要的一些基础功能(用户、角色、权限、登录、注册、操作记录)
package com.didiglobal.logi.security.dao.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.didiglobal.logi.security.common.entity.dept.Dept;
import com.didiglobal.logi.security.common.entity.dept.DeptBrief;
import com.didiglobal.logi.security.common.po.DeptPO;
import com.didiglobal.logi.security.dao.DeptDao;
import com.didiglobal.logi.security.dao.mapper.DeptMapper;
import com.didiglobal.logi.security.util.CopyBeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author cjm
*/
@Component
public class DeptDaoImpl extends BaseDaoImpl implements DeptDao {
@Autowired
private DeptMapper deptMapper;
private QueryWrapper wrapBriefQuery() {
QueryWrapper queryWrapper = getQueryWrapper();
queryWrapper.select(
FieldConstant.ID, FieldConstant.DEPT_NAME,
FieldConstant.LEAF, FieldConstant.LEVEL, FieldConstant.PARENT_ID
);
return queryWrapper;
}
@Override
public List selectAllAndAscOrderByLevel() {
QueryWrapper queryWrapper = getQueryWrapper();
queryWrapper.orderByAsc(FieldConstant.LEVEL);
return CopyBeanUtil.copyList(deptMapper.selectList(queryWrapper), Dept.class);
}
@Override
public List selectIdListByLikeDeptName(String deptName) {
QueryWrapper queryWrapper = getQueryWrapper();
queryWrapper
.select(FieldConstant.ID)
.like(!StringUtils.isEmpty(deptName), FieldConstant.DEPT_NAME, deptName);
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy