修改体检统计数据的参数

This commit is contained in:
lxd 2025-05-27 14:35:44 +08:00
parent 83bc8a06b0
commit 14117aaa69
2 changed files with 19 additions and 8 deletions

View File

@ -94,7 +94,7 @@ public interface InspectPatientService {
/*
* 根据条件获取患者的详细信息
* */
List<InspectPatientDO> getPatientdetails(String stadate, String enddate, String addname);
List<InspectPatientDO> getPatientdetails(PatientDetailsVO detailsVO);
/*
* 根据体检编号更新数据

View File

@ -172,7 +172,7 @@ public class InspectPatientServiceImpl implements InspectPatientService {
return patientDO;
}
@Override
public List<InspectPatientDO> getPatientdetails(String stadate, String enddate, String addname) {
public List<InspectPatientDO> getPatientdetails(PatientDetailsVO detailsVO) {
LambdaQueryWrapper<InspectPatientDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper
.select(
@ -194,11 +194,11 @@ public class InspectPatientServiceImpl implements InspectPatientService {
LocalDate endDate = null;
try {
if (stadate != null && !stadate.isEmpty()) {
startDate = LocalDate.parse(stadate, formatter);
if (detailsVO.getStadate() != null && !detailsVO.getStadate().isEmpty()) {
startDate = LocalDate.parse(detailsVO.getStadate(), formatter);
}
if (enddate != null && !enddate.isEmpty()) {
endDate = LocalDate.parse(enddate, formatter);
if (detailsVO.getEnddate() != null && !detailsVO.getEnddate().isEmpty()) {
endDate = LocalDate.parse(detailsVO.getEnddate(), formatter);
}
} catch (Exception e) {
throw new IllegalArgumentException("时间格式不正确,请使用 yyyy-MM-dd 格式");
@ -209,8 +209,19 @@ public class InspectPatientServiceImpl implements InspectPatientService {
queryWrapper.between(InspectPatientDO::getPrinttime, startDate.atStartOfDay(), endDate.plusDays(1).atStartOfDay());
}
if (addname != null && !addname.isEmpty()) {
queryWrapper.eq(InspectPatientDO::getDistrictname, addname);
if (detailsVO.getAddname() != null && !detailsVO.getAddname().isEmpty()) {
if(detailsVO.getAddname().equals("未知"))
{
queryWrapper.isNull(InspectPatientDO::getDistrictname);
}
else
{
queryWrapper.eq(InspectPatientDO::getDistrictname, detailsVO.getAddname());
}
}
if(detailsVO.getExamhosname()!=null && !detailsVO.getExamhosname().isEmpty())
{
queryWrapper.eq(InspectPatientDO::getOrgname, detailsVO.getExamhosname());
}
return patientMapper.selectList(queryWrapper);