New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.SysMenuMapper; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.mapper.TDeptMapper; |
| | | import com.ruoyi.system.query.TDeptQuery; |
| | | import com.ruoyi.system.service.TDeptService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.DeptVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 部门管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-02-06 |
| | | */ |
| | | @Service |
| | | public class TDeptServiceImpl extends ServiceImpl<TDeptMapper, TDept> implements TDeptService { |
| | | |
| | | @Autowired |
| | | private SysMenuMapper sysMenuMapper; |
| | | @Override |
| | | public boolean isExit(TDept dto) { |
| | | if(StringUtils.hasLength(dto.getId())){ |
| | | // 修改 |
| | | return this.count(Wrappers.lambdaQuery(TDept.class).ne(TDept::getId, dto.getId()).eq(TDept::getDeptId, dto.getDeptId())) > 0; |
| | | }else { |
| | | // 新增 |
| | | return this.count(Wrappers.lambdaQuery(TDept.class).eq(TDept::getDeptId, dto.getDeptId())) > 0; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<DeptVO> pageList(TDeptQuery query) { |
| | | PageInfo<DeptVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<DeptVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | |
| | | } |