|  |  | 
 |  |  | import com.baomidou.mybatisplus.service.impl.ServiceImpl; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | @Service("cstmrService") | 
 |  |  | public class CstmrServiceImpl extends ServiceImpl<CstmrMapper, Cstmr> implements CstmrService { | 
 |  |  |  | 
 |  |  | 
 |  |  |     private String getNextUuid(Long hostId) { | 
 |  |  |         Cstmr cstmr = this.baseMapper.selectCstmrByNewestUuid(hostId); | 
 |  |  |         if (cstmr == null) { | 
 |  |  |             return "0001"; | 
 |  |  |             return "00001"; | 
 |  |  |         } | 
 |  |  |         return zerofill(String.valueOf(Integer.parseInt(cstmr.getUuid()) + 1), 4); | 
 |  |  |         return zerofill(String.valueOf(Integer.parseInt(cstmr.getUuid()) + 1), 5); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Page<Cstmr> getPage(Page page, Long hostId, String deptId, String condition) { | 
 |  |  |         return page.setRecords(baseMapper.listByPage(page, hostId, deptId, condition)); | 
 |  |  |     public Page<Cstmr> getPage2(Page<Cstmr> page, Long hostId, Long deptId, Long userId,Long roleId, String conditionName, String condition) { | 
 |  |  |         return page.setRecords(baseMapper.listByPage2(page, hostId, deptId, userId,roleId,conditionName, condition)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Page<Cstmr> getPage1(Page<Cstmr> page, Long hostId, String deptId, Long userId,String conditionName,  String condition) { | 
 |  |  |         return page.setRecords(baseMapper.listByPage1(page, hostId, deptId, userId,conditionName, condition)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Page<Cstmr> getPage3(Page<Cstmr> page, Long hostId, String deptId, Long userId, List<Integer> cstmrIds, String conditionName, String condition) { | 
 |  |  |         if (cstmrIds==null){ | 
 |  |  |             return page.setRecords(baseMapper.listByPage1(page, hostId, deptId, userId,conditionName, condition)); | 
 |  |  |         }else { | 
 |  |  |             return page.setRecords(baseMapper.listByPage3(page, hostId, deptId, userId,cstmrIds,conditionName, condition)); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Page<Cstmr> getPage(Page<Cstmr> page, Long hostId, String deptId, Long userId,  String condition) { | 
 |  |  |         return page.setRecords(baseMapper.listByPage(page, hostId, deptId, userId, condition)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public int updateDeptIdByUserId(Long userId, Long deptId) { | 
 |  |  |         return this.baseMapper.updateDeptIdByUserId(userId, deptId); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static String zerofill(String msg, Integer count){ | 
 |  |  |         if (msg.length() == count){ | 
 |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Cstmr selectByName(Long hostId, String name) { | 
 |  |  |         return this.baseMapper.selectByName(hostId, name); | 
 |  |  |     } | 
 |  |  | } |