From ea5baebc8f901dc8b9d9afa69b097841f63e7729 Mon Sep 17 00:00:00 2001 From: wang1007152140 <1007152140@qq.com> Date: Thu, 4 Feb 2021 11:14:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=97=85=E4=BE=8B=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E4=BF=AE=E6=94=B9sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/tcm/bean/dto/PatientDto.java | 9 +++ .../main/resources/mapper_dao/PatientDao.xml | 77 +++++++++++-------- 2 files changed, 54 insertions(+), 32 deletions(-) diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java b/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java index 26d7c502..c00db0e1 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java @@ -87,6 +87,15 @@ public class PatientDto { @Data @ApiModel("查询患者的搜索条件集合") public static class SelPatlenConditionList{ + @ApiModelProperty("医院id") + private Long hospitalId; + @ApiModelProperty("录入状态") + private Byte inputStatus; + @ApiModelProperty("对照组id") + private Long inpatientId; + @ApiModelProperty("住院号") + private String hospitalization=""; + @ApiModelProperty("搜索条件集合,不包含时间格式的条件") private List conditionList; @ApiModelProperty("搜索条件集合,是包含时间格式的条件") diff --git a/tcm/src/main/resources/mapper_dao/PatientDao.xml b/tcm/src/main/resources/mapper_dao/PatientDao.xml index 62401c00..bbe93da7 100644 --- a/tcm/src/main/resources/mapper_dao/PatientDao.xml +++ b/tcm/src/main/resources/mapper_dao/PatientDao.xml @@ -50,38 +50,52 @@ t_patient_information tpi left join t_inpatient ti on ti.rec_status=0 and ti.id=tpi.inpatient_id WHERE tpi.rec_status = 0 + + and tpi.hospital_id=#{hospitalId} + + + and tpi.hospitalization like concat('%',#{hospitalization},'%') + + + and tpi.inpatient_id=#{inpatientId} + + + and tpi.input_status=#{inputStatus} + + AND tpi.id IN ( - SELECT DISTINCT - ( t.patient_id ) - FROM - ( - - - SELECT - tpr.patient_id - FROM - t_patient_record tpr - WHERE - tpr.rec_status = 0 - AND tpr.test_questions_id = #{item.testQuestionsId} - AND tpr.contents LIKE concat('%',#{item.contents},'%') - INTERSECT - - - SELECT - tpr.patient_id - FROM - t_patient_record tpr - WHERE - tpr.rec_status = 0 - AND tpr.test_questions_id = #{item1.testQuestionsId} - AND tpr.contents > #{item1.startTime} - AND tpr.contents < #{item1.endTime} - INTERSECT - - - ) t + SELECT DISTINCT + ( t.patient_id ) + FROM + ( + + + SELECT + tpr.patient_id + FROM + t_patient_record tpr + WHERE + tpr.rec_status = 0 + AND tpr.test_questions_id = #{item.testQuestionsId} + AND tpr.contents LIKE concat('%',#{item.contents},'%') + INTERSECT + + + SELECT + tpr.patient_id + FROM + t_patient_record tpr + WHERE + tpr.rec_status = 0 + AND tpr.test_questions_id = #{item1.testQuestionsId} + AND tpr.contents > #{item1.startTime} + AND tpr.contents < #{item1.endTime} + INTERSECT + + + ) t ) + > -<<<<<<< HEAD