30 changed files with 44 additions and 1162 deletions
@ -1,103 +0,0 @@ |
|||||
package com.acupuncture.web.controller.web; |
|
||||
|
|
||||
import cn.hutool.core.bean.BeanUtil; |
|
||||
import cn.hutool.core.collection.CollectionUtil; |
|
||||
import cn.hutool.core.util.IdUtil; |
|
||||
import com.acupuncture.common.annotation.Anonymous; |
|
||||
import com.acupuncture.common.core.domain.BaseDto; |
|
||||
import com.acupuncture.common.core.domain.JsonResponse; |
|
||||
import com.acupuncture.framework.datasource.DynamicDataSourceContextHolder; |
|
||||
import com.acupuncture.system.domain.dto.FmsFollowupDto; |
|
||||
import com.acupuncture.system.domain.po.FmsFollowupTask; |
|
||||
import com.acupuncture.system.domain.vo.FmsFollowupVo; |
|
||||
import com.acupuncture.system.domain.vo.UmsDataSourceVo; |
|
||||
import com.acupuncture.system.persist.dao.FmsFollowupDao; |
|
||||
import com.acupuncture.system.persist.dao.UmsDataSourceDao; |
|
||||
import com.acupuncture.system.persist.mapper.FmsFollowupTaskMapper; |
|
||||
import com.acupuncture.system.service.FmsFollowupQueueService; |
|
||||
import com.acupuncture.system.service.FmsFollowupService; |
|
||||
import com.acupuncture.system.service.TaskService; |
|
||||
import com.github.pagehelper.PageHelper; |
|
||||
import com.github.pagehelper.PageInfo; |
|
||||
import io.swagger.annotations.Api; |
|
||||
import io.swagger.annotations.ApiOperation; |
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
import org.quartz.TriggerUtils; |
|
||||
import org.quartz.impl.triggers.CronTriggerImpl; |
|
||||
import org.springframework.validation.annotation.Validated; |
|
||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||
import org.springframework.web.bind.annotation.RequestBody; |
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||
import org.springframework.web.bind.annotation.RestController; |
|
||||
|
|
||||
import javax.annotation.Resource; |
|
||||
import java.util.ArrayList; |
|
||||
import java.util.Calendar; |
|
||||
import java.util.Date; |
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* @Author zzc |
|
||||
* @Package com.acupuncture.web.controller.web |
|
||||
* @Date 2025/2/11 16:45 |
|
||||
* @description: |
|
||||
*/ |
|
||||
@Slf4j |
|
||||
@Api(tags = "随访相关") |
|
||||
@RestController |
|
||||
@RequestMapping("/followup") |
|
||||
public class FmsFollowupController { |
|
||||
@Resource |
|
||||
private FmsFollowupQueueService fmsFollowupQueueService; |
|
||||
@Resource |
|
||||
private FmsFollowupService fmsFollowupService; |
|
||||
|
|
||||
|
|
||||
@ApiOperation("查询公共队列") |
|
||||
@PostMapping("/commonQueue") |
|
||||
@Anonymous |
|
||||
public JsonResponse<PageInfo<FmsFollowupVo.FollowupQueueVO>> queryCommonQueue(@RequestBody @Validated BaseDto<FmsFollowupDto.QueueQuery> dto) { |
|
||||
if (dto.getPageNum() > 0) { |
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); |
|
||||
} |
|
||||
return JsonResponse.ok(new PageInfo<>(fmsFollowupQueueService.queryCommonQueue(dto.getParam().getName()))); |
|
||||
} |
|
||||
|
|
||||
@ApiOperation("查询随访队列") |
|
||||
@PostMapping("/query") |
|
||||
public JsonResponse<PageInfo<FmsFollowupVo.FollowupQueueVO>> queryQueue(@RequestBody @Validated BaseDto<FmsFollowupDto.FollowupQueueQueryDTO> dto) { |
|
||||
if (dto.getPageNum() > 0) { |
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); |
|
||||
} |
|
||||
return JsonResponse.ok(new PageInfo<>(fmsFollowupService.queryQueue(dto.getParam()))); |
|
||||
} |
|
||||
|
|
||||
@ApiOperation("查询随访患者") |
|
||||
@PostMapping("/queryPatient") |
|
||||
public JsonResponse<PageInfo<FmsFollowupVo.FollowupPatient>> queryPatient(@RequestBody @Validated BaseDto<FmsFollowupDto.FollowupPatientQueryDTO> dto) { |
|
||||
if (dto.getPageNum() > 0) { |
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); |
|
||||
} |
|
||||
return JsonResponse.ok(new PageInfo<>(fmsFollowupService.queryPatient(dto.getParam()))); |
|
||||
} |
|
||||
|
|
||||
@ApiOperation("查询随访任务") |
|
||||
@PostMapping("/queryTask") |
|
||||
public JsonResponse<PageInfo<FmsFollowupVo.FollowupTaskVO>> queryTask(@RequestBody @Validated BaseDto<FmsFollowupDto.FollowupTaskQueryDTO> dto) { |
|
||||
return JsonResponse.ok(new PageInfo<>(fmsFollowupService.queryTask(dto.getParam()))); |
|
||||
} |
|
||||
|
|
||||
@ApiOperation("标记为失访") |
|
||||
@PostMapping("/updStatus") |
|
||||
public JsonResponse<Integer> markAsLost(@RequestBody @Validated FmsFollowupDto.FollowupLostDTO dto) { |
|
||||
fmsFollowupService.markAsLost(dto); |
|
||||
return JsonResponse.ok(); |
|
||||
} |
|
||||
|
|
||||
@ApiOperation("完成随访") |
|
||||
@PostMapping("/followPatient") |
|
||||
public JsonResponse<Integer> completeFollowup(@RequestBody @Validated FmsFollowupDto.FollowupCompleteDTO dto) { |
|
||||
fmsFollowupService.completeFollowup(dto); |
|
||||
return JsonResponse.ok(); |
|
||||
} |
|
||||
} |
|
||||
@ -1,64 +0,0 @@ |
|||||
package com.acupuncture.web.controller.web; |
|
||||
|
|
||||
import com.acupuncture.common.core.domain.JsonResponse; |
|
||||
import com.acupuncture.system.domain.dto.StatisticsDto; |
|
||||
import com.acupuncture.system.domain.vo.StatisticsVo; |
|
||||
import com.acupuncture.system.service.StatisticsService; |
|
||||
import io.swagger.annotations.Api; |
|
||||
import io.swagger.annotations.ApiOperation; |
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
import org.springframework.validation.annotation.Validated; |
|
||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||
import org.springframework.web.bind.annotation.RequestBody; |
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||
import org.springframework.web.bind.annotation.RestController; |
|
||||
|
|
||||
import javax.annotation.Resource; |
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* @Author zzc |
|
||||
* @Package com.acupuncture.web.controller.web |
|
||||
* @Date 2025/2/13 8:58 |
|
||||
* @description: |
|
||||
*/ |
|
||||
@Slf4j |
|
||||
@Api(tags = "统计相关") |
|
||||
@RestController |
|
||||
@RequestMapping("/statistic") |
|
||||
public class StatisticsController { |
|
||||
|
|
||||
@Resource |
|
||||
private StatisticsService statisticsService; |
|
||||
|
|
||||
@ApiOperation("患者统计") |
|
||||
@PostMapping("/patientTotal") |
|
||||
public JsonResponse<StatisticsVo.PatientVo> queryPatientStatistics(@RequestBody @Validated StatisticsDto.Query dto) { |
|
||||
return JsonResponse.ok(statisticsService.queryPatientStatistics(dto)); |
|
||||
} |
|
||||
|
|
||||
@ApiOperation("诊疗统计") |
|
||||
@PostMapping("/zlInfo") |
|
||||
public JsonResponse<StatisticsVo.TreamentVo> queryZlStatistics(@RequestBody @Validated StatisticsDto.Query dto) { |
|
||||
return JsonResponse.ok(statisticsService.queryZlStatistics(dto)); |
|
||||
} |
|
||||
|
|
||||
@ApiOperation("治疗类型统计") |
|
||||
@PostMapping("/zlType") |
|
||||
public JsonResponse<StatisticsVo.ZlTypeVo> queryZlTypeStatistics(@RequestBody @Validated StatisticsDto.Query dto) { |
|
||||
return JsonResponse.ok(statisticsService.queryZlTypeStatistics(dto)); |
|
||||
} |
|
||||
|
|
||||
@ApiOperation("随访分布统计") |
|
||||
@PostMapping("/sffb") |
|
||||
public JsonResponse<StatisticsVo.SffbVo> querySfStatistics(@RequestBody @Validated StatisticsDto.Query dto) { |
|
||||
return JsonResponse.ok(statisticsService.querySfStatistics(dto)); |
|
||||
} |
|
||||
|
|
||||
@ApiOperation("失访统计") |
|
||||
@PostMapping("/sftj") |
|
||||
public JsonResponse<List<StatisticsVo.SftjVo>> querySfTjStatistics(@RequestBody @Validated StatisticsDto.Query dto) { |
|
||||
return JsonResponse.ok(statisticsService.querySfTjStatistics(dto)); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -1,26 +0,0 @@ |
|||||
package com.acupuncture.system.domain.dto; |
|
||||
|
|
||||
import io.swagger.annotations.ApiModelProperty; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
import java.util.Date; |
|
||||
|
|
||||
/** |
|
||||
* @Author zzc |
|
||||
* @Package com.acupuncture.system.domain.dto |
|
||||
* @Date 2025/2/13 10:52 |
|
||||
* @description: |
|
||||
*/ |
|
||||
public class StatisticsDto { |
|
||||
|
|
||||
@Data |
|
||||
public static class Query { |
|
||||
@ApiModelProperty("开始时间") |
|
||||
private Date startTime; |
|
||||
@ApiModelProperty("结束时间") |
|
||||
private Date endTime; |
|
||||
@ApiModelProperty("统计方式 0:周 1:月 2:季 3:年") |
|
||||
private Integer timeType; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -1,432 +0,0 @@ |
|||||
package com.acupuncture.system.domain.vo; |
|
||||
|
|
||||
import com.acupuncture.common.annotation.DataSource; |
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||
import io.swagger.annotations.Api; |
|
||||
import io.swagger.annotations.ApiModel; |
|
||||
import io.swagger.annotations.ApiModelProperty; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.Date; |
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* @Author zzc |
|
||||
* @Package com.acupuncture.system.domain.vo |
|
||||
* @Date 2025/2/13 8:59 |
|
||||
* @description: |
|
||||
*/ |
|
||||
public class StatisticsVo { |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("患者统计") |
|
||||
public static class PatientVo { |
|
||||
private Integer totalPatients; |
|
||||
@ApiModelProperty("性别统计") |
|
||||
private GenderVo gender; |
|
||||
|
|
||||
@ApiModelProperty("年龄统计") |
|
||||
private AgeVo age; |
|
||||
|
|
||||
@ApiModelProperty("疾病统计") |
|
||||
private JwbzVo jwbz; |
|
||||
|
|
||||
@Data |
|
||||
public static class GenderVo { |
|
||||
@ApiModelProperty("男患者人数") |
|
||||
private Integer male; |
|
||||
@ApiModelProperty("女患者人数") |
|
||||
private Integer female; |
|
||||
@ApiModelProperty("未知患者人数") |
|
||||
private Integer other; |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
public static class AgeVo { |
|
||||
@ApiModelProperty("0-40") |
|
||||
private Integer num1; |
|
||||
@ApiModelProperty("41-50") |
|
||||
private Integer num2; |
|
||||
@ApiModelProperty("51-60") |
|
||||
private Integer num3; |
|
||||
@ApiModelProperty("61-70") |
|
||||
private Integer num4; |
|
||||
@ApiModelProperty("71-80") |
|
||||
private Integer num5; |
|
||||
@ApiModelProperty("80") |
|
||||
private Integer num6; |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
public static class JwbzVo { |
|
||||
@ApiModelProperty("高血压") |
|
||||
private Integer gxy; |
|
||||
@ApiModelProperty("脑血管病") |
|
||||
private Integer nxgb; |
|
||||
@ApiModelProperty("恶性肿瘤") |
|
||||
private Integer exzl; |
|
||||
@ApiModelProperty("冠心病") |
|
||||
private Integer gxb; |
|
||||
@ApiModelProperty("精神疾病") |
|
||||
private Integer jsjb; |
|
||||
@ApiModelProperty("胃和十二指肠溃疡") |
|
||||
private Integer whsezcky; |
|
||||
@ApiModelProperty("肥胖症") |
|
||||
private Integer fpz; |
|
||||
@ApiModelProperty("骨质疏松症") |
|
||||
private Integer gzssz; |
|
||||
@ApiModelProperty("遗传性、先天性疾病") |
|
||||
private Integer ycxXtxjb; |
|
||||
@ApiModelProperty("糖尿病") |
|
||||
private Integer tnb; |
|
||||
@ApiModelProperty("慢性肺系疾病") |
|
||||
private Integer mxfxjb; |
|
||||
@ApiModelProperty("高脂血症") |
|
||||
private Integer gzxz; |
|
||||
@ApiModelProperty("肝脏疾病") |
|
||||
private Integer gzjb; |
|
||||
@ApiModelProperty("过敏性疾病") |
|
||||
private Integer gmxjb; |
|
||||
@ApiModelProperty("关节炎") |
|
||||
private Integer gjy; |
|
||||
@ApiModelProperty("痛风") |
|
||||
private Integer tf; |
|
||||
@ApiModelProperty("肾炎、肾病") |
|
||||
private Integer sySb; |
|
||||
@ApiModelProperty("其他") |
|
||||
private Integer other; |
|
||||
|
|
||||
public List<TreamentVo.SortVo> sortFields() { |
|
||||
List<TreamentVo.SortVo> sortList = new ArrayList<>(); |
|
||||
|
|
||||
// 将所有字段及其类型放入列表
|
|
||||
sortList.add(new TreamentVo.SortVo(gxy, 0, "高血压")); |
|
||||
sortList.add(new TreamentVo.SortVo(nxgb, 1, "脑血管病")); |
|
||||
sortList.add(new TreamentVo.SortVo(exzl, 2, "恶性肿瘤")); |
|
||||
sortList.add(new TreamentVo.SortVo(gxb, 3, "冠心病")); |
|
||||
sortList.add(new TreamentVo.SortVo(jsjb, 4, "精神疾病")); |
|
||||
sortList.add(new TreamentVo.SortVo(whsezcky, 5, "胃和十二指肠溃疡")); |
|
||||
sortList.add(new TreamentVo.SortVo(fpz, 6, "肥胖症")); |
|
||||
sortList.add(new TreamentVo.SortVo(gzssz, 7, "骨质疏松症")); |
|
||||
sortList.add(new TreamentVo.SortVo(ycxXtxjb, 8, "遗传性、先天性疾病")); |
|
||||
sortList.add(new TreamentVo.SortVo(tnb, 9, "糖尿病")); |
|
||||
sortList.add(new TreamentVo.SortVo(mxfxjb, 10, "慢性肺系疾病")); |
|
||||
sortList.add(new TreamentVo.SortVo(gzxz, 11, "高脂血症")); |
|
||||
sortList.add(new TreamentVo.SortVo(gzjb, 12, "肝脏疾病")); |
|
||||
sortList.add(new TreamentVo.SortVo(gmxjb, 13, "过敏性疾病")); |
|
||||
sortList.add(new TreamentVo.SortVo(gjy, 14, "关节炎")); |
|
||||
sortList.add(new TreamentVo.SortVo(tf, 15, "痛风")); |
|
||||
sortList.add(new TreamentVo.SortVo(sySb, 16, "肾炎、肾病")); |
|
||||
|
|
||||
// 使用选择排序算法对列表进行排序
|
|
||||
for (int i = 0; i < sortList.size() - 1; i++) { |
|
||||
int minIndex = i; |
|
||||
for (int j = i + 1; j < sortList.size(); j++) { |
|
||||
if (sortList.get(j).getTotal() > sortList.get(minIndex).getTotal()) { |
|
||||
minIndex = j; |
|
||||
} |
|
||||
} |
|
||||
if (minIndex != i) { |
|
||||
TreamentVo.SortVo temp = sortList.get(i); |
|
||||
sortList.set(i, sortList.get(minIndex)); |
|
||||
sortList.set(minIndex, temp); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// 设置排序位置
|
|
||||
for (int i = 0; i < sortList.size(); i++) { |
|
||||
sortList.get(i).setSort(i + 1); |
|
||||
} |
|
||||
return sortList; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("诊疗信息") |
|
||||
public static class TreamentVo { |
|
||||
|
|
||||
@ApiModelProperty("排名信息") |
|
||||
private List<SortVo> sort; |
|
||||
@ApiModelProperty("体型分布") |
|
||||
private TxfbVo txfb; |
|
||||
@ApiModelProperty("中医体质分布") |
|
||||
private ZytzVo zytz; |
|
||||
@ApiModelProperty("体态") |
|
||||
private TtfbVo ttfb; |
|
||||
@ApiModelProperty("失眠") |
|
||||
private SmfbVo smfb; |
|
||||
@ApiModelProperty("焦虑") |
|
||||
private JlfbVo jlfb; |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("排名信息") |
|
||||
public static class SortVo { |
|
||||
private Integer total; |
|
||||
private Integer sort; |
|
||||
private String type; |
|
||||
|
|
||||
public SortVo(Integer total, Integer sort, String type) { |
|
||||
this.total = total; |
|
||||
this.sort = sort; |
|
||||
this.type = type; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("体型分布") |
|
||||
public static class TxfbVo { |
|
||||
@ApiModelProperty("") |
|
||||
private Integer total; |
|
||||
@ApiModelProperty("隐形肥胖型") |
|
||||
private Integer yxfpz; |
|
||||
@ApiModelProperty("脂肪过多型") |
|
||||
private Integer zfgdx; |
|
||||
@ApiModelProperty("肥胖型") |
|
||||
private Integer fpx; |
|
||||
@ApiModelProperty("肌肉不足型") |
|
||||
private Integer jrbzx; |
|
||||
@ApiModelProperty("健康匀称型") |
|
||||
private Integer jkjcx; |
|
||||
@ApiModelProperty("超重肌肉型") |
|
||||
private Integer czjrx; |
|
||||
@ApiModelProperty("消瘦型") |
|
||||
private Integer xsx; |
|
||||
@ApiModelProperty("低脂肪型") |
|
||||
private Integer dzfx; |
|
||||
@ApiModelProperty("运动员型") |
|
||||
private Integer ydyx; |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("体型分布") |
|
||||
public static class ZytzVo { |
|
||||
@ApiModelProperty("") |
|
||||
private Integer total; |
|
||||
@ApiModelProperty("平和质") |
|
||||
private Integer phz; |
|
||||
@ApiModelProperty("气虚质") |
|
||||
private Integer qxz; |
|
||||
@ApiModelProperty("阳虚质") |
|
||||
private Integer yangxz; |
|
||||
@ApiModelProperty("阴虚质") |
|
||||
private Integer yinxz; |
|
||||
@ApiModelProperty("痰湿质") |
|
||||
private Integer tsz; |
|
||||
@ApiModelProperty("湿热质") |
|
||||
private Integer srz; |
|
||||
@ApiModelProperty("血瘀质") |
|
||||
private Integer xyz; |
|
||||
@ApiModelProperty("气郁质") |
|
||||
private Integer qyz; |
|
||||
@ApiModelProperty("特禀质") |
|
||||
private Integer tlz; |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("体态分布") |
|
||||
public static class TtfbVo { |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score1; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score2; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score3; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score4; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score5; |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("失眠分布") |
|
||||
public static class SmfbVo { |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score1; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score2; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score3; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score4; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score5; |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("焦虑分布") |
|
||||
public static class JlfbVo { |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score1; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score2; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score3; |
|
||||
@ApiModelProperty("") |
|
||||
private Integer score4; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("治疗类型") |
|
||||
public static class ZlTypeVo { |
|
||||
@ApiModelProperty("治疗类型统计") |
|
||||
private Zllxtj zllxtj; |
|
||||
@ApiModelProperty("病种方法分布") |
|
||||
private BzfffbVo bzfffb; |
|
||||
@ApiModelProperty("病种穴位分布") |
|
||||
private BzxwfbVo bzxwfb; |
|
||||
@ApiModelProperty("治疗效果统计") |
|
||||
private ZlxgVo zlxwfb; |
|
||||
@ApiModelProperty("诊疗费用分布") |
|
||||
private ZlfyVo zlfy; |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("治疗类型统计") |
|
||||
public static class Zllxtj { |
|
||||
private Integer zxyjh; |
|
||||
private Integer czy; |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("病种方法分布") |
|
||||
public static class BzfffbVo { |
|
||||
private Fpz fpz; |
|
||||
private Smz smz; |
|
||||
private Otherbz otherbz; |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("肥胖症") |
|
||||
public static class Fpz { |
|
||||
@ApiModelProperty("行为心理干预") |
|
||||
private Integer xwxlg; |
|
||||
@ApiModelProperty("运动干预") |
|
||||
private Integer ydgy; |
|
||||
@ApiModelProperty("临床营养治疗") |
|
||||
private Integer lcyyzl; |
|
||||
@ApiModelProperty("针灸疗法") |
|
||||
private Integer zjlf; |
|
||||
@ApiModelProperty("药物治疗") |
|
||||
private Integer ywzl; |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("失眠症") |
|
||||
public static class Smz { |
|
||||
@ApiModelProperty("生活习惯") |
|
||||
private Integer shxg; |
|
||||
@ApiModelProperty("心理调适") |
|
||||
private Integer xlts; |
|
||||
@ApiModelProperty("针灸") |
|
||||
private Integer zj; |
|
||||
@ApiModelProperty("药物治疗") |
|
||||
private Integer ywzl; |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("失眠症") |
|
||||
public static class Otherbz { |
|
||||
@ApiModelProperty("针灸") |
|
||||
private Integer zj; |
|
||||
@ApiModelProperty("药物治疗") |
|
||||
private Integer ywzl; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("病种穴位分布") |
|
||||
public static class BzxwfbVo { |
|
||||
@ApiModelProperty("肥胖症病种穴位分布") |
|
||||
private Bzxwfb fpzbzxwfb; |
|
||||
@ApiModelProperty("失眠症病种穴位分布") |
|
||||
private Bzxwfb smzbzxwfb; |
|
||||
@ApiModelProperty("其他病种穴位分布") |
|
||||
private Bzxwfb qtbzxwfb; |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("病种穴位分布") |
|
||||
public static class Bzxwfb { |
|
||||
@ApiModelProperty("足三里") |
|
||||
private Integer zsl; |
|
||||
@ApiModelProperty("中脘") |
|
||||
private Integer zr; |
|
||||
@ApiModelProperty("天枢") |
|
||||
private Integer tq; |
|
||||
@ApiModelProperty("神门") |
|
||||
private Integer sm; |
|
||||
@ApiModelProperty("三阴交") |
|
||||
private Integer syj; |
|
||||
@ApiModelProperty("百会") |
|
||||
private Integer bh; |
|
||||
@ApiModelProperty("其他") |
|
||||
private Integer am; |
|
||||
@ApiModelProperty("药物治疗") |
|
||||
private Integer other; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("治疗效果统计") |
|
||||
public static class ZlxgVo { |
|
||||
@ApiModelProperty("治愈") |
|
||||
private Integer zy; |
|
||||
@ApiModelProperty("显效") |
|
||||
private Integer xx; |
|
||||
@ApiModelProperty("好转") |
|
||||
private Integer hz; |
|
||||
@ApiModelProperty("无效") |
|
||||
private Integer wx; |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("诊疗费用分布") |
|
||||
public static class ZlfyVo { |
|
||||
@ApiModelProperty("<300元") |
|
||||
private Integer score1; |
|
||||
@ApiModelProperty("300 ~ 900元") |
|
||||
private Integer score2; |
|
||||
@ApiModelProperty("900 ~ 2000元") |
|
||||
private Integer score3; |
|
||||
@ApiModelProperty("2000 ~ 5000元") |
|
||||
private Integer score4; |
|
||||
@ApiModelProperty(">5000元") |
|
||||
private Integer score5; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("随访分布") |
|
||||
public static class SffbVo { |
|
||||
@ApiModelProperty("减重队列") |
|
||||
private DlVo jzdl; |
|
||||
@ApiModelProperty("失眠队列") |
|
||||
private DlVo smdl; |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("队列") |
|
||||
public static class DlVo { |
|
||||
private Long queueId; |
|
||||
@ApiModelProperty("人数") |
|
||||
private Integer num; |
|
||||
@ApiModelProperty("待随访") |
|
||||
private Integer dsf; |
|
||||
@ApiModelProperty("临近随访") |
|
||||
private Integer ljsf; |
|
||||
@ApiModelProperty("超期随访") |
|
||||
private Integer cqsf; |
|
||||
@ApiModelProperty("正常随访") |
|
||||
private Integer zc; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@Data |
|
||||
@ApiModel("失访统计") |
|
||||
public static class SftjVo { |
|
||||
@ApiModelProperty("失访数量") |
|
||||
private Integer num; |
|
||||
@ApiModelProperty("失访原因") |
|
||||
private String reason; |
|
||||
} |
|
||||
} |
|
||||
@ -1,79 +0,0 @@ |
|||||
package com.acupuncture.system.persist.dao; |
|
||||
|
|
||||
import com.acupuncture.system.domain.dto.StatisticsDto; |
|
||||
import com.acupuncture.system.domain.vo.StatisticsVo; |
|
||||
import org.apache.ibatis.annotations.Param; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* @Author zzc |
|
||||
* @Package com.acupuncture.system.persist.dao |
|
||||
* @Date 2025/2/13 14:07 |
|
||||
* @description: |
|
||||
*/ |
|
||||
public interface StatisticsDao { |
|
||||
|
|
||||
/** |
|
||||
* 患者统计 |
|
||||
* |
|
||||
* @param dto |
|
||||
* @param tenantId |
|
||||
* @return |
|
||||
*/ |
|
||||
StatisticsVo.PatientVo.GenderVo queryGenderStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
/** |
|
||||
* 年龄统计 |
|
||||
* |
|
||||
* @param dto |
|
||||
* @param tenantId |
|
||||
* @return |
|
||||
*/ |
|
||||
StatisticsVo.PatientVo.AgeVo queryAgeStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
StatisticsVo.PatientVo.JwbzVo queryJwbzStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
Integer queryTotalPatient(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
StatisticsVo.TreamentVo.TxfbVo queryTxfbStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
StatisticsVo.TreamentVo.ZytzVo queryZytzStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
StatisticsVo.ZlTypeVo.Zllxtj queryZllxtjStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
|
|
||||
StatisticsVo.ZlTypeVo.BzfffbVo.Fpz queryFpzStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
StatisticsVo.ZlTypeVo.ZlxgVo queryZlxgStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
StatisticsVo.ZlTypeVo.ZlfyVo queryZlfyStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
List<StatisticsVo.SftjVo> querySftjStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
List<StatisticsVo.SffbVo.DlVo> querySfStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
StatisticsVo.TreamentVo.TtfbVo queryTtfbStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
StatisticsVo.TreamentVo.SmfbVo querySmfbStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
StatisticsVo.TreamentVo.JlfbVo queryJlfbStatistics(@Param("dto") StatisticsDto.Query dto, |
|
||||
@Param("tenantId") Long tenantId); |
|
||||
|
|
||||
StatisticsVo.ZlTypeVo.BzfffbVo.Smz querySmzStatistics(StatisticsDto.Query dto, Long tenantId); |
|
||||
} |
|
||||
|
|
||||
@ -1,55 +0,0 @@ |
|||||
package com.acupuncture.system.service; |
|
||||
|
|
||||
import com.acupuncture.system.domain.dto.StatisticsDto; |
|
||||
import com.acupuncture.system.domain.vo.StatisticsVo; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* @Author zzc |
|
||||
* @Package com.acupuncture.system.service |
|
||||
* @Date 2025/2/13 8:58 |
|
||||
* @description: |
|
||||
*/ |
|
||||
public interface StatisticsService { |
|
||||
|
|
||||
/** |
|
||||
* 患者统计 |
|
||||
* |
|
||||
* @param dto |
|
||||
* @return |
|
||||
*/ |
|
||||
StatisticsVo.PatientVo queryPatientStatistics(StatisticsDto.Query dto); |
|
||||
|
|
||||
/** |
|
||||
* 诊疗统计 |
|
||||
* |
|
||||
* @param dto |
|
||||
* @return |
|
||||
*/ |
|
||||
StatisticsVo.TreamentVo queryZlStatistics(StatisticsDto.Query dto); |
|
||||
|
|
||||
/** |
|
||||
* 治疗类型统计 |
|
||||
* |
|
||||
* @param dto |
|
||||
* @return |
|
||||
*/ |
|
||||
StatisticsVo.ZlTypeVo queryZlTypeStatistics(StatisticsDto.Query dto); |
|
||||
|
|
||||
/** |
|
||||
* 随访分布统计 |
|
||||
* |
|
||||
* @param dto |
|
||||
* @return |
|
||||
*/ |
|
||||
StatisticsVo.SffbVo querySfStatistics(StatisticsDto.Query dto); |
|
||||
|
|
||||
/** |
|
||||
* 失访统计 |
|
||||
* |
|
||||
* @param dto |
|
||||
* @return |
|
||||
*/ |
|
||||
List<StatisticsVo.SftjVo> querySfTjStatistics(StatisticsDto.Query dto); |
|
||||
} |
|
||||
@ -1,93 +0,0 @@ |
|||||
package com.acupuncture.system.service.impl; |
|
||||
|
|
||||
import cn.hutool.core.bean.BeanUtil; |
|
||||
import cn.hutool.core.collection.CollUtil; |
|
||||
import com.acupuncture.common.utils.SecurityUtils; |
|
||||
import com.acupuncture.system.domain.dto.StatisticsDto; |
|
||||
import com.acupuncture.system.domain.vo.StatisticsVo; |
|
||||
import com.acupuncture.system.persist.dao.StatisticsDao; |
|
||||
import com.acupuncture.system.service.StatisticsService; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
import javax.annotation.Resource; |
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* @Author zzc |
|
||||
* @Package com.acupuncture.system.service |
|
||||
* @Date 2025/2/13 8:58 |
|
||||
* @description: |
|
||||
*/ |
|
||||
@Service |
|
||||
public class StatisticsServiceImpl implements StatisticsService { |
|
||||
@Resource |
|
||||
private StatisticsDao statisticsDao; |
|
||||
|
|
||||
@Override |
|
||||
public StatisticsVo.PatientVo queryPatientStatistics(StatisticsDto.Query dto) { |
|
||||
StatisticsVo.PatientVo patientVo = new StatisticsVo.PatientVo(); |
|
||||
patientVo.setGender(statisticsDao.queryGenderStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
patientVo.setAge(statisticsDao.queryAgeStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
patientVo.setJwbz(statisticsDao.queryJwbzStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
patientVo.setTotalPatients(statisticsDao.queryTotalPatient(dto, SecurityUtils.getTenantId())); |
|
||||
return patientVo; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public StatisticsVo.TreamentVo queryZlStatistics(StatisticsDto.Query dto) { |
|
||||
StatisticsVo.TreamentVo treamentVo = new StatisticsVo.TreamentVo(); |
|
||||
StatisticsVo.PatientVo.JwbzVo jwbzVo = statisticsDao.queryJwbzStatistics(dto, SecurityUtils.getTenantId()); |
|
||||
if (jwbzVo != null) { |
|
||||
treamentVo.setSort(jwbzVo.sortFields()); |
|
||||
} |
|
||||
treamentVo.setTxfb(statisticsDao.queryTxfbStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
treamentVo.setZytz(statisticsDao.queryZytzStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
treamentVo.setTtfb(statisticsDao.queryTtfbStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
treamentVo.setSmfb(statisticsDao.querySmfbStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
treamentVo.setJlfb(statisticsDao.queryJlfbStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
return treamentVo; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public StatisticsVo.ZlTypeVo queryZlTypeStatistics(StatisticsDto.Query dto) { |
|
||||
StatisticsVo.ZlTypeVo zlTypeVo = new StatisticsVo.ZlTypeVo(); |
|
||||
zlTypeVo.setZllxtj(statisticsDao.queryZllxtjStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
|
|
||||
StatisticsVo.ZlTypeVo.BzfffbVo bzfffbVo = new StatisticsVo.ZlTypeVo.BzfffbVo(); |
|
||||
bzfffbVo.setFpz(statisticsDao.queryFpzStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
bzfffbVo.setSmz(statisticsDao.querySmzStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
//TODO
|
|
||||
zlTypeVo.setBzfffb(bzfffbVo); |
|
||||
zlTypeVo.setZlxwfb(statisticsDao.queryZlxgStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
zlTypeVo.setZlfy(statisticsDao.queryZlfyStatistics(dto, SecurityUtils.getTenantId())); |
|
||||
return zlTypeVo; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public StatisticsVo.SffbVo querySfStatistics(StatisticsDto.Query dto) { |
|
||||
StatisticsVo.SffbVo sffbVo = new StatisticsVo.SffbVo(); |
|
||||
List<StatisticsVo.SffbVo.DlVo> dlVos = statisticsDao.querySfStatistics(dto, SecurityUtils.getTenantId()); |
|
||||
if (CollUtil.isNotEmpty(dlVos)) { |
|
||||
for (StatisticsVo.SffbVo.DlVo dlVo : dlVos) { |
|
||||
if (dlVo.getQueueId() == 10L) { |
|
||||
//减重队列
|
|
||||
StatisticsVo.SffbVo.DlVo jzdl = new StatisticsVo.SffbVo.DlVo(); |
|
||||
BeanUtil.copyProperties(dlVo, jzdl); |
|
||||
sffbVo.setJzdl(jzdl); |
|
||||
}else if (dlVo.getQueueId() == 11L) { |
|
||||
//失眠队列
|
|
||||
//减重队列
|
|
||||
StatisticsVo.SffbVo.DlVo smdl = new StatisticsVo.SffbVo.DlVo(); |
|
||||
BeanUtil.copyProperties(dlVo, smdl); |
|
||||
sffbVo.setSmdl(smdl); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
return sffbVo; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public List<StatisticsVo.SftjVo> querySfTjStatistics(StatisticsDto.Query dto) { |
|
||||
return statisticsDao.querySftjStatistics(dto, SecurityUtils.getTenantId()); |
|
||||
} |
|
||||
} |
|
||||
@ -1,287 +0,0 @@ |
|||||
<?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.acupuncture.system.persist.dao.StatisticsDao"> |
|
||||
|
|
||||
<select id="queryGenderStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$PatientVo$GenderVo"> |
|
||||
SELECT |
|
||||
IFNULL(SUM(CASE WHEN gender = 0 THEN 1 ELSE 0 END), 0) AS male, |
|
||||
IFNULL(SUM(CASE WHEN gender = 1 THEN 1 ELSE 0 END), 0) AS female, |
|
||||
IFNULL(SUM(CASE WHEN gender IS NULL OR gender NOT IN (0, 1) THEN 1 ELSE 0 END), 0) AS other |
|
||||
FROM |
|
||||
pms_patient |
|
||||
<where> |
|
||||
<if test="tenantId != null"> |
|
||||
AND tenant_id = #{tenantId} |
|
||||
</if> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<select id="queryAgeStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$PatientVo$AgeVo"> |
|
||||
SELECT |
|
||||
IFNULL(SUM(CASE WHEN age BETWEEN 0 AND 40 THEN 1 ELSE 0 END), 0) as num1, |
|
||||
IFNULL(SUM(CASE WHEN age BETWEEN 41 AND 50 THEN 1 ELSE 0 END), 0) as num2, |
|
||||
IFNULL(SUM(CASE WHEN age BETWEEN 51 AND 60 THEN 1 ELSE 0 END), 0) as num3, |
|
||||
IFNULL(SUM(CASE WHEN age BETWEEN 61 AND 70 THEN 1 ELSE 0 END), 0) as num4, |
|
||||
IFNULL(SUM(CASE WHEN age BETWEEN 71 AND 80 THEN 1 ELSE 0 END), 0) as num5, |
|
||||
IFNULL(SUM(CASE WHEN age > 80 THEN 1 ELSE 0 END), 0) as num6 |
|
||||
FROM |
|
||||
pms_treatment |
|
||||
<where> |
|
||||
<if test="tenantId != null"> |
|
||||
AND tenant_id = #{tenantId} |
|
||||
</if> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<select id="queryJwbzStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$PatientVo$JwbzVo"> |
|
||||
SELECT |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"高血压"') THEN 1 ELSE 0 END) AS gxy, -- 高血压 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"脑血管病"') THEN 1 ELSE 0 END) AS nxgb, -- 脑血管病 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"恶性肿瘤"') THEN 1 ELSE 0 END) AS exzl, -- 恶性肿瘤 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"冠心病"') THEN 1 ELSE 0 END) AS gxb, -- 冠心病 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"精神疾病"') THEN 1 ELSE 0 END) AS jsjb, -- 精神疾病 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"胃和十二指肠溃疡"') THEN 1 ELSE 0 END) AS whsezcky, -- 胃和十二指肠溃疡 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"肥胖症"') THEN 1 ELSE 0 END) AS fpz, -- 肥胖症 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"骨质疏松症"') THEN 1 ELSE 0 END) AS gzssz, -- 骨质疏松症 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"遗传性、先天性疾病"') THEN 1 ELSE 0 END) AS ycxXtxjb, -- 遗传性、先天性疾病 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"糖尿病"') THEN 1 ELSE 0 END) AS tnb, -- 糖尿病 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"慢性肺系疾病"') THEN 1 ELSE 0 END) AS mxfxjb, -- 慢性肺系疾病 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"高脂血症"') THEN 1 ELSE 0 END) AS gzxz, -- 高脂血症 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"肝脏疾病"') THEN 1 ELSE 0 END) AS gzjb, -- 肝脏疾病 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"过敏性疾病"') THEN 1 ELSE 0 END) AS gmxjb, -- 过敏性疾病 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"关节炎"') THEN 1 ELSE 0 END) AS gjy, -- 关节炎 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"痛风"') THEN 1 ELSE 0 END) AS tf, -- 痛风 |
|
||||
SUM(CASE WHEN JSON_CONTAINS(current_illness_history, '"肾炎、肾病"') THEN 1 ELSE 0 END) AS sySb, -- 肾炎、肾病 |
|
||||
SUM(CASE WHEN |
|
||||
JSON_CONTAINS(current_illness_history, '"高血压"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"脑血管病"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"恶性肿瘤"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"冠心病"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"精神疾病"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"胃和十二指肠溃疡"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"肥胖症"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"骨质疏松症"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"遗传性、先天性疾病"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"糖尿病"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"慢性肺系疾病"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"高脂血症"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"肝脏疾病"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"过敏性疾病"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"关节炎"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"痛风"') = 0 AND |
|
||||
JSON_CONTAINS(current_illness_history, '"肾炎、肾病"') = 0 |
|
||||
THEN 1 ELSE 0 END) AS other -- 其他 |
|
||||
FROM |
|
||||
pms_patient |
|
||||
<where> |
|
||||
<if test="tenantId != null"> |
|
||||
AND tenant_id = #{tenantId} |
|
||||
</if> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<select id="queryTotalPatient" resultType="java.lang.Integer"> |
|
||||
SELECT |
|
||||
COUNT(1) |
|
||||
FROM |
|
||||
pms_patient |
|
||||
<where> |
|
||||
<if test="tenantId != null"> |
|
||||
AND tenant_id = #{tenantId} |
|
||||
</if> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<select id="queryTxfbStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$TxfbVo"> |
|
||||
SELECT |
|
||||
COUNT(*) AS total, |
|
||||
SUM(CASE WHEN answer = '隐形肥胖型' THEN 1 ELSE 0 END) AS yxfpz, |
|
||||
SUM(CASE WHEN answer = '脂肪过多型' THEN 1 ELSE 0 END) AS zfgdx, |
|
||||
SUM(CASE WHEN answer = '肥胖型' THEN 1 ELSE 0 END) AS fpx, |
|
||||
SUM(CASE WHEN answer = '肌肉不足型' THEN 1 ELSE 0 END) AS jrbzx, |
|
||||
SUM(CASE WHEN answer = '健康匀称型' THEN 1 ELSE 0 END) AS jkjcx, |
|
||||
SUM(CASE WHEN answer = '超重肌肉型' THEN 1 ELSE 0 END) AS czjrx, |
|
||||
SUM(CASE WHEN answer = '消瘦型' THEN 1 ELSE 0 END) AS xsx, |
|
||||
SUM(CASE WHEN answer = '低脂肪型' THEN 1 ELSE 0 END) AS dzfx, |
|
||||
SUM(CASE WHEN answer = '运动员型' THEN 1 ELSE 0 END) AS ydyx |
|
||||
FROM |
|
||||
pms_treatment t |
|
||||
left join |
|
||||
pms_treatment_record r on t.id = r.treatment_id |
|
||||
WHERE |
|
||||
question_code = 'PG_RTCF_TXLX' |
|
||||
AND r.del_flag = 0 |
|
||||
and t.del_flag = 0 |
|
||||
<if test="tenantId != null"> |
|
||||
AND tenant_id = #{tenantId} |
|
||||
</if> |
|
||||
</select> |
|
||||
|
|
||||
<select id="queryZytzStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$ZytzVo"> |
|
||||
SELECT |
|
||||
COUNT(*) AS total, |
|
||||
SUM(CASE WHEN answer = '平和质' THEN 1 ELSE 0 END) AS phz, |
|
||||
SUM(CASE WHEN answer = '气虚质' THEN 1 ELSE 0 END) AS qxz, |
|
||||
SUM(CASE WHEN answer = '阳虚质' THEN 1 ELSE 0 END) AS yangxz, |
|
||||
SUM(CASE WHEN answer = '阴虚质' THEN 1 ELSE 0 END) AS yinxz, |
|
||||
SUM(CASE WHEN answer = '痰湿质' THEN 1 ELSE 0 END) AS tsz, |
|
||||
SUM(CASE WHEN answer = '湿热质' THEN 1 ELSE 0 END) AS srz, |
|
||||
SUM(CASE WHEN answer = '血瘀质' THEN 1 ELSE 0 END) AS xyz, |
|
||||
SUM(CASE WHEN answer = '气郁质' THEN 1 ELSE 0 END) AS qyz, |
|
||||
SUM(CASE WHEN answer = '特禀质' THEN 1 ELSE 0 END) AS tlz |
|
||||
FROM |
|
||||
pms_treatment t |
|
||||
left join |
|
||||
pms_treatment_record r on t.id = r.treatment_id |
|
||||
WHERE |
|
||||
question_code = 'PG_TZBS_ZYTZ' |
|
||||
AND r.del_flag = 0 and t.del_flag = 0 |
|
||||
</select> |
|
||||
|
|
||||
<select id="queryZllxtjStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$Zllxtj"> |
|
||||
SELECT |
|
||||
SUM( CASE WHEN answer = '中西医结合治疗' THEN 1 ELSE 0 END ) AS zxyjh, |
|
||||
SUM( CASE WHEN answer = '单纯中医治疗' THEN 1 ELSE 0 END ) AS czy |
|
||||
FROM |
|
||||
pms_treatment t |
|
||||
LEFT JOIN pms_treatment_record r ON t.id = r.treatment_id |
|
||||
WHERE |
|
||||
question_code = 'ZLFA_ZLLX' |
|
||||
AND t.del_flag = 0 |
|
||||
AND t.del_flag = 0 |
|
||||
</select> |
|
||||
|
|
||||
<select id="queryFpzStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$BzfffbVo$Fpz"> |
|
||||
SELECT |
|
||||
COUNT( CASE WHEN question_code = 'ZLFA_XWXLGY' THEN 1 END ) AS xwxlg, |
|
||||
COUNT( CASE WHEN question_code = 'ZLFA_YDGY' THEN 1 END ) AS ydgy, |
|
||||
COUNT( CASE WHEN question_code = 'ZLFA_LCYYZL' THEN 1 END ) AS lcyyzl, |
|
||||
COUNT( CASE WHEN question_code = 'ZLFA_ZJ' THEN 1 END ) AS zjlf, |
|
||||
COUNT( CASE WHEN question_code = 'ZLFA_ZL' THEN 1 END ) AS ywzl |
|
||||
FROM |
|
||||
pms_treatment_record |
|
||||
WHERE |
|
||||
question_code IN ( 'ZLFA_XWXLGY', 'ZLFA_YDGY', 'ZLFA_LCYYZL', 'ZLFA_ZJ', 'ZLFA_ZL' ) |
|
||||
AND del_flag = 0 |
|
||||
</select> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<select id="queryZlxgStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$ZlxgVo"> |
|
||||
sELECT |
|
||||
SUM(CASE WHEN answer = '治愈' THEN 1 ELSE 0 END) AS zy, |
|
||||
SUM(CASE WHEN answer = '显效' THEN 1 ELSE 0 END) AS xx, |
|
||||
SUM(CASE WHEN answer = '好转' THEN 1 ELSE 0 END) AS hz, |
|
||||
SUM(CASE WHEN answer = '无效' THEN 1 ELSE 0 END) AS wx |
|
||||
FROM |
|
||||
pms_treatment t |
|
||||
LEFT JOIN pms_treatment_record r ON t.id = r.treatment_id |
|
||||
WHERE |
|
||||
question_code = 'ZLFA_ZLXG' |
|
||||
AND t.del_flag = 0 |
|
||||
and r.del_flag = 0 |
|
||||
</select> |
|
||||
|
|
||||
<select id="queryZlfyStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$ZlfyVo"> |
|
||||
SELECT |
|
||||
SUM(CASE WHEN answer < 300 THEN 1 ELSE 0 END) AS score1, |
|
||||
SUM(CASE WHEN answer BETWEEN 300 AND 900 THEN 1 ELSE 0 END) AS score2, |
|
||||
SUM(CASE WHEN answer BETWEEN 901 AND 2000 THEN 1 ELSE 0 END) AS score3, |
|
||||
SUM(CASE WHEN answer BETWEEN 2001 AND 5000 THEN 1 ELSE 0 END) AS score4, |
|
||||
SUM(CASE WHEN answer > 5000 THEN 1 ELSE 0 END) AS score5 |
|
||||
FROM |
|
||||
pms_treatment t |
|
||||
LEFT JOIN pms_treatment_record r ON t.id = r.treatment_id |
|
||||
WHERE |
|
||||
question_code = 'ZLFA_ZTFY' |
|
||||
AND t.del_flag = 0 |
|
||||
and r.del_flag = 0 |
|
||||
AND answer REGEXP '^[0-9]+$'; |
|
||||
</select> |
|
||||
|
|
||||
<select id="querySftjStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$SftjVo"> |
|
||||
SELECT |
|
||||
COUNT(*) AS num, |
|
||||
lost_reason AS reason |
|
||||
FROM |
|
||||
fms_followup_task |
|
||||
WHERE |
|
||||
status = 2 |
|
||||
AND del_flag = 0 |
|
||||
GROUP BY |
|
||||
lost_reason |
|
||||
ORDER BY |
|
||||
num DESC |
|
||||
</select> |
|
||||
|
|
||||
<select id="querySfStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$SffbVo$DlVo"> |
|
||||
SELECT |
|
||||
queue_id as queueId, |
|
||||
COUNT(*) AS num, -- 总记录数 |
|
||||
SUM(CASE WHEN status = 0 AND followup_time IS NULL AND end_time > NOW() THEN 1 ELSE 0 END) AS dsf, -- 待随访 |
|
||||
SUM(CASE WHEN status = 0 AND followup_time IS NULL AND end_time BETWEEN DATE_SUB(NOW(), INTERVAL 2 DAY) AND DATE_ADD(NOW(), INTERVAL 2 DAY) THEN 1 ELSE 0 END) AS ljsf, -- 临近随访 |
|
||||
SUM(CASE WHEN (status = 0 AND followup_time IS NULL AND end_time < NOW()) OR (status = 1 AND followup_time > end_time) THEN 1 ELSE 0 END) AS cqsf, -- 超期随访 |
|
||||
SUM(CASE WHEN status = 1 AND followup_time <= end_time THEN 1 ELSE 0 END) AS zc -- 正常随访 |
|
||||
FROM |
|
||||
fms_followup_task |
|
||||
WHERE |
|
||||
del_flag = 0 |
|
||||
group by queue_id |
|
||||
</select> |
|
||||
|
|
||||
<select id="queryTtfbStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$TtfbVo"> |
|
||||
SELECT |
|
||||
MAX( CASE WHEN answer = '1' THEN 1 ELSE 0 END ) AS score1, |
|
||||
MAX( CASE WHEN answer = '2' THEN 1 ELSE 0 END ) AS score2, |
|
||||
MAX( CASE WHEN answer = '3' THEN 1 ELSE 0 END ) AS score3, |
|
||||
MAX( CASE WHEN answer = '4' THEN 1 ELSE 0 END ) AS score4, |
|
||||
MAX( CASE WHEN answer = '5' THEN 1 ELSE 0 END ) AS score5 |
|
||||
FROM |
|
||||
pms_treatment t |
|
||||
left join |
|
||||
pms_treatment_record r on t.id = r.treatment_id |
|
||||
WHERE |
|
||||
question_code = 'PG_TT_TAPS_DF' |
|
||||
AND t.del_flag = 0 and r.del_flag = 0 |
|
||||
</select> |
|
||||
|
|
||||
<select id="querySmfbStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$SmfbVo"> |
|
||||
SELECT COUNT(CASE WHEN answer BETWEEN 0 AND 4 THEN 1 END) AS score1, |
|
||||
COUNT(CASE WHEN answer BETWEEN 5 AND 9 THEN 1 END) AS score2, |
|
||||
COUNT(CASE WHEN answer BETWEEN 10 AND 14 THEN 1 END) AS score3, |
|
||||
COUNT(CASE WHEN answer BETWEEN 15 AND 19 THEN 1 END) AS score4, |
|
||||
COUNT(CASE WHEN answer BETWEEN 20 AND 27 THEN 1 END) AS score5 |
|
||||
FROM pms_treatment t |
|
||||
left join |
|
||||
pms_treatment_record r on t.id = r.treatment_id |
|
||||
WHERE question_code = 'PG_SM_PHQ_9_DF' |
|
||||
AND t.del_flag = 0 |
|
||||
and r.del_flag = 0 |
|
||||
</select> |
|
||||
|
|
||||
<select id="queryJlfbStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$JlfbVo"> |
|
||||
SELECT COUNT(CASE WHEN answer < 8 THEN 1 END) AS score1, |
|
||||
COUNT(CASE WHEN answer BETWEEN 8 AND 20 THEN 1 END) AS score2, |
|
||||
COUNT(CASE WHEN answer BETWEEN 21 AND 35 THEN 1 END) AS score3, |
|
||||
COUNT(CASE WHEN answer > 35 THEN 1 END) AS score4 |
|
||||
FROM pms_treatment t |
|
||||
left join |
|
||||
pms_treatment_record r on t.id = r.treatment_id |
|
||||
WHERE question_code = 'PG_JL_HAMD_24_DF' |
|
||||
AND t.del_flag = 0 |
|
||||
and r.del_flag = 0 |
|
||||
</select> |
|
||||
|
|
||||
<select id="querySmzStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$BzfffbVo$Smz"> |
|
||||
SELECT |
|
||||
COUNT( CASE WHEN question_code = 'ZLFA_SHXG' THEN 1 END ) AS xwxlg, |
|
||||
COUNT( CASE WHEN question_code = 'ZLFA_XLTS' THEN 1 END ) AS ydgy, |
|
||||
COUNT( CASE WHEN question_code = 'ZLFA_ZJ' THEN 1 END ) AS lcyyzl, |
|
||||
COUNT( CASE WHEN question_code = 'ZLFA_YW' THEN 1 END ) AS zjlf |
|
||||
FROM |
|
||||
pms_treatment_record |
|
||||
WHERE |
|
||||
question_code IN ( 'ZLFA_XWXLGY', 'ZLFA_YDGY', 'ZLFA_LCYYZL', 'ZLFA_ZJ', 'ZLFA_ZL' ) |
|
||||
AND del_flag = 0 |
|
||||
</select> |
|
||||
</mapper> |
|
||||
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@ |
|||||
#Generated by Maven |
#Generated by Maven |
||||
#Fri Feb 14 17:49:34 CST 2025 |
#Wed Feb 19 09:27:30 CST 2025 |
||||
version=3.8.9 |
version=3.8.9 |
||||
groupId=com.datangMeeting |
groupId=com.datangMeeting |
||||
artifactId=datang-meeting-admin |
artifactId=datang-meeting-admin |
||||
|
|||||
Binary file not shown.
@ -1,5 +1,5 @@ |
|||||
#Generated by Maven |
#Generated by Maven |
||||
#Fri Feb 14 17:49:23 CST 2025 |
#Wed Feb 19 09:27:20 CST 2025 |
||||
version=3.8.9 |
version=3.8.9 |
||||
groupId=com.datangMeeting |
groupId=com.datangMeeting |
||||
artifactId=datang-meeting-common |
artifactId=datang-meeting-common |
||||
|
|||||
Binary file not shown.
@ -1,5 +1,5 @@ |
|||||
#Generated by Maven |
#Generated by Maven |
||||
#Fri Feb 14 17:49:28 CST 2025 |
#Wed Feb 19 09:27:25 CST 2025 |
||||
version=3.8.9 |
version=3.8.9 |
||||
groupId=com.datangMeeting |
groupId=com.datangMeeting |
||||
artifactId=datang-meeting-framework |
artifactId=datang-meeting-framework |
||||
|
|||||
Binary file not shown.
@ -1,5 +1,5 @@ |
|||||
#Generated by Maven |
#Generated by Maven |
||||
#Fri Feb 14 17:49:31 CST 2025 |
#Wed Feb 19 09:27:28 CST 2025 |
||||
version=3.8.9 |
version=3.8.9 |
||||
groupId=com.datangMeeting |
groupId=com.datangMeeting |
||||
artifactId=datang-meeting-generator |
artifactId=datang-meeting-generator |
||||
|
|||||
Binary file not shown.
@ -1,5 +1,5 @@ |
|||||
#Generated by Maven |
#Generated by Maven |
||||
#Fri Feb 14 17:49:29 CST 2025 |
#Wed Feb 19 09:27:26 CST 2025 |
||||
version=3.8.9 |
version=3.8.9 |
||||
groupId=com.datangMeeting |
groupId=com.datangMeeting |
||||
artifactId=datang-meeting-quartz |
artifactId=datang-meeting-quartz |
||||
|
|||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@ |
|||||
#Generated by Maven |
#Generated by Maven |
||||
#Fri Feb 14 17:49:26 CST 2025 |
#Wed Feb 19 09:27:22 CST 2025 |
||||
version=3.8.9 |
version=3.8.9 |
||||
groupId=com.datangMeeting |
groupId=com.datangMeeting |
||||
artifactId=datang-meeting-system |
artifactId=datang-meeting-system |
||||
|
|||||
Loading…
Reference in new issue