病友圈详情的查询操作

master
王堂东 2023-11-03 09:17:35 +08:00
parent ff6ea9ec0e
commit bd8f74b6e5
5 changed files with 29 additions and 0 deletions

View File

@ -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<PatientCircleDetail> findByName(@RequestParam String title){
return patientService.findByName(title);
}
}

View File

@ -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<PatientCircleDetail> findByName(@Param("title") String title);
}

View File

@ -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<PatientCircleDetail> findByName(String title);
}

View File

@ -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<PatientCircleDetail> findByName(String title) {
List<PatientCircleDetail> list=patientMapper.findByName(title);
return list;
}
}

View File

@ -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}
</select>
<select id="findByName" resultMap="patientCircleDetail">
select title,patient_detail,
collect_num,review_num,disease_name from t_patient_circle_detail where title like concat ('%',#{title},'%') or disease_name=#{title}
</select>
</mapper>