病友圈详情的查询操作
parent
ff6ea9ec0e
commit
bd8f74b6e5
|
@ -5,6 +5,8 @@ import com.february.patient.service.PatientService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: february-patient-circle
|
* @program: february-patient-circle
|
||||||
* @description:
|
* @description:
|
||||||
|
@ -20,4 +22,8 @@ public class PatientController {
|
||||||
public PatientCircleDetail circleDetail(@RequestParam Integer patientCircleDetailId){
|
public PatientCircleDetail circleDetail(@RequestParam Integer patientCircleDetailId){
|
||||||
return patientService.circleDetail(patientCircleDetailId);
|
return patientService.circleDetail(patientCircleDetailId);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/findByName")
|
||||||
|
public List<PatientCircleDetail> findByName(@RequestParam String title){
|
||||||
|
return patientService.findByName(title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ import com.february.patient.domain.PatientCircleDetail;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: february-patient-circle
|
* @program: february-patient-circle
|
||||||
* @description:
|
* @description:
|
||||||
|
@ -14,4 +16,6 @@ import org.apache.ibatis.annotations.Param;
|
||||||
public interface PatientMapper {
|
public interface PatientMapper {
|
||||||
|
|
||||||
PatientCircleDetail circleDetail(@Param("patientCircleDetailId") Integer patientCircleDetailId);
|
PatientCircleDetail circleDetail(@Param("patientCircleDetailId") Integer patientCircleDetailId);
|
||||||
|
|
||||||
|
List<PatientCircleDetail> findByName(@Param("title") String title);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package com.february.patient.service;
|
||||||
|
|
||||||
import com.february.patient.domain.PatientCircleDetail;
|
import com.february.patient.domain.PatientCircleDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: february-patient-circle
|
* @program: february-patient-circle
|
||||||
* @description:
|
* @description:
|
||||||
|
@ -10,4 +12,7 @@ import com.february.patient.domain.PatientCircleDetail;
|
||||||
**/
|
**/
|
||||||
public interface PatientService {
|
public interface PatientService {
|
||||||
PatientCircleDetail circleDetail(Integer patientCircleDetailId);
|
PatientCircleDetail circleDetail(Integer patientCircleDetailId);
|
||||||
|
|
||||||
|
|
||||||
|
List<PatientCircleDetail> findByName(String title);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.february.patient.service.PatientService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @program: february-patient-circle
|
* @program: february-patient-circle
|
||||||
* @description:
|
* @description:
|
||||||
|
@ -20,4 +22,11 @@ public class PatientServiceImpl implements PatientService {
|
||||||
public PatientCircleDetail circleDetail(Integer patientCircleDetailId) {
|
public PatientCircleDetail circleDetail(Integer patientCircleDetailId) {
|
||||||
return patientMapper.circleDetail(patientCircleDetailId);
|
return patientMapper.circleDetail(patientCircleDetailId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PatientCircleDetail> findByName(String title) {
|
||||||
|
List<PatientCircleDetail> list=patientMapper.findByName(title);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,4 +19,9 @@
|
||||||
select title,publish_name,department_name,patient_detail,treatment_experience,patient_img,
|
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}
|
collect_num,review_num from t_patient_circle_detail where patient_circle_detail_id=#{patientCircleDetailId}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue