28 lines
973 B
Java
28 lines
973 B
Java
package com.supervision.service.impl;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.supervision.exception.BusinessException;
|
|
import com.supervision.model.Patient;
|
|
import com.supervision.service.AskPatientService;
|
|
import com.supervision.service.PatientService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@Service
|
|
@RequiredArgsConstructor
|
|
public class AskPatientServiceImpl implements AskPatientService {
|
|
|
|
private final PatientService patientService;
|
|
|
|
@Override
|
|
public IPage<Patient> queryPatientPage(Integer pageNum, Integer pageSize) {
|
|
return patientService.lambdaQuery().page(new Page<>(pageNum,pageSize));
|
|
}
|
|
|
|
@Override
|
|
public Patient queryPatientById(String id) {
|
|
return patientService.lambdaQuery().eq(Patient::getId, id).oneOpt().orElseThrow(() -> new BusinessException("未找到用户"));
|
|
}
|
|
}
|