|
@@ -2579,13 +2579,19 @@
|
|
|
|
|
|
<!--病历扣分大于等于5分占比(H5)-->
|
|
<!--病历扣分大于等于5分占比(H5)-->
|
|
<select id="deductGT5ByDept" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.DeptNumDTO">
|
|
<select id="deductGT5ByDept" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.DeptNumDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ k1.deptId,
|
|
|
|
+ k1.deptName,
|
|
|
|
+ k1.num,
|
|
|
|
+ k2.totleNum,
|
|
|
|
+ Round( k1.num / k2.totleNum, 4 ) AS percent,
|
|
|
|
+ CONCAT( Round( k1.num / k2.totleNum * 100, 2 ), '%' ) AS percentStr
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
SELECT
|
|
SELECT
|
|
t1.beh_dept_id AS deptId,
|
|
t1.beh_dept_id AS deptId,
|
|
t1.beh_dept_name AS deptName,
|
|
t1.beh_dept_name AS deptName,
|
|
- sum( t2.totleScore - t1.score_res >= 5 ) AS num,
|
|
|
|
- count(*) AS totleNum,
|
|
|
|
- Round( sum( t2.totleScore - t1.score_res >= 5 ) / count(*), 4 ) AS percent,
|
|
|
|
- CONCAT( Round( sum( t2.totleScore - t1.score_res >= 5 ) / count(*) * 100, 2 ), '%' ) AS percentStr
|
|
|
|
|
|
+ count(*) AS num
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
@@ -2644,13 +2650,74 @@
|
|
`sys_hospital_set`
|
|
`sys_hospital_set`
|
|
WHERE
|
|
WHERE
|
|
CODE = 'score_type'
|
|
CODE = 'score_type'
|
|
- <if test="hospitalId != null and hospitalId != ''">
|
|
|
|
- AND hospital_id = #{hospitalId}
|
|
|
|
- </if>
|
|
|
|
|
|
+ AND hospital_id = '5'
|
|
) t2
|
|
) t2
|
|
|
|
+ WHERE
|
|
|
|
+ t2.totleScore - t1.score_res >= 5
|
|
GROUP BY
|
|
GROUP BY
|
|
t1.beh_dept_id,
|
|
t1.beh_dept_id,
|
|
t1.beh_dept_name
|
|
t1.beh_dept_name
|
|
|
|
+ ) k1,
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ count(*) AS totleNum
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ a.*,
|
|
|
|
+ b.score_res
|
|
|
|
+ FROM
|
|
|
|
+ med_behospital_info a,
|
|
|
|
+ med_qcresult_info b
|
|
|
|
+ WHERE
|
|
|
|
+ a.is_deleted = 'N'
|
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
|
+ AND a.hospital_id = b.hospital_id
|
|
|
|
+ AND a.behospital_code = b.behospital_code
|
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
|
+ 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="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>
|
|
|
|
+ ) t1,
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ `value`,
|
|
|
|
+ hospital_id,
|
|
|
|
+ CASE
|
|
|
|
+ `value`
|
|
|
|
+ WHEN 0 THEN
|
|
|
|
+ 120
|
|
|
|
+ WHEN 1 THEN
|
|
|
|
+ 100
|
|
|
|
+ END AS totleScore
|
|
|
|
+ FROM
|
|
|
|
+ `sys_hospital_set`
|
|
|
|
+ WHERE
|
|
|
|
+ CODE = 'score_type'
|
|
|
|
+ AND hospital_id = '5'
|
|
|
|
+ ) t2
|
|
|
|
+ WHERE
|
|
|
|
+ t2.totleScore - t1.score_res >= 5
|
|
|
|
+ ) k2
|
|
ORDER BY
|
|
ORDER BY
|
|
percent DESC
|
|
percent DESC
|
|
</select>
|
|
</select>
|