|
@@ -21640,4 +21640,200 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!--一级手术级别人数-->
|
|
|
+ <select id="operationLevelOneCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
|
|
|
+ SELECT
|
|
|
+ COUNT(DISTINCT a.behospital_code , case when f.operation_level ='1' then '1' end)
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_medical_record c,
|
|
|
+ qc_mode d,
|
|
|
+ med_home_page e,
|
|
|
+ med_home_operation_info f
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ AND f.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND c.mode_id = d.id
|
|
|
+ AND a.hospital_id = e.hospital_id
|
|
|
+ AND a.hospital_id = f.hospital_id
|
|
|
+ AND a.behospital_code = e.behospital_code
|
|
|
+ AND e.home_page_id = f.home_page_id
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{isPlacefile}
|
|
|
+ </if>
|
|
|
+ AND d.`name` = '手术记录'
|
|
|
+ <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--二级手术级别人数-->
|
|
|
+ <select id="operationLevelTwoCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
|
|
|
+ SELECT
|
|
|
+ COUNT(DISTINCT a.behospital_code , case when f.operation_level ='2' then '1' end)
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_medical_record c,
|
|
|
+ qc_mode d,
|
|
|
+ med_home_page e,
|
|
|
+ med_home_operation_info f
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ AND f.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND c.mode_id = d.id
|
|
|
+ AND a.hospital_id = e.hospital_id
|
|
|
+ AND a.hospital_id = f.hospital_id
|
|
|
+ AND a.behospital_code = e.behospital_code
|
|
|
+ AND e.home_page_id = f.home_page_id
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{isPlacefile}
|
|
|
+ </if>
|
|
|
+ AND d.`name` = '手术记录'
|
|
|
+ <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--三级手术级别人数-->
|
|
|
+ <select id="operationLevelThreeCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
|
|
|
+ SELECT
|
|
|
+ COUNT(DISTINCT a.behospital_code , case when f.operation_level ='3' then '1' end)
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_medical_record c,
|
|
|
+ qc_mode d,
|
|
|
+ med_home_page e,
|
|
|
+ med_home_operation_info f
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ AND f.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND c.mode_id = d.id
|
|
|
+ AND a.hospital_id = e.hospital_id
|
|
|
+ AND a.hospital_id = f.hospital_id
|
|
|
+ AND a.behospital_code = e.behospital_code
|
|
|
+ AND e.home_page_id = f.home_page_id
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{isPlacefile}
|
|
|
+ </if>
|
|
|
+ AND d.`name` = '手术记录'
|
|
|
+ <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--四级手术级别人数-->
|
|
|
+ <select id="operationLevelFourCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
|
|
|
+ SELECT
|
|
|
+ COUNT(DISTINCT a.behospital_code , case when f.operation_level ='4' then '1' end)
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_medical_record c,
|
|
|
+ qc_mode d,
|
|
|
+ med_home_page e,
|
|
|
+ med_home_operation_info f
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ AND f.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND c.mode_id = d.id
|
|
|
+ AND a.hospital_id = e.hospital_id
|
|
|
+ AND a.hospital_id = f.hospital_id
|
|
|
+ AND a.behospital_code = e.behospital_code
|
|
|
+ AND e.home_page_id = f.home_page_id
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{isPlacefile}
|
|
|
+ </if>
|
|
|
+ AND d.`name` = '手术记录'
|
|
|
+ <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|