Browse Source

修改统计,添加时间查询

newMaster
zzc 3 months ago
parent
commit
a578108ed2
  1. 1
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminStatisticsController.java
  2. 21
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/StatisticsController.java
  3. 2
      acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/WebDmsLoginService.java
  4. 8
      acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/StatisticsVo.java
  5. 4
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/StatisticsDao.java
  6. 12
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java
  7. 13
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/StatisticsServiceImpl.java
  8. 97
      acupuncture-system/src/main/resources/mapper/dao/AdminTongjiDao.xml
  9. 1
      acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml
  10. 112
      acupuncture-system/src/main/resources/mapper/dao/StatisticsDao.xml

1
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminStatisticsController.java

@ -4,7 +4,6 @@ import com.acupuncture.common.core.domain.JsonResponse;
import com.acupuncture.system.domain.dto.StatisticsDto;
import com.acupuncture.system.domain.vo.AdminStatisticsVo;
import com.acupuncture.system.service.AdminStatisticsService;
import com.acupuncture.system.service.StatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

21
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/StatisticsController.java

@ -1,5 +1,6 @@
package com.acupuncture.web.controller.web;
import com.acupuncture.common.core.domain.BaseDto;
import com.acupuncture.common.core.domain.JsonResponse;
import com.acupuncture.system.domain.dto.StatisticsDto;
import com.acupuncture.system.domain.vo.StatisticsVo;
@ -33,32 +34,32 @@ public class StatisticsController {
@ApiOperation("患者统计")
@PostMapping("/patientTotal")
public JsonResponse<StatisticsVo.PatientVo> queryPatientStatistics(@RequestBody @Validated StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.queryPatientStatistics(dto));
public JsonResponse<StatisticsVo.PatientVo> queryPatientStatistics(@RequestBody @Validated BaseDto<StatisticsDto.Query> dto) {
return JsonResponse.ok(statisticsService.queryPatientStatistics(dto.getParam()));
}
@ApiOperation("诊疗统计")
@PostMapping("/zlInfo")
public JsonResponse<StatisticsVo.TreamentVo> queryZlStatistics(@RequestBody @Validated StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.queryZlStatistics(dto));
public JsonResponse<StatisticsVo.TreamentVo> queryZlStatistics(@RequestBody @Validated BaseDto<StatisticsDto.Query> dto) {
return JsonResponse.ok(statisticsService.queryZlStatistics(dto.getParam()));
}
@ApiOperation("治疗类型统计")
@PostMapping("/zlType")
public JsonResponse<StatisticsVo.ZlTypeVo> queryZlTypeStatistics(@RequestBody @Validated StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.queryZlTypeStatistics(dto));
public JsonResponse<StatisticsVo.ZlTypeVo> queryZlTypeStatistics(@RequestBody @Validated BaseDto<StatisticsDto.Query> dto) {
return JsonResponse.ok(statisticsService.queryZlTypeStatistics(dto.getParam()));
}
@ApiOperation("随访分布统计")
@PostMapping("/sffb")
public JsonResponse<List<StatisticsVo.SffbVo.DlVo>> querySfStatistics(@RequestBody @Validated StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.querySfStatistics(dto));
public JsonResponse<List<StatisticsVo.SffbVo.DlVo>> querySfStatistics(@RequestBody @Validated BaseDto<StatisticsDto.Query> dto) {
return JsonResponse.ok(statisticsService.querySfStatistics(dto.getParam()));
}
@ApiOperation("失访统计")
@PostMapping("/sftj")
public JsonResponse<List<StatisticsVo.SftjVo>> querySfTjStatistics(@RequestBody @Validated StatisticsDto.Query dto) {
return JsonResponse.ok(statisticsService.querySfTjStatistics(dto));
public JsonResponse<List<StatisticsVo.SftjVo>> querySfTjStatistics(@RequestBody @Validated BaseDto<StatisticsDto.Query> dto) {
return JsonResponse.ok(statisticsService.querySfTjStatistics(dto.getParam()));
}
}

2
acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/WebDmsLoginService.java

@ -62,7 +62,7 @@ public class WebDmsLoginService
public String login(String username, String password, String code, String uuid)
{
// 验证码校验
validateCaptcha(username, code, uuid);
// validateCaptcha(username, code, uuid);
// 登录前置校验
loginPreCheck(username, password);
// 用户验证

8
acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/StatisticsVo.java

@ -341,6 +341,14 @@ public class StatisticsVo {
private Integer wx;
}
@Data
@ApiModel("")
public static class ZlfyResultVo {
private Long id;
private String answer;
}
@Data
@ApiModel("诊疗费用分布")
public static class ZlfyVo {

4
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/StatisticsDao.java

@ -64,7 +64,7 @@ public interface StatisticsDao {
StatisticsVo.ZlTypeVo.ZlxgVo queryZlxgStatistics(@Param("dto") StatisticsDto.Query dto,
@Param("tenantId") Long tenantId);
StatisticsVo.ZlTypeVo.ZlfyVo queryZlfyStatistics(@Param("dto") StatisticsDto.Query dto,
List<StatisticsVo.ZlTypeVo.ZlfyResultVo> queryZlfyStatistics(@Param("dto") StatisticsDto.Query dto,
@Param("tenantId") Long tenantId);
List<StatisticsVo.SftjVo> querySftjStatistics(@Param("dto") StatisticsDto.Query dto,
@ -82,7 +82,7 @@ public interface StatisticsDao {
StatisticsVo.TreamentVo.JlfbVo queryJlfbStatistics(@Param("dto") StatisticsDto.Query dto,
@Param("tenantId") Long tenantId);
StatisticsVo.ZlTypeVo.BzfffbVo.Smz querySmzStatistics(StatisticsDto.Query dto,@Param("tenantId") Long tenantId);
StatisticsVo.ZlTypeVo.BzfffbVo.Smz querySmzStatistics(@Param("dto") StatisticsDto.Query dto,@Param("tenantId") Long tenantId);
}

12
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java

@ -105,7 +105,7 @@ public class ScreeningServiceImpl implements IScreeningService {
"筛查结论",
"筛查时间",
"组织"
);
);
excelWriter.writeHeadRow(headerList);
PageInfo<ScrScreenVo.Result> page = queryDetailByPage(param, -1, -1);
@ -131,7 +131,7 @@ public class ScreeningServiceImpl implements IScreeningService {
excelWriter.writeCellValue(7, row, map.get("SCWJ-WEIGHT") == null ? "" : map.get("SCWJ-WEIGHT").getAnswer());
excelWriter.writeCellValue(8, row, map.get("SCWJ-BMI") == null ? "" : map.get("SCWJ-BMI").getAnswer());
excelWriter.writeCellValue(9, row, map.get("SCWJ-JL") == null ? "" : map.get("SCWJ-JL").getAnswer());
excelWriter.writeCellValue(10,row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer());
excelWriter.writeCellValue(10, row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer());
excelWriter.writeCellValue(11, row, map.get("SCWJ-RSSJ") == null ? "" : map.get("SCWJ-RSSJ").getAnswer());
excelWriter.writeCellValue(12, row, map.get("SCWJ-SXSJ") == null ? "" : map.get("SCWJ-SXSJ").getAnswer());
excelWriter.writeCellValue(13, row, map.get("SCWJ-QCSJ") == null ? "" : map.get("SCWJ-QCSJ").getAnswer());
@ -262,7 +262,7 @@ public class ScreeningServiceImpl implements IScreeningService {
excelWriter.writeCellValue(7, row, map.get("SCWJ-WEIGHT") == null ? "" : map.get("SCWJ-WEIGHT").getAnswer());
excelWriter.writeCellValue(8, row, map.get("SCWJ-BMI") == null ? "" : map.get("SCWJ-BMI").getAnswer());
excelWriter.writeCellValue(9, row, map.get("SCWJ-JL") == null ? "" : map.get("SCWJ-JL").getAnswer());
excelWriter.writeCellValue(10,row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer());
excelWriter.writeCellValue(10, row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer());
excelWriter.writeCellValue(11, row, map.get("SCWJ-RSSJ") == null ? "" : map.get("SCWJ-RSSJ").getAnswer());
excelWriter.writeCellValue(12, row, map.get("SCWJ-SXSJ") == null ? "" : map.get("SCWJ-SXSJ").getAnswer());
excelWriter.writeCellValue(13, row, map.get("SCWJ-QCSJ") == null ? "" : map.get("SCWJ-QCSJ").getAnswer());
@ -303,6 +303,7 @@ public class ScreeningServiceImpl implements IScreeningService {
public void exportRzScreen(HttpServletResponse response, ScreeningDto.Query param) {
}
@Override
public PageInfo<ScrScreenVo.Result> queryDetailByPage(ScreeningDto.Query param, Integer pageNum, Integer pageSize) {
param.setTenantId(SecurityUtils.getTenantId());
@ -442,8 +443,11 @@ public class ScreeningServiceImpl implements IScreeningService {
pmsPatient.setBirthDate(DateUtil.parse(map.get("SCWJ-BIRTH").getAnswer()));
}
if (ObjectUtil.isNotNull(map.get("SCWJ-SEX"))) {
pmsPatient.setGender(Byte.parseByte(map.get("SCWJ-SEX").getAnswer()));
pmsPatient.setGender(map.get("SCWJ-SEX").getAnswer().equals("男") ? (byte) 0 : (byte) 1);
}
pmsPatient.setTenantId(detail.getTenantId());
pmsPatient.setPinyinSimple(PinyinUtil.getFirstLetter(pmsPatient.getName(), ""));
pmsPatient.setPinyinFull(PinyinUtil.getPinyin(pmsPatient.getName()));
pmsPatient.setSource((byte) 0);
pmsPatient.setDelFlag((byte) 0);
pmsPatient.setCreateTime(new Date());

13
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/StatisticsServiceImpl.java

@ -2,6 +2,7 @@ package com.acupuncture.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.acupuncture.common.constant.DiseaseMapping;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.system.domain.dto.StatisticsDto;
@ -119,7 +120,17 @@ public class StatisticsServiceImpl implements StatisticsService {
//TODO
zlTypeVo.setBzfffb(bzfffbVo);
zlTypeVo.setZlxwfb(statisticsDao.queryZlxgStatistics(dto, SecurityUtils.getTenantId()));
zlTypeVo.setZlfy(statisticsDao.queryZlfyStatistics(dto, SecurityUtils.getTenantId()));
List<StatisticsVo.ZlTypeVo.ZlfyResultVo> zlfyResultVoList = statisticsDao.queryZlfyStatistics(dto, SecurityUtils.getTenantId());
StatisticsVo.ZlTypeVo.ZlfyVo zlfyVo = new StatisticsVo.ZlTypeVo.ZlfyVo();
if (CollectionUtil.isNotEmpty(zlfyResultVoList)) {
Map<String, Long> map = zlfyResultVoList.stream().collect(Collectors.groupingBy(StatisticsVo.ZlTypeVo.ZlfyResultVo::getAnswer, Collectors.counting()));
zlfyVo.setScore1(map.getOrDefault("<300元", 0L).intValue());
zlfyVo.setScore2(map.getOrDefault("300 ~ 900元", 0L).intValue());
zlfyVo.setScore3(map.getOrDefault("900 ~ 2000元", 0L).intValue());
zlfyVo.setScore4(map.getOrDefault("2000 ~ 5000元", 0L).intValue());
zlfyVo.setScore5(map.getOrDefault(">5000元", 0L).intValue());
}
zlTypeVo.setZlfy(zlfyVo);
return zlTypeVo;
}

97
acupuncture-system/src/main/resources/mapper/dao/AdminTongjiDao.xml

@ -97,6 +97,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND create_time &lt;= #{dto.endTime}
</if>
</where>
</select>
@ -122,6 +128,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryTotalPatient" resultType="java.lang.Integer">
SELECT
@ -133,6 +145,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND create_time &lt;= #{dto.endTime}
</if>
</where>
</select>
@ -159,6 +177,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryZytzStatistics" resultType="com.acupuncture.system.domain.vo.AdminStatisticsVo$TreamentVo$ZytzVo">
@ -183,6 +207,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryZllxtjStatistics" resultType="com.acupuncture.system.domain.vo.AdminStatisticsVo$ZlTypeVo$Zllxtj">
@ -199,6 +229,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryFpzStatistics" resultType="com.acupuncture.system.domain.vo.AdminStatisticsVo$ZlTypeVo$BzfffbVo$Fpz">
@ -218,6 +254,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
@ -237,6 +279,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryZlfyStatistics" resultType="com.acupuncture.system.domain.vo.AdminStatisticsVo$ZlTypeVo$ZlfyVo">
@ -257,6 +305,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="querySftjStatistics" resultType="com.acupuncture.system.domain.vo.AdminStatisticsVo$SftjVo">
@ -275,6 +329,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="querySfStatistics" resultType="com.acupuncture.system.domain.vo.AdminStatisticsVo$SffbVo$DlVo">
@ -294,6 +354,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
group by queue_id
</select>
@ -314,6 +380,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="querySmfbStatistics" resultType="com.acupuncture.system.domain.vo.AdminStatisticsVo$TreamentVo$SmfbVo">
@ -331,6 +403,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryJlfbStatistics" resultType="com.acupuncture.system.domain.vo.AdminStatisticsVo$TreamentVo$JlfbVo">
@ -347,6 +425,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="querySmzStatistics" resultType="com.acupuncture.system.domain.vo.AdminStatisticsVo$ZlTypeVo$BzfffbVo$Smz">
@ -365,6 +449,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryTxStatistics" resultType="java.lang.String">
@ -379,5 +469,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
</mapper>

1
acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml

@ -119,6 +119,7 @@
OR p.pinyin_full LIKE CONCAT('%', #{query.keywords}, '%')
OR p.pinyin_simple LIKE CONCAT('%', #{query.keywords}, '%')
or p.id_card LIKE CONCAT('%', #{query.keywords}, '%')
or p.phone LIKE CONCAT('%', #{query.keywords}, '%')
)
</if>
</where>

112
acupuncture-system/src/main/resources/mapper/dao/StatisticsDao.xml

@ -49,6 +49,12 @@
<if test="dto.endTime != null">
AND create_time &lt;= #{dto.endTime}
</if>
<if test="dto.startTime != null">
AND create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND create_time &lt;= #{dto.endTime}
</if>
) AS age_data;
</select>
@ -97,6 +103,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND create_time &lt;= #{dto.endTime}
</if>
</where>
</select>
@ -116,6 +128,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryTxStatistics" resultType="java.lang.String">
@ -130,6 +148,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryTotalPatient" resultType="java.lang.Integer">
@ -142,6 +166,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND create_time &lt;= #{dto.endTime}
</if>
</where>
</select>
@ -168,6 +198,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryZytzStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$ZytzVo">
@ -192,6 +228,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryZllxtjStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$Zllxtj">
@ -208,6 +250,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryFpzStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$BzfffbVo$Fpz">
@ -228,6 +276,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
@ -248,15 +302,18 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryZlfyStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$ZlfyVo">
<select id="queryZlfyStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$ZlfyResultVo">
SELECT
SUM(CASE WHEN answer &lt; 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
t.id,
r.answer
FROM
pms_treatment t
LEFT JOIN pms_treatment_record r ON t.id = r.treatment_id
@ -264,10 +321,15 @@
question_code = 'ZLFA_ZTFY'
AND t.del_flag = 0
and r.del_flag = 0
AND answer REGEXP '^[0-9]+$'
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="querySftjStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$SftjVo">
@ -279,6 +341,12 @@
WHERE
status = 2
AND del_flag = 0
<if test="dto.startTime != null">
AND create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND create_time &lt;= #{dto.endTime}
</if>
GROUP BY
lost_reason
ORDER BY
@ -302,6 +370,12 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
group by queue_id
</select>
@ -323,6 +397,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="querySmfbStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$SmfbVo">
@ -340,6 +420,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="queryJlfbStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$TreamentVo$JlfbVo">
@ -356,6 +442,12 @@
<if test="tenantId != null">
AND tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
<select id="querySmzStatistics" resultType="com.acupuncture.system.domain.vo.StatisticsVo$ZlTypeVo$BzfffbVo$Smz">
@ -373,5 +465,11 @@
<if test="tenantId != null">
AND t.tenant_id = #{tenantId}
</if>
<if test="dto.startTime != null">
AND t.create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t.create_time &lt;= #{dto.endTime}
</if>
</select>
</mapper>

Loading…
Cancel
Save