Browse Source

河北演示数据报表明细

SGTY 8 months ago
parent
commit
52065e44f0

+ 2 - 0
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -2163,6 +2163,8 @@ public class ConsoleFacade {
      */
     public List<HomePageNumDTO> homePageLevelStatistics(FilterOrderVO filterOrderVO) {
         filterFacade.filterOrderVOSet(filterOrderVO);
+        //todo 根据条件判断医院ID
+//        filterOrderVO.setHospitalId("");
         List<HomePageNumDTO> records = behospitalInfoFacade.homePageLevelStatistics(filterOrderVO);
         //没有科室过滤时增加全院数据
         if (StringUtil.isBlank(filterOrderVO.getDeptName()) || filterOrderVO.getDeptName().equals("全院")) {

+ 15 - 0
src/main/java/com/diagbot/vo/FilterOrderVO.java

@@ -48,4 +48,19 @@ public class FilterOrderVO extends FilterVO {
      * 去年同期结束时间
      */
     private String lastEndDate;
+
+    /**
+     * 行政区域
+     */
+    private String area;
+
+    /**
+     * 机构类别: 综合医院 专科医院
+     */
+    private String organizationType;
+
+    /**
+     * 机构名称
+     */
+    private String organizationName;
 }

+ 15 - 0
src/main/java/com/diagbot/vo/FilterPageVO.java

@@ -91,4 +91,19 @@ public class FilterPageVO extends Page {
      */
     private String isPlacefile = "1";
 
+    /**
+     * 行政区域
+     */
+    private String area;
+
+    /**
+     * 机构类别: 综合医院 专科医院
+     */
+    private String organizationType;
+
+    /**
+     * 机构名称
+     */
+    private String organizationName;
+
 }

+ 57 - 17
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -2268,9 +2268,10 @@
             and a.is_placefile = #{isPlacefile}
         </if>
         AND a.qc_type_id != 0
-        <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
-        </if>
+<!--        <if test="hospitalId != null and hospitalId != ''">-->
+<!--            AND a.hospital_id = #{hospitalId}-->
+<!--        </if>-->
+        <include refid="hospitalIdChoose"/>
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="startDate != null and startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{startDate}]]>
@@ -2322,9 +2323,10 @@
             and a.is_placefile = #{isPlacefile}
         </if>
         AND a.qc_type_id != 0
-        <if test="hospitalId != null and hospitalId != ''">
+        <!--<if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
-        </if>
+        </if>-->
+        <include refid="hospitalIdChoose"/>
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="startDate != null and startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{startDate}]]>
@@ -2399,9 +2401,10 @@
             and a.is_placefile = #{isPlacefile}
         </if>
         AND a.qc_type_id != 0
-        <if test="hospitalId != null and hospitalId != ''">
+       <!-- <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
-        </if>
+        </if>-->
+        <include refid="hospitalIdChoose"/>
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="lastStartDate != null and lastStartDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{lastStartDate}]]>
@@ -2453,9 +2456,10 @@
             and a.is_placefile = #{isPlacefile}
         </if>
         AND a.qc_type_id != 0
-        <if test="hospitalId != null and hospitalId != ''">
+        <!--<if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
-        </if>
+        </if>-->
+        <include refid="hospitalIdChoose"/>
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="lastStartDate != null and lastStartDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{lastStartDate}]]>
@@ -3308,9 +3312,12 @@
             and a.is_placefile = #{isPlacefile}
         </if>
         AND a.qc_type_id != 0
-        <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
-        </if>
+<!--        <if test="hospitalId != null and hospitalId != ''">-->
+<!--            AND a.hospital_id = #{hospitalId}-->
+<!--        </if>-->
+        <include refid="hospitalIdChoose"/>
+
+
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="startDate != null and startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{startDate}]]>
@@ -3364,9 +3371,10 @@
             and a.is_placefile = #{isPlacefile}
         </if>
         AND a.qc_type_id != 0
-        <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
-        </if>
+<!--        <if test="hospitalId != null and hospitalId != ''">-->
+<!--            AND a.hospital_id = #{hospitalId}-->
+<!--        </if>-->
+        <include refid="hospitalIdChoose"/>
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="startDate != null and startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{startDate}]]>
@@ -3435,9 +3443,10 @@
         </if>
         AND d.cases_id = 243
         AND a.qc_type_id != 0
-        <if test="hospitalId != null and hospitalId != ''">
+        <!--<if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
-        </if>
+        </if>-->
+        <include refid="hospitalIdChoose"/>
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="startDate != null and startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{startDate}]]>
@@ -3530,6 +3539,37 @@
         </if>
     </select>
 
+    <sql id="hospitalIdChoose">
+        <choose>
+            <when test="organizationName != null and organizationName != ''">
+                <choose>
+                    <when test="organizationName == '邵逸夫'">
+                        AND a.hospital_id = 2
+                    </when>
+                    <when test="organizationName == '浙江大学附属第一医院'">
+                        AND a.hospital_id = 3
+                    </when>
+                    <when test="organizationName == '七院'">
+                        AND a.hospital_id = 14
+                    </when>
+                </choose>
+            </when>
+            <otherwise>
+                <choose>
+                    <when test="organizationType == '综合医院'">
+                        AND a.hospital_id IN (2, 3)
+                    </when>
+                    <when test="organizationType == '专科医院'">
+                        AND a.hospital_id = 14
+                    </when>
+                    <otherwise>
+                        AND a.hospital_id IN (2, 3, 14)
+                    </otherwise>
+                </choose>
+            </otherwise>
+        </choose>
+    </sql>
+
     <!-- 医师病案首页合格率占比 湘雅定制-->
     <select id="homePageLevelStatisticsXY" resultType="com.diagbot.dto.HomePageNumXYDTO">
         SELECT

+ 45 - 10
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -1588,9 +1588,10 @@
             and a.is_placefile = #{filterPageVO.isPlacefile}
         </if>
         AND a.qc_type_id != 0
-        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
-            AND a.hospital_id = #{filterPageVO.hospitalId}
-        </if>
+<!--        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">-->
+<!--            AND a.hospital_id = #{filterPageVO.hospitalId}-->
+<!--        </if>-->
+        <include refid="hospitalIdChoose"/>
         <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
             <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
@@ -1636,9 +1637,10 @@
             and a.is_placefile = #{filterPageVO.isPlacefile}
         </if>
         AND a.qc_type_id != 0
-        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
-            AND a.hospital_id = #{filterPageVO.hospitalId}
-        </if>
+<!--        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">-->
+<!--            AND a.hospital_id = #{filterPageVO.hospitalId}-->
+<!--        </if>-->
+        <include refid="hospitalIdChoose"/>
         <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
             <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
@@ -1684,6 +1686,37 @@
         ) t
     </select>
 
+    <sql id="hospitalIdChoose">
+        <choose>
+            <when test="filterPageVO.organizationName != null and filterPageVO.organizationName != ''">
+                <choose>
+                    <when test="filterPageVO.organizationName == '邵逸夫'">
+                        AND a.hospital_id = 2
+                    </when>
+                    <when test="filterPageVO.organizationName == '浙江大学附属第一医院'">
+                        AND a.hospital_id = 3
+                    </when>
+                    <when test="filterPageVO.organizationName == '七院'">
+                        AND a.hospital_id = 14
+                    </when>
+                </choose>
+            </when>
+            <otherwise>
+                <choose>
+                    <when test="filterPageVO.organizationType == '综合医院'">
+                        AND a.hospital_id IN (2, 3)
+                    </when>
+                    <when test="filterPageVO.organizationType == '专科医院'">
+                        AND a.hospital_id = 14
+                    </when>
+                    <otherwise>
+                        AND a.hospital_id IN (2, 3, 14)
+                    </otherwise>
+                </choose>
+            </otherwise>
+        </choose>
+    </sql>
+
     <!-- 缺陷详情(分页) -->
     <select id="entryCountGroupByEntryPage"  resultType="com.diagbot.dto.EntryNumGroupDTO">
         SELECT
@@ -1730,9 +1763,10 @@
             and a.is_placefile = #{filterPageVO.isPlacefile}
         </if>
         AND a.qc_type_id != 0
-        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
+        <!--<if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
-        </if>
+        </if>-->
+        <include refid="hospitalIdChoose"/>
         <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
             <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
@@ -1804,9 +1838,10 @@
         AND e.cases_id = d.cases_id
         AND e.id = d.cases_entry_id
         AND a.qc_type_id != 0
-        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
+        <!--<if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
-        </if>
+        </if>-->
+        <include refid="hospitalIdChoose"/>
         <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
             <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>