master
parent
7cb5e026b5
commit
23fcac41aa
|
@ -0,0 +1,25 @@
|
||||||
|
package com.bwie.common.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zhx
|
||||||
|
* @Package: com.bwie.common.domain
|
||||||
|
* @Datetime: 2023/12/10 11:20
|
||||||
|
* @Filename: BloodPressure
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BloodPressure {
|
||||||
|
private Integer bpId;
|
||||||
|
private String userId;
|
||||||
|
private String userName;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date measurementTime;
|
||||||
|
private Integer systolicPressure;
|
||||||
|
private Integer diastolicPressure;
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.bwie.common.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zhx
|
||||||
|
* @Package: com.bwie.common.domain
|
||||||
|
* @Datetime: 2023/12/10 11:56
|
||||||
|
* @Filename: DiabetesPatient
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DiabetesPatient {
|
||||||
|
|
||||||
|
private Integer patientId;
|
||||||
|
private Integer userId;
|
||||||
|
private String userName;
|
||||||
|
private Integer doctorId;
|
||||||
|
private String doctorName;
|
||||||
|
private String managementStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.bwie.common.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zhx
|
||||||
|
* @Package: com.bwie.common.domain
|
||||||
|
* @Datetime: 2023/12/10 11:31
|
||||||
|
* @Filename: HealthEducation
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class HealthEducation {
|
||||||
|
|
||||||
|
private Integer contentId;
|
||||||
|
private String title;
|
||||||
|
private String content;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date publishTime;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.bwie.common.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zhx
|
||||||
|
* @Package: com.bwie.common.domain
|
||||||
|
* @Datetime: 2023/12/10 11:37
|
||||||
|
* @Filename: HealthRecords
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class HealthRecords {
|
||||||
|
|
||||||
|
private Integer recordId;
|
||||||
|
private Integer userId;
|
||||||
|
private String userName;
|
||||||
|
private String medicalHistory;
|
||||||
|
private String drugAllergies;
|
||||||
|
private String surgicalHistory;
|
||||||
|
private String familyHistory;
|
||||||
|
|
||||||
|
}
|
|
@ -29,16 +29,52 @@ public class BloodController {
|
||||||
@GetMapping("/bloodList")
|
@GetMapping("/bloodList")
|
||||||
public Result bloodList(){
|
public Result bloodList(){
|
||||||
|
|
||||||
log.info("功能名称:xxx,请求URI:{},请求方式:{},请求参数:{}",
|
log.info("功能名称:获取个人血糖数据,请求URI:{},请求方式:{},请求参数:{}",
|
||||||
request.getRequestURI(),request.getMethod(),null);
|
request.getRequestURI(),request.getMethod(),null);
|
||||||
Result result = bloodService.bloodList();
|
Result result = bloodService.bloodList();
|
||||||
log.info("功能名称:xxx,请求URI:{},请求方式:{},响应结果:{}",
|
log.info("功能名称:获取个人血糖数据,请求URI:{},请求方式:{},响应结果:{}",
|
||||||
|
request.getRequestURI(),request.getMethod(), JSONObject.toJSONString(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/BloodPressureList")
|
||||||
|
public Result BloodPressure(){
|
||||||
|
log.info("功能名称:获取个人血压数据,请求URI:{},请求方式:{},请求参数:{}",
|
||||||
|
request.getRequestURI(),request.getMethod(),null);
|
||||||
|
Result result = bloodService.BloodPressure();
|
||||||
|
log.info("功能名称:获取个人血压数据,请求URI:{},请求方式:{},响应结果:{}",
|
||||||
|
request.getRequestURI(),request.getMethod(), JSONObject.toJSONString(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/HealthEducationList")
|
||||||
|
public Result HealthEducationList(){
|
||||||
|
log.info("功能名称:获取健康教育内容,请求URI:{},请求方式:{},请求参数:{}",
|
||||||
|
request.getRequestURI(),request.getMethod(),null);
|
||||||
|
Result result = bloodService.HealthEducationList();
|
||||||
|
log.info("功能名称:获取健康教育内容,请求URI:{},请求方式:{},响应结果:{}",
|
||||||
|
request.getRequestURI(),request.getMethod(), JSONObject.toJSONString(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
@GetMapping("/HealthRecordsList")
|
||||||
|
public Result HealthRecordsList(){
|
||||||
|
log.info("功能名称:获取健康档案,请求URI:{},请求方式:{},请求参数:{}",
|
||||||
|
request.getRequestURI(),request.getMethod(),null);
|
||||||
|
Result result = bloodService.HealthRecordsList();
|
||||||
|
log.info("功能名称:获取获取健康档案,请求URI:{},请求方式:{},响应结果:{}",
|
||||||
|
request.getRequestURI(),request.getMethod(), JSONObject.toJSONString(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/DiabetesPatientList")
|
||||||
|
public Result DiabetesPatientList(){
|
||||||
|
log.info("功能名称:获取糖尿病列表,请求URI:{},请求方式:{},请求参数:{}",
|
||||||
|
request.getRequestURI(),request.getMethod(),null);
|
||||||
|
Result result = bloodService.DiabetesPatientList();
|
||||||
|
log.info("功能名称:获取糖尿病列表,请求URI:{},请求方式:{},响应结果:{}",
|
||||||
request.getRequestURI(),request.getMethod(), JSONObject.toJSONString(result));
|
request.getRequestURI(),request.getMethod(), JSONObject.toJSONString(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package com.bwie.mapper;
|
package com.bwie.mapper;
|
||||||
|
|
||||||
import com.bwie.common.domain.BloodSuger;
|
import com.bwie.common.domain.*;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -15,7 +16,15 @@ import java.util.List;
|
||||||
public interface BloodMapper {
|
public interface BloodMapper {
|
||||||
|
|
||||||
|
|
||||||
List<BloodSuger> bloodList();
|
List<BloodSuger> bloodList(@Param("userId") Integer userId);
|
||||||
|
|
||||||
|
|
||||||
|
List<BloodPressure> BloodPressure(@Param("userId") Integer userId);
|
||||||
|
|
||||||
|
List<HealthEducation> HealthEducationList();
|
||||||
|
|
||||||
|
|
||||||
|
List<HealthRecords> HealthRecordsList(@Param("userId") Integer userId);
|
||||||
|
|
||||||
|
List<DiabetesPatient> DiabetesPatientList(@Param("userId") Integer userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,4 +13,16 @@ public interface BloodService {
|
||||||
Result bloodList();
|
Result bloodList();
|
||||||
|
|
||||||
|
|
||||||
|
Result BloodPressure();
|
||||||
|
|
||||||
|
|
||||||
|
Result HealthEducationList();
|
||||||
|
|
||||||
|
|
||||||
|
Result HealthRecordsList();
|
||||||
|
|
||||||
|
|
||||||
|
Result DiabetesPatientList();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.bwie.service.impl;
|
package com.bwie.service.impl;
|
||||||
|
|
||||||
import com.bwie.common.domain.BloodSuger;
|
import com.bwie.common.domain.*;
|
||||||
import com.bwie.common.result.Result;
|
import com.bwie.common.result.Result;
|
||||||
import com.bwie.mapper.BloodMapper;
|
import com.bwie.mapper.BloodMapper;
|
||||||
import com.bwie.service.BloodService;
|
import com.bwie.service.BloodService;
|
||||||
|
@ -24,9 +24,53 @@ public class BloodServiceImpl implements BloodService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result bloodList() {
|
public Result bloodList() {
|
||||||
|
Integer userId = null;
|
||||||
List<BloodSuger> list = bloodMapper.bloodList();
|
List<BloodSuger> list = bloodMapper.bloodList(userId);
|
||||||
Result result = Result.success(list);
|
Result result = Result.success(list);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result BloodPressure() {
|
||||||
|
|
||||||
|
Integer userId = null;
|
||||||
|
|
||||||
|
|
||||||
|
List<BloodPressure> list = bloodMapper.BloodPressure(userId);
|
||||||
|
Result result = Result.success(list);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result HealthEducationList() {
|
||||||
|
List<HealthEducation> list = bloodMapper.HealthEducationList();
|
||||||
|
Result result = Result.success(list);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result HealthRecordsList() {
|
||||||
|
Integer userId = null;
|
||||||
|
|
||||||
|
|
||||||
|
List<HealthRecords> list = bloodMapper.HealthRecordsList(userId);
|
||||||
|
Result result = Result.success(list);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result DiabetesPatientList() {
|
||||||
|
|
||||||
|
Integer userId = null;
|
||||||
|
|
||||||
|
|
||||||
|
List<DiabetesPatient> list = bloodMapper.DiabetesPatientList(userId);
|
||||||
|
Result result = Result.success(list);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,5 +6,37 @@
|
||||||
|
|
||||||
<select id="bloodList" resultType="com.bwie.common.domain.BloodSuger">
|
<select id="bloodList" resultType="com.bwie.common.domain.BloodSuger">
|
||||||
select b.*,u.username from blood_sugar b left join user_info u on b.user_id=u.user_id
|
select b.*,u.username from blood_sugar b left join user_info u on b.user_id=u.user_id
|
||||||
|
<where>
|
||||||
|
<if test="userId!=null">
|
||||||
|
u.user_id=#{userId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="BloodPressure" resultType="com.bwie.common.domain.BloodPressure">
|
||||||
|
select b.*,u.username from blood_pressure b left join user_info u on b.user_id=u.user_id
|
||||||
|
<where>
|
||||||
|
<if test="userId!=null">
|
||||||
|
u.user_id=#{userId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="HealthEducationList" resultType="com.bwie.common.domain.HealthEducation">
|
||||||
|
select * from health_education
|
||||||
|
</select>
|
||||||
|
<select id="HealthRecordsList" resultType="com.bwie.common.domain.HealthRecords">
|
||||||
|
select h.*,u.username from health_records h left join user_info u on h.user_id=u.user_id
|
||||||
|
<where>
|
||||||
|
<if test="userId!=null">
|
||||||
|
u.user_id=#{userId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="DiabetesPatientList" resultType="com.bwie.common.domain.DiabetesPatient">
|
||||||
|
select d.*,u.username,a.username from diabetes_patient d left join user_info u on d.user_id=u.user_id left join admin_account a on a.admin_id=d.doctor_id
|
||||||
|
<where>
|
||||||
|
<if test="userId!=null">
|
||||||
|
u.user_id=#{userId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue