病友圈评论
parent
2b6680d088
commit
b5e3477c60
|
@ -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 +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue