|  |  | 
 |  |  | package doumeemes.service.business.impl; | 
 |  |  |  | 
 |  |  | import doumeemes.core.constants.ResponseStatus; | 
 |  |  | import doumeemes.core.exception.BusinessException; | 
 |  |  | import doumeemes.core.model.ApiResponse; | 
 |  |  | import doumeemes.core.model.LoginUserInfo; | 
 |  |  | import doumeemes.core.model.PageData; | 
 |  |  | 
 |  |  |             find.setDeleted(Constants.ZERO); | 
 |  |  |             find.setName(unit.getName()); | 
 |  |  |             if( this.count(find)>0){ | 
 |  |  |                 throw new RuntimeException("同一单位类型下名称不能重复"); | 
 |  |  |                 throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"单位名称不能重复"); | 
 |  |  |             }else{ | 
 |  |  |                 unitMapper.insert(unit); | 
 |  |  |             } | 
 |  |  | 
 |  |  |         QueryWrapper<Unit> wrapper = new QueryWrapper<>(unit); | 
 |  |  |         return unitMapper.selectList(wrapper); | 
 |  |  |     } | 
 |  |  |    | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public PageData<Unit> findPage(PageWrap<Unit> pageWrap) { | 
 |  |  |         IPage<Unit> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |