|
@@ -137,36 +137,27 @@
|
|
|
s.casesId,
|
|
|
s.casesName,
|
|
|
s.entryName,
|
|
|
- s.entryId,
|
|
|
- sum(s.totalNum) AS totalNum,
|
|
|
+ s.beforeCasesEntryId AS entryId,
|
|
|
+ count(s.beforeCasesEntryId) AS totalNum,
|
|
|
sum(s.improveleNum) AS improveleNum,
|
|
|
- sum(s.totalNum) - sum(s.improveleNum) AS handleNum,
|
|
|
- concat(ROUND((sum(s.totalNum) - sum(s.improveleNum)) / sum(s.totalNum) * 100,2),'%') AS handleStr
|
|
|
- FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- f.hospitalId,
|
|
|
- f.deptId,
|
|
|
- f.deptName,
|
|
|
- f.behospitalCode,
|
|
|
- f.casesId,
|
|
|
- f.casesName,
|
|
|
- f.casesEntryName as entryName,
|
|
|
- f.beforeCasesEntryId as entryId,
|
|
|
- count(f.beforeCasesEntryId) AS totalNum,
|
|
|
- CASE
|
|
|
- WHEN count(f.lastCasesEntryId) > 0 AND count(f.beforeCasesEntryId) - count(f.lastCasesEntryId) <= 0 THEN
|
|
|
- count(f.beforeCasesEntryId)
|
|
|
- WHEN count(f.lastCasesEntryId) > 0 AND count(f.beforeCasesEntryId) - count(f.lastCasesEntryId) > 0 THEN
|
|
|
- count(f.beforeCasesEntryId) - count(f.lastCasesEntryId)
|
|
|
- WHEN count(f.lastCasesEntryId) = 0 THEN 0
|
|
|
- END AS improveleNum
|
|
|
+ sum(s.handleNum) AS handleNum,
|
|
|
+ concat(ROUND((sum(s.handleNum)) / sum(s.beforeQcresultInfoId) * 100,2),'%') AS handleStr
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
- k.*, i. NAME AS casesName,
|
|
|
- o. NAME AS casesEntryName,
|
|
|
- y.cases_entry_id AS lastCasesEntryId
|
|
|
+ k.hospitalId,
|
|
|
+ k.deptId,
|
|
|
+ k.deptName,
|
|
|
+ k.behospitalCode,
|
|
|
+ k.lastQcresultInfoId,
|
|
|
+ k.beforeQcresultInfoId,
|
|
|
+ k.casesId,
|
|
|
+ k.beforeCasesEntryId,
|
|
|
+ i. NAME AS casesName,
|
|
|
+ o. NAME AS entryName,
|
|
|
+ y.cases_entry_id AS lastCasesEntryId,
|
|
|
+ CASE WHEN y.cases_entry_id IS NULL THEN 0 else 1 END AS improveleNum,
|
|
|
+ CASE WHEN y.cases_entry_id IS NULL THEN 1 else 0 END AS handleNum
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
@@ -325,19 +316,12 @@
|
|
|
<if test="entryName != null and entryName != ''">
|
|
|
and o.name like CONCAT('%',#{entryName},'%')
|
|
|
</if>
|
|
|
- ) f
|
|
|
- GROUP BY
|
|
|
- f.deptId,
|
|
|
- f.deptName,
|
|
|
- f.behospitalCode,
|
|
|
- f.casesId,
|
|
|
- f.beforeCasesEntryId
|
|
|
) s
|
|
|
GROUP BY
|
|
|
s.deptId,
|
|
|
s.deptName,
|
|
|
s.casesId,
|
|
|
- s.entryId
|
|
|
+ s.beforeCasesEntryId
|
|
|
</select>
|
|
|
|
|
|
<select id="getEntryDefectImproveInner" resultType="com.diagbot.dto.BehospitalInfoDTO">
|