|
@@ -229,13 +229,18 @@
|
|
|
</select>
|
|
|
|
|
|
<!-- 条目缺陷占比(内页) -->
|
|
|
- <select id="entryGroupByEntryInnerPage" resultType="com.diagbot.dto.NumDTO">
|
|
|
+ <select id="entryGroupByEntryInnerPage" resultType="com.diagbot.dto.EntryNumDTO">
|
|
|
SELECT t.*
|
|
|
FROM
|
|
|
(SELECT
|
|
|
+ t1.id AS id,
|
|
|
t1.NAME AS NAME,
|
|
|
+ t1.casesId AS casesId,
|
|
|
+ t1.casesName AS casesName,
|
|
|
t1.num AS num,
|
|
|
t2.mrNum AS totleNum,
|
|
|
+ t1.score AS score,
|
|
|
+ t1.isReject AS isReject,
|
|
|
Round( t1.num / t2.mrNum, 4 ) AS percent,
|
|
|
CONCAT( Round( t1.num / t2.mrNum * 100, 2 ), '%' ) AS percentStr
|
|
|
FROM
|
|
@@ -243,23 +248,31 @@
|
|
|
SELECT
|
|
|
e.id,
|
|
|
e.NAME,
|
|
|
- count(*) AS num
|
|
|
+ e.cases_id AS casesId,
|
|
|
+ e.cases_name AS casesName,
|
|
|
+ count(*) AS num,
|
|
|
+ f.score,
|
|
|
+ f.is_reject AS isReject
|
|
|
FROM
|
|
|
med_behospital_info a,
|
|
|
med_qcresult_info c,
|
|
|
med_qcresult_detail d,
|
|
|
- qc_cases_entry e
|
|
|
+ qc_cases_entry e,
|
|
|
+ qc_cases_entry_hospital 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.hospital_id = d.hospital_id
|
|
|
+ AND a.hospital_id = f.hospital_id
|
|
|
AND a.behospital_code = c.behospital_code
|
|
|
AND a.behospital_code = d.behospital_code
|
|
|
AND d.cases_id = e.cases_id
|
|
|
AND d.cases_entry_id = e.id
|
|
|
+ AND e.id = f.cases_entry_id
|
|
|
AND a.is_placefile = '1'
|
|
|
<![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
<if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
|
|
@@ -274,9 +287,17 @@
|
|
|
<if test="filterPageVO.name != null and filterPageVO.name != ''">
|
|
|
AND e.name like CONCAT('%', #{filterPageVO.name},'%')
|
|
|
</if>
|
|
|
+ <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
|
|
|
+ AND e.cases_name = #{filterPageVO.casesName}
|
|
|
+ </if>
|
|
|
+ <if test="filterPageVO.isReject != null">
|
|
|
+ AND f.is_reject = #{filterPageVO.isReject}
|
|
|
+ </if>
|
|
|
GROUP BY
|
|
|
e.id,
|
|
|
- e.NAME
|
|
|
+ e.NAME,
|
|
|
+ e.cases_id,
|
|
|
+ e.cases_name
|
|
|
) t1,
|
|
|
(
|
|
|
SELECT
|
|
@@ -304,6 +325,94 @@
|
|
|
)t
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 单项否决缺陷占比(首页) -->
|
|
|
+ <select id="entryRejectPercent" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.EntryNumDTO">
|
|
|
+ SELECT
|
|
|
+ t1.id AS id,
|
|
|
+ t1.NAME AS NAME,
|
|
|
+ t1.casesId AS casesId,
|
|
|
+ t1.casesName AS casesName,
|
|
|
+ t1.num AS num,
|
|
|
+ t2.mrNum AS totleNum,
|
|
|
+ t1.score AS score,
|
|
|
+ t1.isReject AS isReject,
|
|
|
+ Round( t1.num / t2.mrNum, 4 ) AS percent,
|
|
|
+ CONCAT( Round( t1.num / t2.mrNum * 100, 2 ), '%' ) AS percentStr
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ e.id,
|
|
|
+ e.NAME,
|
|
|
+ e.cases_id AS casesId,
|
|
|
+ e.cases_name AS casesName,
|
|
|
+ count(*) AS num,
|
|
|
+ f.score,
|
|
|
+ f.is_reject AS isReject
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_info c,
|
|
|
+ med_qcresult_detail d,
|
|
|
+ qc_cases_entry e,
|
|
|
+ qc_cases_entry_hospital 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.hospital_id = d.hospital_id
|
|
|
+ AND a.hospital_id = f.hospital_id
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND a.behospital_code = d.behospital_code
|
|
|
+ AND d.cases_id = e.cases_id
|
|
|
+ AND d.cases_entry_id = e.id
|
|
|
+ AND e.id = f.cases_entry_id
|
|
|
+ AND a.is_placefile = '1'
|
|
|
+ AND f.is_reject = 1
|
|
|
+ <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ e.id,
|
|
|
+ e.NAME,
|
|
|
+ e.cases_id,
|
|
|
+ e.cases_name
|
|
|
+ ) t1,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ count(*) AS mrNum
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_info c
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND a.is_placefile = '1'
|
|
|
+ <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
|
|
|
+ </if>
|
|
|
+ ) t2
|
|
|
+ ORDER BY
|
|
|
+ percent DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 各科室质控平均分(首页) -->
|
|
|
<select id="getAverageScore" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.AverageStatisticsDTO">
|
|
|
SELECT
|