Forráskód Böngészése

检验信息bug处理

chengyao 4 éve
szülő
commit
c68ee09c3f

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

@@ -53,6 +53,12 @@ public class CheckInfoVO extends Page {
      * 检查时间结束
      */
     private Date jxDateEnd;
+
+    /**
+     * 是否归档 (0-未归档 1-归档)
+     */
+    private String isPlacefile;
+
     /**
      * 提示信息
      */

+ 4 - 3
src/main/java/com/diagbot/vo/ExamineInfoVO.java

@@ -55,11 +55,12 @@ public class ExamineInfoVO extends Page {
      */
     private Date jyDateEnd;
 
-
+    /**
+     * 是否归档 (0-未归档 1-归档)
+     */
+    private String isPlacefile;
 
     /**
-     *
-     *
      * 提示信息
      */
     @JsonIgnore

+ 23 - 17
src/main/resources/mapper/MedLisInfoMapper.xml

@@ -25,23 +25,18 @@
     </resultMap>
 
 
-    <resultMap id="ExamineInfoMap" type="com.diagbot.dto.ExamineInfoDTO">
-        <result column="repNo" property="repNo"/>
-        <result column="examineItemName" property="examineItemName"/>
-        <result column="examineItemType" property="examineItemType"/>
-        <result column="rTime" property="rTime"/>
-        <result column="cTime" property="cTime"/>
-        <result column="doctorName" property="doctorName"/>
-        <result column="hospitalId" property="hospitalId"/>
-        <result column="behospitalCode" property="behospitalCode"/>
-        <collection property="info"
-                    ofType="java.lang.String">
-            <result column="info" property="info"/>
-        </collection>
-    </resultMap>
 <!--获取检验信息-->
-    <select id="getExamineInfo"  resultMap="ExamineInfoMap">
-        select b.*
+    <select id="getExamineInfo"  resultType="com.diagbot.dto.ExamineInfoDTO">
+        select
+        distinct
+        b.repNo,
+        b.examineItemName,
+        b.examineItemType,
+        b.rTime,
+        b.cTime,
+        b.doctorName,
+        b.hospitalId,
+        b.behospitalCode
         from(
         SELECT
         t1.rep_no as repNo,
@@ -55,14 +50,18 @@
         t1.behospital_code as behospitalCode
         FROM
         med_lis_info t1,
-        med_lis_result t2
+        med_lis_result t2,
+        med_behospital_info t3
         WHERE
         t1.is_deleted = "N"
         AND t2.is_deleted = "N"
+        AND t3.is_deleted = "N"
         AND t1.check_date IS NOT NULL
         AND t2.item_name IS NOT NULL
         AND t1.hospital_id = t2.hospital_id
+        and t1.hospital_id = t3.hospital_id
         AND t1.behospital_code = t2.behospital_code
+        and t1.behospital_code = t3.file_code
         AND t1.rep_no = t2.rep_no
         <if test="examineInfoVO.hospitalId != null">
             and t1.hospital_id = #{examineInfoVO.hospitalId}
@@ -81,6 +80,13 @@
         </if>
         <if test="examineInfoVO.jyDateEnd != null">
             <![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>
+        <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
         where 1=1
         <if test="examineInfoVO.examineType != null and examineInfoVO.examineType == 1">

+ 34 - 23
src/main/resources/mapper/MedPacsInfoMapper.xml

@@ -4,29 +4,29 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.MedPacsInfo">
-        <id column="rep_no" property="repNo" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="behospital_code" property="behospitalCode" />
-        <result column="rep_name" property="repName" />
-        <result column="rep_type" property="repType" />
-        <result column="rep_type_name" property="repTypeName" />
-        <result column="part" property="part" />
-        <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="report_doctor" property="reportDoctor" />
-        <result column="checker" property="checker" />
-        <result column="yjpdz" property="yjpdz" />
-        <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_name" property="repName"/>
+        <result column="rep_type" property="repType"/>
+        <result column="rep_type_name" property="repTypeName"/>
+        <result column="part" property="part"/>
+        <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="report_doctor" property="reportDoctor"/>
+        <result column="checker" property="checker"/>
+        <result column="yjpdz" property="yjpdz"/>
+        <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="getCheckInfo"  resultType="com.diagbot.dto.CheckInfoDTO">
+    <select id="getCheckInfo" resultType="com.diagbot.dto.CheckInfoDTO">
         select b.*
         from(
         SELECT
@@ -41,14 +41,18 @@
         t2.rept_diag as checkResult
         FROM
         med_pacs_info t1,
-        med_pacs_result t2
+        med_pacs_result t2,
+        med_behospital_info t3
         WHERE
         t1.is_deleted = "N"
         AND t2.is_deleted = "N"
+        AND t3.is_deleted = "N"
         AND t2.rept_name IS NOT NULL
         AND t1.check_date IS NOT NULL
         and t1.hospital_id = t2.hospital_id
+        and t1.hospital_id = t3.hospital_id
         and t1.behospital_code = t2.behospital_code
+        and t1.behospital_code = t3.file_code
         and t1.rep_no = t2.rep_no
         <if test="checkInfoVO.hospitalId != null">
             and t1.hospital_id = #{checkInfoVO.hospitalId}
@@ -67,6 +71,13 @@
         </if>
         <if test="checkInfoVO.jxDateEnd != null">
             <![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>
+        <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
         where 1=1
         <if test="checkInfoVO.checkType != null and checkInfoVO.checkType == 1">