Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
59ff8e5afe
|
|
@ -26,7 +26,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
|
||||
/**
|
||||
* 慢性病Controller
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
|
@ -116,4 +116,11 @@ public class HealthChronicController extends BaseController {
|
|||
public AjaxResult remove(@PathVariable Long[] chronicIds) {
|
||||
return toAjax(healthChronicService.deleteHealthChronicByChronicIds(chronicIds));
|
||||
}
|
||||
|
||||
@ApiOperation("获取慢性病字典")
|
||||
@PostMapping({"/dict-health-chronic"})
|
||||
public AjaxResult dictHealthChronic(@RequestBody HealthChronic dto) {
|
||||
List<HealthChronic> list = this.healthChronicService.dictHealthChronic(dto);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
|
||||
/**
|
||||
* 体征数据记录Controller
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
|
||||
/**
|
||||
* 人员健康情况Controller
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
|
@ -55,7 +55,7 @@ public class HealthPersonInfoController extends BaseController {
|
|||
@ApiOperation(value = "导出人员健康情况列表")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:info:export")
|
||||
@SysLog(title = "人员健康情况", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出人员健康情况")
|
||||
@SysLog(title = "人员健康情况", businessType = OperaType.EXPORT, logType = 1,module = "健康管理->导出人员健康情况")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HealthPersonInfo healthPersonInfo) {
|
||||
List<HealthPersonInfo> list = healthPersonInfoService.selectHealthPersonInfoList(healthPersonInfo);
|
||||
|
|
@ -68,9 +68,9 @@ public class HealthPersonInfoController extends BaseController {
|
|||
*/
|
||||
@ApiOperation(value = "获取人员健康情况详细信息")
|
||||
//@RequiresPermissions("health:info:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(healthPersonInfoService.selectHealthPersonInfoById(id));
|
||||
@PostMapping({"/detail-health-info"})
|
||||
public AjaxResult getInfo(@RequestBody HealthPersonInfo vo) {
|
||||
return success(healthPersonInfoService.selectHealthPersonInfoById(vo.getUserId()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -79,7 +79,7 @@ public class HealthPersonInfoController extends BaseController {
|
|||
@ApiOperation(value = "新增人员健康情况")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:info:add")
|
||||
@SysLog(title = "人员健康情况", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增人员健康情况")
|
||||
@SysLog(title = "人员健康情况", businessType = OperaType.INSERT, logType = 1,module = "健康管理->新增人员健康情况")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HealthPersonInfo healthPersonInfo) {
|
||||
try {
|
||||
|
|
@ -95,8 +95,8 @@ public class HealthPersonInfoController extends BaseController {
|
|||
@ApiOperation(value = "修改人员健康情况")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:info:edit")
|
||||
@SysLog(title = "人员健康情况", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改人员健康情况")
|
||||
@PostMapping("/edit")
|
||||
@SysLog(title = "人员健康情况", businessType = OperaType.UPDATE, logType = 1,module = "健康管理->修改人员健康情况")
|
||||
@PostMapping({"/edit-health-info"})
|
||||
public AjaxResult edit(@RequestBody HealthPersonInfo healthPersonInfo) {
|
||||
try {
|
||||
return toAjax(healthPersonInfoService.updateHealthPersonInfo(healthPersonInfo));
|
||||
|
|
@ -112,8 +112,8 @@ public class HealthPersonInfoController extends BaseController {
|
|||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("health:info:remove")
|
||||
@SysLog(title = "人员健康情况", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除人员健康情况")
|
||||
@PostMapping("/del/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(healthPersonInfoService.deleteHealthPersonInfoByIds(ids));
|
||||
@PostMapping({"/del-health-info"})
|
||||
public AjaxResult remove(@RequestBody HealthPersonInfo healthPersonInfo) {
|
||||
return toAjax(healthPersonInfoService.deleteHealthPersonInfoById(healthPersonInfo));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
|
||||
/**
|
||||
* 营养科普Controller
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.bonus.canteen.core.health.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
|
|
@ -10,7 +12,7 @@ import com.bonus.common.core.web.domain.BaseEntity;
|
|||
|
||||
/**
|
||||
* 人员健康情况对象 health_person_info
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
|
@ -106,5 +108,68 @@ public class HealthPersonInfo extends BaseEntity {
|
|||
@Excel(name = "健康状态", readConverterExp = "1=-健康、2-残疾、3-瘫痪")
|
||||
private Long healthState;
|
||||
|
||||
private String articleTitle;
|
||||
|
||||
@ApiModelProperty("人员名称")
|
||||
private String nickName;
|
||||
@ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
@ApiModelProperty("性别 1-男 2-女")
|
||||
private Integer sex;
|
||||
@ApiModelProperty("年龄")
|
||||
private Integer age;
|
||||
@ApiModelProperty("所属组织id")
|
||||
private Long orgId;
|
||||
@ApiModelProperty("所属组织名称")
|
||||
private String orgFullName;
|
||||
@ApiModelProperty("人员类别")
|
||||
private Integer userType;
|
||||
@ApiModelProperty("所属位置Id")
|
||||
private Long placeId;
|
||||
@ApiModelProperty("所属位置")
|
||||
private String placeFullName;
|
||||
@ApiModelProperty("生日")
|
||||
private LocalDate birthday;
|
||||
@ApiModelProperty("慢性病id多个用逗号分割")
|
||||
private String chronicIds;
|
||||
@ApiModelProperty("慢性病名称多个用逗号分割")
|
||||
private String chronicNames;
|
||||
@ApiModelProperty("是否删除 0-正常 2-删除")
|
||||
private Integer delFlag;
|
||||
@ApiModelProperty("身高")
|
||||
private BigDecimal height;
|
||||
@ApiModelProperty("体重")
|
||||
private BigDecimal weight;
|
||||
@ApiModelProperty("BMI指数")
|
||||
private BigDecimal bmi;
|
||||
@ApiModelProperty("体型")
|
||||
private String shape;
|
||||
@ApiModelProperty("胸围")
|
||||
private BigDecimal bust;
|
||||
@ApiModelProperty("腰围")
|
||||
private BigDecimal waistline;
|
||||
@ApiModelProperty("血糖")
|
||||
private BigDecimal bloodSugar;
|
||||
@ApiModelProperty("血脂")
|
||||
private Integer bloodFat;
|
||||
@ApiModelProperty("血压高")
|
||||
private BigDecimal bloodPressureHigh;
|
||||
@ApiModelProperty("血压低")
|
||||
private BigDecimal bloodPressureLow;
|
||||
@ApiModelProperty("心率")
|
||||
private BigDecimal heartRate;
|
||||
@ApiModelProperty("血氧")
|
||||
private BigDecimal bloodOxygen;
|
||||
@ApiModelProperty("尿酸")
|
||||
private Integer uricAcid;
|
||||
@ApiModelProperty("血压")
|
||||
private Integer bloodPressure;
|
||||
@ApiModelProperty("创建人")
|
||||
private String createBy;
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
@ApiModelProperty("更新人")
|
||||
private String updateBy;
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ import com.bonus.canteen.core.health.domain.HealthChronic;
|
|||
|
||||
/**
|
||||
* 慢性病Mapper接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
public interface HealthChronicMapper {
|
||||
/**
|
||||
* 查询慢性病
|
||||
*
|
||||
*
|
||||
* @param chronicId 慢性病主键
|
||||
* @return 慢性病
|
||||
*/
|
||||
|
|
@ -20,7 +20,7 @@ public interface HealthChronicMapper {
|
|||
|
||||
/**
|
||||
* 查询慢性病列表
|
||||
*
|
||||
*
|
||||
* @param healthChronic 慢性病
|
||||
* @return 慢性病集合
|
||||
*/
|
||||
|
|
@ -28,7 +28,7 @@ public interface HealthChronicMapper {
|
|||
|
||||
/**
|
||||
* 新增慢性病
|
||||
*
|
||||
*
|
||||
* @param healthChronic 慢性病
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +36,7 @@ public interface HealthChronicMapper {
|
|||
|
||||
/**
|
||||
* 修改慢性病
|
||||
*
|
||||
*
|
||||
* @param healthChronic 慢性病
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public interface HealthChronicMapper {
|
|||
|
||||
/**
|
||||
* 删除慢性病
|
||||
*
|
||||
*
|
||||
* @param chronicId 慢性病主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,9 +52,10 @@ public interface HealthChronicMapper {
|
|||
|
||||
/**
|
||||
* 批量删除慢性病
|
||||
*
|
||||
*
|
||||
* @param chronicIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHealthChronicByChronicIds(Long[] chronicIds);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ import com.bonus.canteen.core.health.domain.HealthPersonBodyRecord;
|
|||
|
||||
/**
|
||||
* 体征数据记录Mapper接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
public interface HealthPersonBodyRecordMapper {
|
||||
/**
|
||||
* 查询体征数据记录
|
||||
*
|
||||
*
|
||||
* @param id 体征数据记录主键
|
||||
* @return 体征数据记录
|
||||
*/
|
||||
|
|
@ -20,7 +20,7 @@ public interface HealthPersonBodyRecordMapper {
|
|||
|
||||
/**
|
||||
* 查询体征数据记录列表
|
||||
*
|
||||
*
|
||||
* @param healthPersonBodyRecord 体征数据记录
|
||||
* @return 体征数据记录集合
|
||||
*/
|
||||
|
|
@ -28,7 +28,7 @@ public interface HealthPersonBodyRecordMapper {
|
|||
|
||||
/**
|
||||
* 新增体征数据记录
|
||||
*
|
||||
*
|
||||
* @param healthPersonBodyRecord 体征数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +36,7 @@ public interface HealthPersonBodyRecordMapper {
|
|||
|
||||
/**
|
||||
* 修改体征数据记录
|
||||
*
|
||||
*
|
||||
* @param healthPersonBodyRecord 体征数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public interface HealthPersonBodyRecordMapper {
|
|||
|
||||
/**
|
||||
* 删除体征数据记录
|
||||
*
|
||||
*
|
||||
* @param id 体征数据记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,7 +52,7 @@ public interface HealthPersonBodyRecordMapper {
|
|||
|
||||
/**
|
||||
* 批量删除体征数据记录
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,17 +2,18 @@ package com.bonus.canteen.core.health.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.bonus.canteen.core.health.domain.HealthPersonInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 人员健康情况Mapper接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
public interface HealthPersonInfoMapper {
|
||||
/**
|
||||
* 查询人员健康情况
|
||||
*
|
||||
*
|
||||
* @param id 人员健康情况主键
|
||||
* @return 人员健康情况
|
||||
*/
|
||||
|
|
@ -20,7 +21,7 @@ public interface HealthPersonInfoMapper {
|
|||
|
||||
/**
|
||||
* 查询人员健康情况列表
|
||||
*
|
||||
*
|
||||
* @param healthPersonInfo 人员健康情况
|
||||
* @return 人员健康情况集合
|
||||
*/
|
||||
|
|
@ -28,7 +29,7 @@ public interface HealthPersonInfoMapper {
|
|||
|
||||
/**
|
||||
* 新增人员健康情况
|
||||
*
|
||||
*
|
||||
* @param healthPersonInfo 人员健康情况
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +37,7 @@ public interface HealthPersonInfoMapper {
|
|||
|
||||
/**
|
||||
* 修改人员健康情况
|
||||
*
|
||||
*
|
||||
* @param healthPersonInfo 人员健康情况
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +45,7 @@ public interface HealthPersonInfoMapper {
|
|||
|
||||
/**
|
||||
* 删除人员健康情况
|
||||
*
|
||||
*
|
||||
* @param id 人员健康情况主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,9 +53,27 @@ public interface HealthPersonInfoMapper {
|
|||
|
||||
/**
|
||||
* 批量删除人员健康情况
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHealthPersonInfoByIds(Long[] ids);
|
||||
|
||||
List<HealthPersonInfo> selectHealthChronicList(HealthPersonInfo healthInfoSimpleVo);
|
||||
|
||||
int updateHealthInfo(HealthPersonInfo entitie);
|
||||
|
||||
int getHealthBodyRecordNum(HealthPersonInfo entitie);
|
||||
|
||||
int insertHealthBodyRecord(HealthPersonInfo entitie);
|
||||
|
||||
int updateHealthBodyRecord(HealthPersonInfo entitie);
|
||||
|
||||
int deleteHealthInfoChronic(HealthPersonInfo entitie);
|
||||
|
||||
int delHealthInfo(HealthPersonInfo entitie);
|
||||
|
||||
int insertHealthInfoChronic(@Param("entities") List<HealthPersonInfo> entities);
|
||||
|
||||
int insertHealthInfo(HealthPersonInfo entities);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public interface HealthPopularArticleMapper {
|
|||
* @return 营养科普集合
|
||||
*/
|
||||
public List<HealthPopularArticle> selectHealthPopularArticleList(HealthPopularArticle healthPopularArticle);
|
||||
|
||||
|
||||
/**
|
||||
* 新增营养科普
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ import com.bonus.canteen.core.health.domain.HealthChronic;
|
|||
|
||||
/**
|
||||
* 慢性病Service接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
public interface IHealthChronicService {
|
||||
/**
|
||||
* 查询慢性病
|
||||
*
|
||||
*
|
||||
* @param chronicId 慢性病主键
|
||||
* @return 慢性病
|
||||
*/
|
||||
|
|
@ -20,7 +20,7 @@ public interface IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 查询慢性病列表
|
||||
*
|
||||
*
|
||||
* @param healthChronic 慢性病
|
||||
* @return 慢性病集合
|
||||
*/
|
||||
|
|
@ -28,7 +28,7 @@ public interface IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 新增慢性病
|
||||
*
|
||||
*
|
||||
* @param healthChronic 慢性病
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +36,7 @@ public interface IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 修改慢性病
|
||||
*
|
||||
*
|
||||
* @param healthChronic 慢性病
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public interface IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 批量删除慢性病
|
||||
*
|
||||
*
|
||||
* @param chronicIds 需要删除的慢性病主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,9 +52,11 @@ public interface IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 删除慢性病信息
|
||||
*
|
||||
*
|
||||
* @param chronicId 慢性病主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHealthChronicByChronicId(Long chronicId);
|
||||
|
||||
List<HealthChronic> dictHealthChronic(HealthChronic content);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ import com.bonus.canteen.core.health.domain.HealthPersonBodyRecord;
|
|||
|
||||
/**
|
||||
* 体征数据记录Service接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
public interface IHealthPersonBodyRecordService {
|
||||
/**
|
||||
* 查询体征数据记录
|
||||
*
|
||||
*
|
||||
* @param id 体征数据记录主键
|
||||
* @return 体征数据记录
|
||||
*/
|
||||
|
|
@ -20,15 +20,15 @@ public interface IHealthPersonBodyRecordService {
|
|||
|
||||
/**
|
||||
* 查询体征数据记录列表
|
||||
*
|
||||
*
|
||||
* @param healthPersonBodyRecord 体征数据记录
|
||||
* @return 体征数据记录集合
|
||||
*/
|
||||
public List<HealthPersonBodyRecord> selectHealthPersonBodyRecordList(HealthPersonBodyRecord healthPersonBodyRecord);
|
||||
|
||||
|
||||
/**
|
||||
* 新增体征数据记录
|
||||
*
|
||||
*
|
||||
* @param healthPersonBodyRecord 体征数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +36,7 @@ public interface IHealthPersonBodyRecordService {
|
|||
|
||||
/**
|
||||
* 修改体征数据记录
|
||||
*
|
||||
*
|
||||
* @param healthPersonBodyRecord 体征数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public interface IHealthPersonBodyRecordService {
|
|||
|
||||
/**
|
||||
* 批量删除体征数据记录
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的体征数据记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,7 +52,7 @@ public interface IHealthPersonBodyRecordService {
|
|||
|
||||
/**
|
||||
* 删除体征数据记录信息
|
||||
*
|
||||
*
|
||||
* @param id 体征数据记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ import com.bonus.canteen.core.health.domain.HealthPersonInfo;
|
|||
|
||||
/**
|
||||
* 人员健康情况Service接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
public interface IHealthPersonInfoService {
|
||||
/**
|
||||
* 查询人员健康情况
|
||||
*
|
||||
*
|
||||
* @param id 人员健康情况主键
|
||||
* @return 人员健康情况
|
||||
*/
|
||||
|
|
@ -20,7 +20,7 @@ public interface IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 查询人员健康情况列表
|
||||
*
|
||||
*
|
||||
* @param healthPersonInfo 人员健康情况
|
||||
* @return 人员健康情况集合
|
||||
*/
|
||||
|
|
@ -28,7 +28,7 @@ public interface IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 新增人员健康情况
|
||||
*
|
||||
*
|
||||
* @param healthPersonInfo 人员健康情况
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +36,7 @@ public interface IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 修改人员健康情况
|
||||
*
|
||||
*
|
||||
* @param healthPersonInfo 人员健康情况
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public interface IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 批量删除人员健康情况
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的人员健康情况主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,9 +52,9 @@ public interface IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 删除人员健康情况信息
|
||||
*
|
||||
*
|
||||
* @param id 人员健康情况主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHealthPersonInfoById(Long id);
|
||||
public int deleteHealthPersonInfoById(HealthPersonInfo content);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ import com.bonus.canteen.core.health.domain.HealthPopularArticle;
|
|||
|
||||
/**
|
||||
* 营养科普Service接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
public interface IHealthPopularArticleService {
|
||||
/**
|
||||
* 查询营养科普
|
||||
*
|
||||
*
|
||||
* @param articleId 营养科普主键
|
||||
* @return 营养科普
|
||||
*/
|
||||
|
|
@ -20,15 +20,15 @@ public interface IHealthPopularArticleService {
|
|||
|
||||
/**
|
||||
* 查询营养科普列表
|
||||
*
|
||||
*
|
||||
* @param healthPopularArticle 营养科普
|
||||
* @return 营养科普集合
|
||||
*/
|
||||
public List<HealthPopularArticle> selectHealthPopularArticleList(HealthPopularArticle healthPopularArticle);
|
||||
|
||||
|
||||
/**
|
||||
* 新增营养科普
|
||||
*
|
||||
*
|
||||
* @param healthPopularArticle 营养科普
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +36,7 @@ public interface IHealthPopularArticleService {
|
|||
|
||||
/**
|
||||
* 修改营养科普
|
||||
*
|
||||
*
|
||||
* @param healthPopularArticle 营养科普
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public interface IHealthPopularArticleService {
|
|||
|
||||
/**
|
||||
* 批量删除营养科普
|
||||
*
|
||||
*
|
||||
* @param articleIds 需要删除的营养科普主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,7 +52,7 @@ public interface IHealthPopularArticleService {
|
|||
|
||||
/**
|
||||
* 删除营养科普信息
|
||||
*
|
||||
*
|
||||
* @param articleId 营养科普主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,8 +1,14 @@
|
|||
package com.bonus.canteen.core.health.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.houqin.constant.DelFlagEnum;
|
||||
import com.bonus.common.houqin.utils.LeBeanUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.health.mapper.HealthChronicMapper;
|
||||
|
|
@ -11,7 +17,7 @@ import com.bonus.canteen.core.health.service.IHealthChronicService;
|
|||
|
||||
/**
|
||||
* 慢性病Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
|
@ -22,7 +28,7 @@ public class HealthChronicServiceImpl implements IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 查询慢性病
|
||||
*
|
||||
*
|
||||
* @param chronicId 慢性病主键
|
||||
* @return 慢性病
|
||||
*/
|
||||
|
|
@ -33,7 +39,7 @@ public class HealthChronicServiceImpl implements IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 查询慢性病列表
|
||||
*
|
||||
*
|
||||
* @param healthChronic 慢性病
|
||||
* @return 慢性病
|
||||
*/
|
||||
|
|
@ -44,7 +50,7 @@ public class HealthChronicServiceImpl implements IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 新增慢性病
|
||||
*
|
||||
*
|
||||
* @param healthChronic 慢性病
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -60,7 +66,7 @@ public class HealthChronicServiceImpl implements IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 修改慢性病
|
||||
*
|
||||
*
|
||||
* @param healthChronic 慢性病
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -76,7 +82,7 @@ public class HealthChronicServiceImpl implements IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 批量删除慢性病
|
||||
*
|
||||
*
|
||||
* @param chronicIds 需要删除的慢性病主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -87,7 +93,7 @@ public class HealthChronicServiceImpl implements IHealthChronicService {
|
|||
|
||||
/**
|
||||
* 删除慢性病信息
|
||||
*
|
||||
*
|
||||
* @param chronicId 慢性病主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -95,4 +101,10 @@ public class HealthChronicServiceImpl implements IHealthChronicService {
|
|||
public int deleteHealthChronicByChronicId(Long chronicId) {
|
||||
return healthChronicMapper.deleteHealthChronicByChronicId(chronicId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HealthChronic> dictHealthChronic(HealthChronic content) {
|
||||
|
||||
return healthChronicMapper.selectHealthChronicList(content);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import com.bonus.canteen.core.health.service.IHealthPersonBodyRecordService;
|
|||
|
||||
/**
|
||||
* 体征数据记录Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
|
@ -22,7 +22,7 @@ public class HealthPersonBodyRecordServiceImpl implements IHealthPersonBodyRecor
|
|||
|
||||
/**
|
||||
* 查询体征数据记录
|
||||
*
|
||||
*
|
||||
* @param id 体征数据记录主键
|
||||
* @return 体征数据记录
|
||||
*/
|
||||
|
|
@ -33,7 +33,7 @@ public class HealthPersonBodyRecordServiceImpl implements IHealthPersonBodyRecor
|
|||
|
||||
/**
|
||||
* 查询体征数据记录列表
|
||||
*
|
||||
*
|
||||
* @param healthPersonBodyRecord 体征数据记录
|
||||
* @return 体征数据记录
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public class HealthPersonBodyRecordServiceImpl implements IHealthPersonBodyRecor
|
|||
|
||||
/**
|
||||
* 新增体征数据记录
|
||||
*
|
||||
*
|
||||
* @param healthPersonBodyRecord 体征数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -60,7 +60,7 @@ public class HealthPersonBodyRecordServiceImpl implements IHealthPersonBodyRecor
|
|||
|
||||
/**
|
||||
* 修改体征数据记录
|
||||
*
|
||||
*
|
||||
* @param healthPersonBodyRecord 体征数据记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -76,7 +76,7 @@ public class HealthPersonBodyRecordServiceImpl implements IHealthPersonBodyRecor
|
|||
|
||||
/**
|
||||
* 批量删除体征数据记录
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的体征数据记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -87,7 +87,7 @@ public class HealthPersonBodyRecordServiceImpl implements IHealthPersonBodyRecor
|
|||
|
||||
/**
|
||||
* 删除体征数据记录信息
|
||||
*
|
||||
*
|
||||
* @param id 体征数据记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
package com.bonus.canteen.core.health.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -11,7 +17,7 @@ import com.bonus.canteen.core.health.service.IHealthPersonInfoService;
|
|||
|
||||
/**
|
||||
* 人员健康情况Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
|
@ -22,7 +28,7 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 查询人员健康情况
|
||||
*
|
||||
*
|
||||
* @param id 人员健康情况主键
|
||||
* @return 人员健康情况
|
||||
*/
|
||||
|
|
@ -33,7 +39,7 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 查询人员健康情况列表
|
||||
*
|
||||
*
|
||||
* @param healthPersonInfo 人员健康情况
|
||||
* @return 人员健康情况
|
||||
*/
|
||||
|
|
@ -44,7 +50,7 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 新增人员健康情况
|
||||
*
|
||||
*
|
||||
* @param healthPersonInfo 人员健康情况
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -60,15 +66,53 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 修改人员健康情况
|
||||
*
|
||||
* @param healthPersonInfo 人员健康情况
|
||||
*
|
||||
* @param content 人员健康情况
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateHealthPersonInfo(HealthPersonInfo healthPersonInfo) {
|
||||
healthPersonInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
public int updateHealthPersonInfo(HealthPersonInfo content) {
|
||||
content.setUpdateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
return healthPersonInfoMapper.updateHealthPersonInfo(healthPersonInfo);
|
||||
Long userId = content.getUserId();
|
||||
HealthPersonInfo chronicVo=new HealthPersonInfo();
|
||||
chronicVo.setChronicIds(content.getChronicIds());
|
||||
List<HealthPersonInfo> chronicVos=healthPersonInfoMapper.selectHealthChronicList(chronicVo);
|
||||
if(chronicVos!=null&&chronicVos.size()>0){
|
||||
/**
|
||||
* 清空疾病信息
|
||||
*/
|
||||
healthPersonInfoMapper.deleteHealthInfoChronic(content);
|
||||
List<HealthPersonInfo> chronicfVos=new ArrayList<>();
|
||||
for(HealthPersonInfo vo:chronicVos){
|
||||
HealthPersonInfo hfd=new HealthPersonInfo();
|
||||
hfd.setUserId(content.getUserId());
|
||||
hfd.setChronicIds(vo.getChronicIds());
|
||||
hfd.setChronicNames(vo.getChronicNames());
|
||||
chronicfVos.add(hfd);
|
||||
}
|
||||
/**
|
||||
* 重新录入疾病信息
|
||||
*/
|
||||
healthPersonInfoMapper.insertHealthInfoChronic(chronicfVos);
|
||||
}
|
||||
healthPersonInfoMapper.delHealthInfo(content);
|
||||
/**
|
||||
* 重新录入健康信息
|
||||
*/
|
||||
healthPersonInfoMapper.delHealthInfo(content);
|
||||
healthPersonInfoMapper.insertHealthInfo(content);
|
||||
healthPersonInfoMapper.updateHealthInfo(content);
|
||||
/**
|
||||
* 重新录入身体信息
|
||||
*/
|
||||
int flag=healthPersonInfoMapper.getHealthBodyRecordNum(content);
|
||||
if(flag==0){
|
||||
healthPersonInfoMapper.insertHealthBodyRecord(content);
|
||||
}
|
||||
content.setBmi(getBMI(content.getWeight(),content.getHeight()));
|
||||
healthPersonInfoMapper.updateHealthBodyRecord(content);
|
||||
return 1;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
|
|
@ -76,7 +120,7 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 批量删除人员健康情况
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的人员健康情况主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -87,12 +131,31 @@ public class HealthPersonInfoServiceImpl implements IHealthPersonInfoService {
|
|||
|
||||
/**
|
||||
* 删除人员健康情况信息
|
||||
*
|
||||
* @param id 人员健康情况主键
|
||||
*
|
||||
* @param content 人员健康情况主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHealthPersonInfoById(Long id) {
|
||||
return healthPersonInfoMapper.deleteHealthPersonInfoById(id);
|
||||
public int deleteHealthPersonInfoById(HealthPersonInfo content) {
|
||||
Long userId = content.getUserId();
|
||||
try{
|
||||
healthPersonInfoMapper.deleteHealthInfoChronic(content);
|
||||
healthPersonInfoMapper.delHealthInfo(content);
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
public static BigDecimal getBMI(BigDecimal weight, BigDecimal height) {
|
||||
if (!ObjectUtil.isNull(weight) && !ObjectUtil.isNull(height)) {
|
||||
if (NumberUtil.equals(height, BigDecimal.ZERO)) {
|
||||
return new BigDecimal(-1);
|
||||
} else {
|
||||
height = NumberUtil.div(height, BigDecimal.valueOf(100L), 2, RoundingMode.HALF_UP);
|
||||
return NumberUtil.div(weight, NumberUtil.mul(height, height), 2, RoundingMode.HALF_UP);
|
||||
}
|
||||
} else {
|
||||
return new BigDecimal(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import com.bonus.canteen.core.health.service.IHealthPopularArticleService;
|
|||
|
||||
/**
|
||||
* 营养科普Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
|
@ -22,7 +22,7 @@ public class HealthPopularArticleServiceImpl implements IHealthPopularArticleSer
|
|||
|
||||
/**
|
||||
* 查询营养科普
|
||||
*
|
||||
*
|
||||
* @param articleId 营养科普主键
|
||||
* @return 营养科普
|
||||
*/
|
||||
|
|
@ -33,7 +33,7 @@ public class HealthPopularArticleServiceImpl implements IHealthPopularArticleSer
|
|||
|
||||
/**
|
||||
* 查询营养科普列表
|
||||
*
|
||||
*
|
||||
* @param healthPopularArticle 营养科普
|
||||
* @return 营养科普
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public class HealthPopularArticleServiceImpl implements IHealthPopularArticleSer
|
|||
|
||||
/**
|
||||
* 新增营养科普
|
||||
*
|
||||
*
|
||||
* @param healthPopularArticle 营养科普
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -60,7 +60,7 @@ public class HealthPopularArticleServiceImpl implements IHealthPopularArticleSer
|
|||
|
||||
/**
|
||||
* 修改营养科普
|
||||
*
|
||||
*
|
||||
* @param healthPopularArticle 营养科普
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -76,7 +76,7 @@ public class HealthPopularArticleServiceImpl implements IHealthPopularArticleSer
|
|||
|
||||
/**
|
||||
* 批量删除营养科普
|
||||
*
|
||||
*
|
||||
* @param articleIds 需要删除的营养科普主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -87,7 +87,7 @@ public class HealthPopularArticleServiceImpl implements IHealthPopularArticleSer
|
|||
|
||||
/**
|
||||
* 删除营养科普信息
|
||||
*
|
||||
*
|
||||
* @param articleId 营养科普主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectHealthPersonBodyRecordList" parameterType="com.bonus.canteen.core.health.domain.HealthPersonBodyRecord" resultMap="HealthPersonBodyRecordResult">
|
||||
<include refid="selectHealthPersonBodyRecordVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="registerDate != null "> and register_date = #{registerDate}</if>
|
||||
<if test="height != null "> and height = #{height}</if>
|
||||
|
|
@ -58,12 +58,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="healthInfoSource != null "> and health_info_source = #{healthInfoSource}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectHealthPersonBodyRecordById" parameterType="Long" resultMap="HealthPersonBodyRecordResult">
|
||||
<include refid="selectHealthPersonBodyRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertHealthPersonBodyRecord" parameterType="com.bonus.canteen.core.health.domain.HealthPersonBodyRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into health_person_body_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -156,9 +156,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteHealthPersonBodyRecordByIds" parameterType="String">
|
||||
delete from health_person_body_record where id in
|
||||
delete from health_person_body_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -32,32 +32,143 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
|
||||
<select id="selectHealthPersonInfoList" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo" resultMap="HealthPersonInfoResult">
|
||||
<include refid="selectHealthPersonInfoVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="registerDate != null "> and register_date = #{registerDate}</if>
|
||||
<if test="bloodType != null "> and blood_type = #{bloodType}</if>
|
||||
<if test="maritalStatus != null "> and marital_status = #{maritalStatus}</if>
|
||||
<if test="pregnantStatus != null "> and pregnant_status = #{pregnantStatus}</if>
|
||||
<if test="pregnancyDate != null "> and pregnancy_date = #{pregnancyDate}</if>
|
||||
<if test="doctorAdvice != null "> and doctor_advice = #{doctorAdvice}</if>
|
||||
<if test="ifHospitalized != null "> and if_hospitalized = #{ifHospitalized}</if>
|
||||
<if test="doctorNum != null and doctorNum != ''"> and doctor_num = #{doctorNum}</if>
|
||||
<if test="hospitalNum != null and hospitalNum != ''"> and hospital_num = #{hospitalNum}</if>
|
||||
<if test="inpatientDate != null "> and inpatient_date = #{inpatientDate}</if>
|
||||
<if test="inpatientResult != null and inpatientResult != ''"> and inpatient_result = #{inpatientResult}</if>
|
||||
<if test="weightControl != null "> and weight_control = #{weightControl}</if>
|
||||
<if test="allergen != null and allergen != ''"> and allergen = #{allergen}</if>
|
||||
<if test="labourIntensity != null "> and labour_intensity = #{labourIntensity}</if>
|
||||
<if test="healthState != null "> and health_state = #{healthState}</if>
|
||||
</where>
|
||||
<!-- <include refid="selectHealthPersonInfoVo"/>-->
|
||||
<!-- <where> -->
|
||||
<!-- <if test="userId != null "> and user_id = #{userId}</if>-->
|
||||
<!-- <if test="registerDate != null "> and register_date = #{registerDate}</if>-->
|
||||
<!-- <if test="bloodType != null "> and blood_type = #{bloodType}</if>-->
|
||||
<!-- <if test="maritalStatus != null "> and marital_status = #{maritalStatus}</if>-->
|
||||
<!-- <if test="pregnantStatus != null "> and pregnant_status = #{pregnantStatus}</if>-->
|
||||
<!-- <if test="pregnancyDate != null "> and pregnancy_date = #{pregnancyDate}</if>-->
|
||||
<!-- <if test="doctorAdvice != null "> and doctor_advice = #{doctorAdvice}</if>-->
|
||||
<!-- <if test="ifHospitalized != null "> and if_hospitalized = #{ifHospitalized}</if>-->
|
||||
<!-- <if test="doctorNum != null and doctorNum != ''"> and doctor_num = #{doctorNum}</if>-->
|
||||
<!-- <if test="hospitalNum != null and hospitalNum != ''"> and hospital_num = #{hospitalNum}</if>-->
|
||||
<!-- <if test="inpatientDate != null "> and inpatient_date = #{inpatientDate}</if>-->
|
||||
<!-- <if test="inpatientResult != null and inpatientResult != ''"> and inpatient_result = #{inpatientResult}</if>-->
|
||||
<!-- <if test="weightControl != null "> and weight_control = #{weightControl}</if>-->
|
||||
<!-- <if test="allergen != null and allergen != ''"> and allergen = #{allergen}</if>-->
|
||||
<!-- <if test="labourIntensity != null "> and labour_intensity = #{labourIntensity}</if>-->
|
||||
<!-- <if test="healthState != null "> and health_state = #{healthState}</if>-->
|
||||
<!-- </where>-->
|
||||
SELECT a.user_id,
|
||||
a.nick_name,
|
||||
a.phonenumber as mobile,
|
||||
a.photo_url as custPhotoUrl,
|
||||
a.sex,
|
||||
d.height,
|
||||
d.weight,
|
||||
d.bmi,
|
||||
b.doctor_advice,
|
||||
b.allergen,
|
||||
b.labour_intensity,
|
||||
b.pregnant_status,
|
||||
b.doctor_num,
|
||||
b.hospital_num,
|
||||
b.inpatient_date,
|
||||
GROUP_CONCAT(c.chronic_name ORDER BY c.chronic_id desc) AS chronic_names,
|
||||
GROUP_CONCAT(c.chronic_id ORDER BY c.chronic_id desc) AS chronic_ids
|
||||
from sys_user a
|
||||
left join health_person_info b on a.user_id = b.user_id
|
||||
left join health_person_info_chronic c on a.user_id = c.user_id
|
||||
left join health_person_body_record d on a.user_id = d.user_id and d.if_latest = 1
|
||||
where 1 = 1
|
||||
<if test="articleTitle != null and articleTitle != ''">
|
||||
and(a.nick_name like concat('%', #{articleTitle}, '%') or a.phonenumber like concat('%', #{articleTitle}, '%') or b.doctor_num like concat('%', #{articleTitle}, '%'))
|
||||
</if>
|
||||
group by a.user_id,
|
||||
a.nick_name,
|
||||
a.dept_id,
|
||||
a.phonenumber,
|
||||
a.photo_url,
|
||||
a.sex,
|
||||
d.height,
|
||||
d.weight,
|
||||
d.bmi,
|
||||
b.doctor_advice,
|
||||
b.allergen,
|
||||
b.labour_intensity,
|
||||
b.pregnant_status
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectHealthPersonInfoById" parameterType="Long" resultMap="HealthPersonInfoResult">
|
||||
<include refid="selectHealthPersonInfoVo"/>
|
||||
where id = #{id}
|
||||
select a.user_id,
|
||||
a.nick_name,
|
||||
a.phonenumber as mobile,
|
||||
a.sex,
|
||||
a.dept_id as orgId,
|
||||
a.user_type,
|
||||
b.marital_status,
|
||||
b.pregnant_status,
|
||||
b.pregnancy_date,
|
||||
b.doctor_advice,
|
||||
b.if_hospitalized,
|
||||
b.doctor_num,
|
||||
b.hospital_num,
|
||||
b.inpatient_date,
|
||||
b.inpatient_result,
|
||||
b.weight_control,
|
||||
b.allergen,
|
||||
b.labour_intensity,
|
||||
b.health_state,
|
||||
b.blood_type,
|
||||
c.height,
|
||||
c.weight,
|
||||
c.bmi,
|
||||
c.shape,
|
||||
c.bust,
|
||||
c.waistline,
|
||||
c.blood_sugar,
|
||||
c.blood_fat,
|
||||
c.blood_pressure_high,
|
||||
c.blood_pressure_low,
|
||||
c.heart_rate,
|
||||
c.blood_oxygen,
|
||||
c.uric_acid,
|
||||
c.blood_pressure,
|
||||
GROUP_CONCAT(d.chronic_name ORDER BY d.chronic_id desc) AS chronic_names,
|
||||
GROUP_CONCAT(d.chronic_id ORDER BY d.chronic_id desc) AS chronic_ids
|
||||
from sys_user a
|
||||
left join health_person_info b on a.user_id = b.user_id
|
||||
left join health_person_body_record c on a.user_id = c.user_id and c.if_latest = 1
|
||||
left join health_person_info_chronic d on a.user_id = d.user_id
|
||||
where a.user_id = #{userId}
|
||||
group by a.user_id,
|
||||
a.user_name,
|
||||
a.phonenumber,
|
||||
a.sex,
|
||||
a.dept_id,
|
||||
a.user_type,
|
||||
b.marital_status,
|
||||
b.pregnant_status,
|
||||
b.pregnancy_date,
|
||||
b.doctor_advice,
|
||||
b.if_hospitalized,
|
||||
b.doctor_num,
|
||||
b.hospital_num,
|
||||
b.inpatient_date,
|
||||
b.inpatient_result,
|
||||
b.weight_control,
|
||||
b.allergen,
|
||||
b.labour_intensity,
|
||||
b.health_state,
|
||||
b.blood_type,
|
||||
c.height,
|
||||
c.weight,
|
||||
c.bmi,
|
||||
c.shape,
|
||||
c.bust,
|
||||
c.waistline,
|
||||
c.blood_sugar,
|
||||
c.blood_fat,
|
||||
c.blood_pressure_high,
|
||||
c.blood_pressure_low,
|
||||
c.heart_rate,
|
||||
c.blood_oxygen,
|
||||
c.uric_acid,
|
||||
c.blood_pressure
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertHealthPersonInfo" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
insert into health_person_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -140,9 +251,216 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteHealthPersonInfoByIds" parameterType="String">
|
||||
delete from health_person_info where id in
|
||||
delete from health_person_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
|
||||
<select id="selectHealthChronicList" resultType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
SELECT distinct chronic_id as chronic_ids,chronic_name as chronic_names from health_chronic where chronic_id in (${chronicIds})
|
||||
</select>
|
||||
|
||||
<select id="getSimpleInfo" resultType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
SELECT a.user_id,
|
||||
a.nick_name,
|
||||
a.phonenumber as mobile,
|
||||
a.photo_url as custPhotoUrl,
|
||||
a.sex,
|
||||
d.height,
|
||||
d.weight,
|
||||
d.bmi,
|
||||
b.doctor_advice,
|
||||
b.allergen,
|
||||
b.labour_intensity,
|
||||
b.pregnant_status,
|
||||
GROUP_CONCAT(c.chronic_name ORDER BY c.chronic_id desc) AS chronic_names,
|
||||
GROUP_CONCAT(c.chronic_id ORDER BY c.chronic_id desc) AS chronic_ids
|
||||
from sys_user a
|
||||
left join health_person_info b on a.user_id = b.user_id
|
||||
left join health_person_info_chronic c on a.user_id = c.user_id
|
||||
left join health_person_body_record d on a.user_id = d.user_id and d.if_latest = 1
|
||||
where 1 = 1
|
||||
and a.user_id = #{userId}
|
||||
group by a.user_id,
|
||||
a.nick_name,
|
||||
a.dept_id,
|
||||
a.phonenumber,
|
||||
a.photo_url,
|
||||
a.sex,
|
||||
d.height,
|
||||
d.weight,
|
||||
d.bmi,
|
||||
b.doctor_advice,
|
||||
b.allergen,
|
||||
b.labour_intensity,
|
||||
b.pregnant_status
|
||||
</select>
|
||||
|
||||
<select id="fullHealthInfo" resultType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
select a.user_id,
|
||||
a.nick_name,
|
||||
a.phonenumber as mobile,
|
||||
a.sex,
|
||||
a.dept_id as orgId,
|
||||
a.user_type,
|
||||
b.marital_status,
|
||||
b.pregnant_status,
|
||||
b.pregnancy_date,
|
||||
b.doctor_advice,
|
||||
b.if_hospitalized,
|
||||
b.doctor_num,
|
||||
b.hospital_num,
|
||||
b.inpatient_date,
|
||||
b.inpatient_result,
|
||||
b.weight_control,
|
||||
b.allergen,
|
||||
b.labour_intensity,
|
||||
b.health_state,
|
||||
b.blood_type,
|
||||
c.height,
|
||||
c.weight,
|
||||
c.bmi,
|
||||
c.shape,
|
||||
c.bust,
|
||||
c.waistline,
|
||||
c.blood_sugar,
|
||||
c.blood_fat,
|
||||
c.blood_pressure_high,
|
||||
c.blood_pressure_low,
|
||||
c.heart_rate,
|
||||
c.blood_oxygen,
|
||||
c.uric_acid,
|
||||
c.blood_pressure,
|
||||
GROUP_CONCAT(d.chronic_name ORDER BY d.chronic_id desc) AS chronic_names,
|
||||
GROUP_CONCAT(d.chronic_id ORDER BY d.chronic_id desc) AS chronic_ids
|
||||
from sys_user a
|
||||
left join health_person_info b on a.user_id = b.user_id
|
||||
left join health_person_body_record c on a.user_id = c.user_id and c.if_latest = 1
|
||||
left join health_person_info_chronic d on a.user_id = d.user_id
|
||||
where a.user_id = #{userId}
|
||||
group by a.user_id,
|
||||
a.user_name,
|
||||
a.phonenumber,
|
||||
a.sex,
|
||||
a.dept_id,
|
||||
a.user_type,
|
||||
b.marital_status,
|
||||
b.pregnant_status,
|
||||
b.pregnancy_date,
|
||||
b.doctor_advice,
|
||||
b.if_hospitalized,
|
||||
b.doctor_num,
|
||||
b.hospital_num,
|
||||
b.inpatient_date,
|
||||
b.inpatient_result,
|
||||
b.weight_control,
|
||||
b.allergen,
|
||||
b.labour_intensity,
|
||||
b.health_state,
|
||||
b.blood_type,
|
||||
c.height,
|
||||
c.weight,
|
||||
c.bmi,
|
||||
c.shape,
|
||||
c.bust,
|
||||
c.waistline,
|
||||
c.blood_sugar,
|
||||
c.blood_fat,
|
||||
c.blood_pressure_high,
|
||||
c.blood_pressure_low,
|
||||
c.heart_rate,
|
||||
c.blood_oxygen,
|
||||
c.uric_acid,
|
||||
c.blood_pressure
|
||||
</select>
|
||||
<update id="updateHealthInfo" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
update health_person_info
|
||||
<set>
|
||||
<if test="bloodType != null and bloodType != ''">
|
||||
blood_type = #{bloodType},
|
||||
</if>
|
||||
<if test="maritalStatus != null and maritalStatus != ''">
|
||||
marital_status = #{maritalStatus},
|
||||
</if>
|
||||
<if test="pregnantStatus != null and pregnantStatus != ''">
|
||||
pregnant_status = #{pregnantStatus},
|
||||
</if>
|
||||
<if test="pregnancyDate != null ">
|
||||
pregnancy_date = #{pregnancyDate},
|
||||
</if>
|
||||
<if test="doctorAdvice != null and doctorAdvice != ''">
|
||||
doctor_advice = #{doctorAdvice},
|
||||
</if>
|
||||
<if test="ifHospitalized != null and ifHospitalized != ''">
|
||||
if_hospitalized = #{ifHospitalized},
|
||||
</if>
|
||||
<if test="doctorNum != null and doctorNum != ''">
|
||||
doctor_num = #{doctorNum},
|
||||
</if>
|
||||
<if test="hospitalNum != null and hospitalNum != ''">
|
||||
hospital_num = #{hospitalNum},
|
||||
</if>
|
||||
<if test="inpatientDate != null ">
|
||||
inpatient_date = #{inpatientDate},
|
||||
</if>
|
||||
<if test="weightControl != null and weightControl != ''">
|
||||
weight_control = #{weightControl},
|
||||
</if>
|
||||
<if test="allergen != null and allergen != ''">
|
||||
allergen = #{allergen},
|
||||
</if>
|
||||
<if test="labourIntensity != null and labourIntensity != ''">
|
||||
labour_intensity = #{labourIntensity},
|
||||
</if>
|
||||
</set>
|
||||
where user_id = #{userId} and del_flag='0'
|
||||
</update>
|
||||
|
||||
<select id="getHealthBodyRecordNum" resultType="java.lang.Integer">
|
||||
select count(1) from health_person_body_record where user_id=#{userId} and if_latest = 1
|
||||
</select>
|
||||
|
||||
<insert id="insertHealthBodyRecord" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
insert into health_person_body_record(user_id,if_latest)
|
||||
values
|
||||
(#{userId},1)
|
||||
</insert>
|
||||
|
||||
<update id="updateHealthBodyRecord" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
update health_person_body_record
|
||||
<set>
|
||||
<if test="height != null and height != ''">
|
||||
height = #{height},
|
||||
</if>
|
||||
<if test="weight != null and weight != ''">
|
||||
weight = #{weight},
|
||||
</if>
|
||||
<if test="bmi != null and bmi != ''">
|
||||
bmi = #{bmi},
|
||||
</if>
|
||||
</set>
|
||||
where user_id = #{userId} and if_latest = 1
|
||||
</update>
|
||||
<update id="deleteHealthInfoChronic" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
delete from health_person_info_chronic
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
<update id="delHealthInfo" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
delete from health_person_info
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
<insert id="insertHealthInfoChronic" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
insert into health_person_info_chronic(user_id, chronic_id, chronic_name)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userId}, #{entity.chronicIds}, #{entity.chronicNames})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertHealthInfo" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo">
|
||||
insert into health_person_info(user_id)
|
||||
values
|
||||
(#{userId})
|
||||
</insert>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectHealthPopularArticleList" parameterType="com.bonus.canteen.core.health.domain.HealthPopularArticle" resultMap="HealthPopularArticleResult">
|
||||
<include refid="selectHealthPopularArticleVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="articleTitle != null and articleTitle != ''"> and article_title = #{articleTitle}</if>
|
||||
<if test="coverPhoto != null and coverPhoto != ''"> and cover_photo = #{coverPhoto}</if>
|
||||
<if test="articleType != null "> and article_type = #{articleType}</if>
|
||||
|
|
@ -40,12 +40,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="summary != null and summary != ''"> and summary = #{summary}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectHealthPopularArticleByArticleId" parameterType="Long" resultMap="HealthPopularArticleResult">
|
||||
<include refid="selectHealthPopularArticleVo"/>
|
||||
where article_id = #{articleId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertHealthPopularArticle" parameterType="com.bonus.canteen.core.health.domain.HealthPopularArticle" useGeneratedKeys="true" keyProperty="articleId">
|
||||
insert into health_popular_article
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -108,9 +108,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteHealthPopularArticleByArticleIds" parameterType="String">
|
||||
delete from health_popular_article where article_id in
|
||||
delete from health_popular_article where article_id in
|
||||
<foreach item="articleId" collection="array" open="(" separator="," close=")">
|
||||
#{articleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue