|
@@ -512,23 +512,26 @@
|
|
|
<!-- 各科室甲/乙/丙级病历占比 -->
|
|
|
<select id="qcResultLevelPercent" parameterType="com.lantone.common.vo.report.FilterVO"
|
|
|
resultType="com.lantone.common.dto.report.DeptNumDTO">
|
|
|
+
|
|
|
SELECT
|
|
|
- a.beh_dept_id AS deptId,
|
|
|
- a.beh_dept_name AS deptName,
|
|
|
+ beh_dept_id AS deptId,
|
|
|
<if test="level != null and level != ''">
|
|
|
- sum( c.`level` = #{level} ) AS num,
|
|
|
- ROUND( sum( c.`level` = #{level} )/ count(*), 4 ) AS percent,
|
|
|
- concat( ROUND( sum( c.`level` = #{level} )/ count(*)* 100, 2 ), '%' ) AS percentStr,
|
|
|
+ ROUND(num/totleNum,4)AS percent,
|
|
|
+ concat(ROUND(num/totleNum* 100,2), '%') AS percentStr,
|
|
|
</if>
|
|
|
- count(*) AS totleNum
|
|
|
+ beh_dept_name AS deptName
|
|
|
+ FROM(
|
|
|
+ SELECT
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name,
|
|
|
+ <if test="level != null and level != ''">
|
|
|
+ count(DISTINCT CASE WHEN a.`level` = #{level} THEN a.behospital_code END) AS num,
|
|
|
+ </if>
|
|
|
+ count(DISTINCT a.behospital_code)as totleNum
|
|
|
FROM
|
|
|
- med_behospital_info a,
|
|
|
- med_qcresult_info c
|
|
|
+ med_qcresult_report a
|
|
|
WHERE
|
|
|
a.is_deleted = 'N'
|
|
|
- AND c.is_deleted = 'N'
|
|
|
- AND a.hospital_id = c.hospital_id
|
|
|
- AND a.behospital_code = c.behospital_code
|
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
|
and a.is_placefile = #{isPlacefile}
|
|
|
</if>
|
|
@@ -555,9 +558,10 @@
|
|
|
GROUP BY
|
|
|
a.beh_dept_id,
|
|
|
a.beh_dept_name
|
|
|
+ )t1
|
|
|
ORDER BY
|
|
|
percent DESC,
|
|
|
- a.beh_dept_name ASC
|
|
|
+ deptName ASC
|
|
|
</select>
|
|
|
|
|
|
<!-- 各科室质控平均分(首页) -->
|