更新表数据和更改表
parent
2bd77f3750
commit
197eb5829a
|
@ -1,5 +1,6 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* @program: patient
|
||||
|
@ -9,32 +10,44 @@ import lombok.Data;
|
|||
**/
|
||||
@Data
|
||||
public class Disease {
|
||||
/**
|
||||
* 病症详情id
|
||||
*/
|
||||
private Integer diseaseDetailId;
|
||||
// /**
|
||||
// * 病症详情id
|
||||
// */
|
||||
// private Integer diseaseDetailId;
|
||||
// /**
|
||||
// * 病症id
|
||||
// */
|
||||
// private Integer diseaseId;
|
||||
// /**
|
||||
// * 病理
|
||||
// */
|
||||
// private String diseaseDetailPathology;
|
||||
// /**
|
||||
// * 病状
|
||||
// */
|
||||
// private String diseaseDetailSymptom;
|
||||
// /**
|
||||
// * 宜与忌
|
||||
// */
|
||||
// private String diseaseDetailAnnouncements;
|
||||
// /**
|
||||
// * 西药治疗
|
||||
// */
|
||||
// private String diseaseDetailUsage;
|
||||
// /**
|
||||
// * 所属科目
|
||||
// */
|
||||
// private String diseaseName;
|
||||
/**
|
||||
* 病症id
|
||||
*/
|
||||
private Integer diseaseId;
|
||||
/**
|
||||
* 病理
|
||||
*/
|
||||
private String diseaseDetailPathology;
|
||||
/**
|
||||
* 病状
|
||||
*/
|
||||
private String diseaseDetailSymptom;
|
||||
/**
|
||||
* 宜与忌
|
||||
*/
|
||||
private String diseaseDetailAnnouncements;
|
||||
/**
|
||||
* 西药治疗
|
||||
*/
|
||||
private String diseaseDetailUsage;
|
||||
/**
|
||||
* 所属科目
|
||||
* 科室及病症名称
|
||||
*/
|
||||
private String diseaseName;
|
||||
/**
|
||||
* 父级id
|
||||
*/
|
||||
private Integer diseaseParentId;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
@ -12,24 +13,68 @@ import java.util.Date;
|
|||
**/
|
||||
@Data
|
||||
public class PatientCircle {
|
||||
// /**
|
||||
// * 病友圈id
|
||||
// */
|
||||
// private Integer patientCircleId;
|
||||
// /**
|
||||
// * 病友圈标题
|
||||
// */
|
||||
// private String patientCircleTitle;
|
||||
// /**
|
||||
// * 发布时间
|
||||
// */
|
||||
// private Date patientCircleTime;
|
||||
// /**
|
||||
// * 病友圈详情
|
||||
// */
|
||||
// private String patientCircleDetails;
|
||||
// /**
|
||||
// * 用户id
|
||||
// */
|
||||
// private Integer userId;
|
||||
// /**
|
||||
// * 所属科室id
|
||||
// */
|
||||
// private Integer diseaseId;
|
||||
// /**
|
||||
// * 所属科室名称
|
||||
// */
|
||||
// private String diseaseName;
|
||||
/**
|
||||
* 病友圈id
|
||||
*/
|
||||
private Integer patientCircleId;
|
||||
/**
|
||||
* 病友圈标题
|
||||
*/
|
||||
private String patientCircleTitle;
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
private Date patientCircleTime;
|
||||
/**
|
||||
* 病友圈详情
|
||||
*/
|
||||
private String patientCircleDetails;
|
||||
/**
|
||||
* 用户id
|
||||
* 用户ID
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 病症id
|
||||
*/
|
||||
private Integer diseaseId;
|
||||
/**
|
||||
* 病症详情
|
||||
*/
|
||||
private String diseaseDetail;
|
||||
/**
|
||||
* 治疗经历id
|
||||
*/
|
||||
private Integer diseaseProcessId;
|
||||
/**
|
||||
* 相关图片
|
||||
*/
|
||||
private String pic;
|
||||
/**
|
||||
* 收藏数
|
||||
*/
|
||||
private Integer collectNum;
|
||||
/**
|
||||
* 评论数
|
||||
*/
|
||||
private Integer reviewNum;
|
||||
/**
|
||||
* 被采纳id
|
||||
*/
|
||||
private Integer adoptedId;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
@ -12,14 +13,50 @@ import java.util.Date;
|
|||
**/
|
||||
@Data
|
||||
public class Review {
|
||||
// /**
|
||||
// * 评论id
|
||||
// */
|
||||
// private Integer reviewId;
|
||||
// /**
|
||||
// * 评论者
|
||||
// */
|
||||
// private String reviewName;
|
||||
// /**
|
||||
// * 评论内容
|
||||
// */
|
||||
// private String reviewDetail;
|
||||
// /**
|
||||
// * 评论时间
|
||||
// */
|
||||
// private Date reviewTime;
|
||||
// /**
|
||||
// * 点赞数
|
||||
// */
|
||||
// private Integer upvoteNum;
|
||||
// /**
|
||||
// * 嘲讽数
|
||||
// */
|
||||
// private Integer negativeNum;
|
||||
// /**
|
||||
// * 头像
|
||||
// */
|
||||
// private String avatar;
|
||||
// /**
|
||||
// * 是否采纳
|
||||
// */
|
||||
// private Integer isAdopt;
|
||||
/**
|
||||
* 评论id
|
||||
*/
|
||||
private Integer reviewId;
|
||||
/**
|
||||
* 评论者
|
||||
* 头像
|
||||
*/
|
||||
private String reviewName;
|
||||
private String avatar;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 评论内容
|
||||
*/
|
||||
|
@ -31,17 +68,13 @@ public class Review {
|
|||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private Integer upvoteNum;
|
||||
private Integer approveNum;
|
||||
/**
|
||||
* 嘲讽数
|
||||
* 不认同数
|
||||
*/
|
||||
private Integer negativeNum;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
private Integer disapproveNum;
|
||||
/**
|
||||
* 是否采纳
|
||||
*/
|
||||
private Integer isAdopt;
|
||||
private Integer isAdopted;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
@ -20,13 +21,16 @@ public class User {
|
|||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
// /**
|
||||
// * 用户邮箱
|
||||
// */
|
||||
// private String userEmail;
|
||||
// /**
|
||||
// * 用户邮箱账号
|
||||
// */
|
||||
// private String userEmailNumber;
|
||||
/**
|
||||
* 用户邮箱
|
||||
* 角色id
|
||||
*/
|
||||
private String userEmail;
|
||||
/**
|
||||
* 用户邮箱账号
|
||||
*/
|
||||
private String userEmailNumber;
|
||||
|
||||
private Integer roleId;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.february.patient.circle.domain.request.PatientRequest;
|
|||
import com.february.patient.circle.domain.request.ReviewPatientRequest;
|
||||
import com.february.patient.circle.result.Result;
|
||||
import com.february.patient.circle.service.PatientService;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
@ -29,8 +30,8 @@ public class PatientController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("/patientCircleList")
|
||||
public Result<List<PatientCircle>> patientCircleList(Integer userId){
|
||||
return patientService.patientCircleList(userId);
|
||||
public Result<List<PatientCircle>> patientCircleList(Integer diseaseId){
|
||||
return patientService.patientCircleList(diseaseId);
|
||||
}
|
||||
/**
|
||||
* 个人信息展示
|
||||
|
@ -130,8 +131,24 @@ public class PatientController {
|
|||
public Result patientToSick(@RequestBody ReviewPatientRequest reviewPatientRequest){
|
||||
return patientService.patientToSick(reviewPatientRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传照片文件
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/uploadMsg")
|
||||
public Result uploadMsg(@RequestParam("file")MultipartFile file){
|
||||
return patientService.uploadMsg(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* 科室名称查询
|
||||
* @param diseaseId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/findDiseaseName")
|
||||
public String findDiseaseName(@RequestParam Integer diseaseId){
|
||||
return patientService.findDiseaseName(diseaseId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import java.util.List;
|
|||
**/
|
||||
@Mapper
|
||||
public interface PatientMapper {
|
||||
List<PatientCircle> patientCircleList(@Param("userId") Integer userId);
|
||||
List<PatientCircle> patientCircleList(@Param("diseaseId") Integer diseaseId);
|
||||
|
||||
|
||||
|
||||
|
@ -41,4 +41,6 @@ public interface PatientMapper {
|
|||
List<PatientRequest> patientList(@Param("patientNickname") String patientNickname);
|
||||
|
||||
Integer patientToSick(ReviewPatientRequest reviewPatientRequest);
|
||||
|
||||
String findDiseaseName(@Param("diseaseId") Integer diseaseId);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.february.patient.circle.domain.request.PatientCircleRequest;
|
|||
import com.february.patient.circle.domain.request.PatientRequest;
|
||||
import com.february.patient.circle.domain.request.ReviewPatientRequest;
|
||||
import com.february.patient.circle.result.Result;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
@ -19,7 +20,7 @@ import java.util.List;
|
|||
**/
|
||||
@Component
|
||||
public interface PatientService {
|
||||
Result<List<PatientCircle>> patientCircleList(Integer userId);
|
||||
Result<List<PatientCircle>> patientCircleList(Integer diseaseId);
|
||||
|
||||
Result<List<PatientRequest>> patientList(String patientNickname);
|
||||
|
||||
|
@ -44,4 +45,6 @@ public interface PatientService {
|
|||
Result patientToSick(ReviewPatientRequest reviewPatientRequest);
|
||||
|
||||
Result uploadMsg(MultipartFile file);
|
||||
|
||||
String findDiseaseName(Integer diseaseId);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.february.patient.circle.service.impl;
|
||||
|
||||
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import com.february.patient.circle.constants.JwtConstants;
|
||||
import com.february.patient.circle.domain.*;
|
||||
import com.february.patient.circle.domain.request.PatientCircleRequest;
|
||||
|
@ -12,6 +12,7 @@ import com.february.patient.circle.service.PatientService;
|
|||
import com.february.patient.circle.util.FastUtil;
|
||||
import com.february.patient.circle.util.OssUtil;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Cleanup;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
@ -33,8 +34,12 @@ public class PatientServiceImpl implements PatientService {
|
|||
@Autowired
|
||||
private OssUtil ossUtil;
|
||||
@Override
|
||||
public Result<List<PatientCircle>> patientCircleList(Integer userId) {
|
||||
List<PatientCircle> list=patientMapper.patientCircleList(userId);
|
||||
public Result<List<PatientCircle>> patientCircleList(Integer diseaseId) {
|
||||
String diseaseName = findDiseaseName(diseaseId);
|
||||
List<PatientCircle> list=patientMapper.patientCircleList(diseaseId);
|
||||
list.forEach(l->{
|
||||
l.setDiseaseName(diseaseName);
|
||||
});
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
@ -88,9 +93,10 @@ public class PatientServiceImpl implements PatientService {
|
|||
|
||||
@Override
|
||||
public Result upload(MultipartFile file) {
|
||||
String upload="";
|
||||
try {
|
||||
String upload = fastUtil.upload(file);
|
||||
return Result.success("http://10.100.1.2:8888/"+upload,"上传成功");
|
||||
upload = fastUtil.upload(file);
|
||||
return Result.success("http://47.120.41.50:8888/"+upload,"上传成功");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -122,4 +128,10 @@ public class PatientServiceImpl implements PatientService {
|
|||
}
|
||||
return Result.success("上传失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String findDiseaseName(Integer diseaseId) {
|
||||
|
||||
return patientMapper.findDiseaseName(diseaseId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,23 +16,23 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.100.1.2:8848
|
||||
server-addr: 47.120.41.50:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.100.1.2:8848
|
||||
server-addr: 47.120.41.50:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
rabbitmq:
|
||||
host: 10.100.1.3
|
||||
host: 47.113.230.149
|
||||
fdfs:
|
||||
so-timeout: 1500 # socket 连接时长
|
||||
connect-timeout: 600 # 连接 tracker 服务器超时时长
|
||||
# 这两个是你服务器的 IP 地址,注意 23000 端口也要打开,阿里云服务器记得配置安全组。tracker 要和 stroage 服务进行交流
|
||||
tracker-list: 10.100.1.2:22122
|
||||
web-server-url: 10.100.1.2:8888
|
||||
tracker-list: 47.120.41.50:22122
|
||||
web-server-url: 47.120.41.50:8888
|
||||
pool:
|
||||
jmx-enabled: false
|
||||
# 生成缩略图
|
||||
|
|
|
@ -1,37 +1,41 @@
|
|||
<?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.circle.mapper.PatientMapper">
|
||||
<insert id="addPatientCircle">
|
||||
INSERT INTO `patient`.`t_patient_circle_log` (`patient_circle_title`, `disease_id`, `drug_id`, `patient_circle_detail`, `hospital`, `patient_circle_start_time`, `patient_circle_end_time`, `patient_circle_process`, `patient_circle_picture`) VALUES ( #{patientCircleTitle}, #{diseaseId}, #{drugId}, #{patientCircleDetail}, #{hospital}, #{patientCircleStartTime}, #{patientCircleEndTime}, #{patientCircleProcess}, #{patientCirclePicture})
|
||||
</insert>
|
||||
<insert id="patientToSick">
|
||||
INSERT INTO `ry-cloud`.`t_review` (`review_id`, `review_detail`) VALUES (#{reviewId},#{reviewDetail})
|
||||
</insert>
|
||||
<select id="patientCircleList" resultType="com.february.patient.circle.domain.PatientCircle">
|
||||
select * from t_patient_circle where user_id=#{userId}
|
||||
</select>
|
||||
<select id="reviewList" resultType="com.february.patient.circle.domain.Review">
|
||||
select * from t_review
|
||||
</select>
|
||||
<select id="findPatientCircle" resultType="com.february.patient.circle.domain.PatientCircle">
|
||||
select * from t_patient_circle where patient_circle_title like ('%',#{patientCircle},'%')
|
||||
</select>
|
||||
<select id="diseaseList" resultType="com.february.patient.circle.domain.Disease">
|
||||
SELECT t1.*,t3.disease_name from t_disease_detail t1 LEFT JOIN t_disease t2 on t1.disease_id=t2.disease_id LEFT JOIN t_disease t3 on t2.disease_parent_id=t3.disease_id
|
||||
</select>
|
||||
<select id="drugList" resultType="com.february.patient.circle.domain.Drug">
|
||||
SELECT t1.*,t3.drug_name from t_drug_detail t1 LEFT JOIN t_drug t2 on t1.drug_id=t2.drug_id LEFT JOIN t_drug t3 on t2.drug_parent_id=t3.drug_id
|
||||
</select>
|
||||
<select id="findPatientCircleList" resultType="com.february.patient.circle.domain.PatientCircle">
|
||||
select * from t_patient_circle where user_id=#{userId}
|
||||
</select>
|
||||
<select id="findAdoptReview" resultType="com.february.patient.circle.domain.Review">
|
||||
select * from t_review where is_adopt=#{isAdopt}
|
||||
</select>
|
||||
<select id="findByUserEmail" resultType="com.february.patient.circle.domain.User">
|
||||
select * from t_user where user_email_number=#{userEmailNumber}
|
||||
</select>
|
||||
<select id="patientList" resultType="com.february.patient.circle.domain.request.PatientRequest">
|
||||
select * from t_patient p LEFT JOIN t_sex s on p.sex_id=s.sex_id LEFT JOIN t_sign sg on p.sign_id=sg.sign_id LEFT JOIN t_user u on p.user_id=u.user_id where patient_nickname=#{patientNickname}
|
||||
</select>
|
||||
<!-- <insert id="addPatientCircle">-->
|
||||
<!-- INSERT INTO `patient`.`t_patient_circle_log` (`patient_circle_title`, `disease_id`, `drug_id`, `patient_circle_detail`, `hospital`, `patient_circle_start_time`, `patient_circle_end_time`, `patient_circle_process`, `patient_circle_picture`) VALUES ( #{patientCircleTitle}, #{diseaseId}, #{drugId}, #{patientCircleDetail}, #{hospital}, #{patientCircleStartTime}, #{patientCircleEndTime}, #{patientCircleProcess}, #{patientCirclePicture})-->
|
||||
<!-- </insert>-->
|
||||
<!-- <insert id="patientToSick">-->
|
||||
<!-- INSERT INTO `ry-cloud`.`t_review` (`review_id`, `review_detail`) VALUES (#{reviewId},#{reviewDetail})-->
|
||||
<!-- </insert>-->
|
||||
<!-- <select id="patientCircleList" resultType="com.february.patient.circle.domain.PatientCircle">-->
|
||||
<!-- select * from t_patient_circle where disease_id=#{diseaseId}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="reviewList" resultType="com.february.patient.circle.domain.Review">-->
|
||||
<!-- select * from t_review-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="findPatientCircle" resultType="com.february.patient.circle.domain.PatientCircle">-->
|
||||
<!-- select * from t_patient_circle where patient_circle_title like ('%',#{patientCircle},'%')-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="diseaseList" resultType="com.february.patient.circle.domain.Disease">-->
|
||||
<!-- SELECT t1.*,t3.disease_name from t_disease_detail t1 LEFT JOIN t_disease t2 on t1.disease_id=t2.disease_id LEFT JOIN t_disease t3 on t2.disease_parent_id=t3.disease_id-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="drugList" resultType="com.february.patient.circle.domain.Drug">-->
|
||||
<!-- SELECT t1.*,t3.drug_name from t_drug_detail t1 LEFT JOIN t_drug t2 on t1.drug_id=t2.drug_id LEFT JOIN t_drug t3 on t2.drug_parent_id=t3.drug_id-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="findPatientCircleList" resultType="com.february.patient.circle.domain.PatientCircle">-->
|
||||
<!-- select * from t_patient_circle where user_id=#{userId}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="findAdoptReview" resultType="com.february.patient.circle.domain.Review">-->
|
||||
<!-- select * from t_review where is_adopt=#{isAdopt}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="findByUserEmail" resultType="com.february.patient.circle.domain.User">-->
|
||||
<!-- select * from t_user where user_email_number=#{userEmailNumber}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="patientList" resultType="com.february.patient.circle.domain.request.PatientRequest">-->
|
||||
<!-- select * from t_patient p LEFT JOIN t_sex s on p.sex_id=s.sex_id LEFT JOIN t_sign sg on p.sign_id=sg.sign_id LEFT JOIN t_user u on p.user_id=u.user_id where patient_nickname=#{patientNickname}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="findDiseaseName" resultType="java.lang.String">-->
|
||||
<!-- select disease_name from t_disease where disease_id=#{diseaseId}-->
|
||||
<!-- </select>-->
|
||||
</mapper>
|
||||
|
||||
|
|
Loading…
Reference in New Issue