病友圈评论

master
王堂东 2023-11-02 21:38:40 +08:00
parent 2b6680d088
commit b5e3477c60
7 changed files with 232 additions and 2 deletions

View File

@ -0,0 +1,125 @@
package com.february.patient.domain;
/**
* @program: february-patient-circle
* @description:
* @author: Mr.Wang
* @create: 2023-11-02 20:27
**/
import java.util.Date;
/**
*
*/
public class Review {
/**
* id
*/
private Integer reviewId;
/**
*
*/
private String reviewImg;
/**
*
*/
private String reviewName;
/**
*
*/
private String reviewContent;
/**
*
*/
private Date reviewDate;
/**
*
*/
private Integer goodNum;
/**
*
*/
private Integer badNum;
/**
* id
*/
private Integer patientCircleDetailId;
public Integer getPatientCircleDetailId() {
return patientCircleDetailId;
}
public void setPatientCircleDetailId(Integer patientCircleDetailId) {
this.patientCircleDetailId = patientCircleDetailId;
}
public Integer getReviewId() {
return reviewId;
}
public void setReviewId(Integer reviewId) {
this.reviewId = reviewId;
}
public String getReviewImg() {
return reviewImg;
}
public void setReviewImg(String reviewImg) {
this.reviewImg = reviewImg;
}
public String getReviewName() {
return reviewName;
}
public void setReviewName(String reviewName) {
this.reviewName = reviewName;
}
public String getReviewContent() {
return reviewContent;
}
public void setReviewContent(String reviewContent) {
this.reviewContent = reviewContent;
}
public Date getReviewDate() {
return reviewDate;
}
public void setReviewDate(Date reviewDate) {
this.reviewDate = reviewDate;
}
public Integer getGoodNum() {
return goodNum;
}
public void setGoodNum(Integer goodNum) {
this.goodNum = goodNum;
}
public Integer getBadNum() {
return badNum;
}
public void setBadNum(Integer badNum) {
this.badNum = badNum;
}
@Override
public String toString() {
return "Review{" +
"reviewId=" + reviewId +
", reviewImg='" + reviewImg + '\'' +
", reviewName='" + reviewName + '\'' +
", reviewContent='" + reviewContent + '\'' +
", reviewDate=" + reviewDate +
", goodNum=" + goodNum +
", badNum=" + badNum +
'}';
}
}

View File

@ -0,0 +1,28 @@
package com.february.patient.controller;
import com.february.patient.domain.Review;
import com.february.patient.service.ReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @program: february-patient-circle
* @description:
* @author: Mr.Wang
* @create: 2023-11-02 20:43
**/
@RestController
@RequestMapping("/review")
public class ReviewController {
@Autowired
private ReviewService reviewService;
@PostMapping("/findReviewListByPatientCircleDetailId")
public List<Review> findReviewListByPatientCircleDetailId(@RequestParam Integer patientCircleDetailId){
return reviewService.findReviewListByPatientCircleDetailId(patientCircleDetailId);
}
}

View File

@ -0,0 +1,16 @@
package com.february.patient.mapper;
import com.february.patient.domain.Review;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @program: february-patient-circle
* @description:
* @author: Mr.Wang
* @create: 2023-11-02 20:43
**/
public interface ReviewMapper {
List<Review> findReviewListByPatientCircleDetailId(@Param("patientCircleDetailId") Integer patientCircleDetailId);
}

View File

@ -0,0 +1,15 @@
package com.february.patient.service;
import com.february.patient.domain.Review;
import java.util.List;
/**
* @program: february-patient-circle
* @description:
* @author: Mr.Wang
* @create: 2023-11-02 20:44
**/
public interface ReviewService {
List<Review> findReviewListByPatientCircleDetailId(Integer patientCircleDetailId);
}

View File

@ -0,0 +1,25 @@
package com.february.patient.service.impl;
import com.february.patient.domain.Review;
import com.february.patient.mapper.ReviewMapper;
import com.february.patient.service.ReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @program: february-patient-circle
* @description:
* @author: Mr.Wang
* @create: 2023-11-02 20:44
**/
@Service
public class ReviewServiceImpl implements ReviewService {
@Autowired
private ReviewMapper reviewMapper;
@Override
public List<Review> findReviewListByPatientCircleDetailId(Integer patientCircleDetailId) {
return reviewMapper.findReviewListByPatientCircleDetailId(patientCircleDetailId);
}
}

View File

@ -10,12 +10,13 @@
<result property="diseaseName" column="disease_name" />
<result property="departmentName" column="department_name" />
<result property="patientDetail" column="patient_detail" />
<result property="treatmentExperience" column="treatment_exception" />
<result property="treatmentExperience" column="treatment_experience" />
<result property="patientImg" column="patient_img" />
<result property="collectNum" column="collect_num" />
<result property="reviewNum" column="review_num" />
</resultMap>
<select id="circleDetail" resultMap="patientCircleDetail">
select * from t_patient_circle_detail where patient_circle_detail_id=#{patientCircleDetailId}
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>
</mapper>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.february.patient.mapper.ReviewMapper">
<resultMap id="Review" type="com.february.patient.domain.Review">
<id property="reviewId" column="review_id" />
<result property="reviewImg" column="review_img" />
<result property="reviewName" column="review_name" />
<result property="reviewContent" column="review_content" />
<result property="goodNum" column="good_num" />
<result property="badNum" column="bad_num" />
<result property="reviewDate" column="review_date" />
<result property="patientCircleDetailId" column="patient_circle_detail_id" />
</resultMap>
<select id="findReviewListByPatientCircleDetailId" resultMap="Review">
select review_id,review_img,review_name,review_content,review_date,good_num,bad_num,patient_circle_detail_id from t_review where patient_circle_detail_id=#{patientCircleDetailId}
</select>
</mapper>