healthbody

This commit is contained in:
sxu 2025-03-12 20:26:59 +08:00
parent 29676f8ef6
commit 3a8c9344c7
5 changed files with 742 additions and 0 deletions

View File

@ -0,0 +1,65 @@
package com.bonus.canteen.core.nutrition.common.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import com.bonus.canteen.core.common.page.PageDTO;
@ApiModel("分页查询人员健康监测记录")
public class HealthMonitoringPageDTO extends PageDTO {
@ApiModelProperty("关键字(姓名,编号,手机号)")
private String keyword;
@ApiModelProperty("人员id")
private Long custId;
@ApiModelProperty("健康信息录入来源 1-系统录入 2-身高体重秤")
private Integer healthInfoSource;
@ApiModelProperty("查询月份")
private String queryDate;
@ApiModelProperty("所属组织id 列表")
private List<Long> orgIdList;
public String getKeyword() {
return this.keyword;
}
public Long getCustId() {
return this.custId;
}
public Integer getHealthInfoSource() {
return this.healthInfoSource;
}
public String getQueryDate() {
return this.queryDate;
}
public List<Long> getOrgIdList() {
return this.orgIdList;
}
public void setKeyword(final String keyword) {
this.keyword = keyword;
}
public void setCustId(final Long custId) {
this.custId = custId;
}
public void setHealthInfoSource(final Integer healthInfoSource) {
this.healthInfoSource = healthInfoSource;
}
public void setQueryDate(final String queryDate) {
this.queryDate = queryDate;
}
public void setOrgIdList(final List<Long> orgIdList) {
this.orgIdList = orgIdList;
}
public String toString() {
String var10000 = this.getKeyword();
return "HealthMonitoringPageDTO(keyword=" + var10000 + ", custId=" + this.getCustId() + ", healthInfoSource=" + this.getHealthInfoSource() + ", queryDate=" + this.getQueryDate() + ", orgIdList=" + String.valueOf(this.getOrgIdList()) + ")";
}
}

View File

@ -0,0 +1,15 @@
package com.bonus.canteen.core.nutrition.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.nutrition.common.dto.HealthMonitoringPageDTO;
import com.bonus.canteen.core.nutrition.common.model.HealthBodyRecord;
import com.bonus.canteen.core.nutrition.common.vo.HealthBodyRecordPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface HealthBodyRecordMapper extends BaseMapper<HealthBodyRecord> {
List<HealthBodyRecordPageVO> listHealthMonitoring(@Param("param") HealthMonitoringPageDTO param);
}

View File

@ -0,0 +1,384 @@
package com.bonus.canteen.core.nutrition.common.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bonus.canteen.core.common.encrypt.LeNiuDecryptDataProcess;
import com.bonus.canteen.core.common.encrypt.LeNiuDecryptField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@TableName("health_body_record")
@ApiModel("体征数据记录表 实体类")
@LeNiuDecryptDataProcess
public class HealthBodyRecord {
@TableId("id")
@ApiModelProperty("主键自增")
private Long id;
@TableField("cust_id")
@ApiModelProperty("人员id")
private Long custId;
@TableField("height")
@ApiModelProperty("身高")
private BigDecimal height;
@TableField("weight")
@ApiModelProperty("体重")
private BigDecimal weight;
@TableField("bmi")
@ApiModelProperty("BMI指数")
private BigDecimal bmi;
@TableField("shape")
@ApiModelProperty("体型")
private String shape;
@TableField("bust")
@ApiModelProperty("胸围")
private BigDecimal bust;
@TableField("waistline")
@ApiModelProperty("腰围")
private BigDecimal waistline;
@TableField("blood_sugar")
@ApiModelProperty("血糖")
private BigDecimal bloodSugar;
@TableField("blood_fat")
@ApiModelProperty("血脂")
private Integer bloodFat;
@TableField("blood_pressure_high")
@ApiModelProperty("血压高")
private BigDecimal bloodPressureHigh;
@TableField("blood_pressure_low")
@ApiModelProperty("血压低")
private BigDecimal bloodPressureLow;
@TableField("heart_rate")
@ApiModelProperty("心率")
private BigDecimal heartRate;
@TableField("blood_oxygen")
@ApiModelProperty("血氧")
private BigDecimal bloodOxygen;
@TableField("uric_acid")
@ApiModelProperty("尿酸")
private Integer uricAcid;
@TableField("blood_pressure")
@ApiModelProperty("血压")
private Integer bloodPressure;
@TableField("if_latest")
@ApiModelProperty("是否最新 1-是 2-否")
private Integer ifLatest;
@TableField("if_del")
@ApiModelProperty("是否删除 1-是 2-否")
private Integer ifDel;
@TableField("crby")
@ApiModelProperty("创建人")
private String crby;
@TableField("crtime")
@ApiModelProperty("创建时间")
private LocalDateTime crtime;
@TableField("upby")
@ApiModelProperty("更新人")
private String upby;
@TableField("uptime")
@ApiModelProperty("更新时间")
private LocalDateTime uptime;
@TableField("health_info_source")
@ApiModelProperty("健康信息录入来源 1-系统录入 2-身高体重秤")
private Integer healthInfoSource;
@ApiModelProperty("上传时间")
@TableField(
exist = false
)
private LocalDateTime registerDate;
@ApiModelProperty("人员编号")
@TableField(
exist = false
)
private String custNum;
@ApiModelProperty("人员姓名")
@TableField(
exist = false
)
@LeNiuDecryptField
private String custName;
@ApiModelProperty("手机号")
@TableField(
exist = false
)
@LeNiuDecryptField
private String mobile;
@ApiModelProperty("所属组织")
@TableField(
exist = false
)
private String orgFullName;
@ApiModelProperty("性别 1-男 2-女")
@TableField(
exist = false
)
private Integer sex;
public Long getId() {
return this.id;
}
public Long getCustId() {
return this.custId;
}
public BigDecimal getHeight() {
return this.height;
}
public BigDecimal getWeight() {
return this.weight;
}
public BigDecimal getBmi() {
return this.bmi;
}
public String getShape() {
return this.shape;
}
public BigDecimal getBust() {
return this.bust;
}
public BigDecimal getWaistline() {
return this.waistline;
}
public BigDecimal getBloodSugar() {
return this.bloodSugar;
}
public Integer getBloodFat() {
return this.bloodFat;
}
public BigDecimal getBloodPressureHigh() {
return this.bloodPressureHigh;
}
public BigDecimal getBloodPressureLow() {
return this.bloodPressureLow;
}
public BigDecimal getHeartRate() {
return this.heartRate;
}
public BigDecimal getBloodOxygen() {
return this.bloodOxygen;
}
public Integer getUricAcid() {
return this.uricAcid;
}
public Integer getBloodPressure() {
return this.bloodPressure;
}
public Integer getIfLatest() {
return this.ifLatest;
}
public Integer getIfDel() {
return this.ifDel;
}
public String getCrby() {
return this.crby;
}
public LocalDateTime getCrtime() {
return this.crtime;
}
public String getUpby() {
return this.upby;
}
public LocalDateTime getUptime() {
return this.uptime;
}
public Integer getHealthInfoSource() {
return this.healthInfoSource;
}
public LocalDateTime getRegisterDate() {
return this.registerDate;
}
public String getCustNum() {
return this.custNum;
}
public String getCustName() {
return this.custName;
}
public String getMobile() {
return this.mobile;
}
public String getOrgFullName() {
return this.orgFullName;
}
public Integer getSex() {
return this.sex;
}
public HealthBodyRecord setId(final Long id) {
this.id = id;
return this;
}
public HealthBodyRecord setCustId(final Long custId) {
this.custId = custId;
return this;
}
public HealthBodyRecord setHeight(final BigDecimal height) {
this.height = height;
return this;
}
public HealthBodyRecord setWeight(final BigDecimal weight) {
this.weight = weight;
return this;
}
public HealthBodyRecord setBmi(final BigDecimal bmi) {
this.bmi = bmi;
return this;
}
public HealthBodyRecord setShape(final String shape) {
this.shape = shape;
return this;
}
public HealthBodyRecord setBust(final BigDecimal bust) {
this.bust = bust;
return this;
}
public HealthBodyRecord setWaistline(final BigDecimal waistline) {
this.waistline = waistline;
return this;
}
public HealthBodyRecord setBloodSugar(final BigDecimal bloodSugar) {
this.bloodSugar = bloodSugar;
return this;
}
public HealthBodyRecord setBloodFat(final Integer bloodFat) {
this.bloodFat = bloodFat;
return this;
}
public HealthBodyRecord setBloodPressureHigh(final BigDecimal bloodPressureHigh) {
this.bloodPressureHigh = bloodPressureHigh;
return this;
}
public HealthBodyRecord setBloodPressureLow(final BigDecimal bloodPressureLow) {
this.bloodPressureLow = bloodPressureLow;
return this;
}
public HealthBodyRecord setHeartRate(final BigDecimal heartRate) {
this.heartRate = heartRate;
return this;
}
public HealthBodyRecord setBloodOxygen(final BigDecimal bloodOxygen) {
this.bloodOxygen = bloodOxygen;
return this;
}
public HealthBodyRecord setUricAcid(final Integer uricAcid) {
this.uricAcid = uricAcid;
return this;
}
public HealthBodyRecord setBloodPressure(final Integer bloodPressure) {
this.bloodPressure = bloodPressure;
return this;
}
public HealthBodyRecord setIfLatest(final Integer ifLatest) {
this.ifLatest = ifLatest;
return this;
}
public HealthBodyRecord setIfDel(final Integer ifDel) {
this.ifDel = ifDel;
return this;
}
public HealthBodyRecord setCrby(final String crby) {
this.crby = crby;
return this;
}
public HealthBodyRecord setCrtime(final LocalDateTime crtime) {
this.crtime = crtime;
return this;
}
public HealthBodyRecord setUpby(final String upby) {
this.upby = upby;
return this;
}
public HealthBodyRecord setUptime(final LocalDateTime uptime) {
this.uptime = uptime;
return this;
}
public HealthBodyRecord setHealthInfoSource(final Integer healthInfoSource) {
this.healthInfoSource = healthInfoSource;
return this;
}
public HealthBodyRecord setRegisterDate(final LocalDateTime registerDate) {
this.registerDate = registerDate;
return this;
}
public HealthBodyRecord setCustNum(final String custNum) {
this.custNum = custNum;
return this;
}
public HealthBodyRecord setCustName(final String custName) {
this.custName = custName;
return this;
}
public HealthBodyRecord setMobile(final String mobile) {
this.mobile = mobile;
return this;
}
public HealthBodyRecord setOrgFullName(final String orgFullName) {
this.orgFullName = orgFullName;
return this;
}
public HealthBodyRecord setSex(final Integer sex) {
this.sex = sex;
return this;
}
public String toString() {
Long var10000 = this.getId();
return "HealthBodyRecord(id=" + var10000 + ", custId=" + this.getCustId() + ", height=" + String.valueOf(this.getHeight()) + ", weight=" + String.valueOf(this.getWeight()) + ", bmi=" + String.valueOf(this.getBmi()) + ", shape=" + this.getShape() + ", bust=" + String.valueOf(this.getBust()) + ", waistline=" + String.valueOf(this.getWaistline()) + ", bloodSugar=" + String.valueOf(this.getBloodSugar()) + ", bloodFat=" + this.getBloodFat() + ", bloodPressureHigh=" + String.valueOf(this.getBloodPressureHigh()) + ", bloodPressureLow=" + String.valueOf(this.getBloodPressureLow()) + ", heartRate=" + String.valueOf(this.getHeartRate()) + ", bloodOxygen=" + String.valueOf(this.getBloodOxygen()) + ", uricAcid=" + this.getUricAcid() + ", bloodPressure=" + this.getBloodPressure() + ", ifLatest=" + this.getIfLatest() + ", ifDel=" + this.getIfDel() + ", crby=" + this.getCrby() + ", crtime=" + String.valueOf(this.getCrtime()) + ", upby=" + this.getUpby() + ", uptime=" + String.valueOf(this.getUptime()) + ", healthInfoSource=" + this.getHealthInfoSource() + ", registerDate=" + String.valueOf(this.getRegisterDate()) + ", custNum=" + this.getCustNum() + ", custName=" + this.getCustName() + ", mobile=" + this.getMobile() + ", orgFullName=" + this.getOrgFullName() + ", sex=" + this.getSex() + ")";
}
}

View File

@ -0,0 +1,171 @@
package com.bonus.canteen.core.nutrition.common.vo;
import com.bonus.canteen.core.common.encrypt.HandleType;
import com.bonus.canteen.core.common.encrypt.LeNiuDecryptDataProcess;
import com.bonus.canteen.core.common.encrypt.LeNiuDecryptField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@LeNiuDecryptDataProcess
@ApiModel("健康监测记录")
public class HealthBodyRecordPageVO {
@ApiModelProperty("记录日期")
private LocalDateTime registerDate;
@ApiModelProperty("身高cm")
private BigDecimal height;
@ApiModelProperty("体重kg")
private BigDecimal weight;
@ApiModelProperty("体重指数 BMI = 体重(千克)/身高的平方即kg/m2")
private BigDecimal bmi;
@ApiModelProperty("体型")
private String shape;
@ApiModelProperty("血压 高压")
private BigDecimal bloodPressureHigh;
@ApiModelProperty("血压 低压")
private BigDecimal bloodPressureLow;
@ApiModelProperty("心率(次/分)")
private BigDecimal heartRate;
@ApiModelProperty("人员编号")
private String custNum;
@ApiModelProperty("人员Id")
private Long custId;
@ApiModelProperty("人员姓名")
@LeNiuDecryptField
private String custName;
@ApiModelProperty("手机号")
@LeNiuDecryptField(HandleType.DESENSITIZE_MOBILE_PHONE)
private String mobile;
@ApiModelProperty("所属组织")
private String orgFullName;
@ApiModelProperty("健康信息录入来源 1-系统录入 2-身高体重秤")
private Integer healthInfoSource;
@ApiModelProperty("性别 1-男 2-女")
private Integer sex;
public LocalDateTime getRegisterDate() {
return this.registerDate;
}
public BigDecimal getHeight() {
return this.height;
}
public BigDecimal getWeight() {
return this.weight;
}
public BigDecimal getBmi() {
return this.bmi;
}
public String getShape() {
return this.shape;
}
public BigDecimal getBloodPressureHigh() {
return this.bloodPressureHigh;
}
public BigDecimal getBloodPressureLow() {
return this.bloodPressureLow;
}
public BigDecimal getHeartRate() {
return this.heartRate;
}
public String getCustNum() {
return this.custNum;
}
public Long getCustId() {
return this.custId;
}
public String getCustName() {
return this.custName;
}
public String getMobile() {
return this.mobile;
}
public String getOrgFullName() {
return this.orgFullName;
}
public Integer getHealthInfoSource() {
return this.healthInfoSource;
}
public Integer getSex() {
return this.sex;
}
public void setRegisterDate(final LocalDateTime registerDate) {
this.registerDate = registerDate;
}
public void setHeight(final BigDecimal height) {
this.height = height;
}
public void setWeight(final BigDecimal weight) {
this.weight = weight;
}
public void setBmi(final BigDecimal bmi) {
this.bmi = bmi;
}
public void setShape(final String shape) {
this.shape = shape;
}
public void setBloodPressureHigh(final BigDecimal bloodPressureHigh) {
this.bloodPressureHigh = bloodPressureHigh;
}
public void setBloodPressureLow(final BigDecimal bloodPressureLow) {
this.bloodPressureLow = bloodPressureLow;
}
public void setHeartRate(final BigDecimal heartRate) {
this.heartRate = heartRate;
}
public void setCustNum(final String custNum) {
this.custNum = custNum;
}
public void setCustId(final Long custId) {
this.custId = custId;
}
public void setCustName(final String custName) {
this.custName = custName;
}
public void setMobile(final String mobile) {
this.mobile = mobile;
}
public void setOrgFullName(final String orgFullName) {
this.orgFullName = orgFullName;
}
public void setHealthInfoSource(final Integer healthInfoSource) {
this.healthInfoSource = healthInfoSource;
}
public void setSex(final Integer sex) {
this.sex = sex;
}
public String toString() {
String var10000 = String.valueOf(this.getRegisterDate());
return "HealthBodyRecordPageVO(registerDate=" + var10000 + ", height=" + String.valueOf(this.getHeight()) + ", weight=" + String.valueOf(this.getWeight()) + ", bmi=" + String.valueOf(this.getBmi()) + ", shape=" + this.getShape() + ", bloodPressureHigh=" + String.valueOf(this.getBloodPressureHigh()) + ", bloodPressureLow=" + String.valueOf(this.getBloodPressureLow()) + ", heartRate=" + String.valueOf(this.getHeartRate()) + ", custNum=" + this.getCustNum() + ", custId=" + this.getCustId() + ", custName=" + this.getCustName() + ", mobile=" + this.getMobile() + ", orgFullName=" + this.getOrgFullName() + ", healthInfoSource=" + this.getHealthInfoSource() + ", sex=" + this.getSex() + ")";
}
}

View File

@ -0,0 +1,107 @@
<?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.bonus.canteen.core.nutrition.common.mapper.HealthBodyRecordMapper">
<select id="listHealthMonitoring" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthBodyRecordPageVO">
SELECT
h.crtime register_date,
h.height,
h.weight,
h.bmi,
h.shape,
h.blood_pressure_high,
h.blood_pressure_low,
h.heart_rate,
c.cust_num,
h.cust_id,
c.cust_name,
c.mobile,
co.org_full_name,
h.health_info_source,
c.sex
FROM
health_body_record h
LEFT JOIN cust_info c ON c.cust_id = h.cust_id
LEFT JOIN cust_org co ON c.org_id = co.org_id
WHERE 1=1
<if test="param.healthInfoSource != null">
AND h.health_info_source = #{param.healthInfoSource}
</if>
<if test="param.custId != null">
AND h.cust_id = #{param.custId}
</if>
<if test="param.keyword != null and param.keyword != ''">
AND (
c.cust_num = #{param.keyword}
OR c.cust_name = #{param.keyword,typeHandler=net.xnzn.core.common.encrypt.SM4EncDecHandler}
OR c.mobile = #{param.keyword,typeHandler=net.xnzn.core.common.encrypt.SM4EncDecHandler}
or c.mobile_suffix = #{param.keyword,typeHandler=net.xnzn.core.common.encrypt.SM4EncDecHandler}
)
</if>
<if test="param.queryDate != null">
<![CDATA[AND date_format( h.crtime, '%Y-%m' ) = date_format(#{param.queryDate},'%Y-%m')]]>
</if>
<if test="param.orgIdList != null and param.orgIdList.size() > 0">
AND c.org_id IN
<foreach collection="param.orgIdList" item="orgId" separator="," open="("
close=")">
#{orgId}
</foreach>
</if>
ORDER BY h.crtime DESC
</select>
<!--KingBase适配-->
<select id="listHealthMonitoring" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthBodyRecordPageVO"
databaseId="kb">
SELECT
h.crtime register_date,
h.height,
h.weight,
h.bmi,
h.shape,
h.blood_pressure_high,
h.blood_pressure_low,
h.heart_rate,
c.cust_num,
h.cust_id,
c.cust_name,
c.mobile,
co.org_full_name,
h.health_info_source,
c.sex
FROM
health_body_record h
LEFT JOIN cust_info c ON c.cust_id = h.cust_id
LEFT JOIN cust_org co ON c.org_id = co.org_id
WHERE 1=1
<if test="param.healthInfoSource != null">
AND h.health_info_source = #{param.healthInfoSource}
</if>
<if test="param.custId != null">
AND h.cust_id = #{param.custId}
</if>
<if test="param.keyword != null and param.keyword != ''">
AND (
c.cust_num = #{param.keyword}
OR c.cust_name = #{param.keyword,typeHandler=net.xnzn.core.common.encrypt.SM4EncDecHandler}
OR c.mobile = #{param.keyword,typeHandler=net.xnzn.core.common.encrypt.SM4EncDecHandler}
OR c.mobile_suffix = #{param.keyword,typeHandler=net.xnzn.core.common.encrypt.SM4EncDecHandler}
)
</if>
<if test="param.queryDate != null">
<![CDATA[AND TO_CHAR( h.crtime, 'yyyy-mm' ) = TO_CHAR(#{param.queryDate},'yyyy-mm')]]>
</if>
<if test="param.orgIdList != null and param.orgIdList.size() > 0">
AND c.org_id IN
<foreach collection="param.orgIdList" item="orgId" separator="," open="("
close=")">
#{orgId}
</foreach>
</if>
ORDER BY h.crtime DESC
</select>
</mapper>