|
@@ -1,5 +1,8 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.diagbot.entity.DeptInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
@@ -7,11 +10,16 @@ import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.DeptInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.AddDeptInfoVO;
|
|
|
+import com.diagbot.vo.GetDeptInfoVO;
|
|
|
import com.diagbot.vo.UpdateDeptInfoVO;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* @Description:
|
|
|
* @Author:zhaops
|
|
@@ -75,4 +83,21 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
return flag;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public IPage<DeptInfo> getDeptInfo(GetDeptInfoVO getDeptInfoVO){
|
|
|
+ IPage iPage =new Page();
|
|
|
+ BeanUtil.copyProperties(getDeptInfoVO,iPage);
|
|
|
+ QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey());
|
|
|
+ if (StringUtil.isNotEmpty(getDeptInfoVO.getName())){
|
|
|
+ queryWrapper.eq("name",getDeptInfoVO.getName());
|
|
|
+ }
|
|
|
+ List<DeptInfo> deptInfoList = this.list(queryWrapper);
|
|
|
+ if (ListUtil.isEmpty(deptInfoList)){
|
|
|
+ throw new CommonException(CommonErrorCode.FAIL,
|
|
|
+ "获取科室信息失败");
|
|
|
+ }
|
|
|
+ iPage.setRecords(deptInfoList);
|
|
|
+ return iPage;
|
|
|
+ }
|
|
|
}
|