健康体征问卷,糖尿病

This commit is contained in:
xiezhijun
2021-06-23 20:12:45 +08:00
parent 6df594a35a
commit 4a9124647e
13 changed files with 860 additions and 27 deletions

View File

@ -446,4 +446,6 @@ public class SysCustomerHealthy extends BaseEntity
private Long delFlag;
private JSONArray avoidFood;
private SysCustomerHealthyExtended healthyExtend;
}

View File

@ -0,0 +1,62 @@
package com.stdiet.custom.domain;
import java.math.BigDecimal;
import com.alibaba.fastjson.JSON;
import com.stdiet.common.annotation.Excel;
import com.stdiet.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 客户健康信息补充对象 sys_customer_healthy_extended
*
* @author wonder
* @date 2021-06-21
*/
@Data
public class SysCustomerHealthyExtended extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** healthy表id */
@Excel(name = "healthy表id")
private Long healthyId;
/** 腰围,厘米 */
@Excel(name = "腰围,厘米")
private BigDecimal waist;
/** 臀围,厘米 */
@Excel(name = "臀围,厘米")
private BigDecimal hipline;
/** 常吃水果信息:水果名称、水果数量 */
@Excel(name = "常吃水果信息:水果名称、水果数量")
private String eatFruitsMessage;
/** 长时间服用药物信息:药物类型、药物名称、用药量、用药时间 */
@Excel(name = "长时间服用药物信息:药物类型、药物名称、用药量、用药时间")
private String longEatDrugMessage;
/** 血糖相关信息 */
@Excel(name = "血糖相关信息")
private String bloodSugarMessage;
/** 郁抑状态评估 */
@Excel(name = "郁抑状态评估")
private String depressedStateMessage;
/** 血压相关信息 */
@Excel(name = "血压相关信息")
private String bloodPressureMessage;
/** 焦虑状态评估 */
@Excel(name = "焦虑状态评估")
private String anxietyStateMessage;
/** 删除标识 0未删除 1已删除 */
private Long delFlag;
}

View File

@ -0,0 +1,61 @@
package com.stdiet.custom.mapper;
import java.util.List;
import com.stdiet.custom.domain.SysCustomerHealthyExtended;
/**
* 客户健康信息补充Mapper接口
*
* @author wonder
* @date 2021-06-21
*/
public interface SysCustomerHealthyExtendedMapper
{
/**
* 查询客户健康信息补充
*
* @param id 客户健康信息补充ID
* @return 客户健康信息补充
*/
public SysCustomerHealthyExtended selectSysCustomerHealthyExtendedById(Long id);
/**
* 查询客户健康信息补充列表
*
* @param sysCustomerHealthyExtended 客户健康信息补充
* @return 客户健康信息补充集合
*/
public List<SysCustomerHealthyExtended> selectSysCustomerHealthyExtendedList(SysCustomerHealthyExtended sysCustomerHealthyExtended);
/**
* 新增客户健康信息补充
*
* @param sysCustomerHealthyExtended 客户健康信息补充
* @return 结果
*/
public int insertSysCustomerHealthyExtended(SysCustomerHealthyExtended sysCustomerHealthyExtended);
/**
* 修改客户健康信息补充
*
* @param sysCustomerHealthyExtended 客户健康信息补充
* @return 结果
*/
public int updateSysCustomerHealthyExtended(SysCustomerHealthyExtended sysCustomerHealthyExtended);
/**
* 删除客户健康信息补充
*
* @param id 客户健康信息补充ID
* @return 结果
*/
public int deleteSysCustomerHealthyExtendedById(Long id);
/**
* 批量删除客户健康信息补充
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysCustomerHealthyExtendedByIds(Long[] ids);
}

View File

@ -11,9 +11,11 @@ import com.stdiet.common.utils.bean.ObjectUtils;
import com.stdiet.common.utils.reflect.ReflectUtils;
import com.stdiet.common.utils.sign.AesUtils;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.domain.SysCustomerHealthyExtended;
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
import com.stdiet.custom.dto.request.HealthyDetailRequest;
import com.stdiet.custom.dto.response.NutritionalCalories;
import com.stdiet.custom.mapper.SysCustomerHealthyExtendedMapper;
import com.stdiet.custom.mapper.SysCustomerMapper;
import com.stdiet.custom.service.ISysCustomerService;
import com.stdiet.custom.utils.NutritionalUtils;
@ -39,6 +41,9 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService
@Autowired
private SysCustomerMapper sysCustomerMapper;
@Autowired
private SysCustomerHealthyExtendedMapper sysCustomerHealthyExtendedMapper;
public static final String reportDownFileNameFormat = "%s超重%s斤%s";
/**
@ -91,6 +96,11 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService
//设置客户ID
sysCustomerHealthy.setCustomerId(Long.parseLong(customerId));
int rows = sysCustomerHealthyMapper.insertSysCustomerHealthy(sysCustomerHealthy);
if(rows > 0 && sysCustomerHealthy.getId() != null){
//添加扩展信息
sysCustomerHealthy.getHealthyExtend().setHealthyId(sysCustomerHealthy.getId());
rows = sysCustomerHealthyExtendedMapper.insertSysCustomerHealthyExtended(sysCustomerHealthy.getHealthyExtend());
}
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}

View File

@ -0,0 +1,91 @@
<?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.stdiet.custom.mapper.SysCustomerHealthyExtendedMapper">
<resultMap type="SysCustomerHealthyExtended" id="SysCustomerHealthyExtendedResult">
<result property="id" column="id" />
<result property="healthyId" column="healthy_id" />
<result property="waist" column="waist" />
<result property="hipline" column="hipline" />
<result property="eatFruitsMessage" column="eat_fruits_message" />
<result property="longEatDrugMessage" column="long_eat_drug_message" />
<result property="bloodSugarMessage" column="blood_sugar_message" />
<result property="depressedStateMessage" column="depressed_state_message" />
<result property="bloodPressureMessage" column="blood_pressure_message" />
<result property="anxietyStateMessage" column="anxiety_state_message" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectSysCustomerHealthyExtendedVo">
select id, healthy_id, waist, hipline, eat_fruits_message, long_eat_drug_message, blood_sugar_message, depressed_state_message, blood_pressure_message, anxiety_state_message, del_flag from sys_customer_healthy_extended
</sql>
<select id="selectSysCustomerHealthyExtendedList" parameterType="SysCustomerHealthyExtended" resultMap="SysCustomerHealthyExtendedResult">
<include refid="selectSysCustomerHealthyExtendedVo"/> where del_flag = 0
</select>
<select id="selectSysCustomerHealthyExtendedById" parameterType="Long" resultMap="SysCustomerHealthyExtendedResult">
<include refid="selectSysCustomerHealthyExtendedVo"/>
where id = #{id} and del_flag = 0
</select>
<insert id="insertSysCustomerHealthyExtended" parameterType="SysCustomerHealthyExtended" useGeneratedKeys="true" keyProperty="id">
insert into sys_customer_healthy_extended
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="healthyId != null">healthy_id,</if>
<if test="waist != null">waist,</if>
<if test="hipline != null">hipline,</if>
<if test="eatFruitsMessage != null">eat_fruits_message,</if>
<if test="longEatDrugMessage != null">long_eat_drug_message,</if>
<if test="bloodSugarMessage != null">blood_sugar_message,</if>
<if test="depressedStateMessage != null">depressed_state_message,</if>
<if test="bloodPressureMessage != null">blood_pressure_message,</if>
<if test="anxietyStateMessage != null">anxiety_state_message,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="healthyId != null">#{healthyId},</if>
<if test="waist != null">#{waist},</if>
<if test="hipline != null">#{hipline},</if>
<if test="eatFruitsMessage != null">#{eatFruitsMessage},</if>
<if test="longEatDrugMessage != null">#{longEatDrugMessage},</if>
<if test="bloodSugarMessage != null">#{bloodSugarMessage},</if>
<if test="depressedStateMessage != null">#{depressedStateMessage},</if>
<if test="bloodPressureMessage != null">#{bloodPressureMessage},</if>
<if test="anxietyStateMessage != null">#{anxietyStateMessage},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateSysCustomerHealthyExtended" parameterType="SysCustomerHealthyExtended">
update sys_customer_healthy_extended
<trim prefix="SET" suffixOverrides=",">
<if test="healthyId != null">healthy_id = #{healthyId},</if>
<if test="waist != null">waist = #{waist},</if>
<if test="hipline != null">hipline = #{hipline},</if>
<if test="eatFruitsMessage != null">eat_fruits_message = #{eatFruitsMessage},</if>
<if test="longEatDrugMessage != null">long_eat_drug_message = #{longEatDrugMessage},</if>
<if test="bloodSugarMessage != null">blood_sugar_message = #{bloodSugarMessage},</if>
<if test="depressedStateMessage != null">depressed_state_message = #{depressedStateMessage},</if>
<if test="bloodPressureMessage != null">blood_pressure_message = #{bloodPressureMessage},</if>
<if test="anxietyStateMessage != null">anxiety_state_message = #{anxietyStateMessage},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<update id="deleteSysCustomerHealthyExtendedById" parameterType="Long">
update sys_customer_healthy_extended set del_flag = 1 where id = #{id}
</update>
<update id="deleteSysCustomerHealthyExtendedByIds" parameterType="String">
update sys_customer_healthy_extended set del_flag = 1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@ -121,7 +121,7 @@
<result property="avoidFood" column="avoid_food" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler" />
<!-- column是传的参数, select是调用的查询 -->
<association property="signList" column="physical_signs_id" select="getSignByIds"/>
<association property="healthyExtend" column="id" select="getHealthyExtendedByHealthyId"></association>
</resultMap>
<sql id="selectSysCustomerHealthyVo">
@ -160,7 +160,7 @@
where sch.del_flag = 0 and sc.del_flag = 0 and sch.customer_id = #{customerId} order by sch.id desc limit 1
</select>
<insert id="insertSysCustomerHealthy" parameterType="SysCustomerHealthy">
<insert id="insertSysCustomerHealthy" parameterType="SysCustomerHealthy" useGeneratedKeys="true" keyProperty="id">
insert into sys_customer_healthy
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
@ -542,4 +542,22 @@
order by dict_sort asc
</select>
<resultMap type="SysCustomerHealthyExtended" id="HealthyExtendedResult">
<result property="id" column="id" />
<result property="healthyId" column="healthy_id" />
<result property="waist" column="waist" />
<result property="hipline" column="hipline" />
<result property="eatFruitsMessage" column="eat_fruits_message" />
<result property="longEatDrugMessage" column="long_eat_drug_message" />
<result property="bloodSugarMessage" column="blood_sugar_message" />
<result property="depressedStateMessage" column="depressed_state_message" />
<result property="bloodPressureMessage" column="blood_pressure_message" />
<result property="anxietyStateMessage" column="anxiety_state_message" />
<result property="delFlag" column="del_flag" />
</resultMap>
<select id="getHealthyExtendedByHealthyId" parameterType="Long" resultMap="HealthyExtendedResult">
select waist, hipline, eat_fruits_message, long_eat_drug_message, blood_sugar_message, depressed_state_message, blood_pressure_message, anxiety_state_message from sys_customer_healthy_extended where del_flag = 0 and healthy_id = #{id} limit 1
</select>
</mapper>