| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package org.example.service;
- import org.example.entity.PatientTest;
- import org.example.mapper.PatientTestMapper;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import java.util.List;
- /**
- * 患者检验报告服务
- */
- @Service
- public class PatientTestService {
- @Autowired
- private PatientTestMapper patientTestMapper;
- /**
- * 根据患者ID(身份证号)查询检验报告列表
- */
- public List<PatientTest> findByPatientId(String patientId) {
- return patientTestMapper.findByPatientId(patientId);
- }
- /**
- * 根据患者表ID查询检验报告列表
- */
- public List<PatientTest> findByPatientTableId(Long patientTableId) {
- return patientTestMapper.findByPatientTableId(patientTableId);
- }
- /**
- * 根据ID查询检验报告
- */
- public PatientTest findById(Long id) {
- return patientTestMapper.findById(id);
- }
- /**
- * 保存检验报告
- */
- public void save(PatientTest test) {
- if (test.getId() == null) {
- patientTestMapper.insert(test);
- } else {
- patientTestMapper.update(test);
- }
- }
- /**
- * 删除检验报告
- */
- public void deleteById(Long id) {
- patientTestMapper.deleteById(id);
- }
- }
|