|
@@ -32,6 +32,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
@Service
|
|
|
@AllArgsConstructor
|
|
|
public class CadreDeptServiceImpl extends MPJBaseServiceImpl<CadreDeptMapper, CadreDept> implements ICadreDeptService {
|
|
|
+ private final CadreDeptMapper cadreDeptMapper;
|
|
|
@Override
|
|
|
public List<CadreDeptTreeVo> getCadreDeptTree() {
|
|
|
CadreDeptTreeDto dto = new CadreDeptTreeDto();
|
|
@@ -40,14 +41,8 @@ public class CadreDeptServiceImpl extends MPJBaseServiceImpl<CadreDeptMapper, Ca
|
|
|
|
|
|
@Override
|
|
|
public List<CadreDeptTreeVo> getCadreDeptTree(CadreDeptTreeDto dto) {
|
|
|
- MPJLambdaWrapper<CadreDept> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
- queryWrapper
|
|
|
- .selectAs(XjrUser::getName, CadreDeptTreeVo::getInstructorUserIdCN)
|
|
|
- .select(CadreDept.class, x -> VoToColumnUtil.fieldsToColumns(CadreDeptTreeVo.class).contains(x.getProperty()))
|
|
|
- .leftJoin(XjrUser.class, XjrUser::getId, CadreDept::getInstructorUserId)
|
|
|
- .orderByDesc(CadreDept::getId);
|
|
|
|
|
|
- List<CadreDeptTreeVo> list = this.selectJoinList(CadreDeptTreeVo.class,queryWrapper);
|
|
|
+ List<CadreDeptTreeVo> list = cadreDeptMapper.getCadreDeptTree(dto);
|
|
|
|
|
|
List<CadreDeptTreeVo> treeVoList = TreeUtil.build(list);
|
|
|
return treeVoList;
|