瀏覽代碼

Merge branch 'dev/20200903_1.4.5' into debug

chengyao 4 年之前
父節點
當前提交
584be9397f

+ 10 - 0
src/main/java/com/diagbot/dto/CheckInfoDTO.java

@@ -43,6 +43,16 @@ public class CheckInfoDTO {
      */
     private Date rTime;
 
+    /**
+     * 入院时间
+     */
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private Date leaveHospitalDate;
+
     /**
      * 开单医生
      */

+ 12 - 89
src/main/java/com/diagbot/dto/ExamineInfoDTO.java

@@ -9,7 +9,8 @@ import java.util.Date;
  * @author: cy
  * @time: 2020/9/07 15:00
  */
-
+@Getter
+@Setter
 public class ExamineInfoDTO {
     /**
      * 医院id
@@ -39,12 +40,21 @@ public class ExamineInfoDTO {
     private Date cTime;
 
 
-
     /**
      * 返回报告时间
      */
     private Date rTime;
 
+    /**
+     * 入院时间
+     */
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private Date leaveHospitalDate;
+
     /**
      * 开单医生
      */
@@ -60,91 +70,4 @@ public class ExamineInfoDTO {
      */
     @JsonIgnore
     private String info;
-
-    public Long getHospitalId() {
-        return hospitalId;
-    }
-
-    public void setHospitalId(Long hospitalId) {
-        this.hospitalId = hospitalId;
-    }
-
-    public String getBehospitalCode() {
-        return behospitalCode;
-    }
-
-    public void setBehospitalCode(String behospitalCode) {
-        this.behospitalCode = behospitalCode;
-    }
-
-    public String getExamineItemType() {
-        return examineItemType;
-    }
-
-    public void setExamineItemType(String examineItemType) {
-        this.examineItemType = examineItemType;
-    }
-
-    public String getExamineItemName() {
-        return examineItemName;
-    }
-
-    public void setExamineItemName(String examineItemName) {
-        this.examineItemName = examineItemName;
-    }
-
-    public Date getcTime() {
-        return cTime;
-    }
-
-    public void setcTime(Date cTime) {
-        this.cTime = cTime;
-    }
-
-    public Date getrTime() {
-        return rTime;
-    }
-
-    public void setrTime(Date rTime) {
-        this.rTime = rTime;
-    }
-
-    public String getDoctorName() {
-        return doctorName;
-    }
-
-    public void setDoctorName(String doctorName) {
-        this.doctorName = doctorName;
-    }
-
-    public String getRepNo() {
-        return repNo;
-    }
-
-    public void setRepNo(String repNo) {
-        this.repNo = repNo;
-    }
-
-    public String getInfo() {
-        return info;
-    }
-
-    public void setInfo(String info) {
-        this.info = info;
-    }
-
-    @Override
-    public String toString() {
-        return "ExamineInfoDTO{" +
-                "hospitalId=" + hospitalId +
-                ", behospitalCode='" + behospitalCode + '\'' +
-                ", examineItemType='" + examineItemType + '\'' +
-                ", examineItemName='" + examineItemName + '\'' +
-                ", cTime=" + cTime +
-                ", rTime=" + rTime +
-                ", doctorName='" + doctorName + '\'' +
-                ", repNo='" + repNo + '\'' +
-                ", info='" + info + '\'' +
-                '}';
-    }
 }

+ 7 - 2
src/main/java/com/diagbot/mapper/MedLisInfoMapper.java

@@ -12,18 +12,23 @@ import com.diagbot.vo.ExamineSonInfoVO;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 /**
  * <p>
- *  Mapper 接口
+ * Mapper 接口
  * </p>
  *
  * @author zhoutg
  * @since 2020-07-28
  */
 public interface MedLisInfoMapper extends BaseMapper<MedLisInfo> {
+    Map<String, Object> getTime(@Param("examineInfoVO") ExamineInfoVO examineInfoVO);
+
     IPage<ExamineInfoDTO> getExamineInfo(@Param("examineInfoVO") ExamineInfoVO examineInfoVO, @Param("infos") Set<String> infos);
-    List<String> getInfo(@Param("hospitalId")Long hospitalId, @Param("behospitalCode")String behospitalCode);
+
+    List<String> getInfo(@Param("hospitalId") Long hospitalId, @Param("behospitalCode") String behospitalCode);
+
     IPage<ExamineSonInfoDTO> getExamineSonInfo(@Param("examineSonInfoVO") ExamineSonInfoVO examineSonInfoVO);
 }

+ 7 - 2
src/main/java/com/diagbot/mapper/MedPacsInfoMapper.java

@@ -11,18 +11,23 @@ import com.diagbot.vo.DoctorAdviceVO;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 /**
  * <p>
- *  Mapper 接口
+ * Mapper 接口
  * </p>
  *
  * @author cy
  * @since 2020-09-04
  */
 public interface MedPacsInfoMapper extends BaseMapper<MedPacsInfo> {
+
+    Map<String,Object> getTime(@Param("checkInfoVO") CheckInfoVO checkInfoVO);
+
     IPage<CheckInfoDTO> getCheckInfo(@Param("checkInfoVO") CheckInfoVO checkInfoVO, @Param("infos") Set<String> infos);
-    List<String> getInfo(@Param("hospitalId")Long hospitalId, @Param("behospitalCode")String behospitalCode);
+
+    List<String> getInfo(@Param("hospitalId") Long hospitalId, @Param("behospitalCode") String behospitalCode);
 
 }

+ 12 - 7
src/main/java/com/diagbot/service/impl/MedLisInfoServiceImpl.java

@@ -17,14 +17,11 @@ import org.springframework.stereotype.Service;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 /**
  * <p>
- *  服务实现类
+ * 服务实现类
  * </p>
  *
  * @author zhoutg
@@ -35,7 +32,7 @@ import java.util.Set;
 public class MedLisInfoServiceImpl extends ServiceImpl<MedLisInfoMapper, MedLisInfo> implements MedLisInfoService {
 
 
-    public IPage<ExamineInfoDTO> getExamineInfo(ExamineInfoVO examineInfoVO){
+    public IPage<ExamineInfoDTO> getExamineInfo(ExamineInfoVO examineInfoVO) {
 
         List<String> infos = this.baseMapper.getInfo(examineInfoVO.getHospitalId(), examineInfoVO.getBehospitalCode());
 
@@ -53,8 +50,16 @@ public class MedLisInfoServiceImpl extends ServiceImpl<MedLisInfoMapper, MedLisI
                 }
             }
         }
+
+        //获取病人进出院时间
+        Map<String, Object> timeMap = this.baseMapper.getTime(examineInfoVO);
+        Date behospital_date = (Date) timeMap.get("behospital_date");
+        examineInfoVO.setBehospitalDate(behospital_date);
+        Date leaveHospitalDate = (Date) timeMap.get("leave_hospital_date");
+        examineInfoVO.setLeaveHospitalDate(leaveHospitalDate);
+
         String s = examineInfoVO.getBehospitalCode();
-        examineInfoVO.setBehospitalCode( s.split("_")[0]);
+        examineInfoVO.setBehospitalCode(s.split("_")[0]);
 
         IPage<ExamineInfoDTO> page = this.baseMapper.getExamineInfo(examineInfoVO, infoSet);
         return page;

+ 14 - 5
src/main/java/com/diagbot/service/impl/MedPacsInfoServiceImpl.java

@@ -1,4 +1,5 @@
 package com.diagbot.service.impl;
+
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.CheckInfoDTO;
 import com.diagbot.entity.MedPacsInfo;
@@ -7,9 +8,8 @@ import com.diagbot.service.MedPacsInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.vo.CheckInfoVO;
 import org.springframework.stereotype.Service;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+
+import java.util.*;
 
 /**
  * <p>
@@ -44,8 +44,17 @@ public class MedPacsInfoServiceImpl extends ServiceImpl<MedPacsInfoMapper, MedPa
             }
         }
 
-       String s = checkInfoVO.getBehospitalCode();
-        checkInfoVO.setBehospitalCode( s.split("_")[0]);
+        //获取病人进出院时间
+        Map<String, Object> timeMap = this.baseMapper.getTime(checkInfoVO);
+        if (null != timeMap) {
+            Date behospital_date = (Date) timeMap.get("behospital_date");
+            checkInfoVO.setBehospitalDate(behospital_date);
+            Date leaveHospitalDate = (Date) timeMap.get("leave_hospital_date");
+            checkInfoVO.setLeaveHospitalDate(leaveHospitalDate);
+        }
+
+        String s = checkInfoVO.getBehospitalCode();
+        checkInfoVO.setBehospitalCode(s.split("_")[0]);
         IPage<CheckInfoDTO> page = this.baseMapper.getCheckInfo(checkInfoVO, infoSet);
         return page;
     }

+ 10 - 0
src/main/java/com/diagbot/vo/CheckInfoVO.java

@@ -49,6 +49,16 @@ public class CheckInfoVO extends Page {
      */
     private Date jxDateStart;
 
+    /**
+     * 入院时间
+     */
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private Date leaveHospitalDate;
+
     /**
      * 检查时间结束
      */

+ 10 - 1
src/main/java/com/diagbot/vo/ExamineInfoVO.java

@@ -49,12 +49,21 @@ public class ExamineInfoVO extends Page {
      */
     private Date jyDateStart;
 
-
     /**
      * 检验时间结束
      */
     private Date jyDateEnd;
 
+    /**
+     * 入院时间
+     */
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private Date leaveHospitalDate;
+
     /**
      * 是否归档 (0-未归档 1-归档)
      */

+ 42 - 25
src/main/resources/mapper/MedLisInfoMapper.xml

@@ -4,29 +4,41 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.MedLisInfo">
-        <id column="rep_no" property="repNo" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="behospital_code" property="behospitalCode" />
-        <result column="rep_type" property="repType" />
-        <result column="rep_name" property="repName" />
-        <result column="rep_type_name" property="repTypeName" />
-        <result column="slide_type" property="slideType" />
-        <result column="rep_date" property="repDate" />
-        <result column="check_date" property="checkDate" />
-        <result column="apply_doctor" property="applyDoctor" />
-        <result column="dept_id" property="deptId" />
-        <result column="dept_name" property="deptName" />
-        <result column="register_flag" property="registerFlag" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
+        <id column="rep_no" property="repNo"/>
+        <result column="hospital_id" property="hospitalId"/>
+        <result column="behospital_code" property="behospitalCode"/>
+        <result column="rep_type" property="repType"/>
+        <result column="rep_name" property="repName"/>
+        <result column="rep_type_name" property="repTypeName"/>
+        <result column="slide_type" property="slideType"/>
+        <result column="rep_date" property="repDate"/>
+        <result column="check_date" property="checkDate"/>
+        <result column="apply_doctor" property="applyDoctor"/>
+        <result column="dept_id" property="deptId"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="register_flag" property="registerFlag"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="gmt_create" property="gmtCreate"/>
+        <result column="gmt_modified" property="gmtModified"/>
+        <result column="creator" property="creator"/>
+        <result column="modifier" property="modifier"/>
     </resultMap>
 
+    <!--    获取病人的出入院时间-->
+    <select id="getTime" resultType="java.util.HashMap">
+        select
+        t.behospital_date,
+        t.leave_hospital_date
+        from med_behospital_info t
+        where
+        t.is_deleted = 'N'
+        <if test="examineInfoVO.behospitalCode != null">
+            and t.behospital_code = #{examineInfoVO.behospitalCode}
+        </if>
+    </select>
 
-<!--获取检验信息-->
-    <select id="getExamineInfo"  resultType="com.diagbot.dto.ExamineInfoDTO">
+    <!--获取检验信息-->
+    <select id="getExamineInfo" resultType="com.diagbot.dto.ExamineInfoDTO">
         select
         distinct
         b.repNo,
@@ -42,7 +54,7 @@
         t1.rep_no as repNo,
         t1.rep_name as examineItemName,
         t1.rep_type_name as examineItemType,
-        CONCAT( t2.item_name, '(',DATE_FORMAT( t2.gmt_create,'%Y-%m-%d'),')')as info,
+        CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d'),')')as info,
         DATE_FORMAT( t1.rep_date, '%Y-%m-%d %h:%i:%s' ) as rTime,
         DATE_FORMAT( t1.check_date, '%Y-%m-%d %h:%i:%s' ) as cTime,
         t1.apply_doctor as doctorName,
@@ -82,12 +94,17 @@
             <![CDATA[ AND date_format(t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.jyDateEnd}]]>
         </if>
         <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 1">
-            <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= t3.leave_hospital_date]]>
-            <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= t3.behospital_date]]>
+            <if test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
         </if>
         <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 0">
-            <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= t3.behospital_date]]>
-        </if>) b
+            <if test="examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        ) b
         where 1=1
         <if test="examineInfoVO.examineType != null and examineInfoVO.examineType == 1">
             <if test="infos != null and infos.size() > 0">

+ 1 - 1
src/main/resources/mapper/MedLisResultMapper.xml

@@ -39,7 +39,7 @@
         t2.abnormal,
         t2.color,
         t2.is_deleted,
-        t2.gmt_create,
+        date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') as gmt_create,
         t2.gmt_modified,
         t2.creator,
         t2.modifier

+ 24 - 6
src/main/resources/mapper/MedPacsInfoMapper.xml

@@ -26,13 +26,26 @@
         <result column="creator" property="creator"/>
         <result column="modifier" property="modifier"/>
     </resultMap>
+    <!--    获取病人的出入院时间-->
+    <select id="getTime" resultType="java.util.HashMap">
+        select
+        t.behospital_date,
+        t.leave_hospital_date
+        from med_behospital_info t
+        where
+        t.is_deleted = 'N'
+        <if test="checkInfoVO.behospitalCode != null">
+            and t.behospital_code = #{checkInfoVO.behospitalCode}
+        </if>
+    </select>
+
     <select id="getCheckInfo" resultType="com.diagbot.dto.CheckInfoDTO">
         select b.*
         from(
         SELECT
-        t2.rept_name as checkItemName,
+        t1.rep_name as checkItemName,
         t1.rep_type_name as checkItemType,
-        CONCAT( t2.rept_name, '(',DATE_FORMAT( t2.gmt_create,'%Y-%m-%d'),')')as info,
+        CONCAT( t1.rep_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d'),')')as info,
         date_format (t1.rep_date,'%Y-%m-%d %H:%i:%s') as rTime,
         date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') as cTime,
         t1.apply_doctor as doctorName,
@@ -73,12 +86,17 @@
             <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s')  <= #{checkInfoVO.jxDateEnd}]]>
         </if>
         <if test="checkInfoVO.isPlacefile != null and checkInfoVO.isPlacefile == 1">
-            <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= t3.leave_hospital_date]]>
-            <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= t3.behospital_date]]>
+            <if test="checkInfoVO.leaveHospitalDate != null and checkInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{checkInfoVO.leaveHospitalDate}]]>
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{checkInfoVO.behospitalDate}]]>
+            </if>
         </if>
         <if test="checkInfoVO.isPlacefile != null and checkInfoVO.isPlacefile == 0">
-            <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= t3.behospital_date]]>
-        </if>) b
+            <if test="checkInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{checkInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        ) b
         where 1=1
         <if test="checkInfoVO.checkType != null and checkInfoVO.checkType == 1">
             <if test="infos != null and infos.size() > 0">

+ 3 - 2
src/main/resources/mapper/MedPacsResultMapper.xml

@@ -27,7 +27,7 @@
             resultType="com.diagbot.entity.MedPacsResult">
         SELECT
         t2.rep_no repNo,
-        t2.rept_name as reptName,
+        t1.rep_name as reptName,
         t2.dept_name,
         t1.part,
         t2.hospital_id,
@@ -40,7 +40,8 @@
         t2.report_doctor,
         t2.checker_doctor,
         t2.is_deleted,
-        t2.gmt_create,
+--         作为时间标记
+        date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') as gmt_create,
         t2.gmt_modified,
         t2.creator,
         t2.modifier