diff --git a/february-patient-server/src/main/java/com/february/patient/controller/PatientController.java b/february-patient-server/src/main/java/com/february/patient/controller/PatientController.java index 6552c42..74d7bbd 100644 --- a/february-patient-server/src/main/java/com/february/patient/controller/PatientController.java +++ b/february-patient-server/src/main/java/com/february/patient/controller/PatientController.java @@ -5,6 +5,8 @@ import com.february.patient.service.PatientService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @program: february-patient-circle * @description: @@ -20,4 +22,8 @@ public class PatientController { public PatientCircleDetail circleDetail(@RequestParam Integer patientCircleDetailId){ return patientService.circleDetail(patientCircleDetailId); } + @PostMapping("/findByName") + public List findByName(@RequestParam String title){ + return patientService.findByName(title); + } } diff --git a/february-patient-server/src/main/java/com/february/patient/mapper/PatientMapper.java b/february-patient-server/src/main/java/com/february/patient/mapper/PatientMapper.java index fae94ea..35db6ea 100644 --- a/february-patient-server/src/main/java/com/february/patient/mapper/PatientMapper.java +++ b/february-patient-server/src/main/java/com/february/patient/mapper/PatientMapper.java @@ -4,6 +4,8 @@ import com.february.patient.domain.PatientCircleDetail; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * @program: february-patient-circle * @description: @@ -14,4 +16,6 @@ import org.apache.ibatis.annotations.Param; public interface PatientMapper { PatientCircleDetail circleDetail(@Param("patientCircleDetailId") Integer patientCircleDetailId); + + List findByName(@Param("title") String title); } diff --git a/february-patient-server/src/main/java/com/february/patient/service/PatientService.java b/february-patient-server/src/main/java/com/february/patient/service/PatientService.java index c7d8aba..efbdd18 100644 --- a/february-patient-server/src/main/java/com/february/patient/service/PatientService.java +++ b/february-patient-server/src/main/java/com/february/patient/service/PatientService.java @@ -2,6 +2,8 @@ package com.february.patient.service; import com.february.patient.domain.PatientCircleDetail; +import java.util.List; + /** * @program: february-patient-circle * @description: @@ -10,4 +12,7 @@ import com.february.patient.domain.PatientCircleDetail; **/ public interface PatientService { PatientCircleDetail circleDetail(Integer patientCircleDetailId); + + + List findByName(String title); } diff --git a/february-patient-server/src/main/java/com/february/patient/service/impl/PatientServiceImpl.java b/february-patient-server/src/main/java/com/february/patient/service/impl/PatientServiceImpl.java index 43456b4..68a503e 100644 --- a/february-patient-server/src/main/java/com/february/patient/service/impl/PatientServiceImpl.java +++ b/february-patient-server/src/main/java/com/february/patient/service/impl/PatientServiceImpl.java @@ -6,6 +6,8 @@ import com.february.patient.service.PatientService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * @program: february-patient-circle * @description: @@ -20,4 +22,11 @@ public class PatientServiceImpl implements PatientService { public PatientCircleDetail circleDetail(Integer patientCircleDetailId) { return patientMapper.circleDetail(patientCircleDetailId); } + + @Override + public List findByName(String title) { + List list=patientMapper.findByName(title); + return list; + } + } diff --git a/february-patient-server/src/main/resources/mapper/patient/PatientMapper.xml b/february-patient-server/src/main/resources/mapper/patient/PatientMapper.xml index 4221ab9..c417249 100644 --- a/february-patient-server/src/main/resources/mapper/patient/PatientMapper.xml +++ b/february-patient-server/src/main/resources/mapper/patient/PatientMapper.xml @@ -19,4 +19,9 @@ select title,publish_name,department_name,patient_detail,treatment_experience,patient_img, collect_num,review_num from t_patient_circle_detail where patient_circle_detail_id=#{patientCircleDetailId} + +