添加病友圈治疗经历
parent
0e6a6c089f
commit
0fa4ef5d9e
|
@ -51,6 +51,48 @@ public class PatientCircleDetail {
|
||||||
* 评论数
|
* 评论数
|
||||||
*/
|
*/
|
||||||
private Integer reviewNum;
|
private Integer reviewNum;
|
||||||
|
/**
|
||||||
|
* 是否悬赏
|
||||||
|
*/
|
||||||
|
private Integer isReward;
|
||||||
|
/**
|
||||||
|
* 悬赏金额
|
||||||
|
*/
|
||||||
|
private Integer rewardNum;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PatientCircleDetail{" +
|
||||||
|
"patientCircleDetailId=" + patientCircleDetailId +
|
||||||
|
", title='" + title + '\'' +
|
||||||
|
", publishName='" + publishName + '\'' +
|
||||||
|
", diseaseName='" + diseaseName + '\'' +
|
||||||
|
", departmentName='" + departmentName + '\'' +
|
||||||
|
", patientDetail='" + patientDetail + '\'' +
|
||||||
|
", treatmentExperience='" + treatmentExperience + '\'' +
|
||||||
|
", patientImg='" + patientImg + '\'' +
|
||||||
|
", collectNum=" + collectNum +
|
||||||
|
", reviewNum=" + reviewNum +
|
||||||
|
", isReward=" + isReward +
|
||||||
|
", reward=" + rewardNum +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIsReward() {
|
||||||
|
return isReward;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsReward(Integer isReward) {
|
||||||
|
this.isReward = isReward;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRewardNum() {
|
||||||
|
return rewardNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRewardNum(Integer reward) {
|
||||||
|
this.rewardNum = reward;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getPatientCircleDetailId() {
|
public Integer getPatientCircleDetailId() {
|
||||||
return patientCircleDetailId;
|
return patientCircleDetailId;
|
||||||
|
@ -132,19 +174,4 @@ public class PatientCircleDetail {
|
||||||
this.reviewNum = reviewNum;
|
this.reviewNum = reviewNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "patientCircleDetail{" +
|
|
||||||
"patientCircleDetailId=" + patientCircleDetailId +
|
|
||||||
", title='" + title + '\'' +
|
|
||||||
", publishName='" + publishName + '\'' +
|
|
||||||
", diseaseName='" + diseaseName + '\'' +
|
|
||||||
", departmentName='" + departmentName + '\'' +
|
|
||||||
", patientDetail='" + patientDetail + '\'' +
|
|
||||||
", treatmentExperience='" + treatmentExperience + '\'' +
|
|
||||||
", patientImg='" + patientImg + '\'' +
|
|
||||||
", collectNum=" + collectNum +
|
|
||||||
", reviewNum=" + reviewNum +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.february.patient.domain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: february-patient-circle
|
||||||
|
* @description: 治疗经历表
|
||||||
|
* @author: Mr.Wang
|
||||||
|
* @create: 2023-11-03 15:46
|
||||||
|
**/
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 治疗经历
|
||||||
|
*/
|
||||||
|
public class TreatmentExperience {
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Integer treatmentExperienceId;
|
||||||
|
/**
|
||||||
|
* 医院名称
|
||||||
|
*/
|
||||||
|
private String hospital;
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Date startTime;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 治疗过程
|
||||||
|
*/
|
||||||
|
private String treatmentExperienceDetail;
|
||||||
|
}
|
|
@ -1,7 +1,9 @@
|
||||||
package com.february.patient.controller;
|
package com.february.patient.controller;
|
||||||
|
|
||||||
import com.february.patient.domain.PatientCircleDetail;
|
import com.february.patient.domain.PatientCircleDetail;
|
||||||
|
import com.february.patient.domain.TreatmentExperience;
|
||||||
import com.february.patient.service.PatientService;
|
import com.february.patient.service.PatientService;
|
||||||
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
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.*;
|
||||||
|
|
||||||
|
@ -42,4 +44,13 @@ public class PatientController {
|
||||||
public List<PatientCircleDetail> findByName(@RequestParam String title){
|
public List<PatientCircleDetail> findByName(@RequestParam String title){
|
||||||
return patientService.findByName(title);
|
return patientService.findByName(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加相关治疗经历
|
||||||
|
* @param treatmentExperience
|
||||||
|
*/
|
||||||
|
@PostMapping("/addExperience")
|
||||||
|
public void addExperience(@RequestBody TreatmentExperience treatmentExperience){
|
||||||
|
patientService.addExperience(treatmentExperience);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.february.patient.mapper;
|
package com.february.patient.mapper;
|
||||||
|
|
||||||
import com.february.patient.domain.PatientCircleDetail;
|
import com.february.patient.domain.PatientCircleDetail;
|
||||||
|
import com.february.patient.domain.TreatmentExperience;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@ -18,4 +19,6 @@ public interface PatientMapper {
|
||||||
PatientCircleDetail circleDetail(@Param("patientCircleDetailId") Integer patientCircleDetailId);
|
PatientCircleDetail circleDetail(@Param("patientCircleDetailId") Integer patientCircleDetailId);
|
||||||
|
|
||||||
List<PatientCircleDetail> findByName(@Param("title") String title);
|
List<PatientCircleDetail> findByName(@Param("title") String title);
|
||||||
|
|
||||||
|
void addExperience(TreatmentExperience treatmentExperience);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.february.patient.service;
|
package com.february.patient.service;
|
||||||
|
|
||||||
import com.february.patient.domain.PatientCircleDetail;
|
import com.february.patient.domain.PatientCircleDetail;
|
||||||
|
import com.february.patient.domain.TreatmentExperience;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -15,4 +16,6 @@ public interface PatientService {
|
||||||
|
|
||||||
|
|
||||||
List<PatientCircleDetail> findByName(String title);
|
List<PatientCircleDetail> findByName(String title);
|
||||||
|
|
||||||
|
void addExperience(TreatmentExperience treatmentExperience);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.february.patient.service.impl;
|
package com.february.patient.service.impl;
|
||||||
|
|
||||||
import com.february.patient.domain.PatientCircleDetail;
|
import com.february.patient.domain.PatientCircleDetail;
|
||||||
|
import com.february.patient.domain.TreatmentExperience;
|
||||||
import com.february.patient.mapper.PatientMapper;
|
import com.february.patient.mapper.PatientMapper;
|
||||||
import com.february.patient.service.PatientService;
|
import com.february.patient.service.PatientService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -29,4 +30,9 @@ public class PatientServiceImpl implements PatientService {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addExperience(TreatmentExperience treatmentExperience) {
|
||||||
|
patientMapper.addExperience(treatmentExperience);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,21 @@
|
||||||
<result property="collectNum" column="collect_num" />
|
<result property="collectNum" column="collect_num" />
|
||||||
<result property="reviewNum" column="review_num" />
|
<result property="reviewNum" column="review_num" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
<insert id="addExperience">
|
||||||
|
-- INSERT INTO `patientcircle`.`t_treatment_experience` (`treatment_experience_id`, `hospital`, `start_time`, `end_time`, `treatment_experience_detail`)
|
||||||
|
-- VALUES (1, NULL, NULL, NULL, NULL);
|
||||||
|
insert into t_treatment_experience(
|
||||||
|
<if test="hospital!=null and hospital!=''">hospital,</if>
|
||||||
|
start_time,
|
||||||
|
end_time,
|
||||||
|
<if test="treatmentExperienceDetail!=null and treatmentExperienceDetail!=''">treatment_experience_detail</if>
|
||||||
|
)values (
|
||||||
|
<if test="hospital!=null and hospital!=''">#{hospital},</if>
|
||||||
|
#{startTime},
|
||||||
|
#{endTime},
|
||||||
|
<if test="treatmentExperienceDetail!=null and treatmentExperienceDetail!=''">#{treatmentExperienceDetail}</if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
<select id="circleDetail" resultMap="patientCircleDetail">
|
<select id="circleDetail" resultMap="patientCircleDetail">
|
||||||
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}
|
||||||
|
|
Loading…
Reference in New Issue