|
@@ -728,33 +728,36 @@
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
- e.id,
|
|
|
- e.NAME,
|
|
|
- a.beh_dept_id AS deptId,
|
|
|
- a.beh_dept_name AS deptName,
|
|
|
- count(*) AS num
|
|
|
+ tt2.id,
|
|
|
+ tt2.NAME,
|
|
|
+ tt1.beh_dept_id AS deptId,
|
|
|
+ tt1.beh_dept_name AS deptName,
|
|
|
+ tt1.num
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name,
|
|
|
+ count(*) AS num,
|
|
|
+ d.cases_entry_id
|
|
|
FROM
|
|
|
med_behospital_info a,
|
|
|
med_qcresult_info c,
|
|
|
med_qcresult_detail d,
|
|
|
- qc_cases_entry e,
|
|
|
sys_user_dept 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 a.beh_dept_id = f.dept_id
|
|
|
AND a.is_placefile = '1'
|
|
|
- <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ AND a.qc_type_id != 0
|
|
|
<if test="userId!=null">
|
|
|
AND f.user_id = #{userId}
|
|
|
</if>
|
|
@@ -768,10 +771,14 @@
|
|
|
<![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
|
|
|
</if>
|
|
|
GROUP BY
|
|
|
- e.id,
|
|
|
- e.NAME,
|
|
|
+ d.cases_entry_id,
|
|
|
a.beh_dept_id,
|
|
|
a.beh_dept_name
|
|
|
+ ) tt1,
|
|
|
+ qc_cases_entry tt2
|
|
|
+ WHERE
|
|
|
+ tt2.is_deleted = 'N'
|
|
|
+ AND tt1.cases_entry_id = tt2.id
|
|
|
) t1,
|
|
|
(
|
|
|
SELECT
|
|
@@ -791,7 +798,7 @@
|
|
|
AND a.behospital_code = c.behospital_code
|
|
|
AND a.beh_dept_id = f.dept_id
|
|
|
AND a.is_placefile = '1'
|
|
|
- <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ AND a.qc_type_id != 0
|
|
|
<if test="userId!=null">
|
|
|
AND f.user_id = #{userId}
|
|
|
</if>
|
|
@@ -838,41 +845,43 @@
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
- e.id,
|
|
|
- e.NAME,
|
|
|
- a.beh_dept_id AS deptId,
|
|
|
- a.beh_dept_name AS deptName,
|
|
|
- e.cases_id AS casesId,
|
|
|
- e.cases_name AS casesName,
|
|
|
+ tt2.id,
|
|
|
+ tt2.NAME,
|
|
|
+ tt1.beh_dept_id AS deptId,
|
|
|
+ tt1.beh_dept_name AS deptName,
|
|
|
+ tt2.cases_id AS casesId,
|
|
|
+ tt2.cases_name AS casesName,
|
|
|
+ tt1.num,
|
|
|
+ tt3.score,
|
|
|
+ tt1.is_reject AS isReject
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.hospital_id,
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name,
|
|
|
count(*) AS num,
|
|
|
- g.score,
|
|
|
- d.is_reject AS isReject
|
|
|
+ d.cases_id,
|
|
|
+ d.cases_entry_id,
|
|
|
+ d.is_reject
|
|
|
FROM
|
|
|
med_behospital_info a,
|
|
|
med_qcresult_info c,
|
|
|
med_qcresult_detail d,
|
|
|
- qc_cases_entry e,
|
|
|
- sys_user_dept f,
|
|
|
- qc_cases_entry_hospital g
|
|
|
+ sys_user_dept 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 g.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.hospital_id = g.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 = g.cases_entry_id
|
|
|
AND a.beh_dept_id = f.dept_id
|
|
|
AND a.is_placefile = '1'
|
|
|
- <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ AND a.qc_type_id != 0
|
|
|
<if test="filterPageByDeptVO.userId!=null">
|
|
|
AND f.user_id = #{filterPageByDeptVO.userId}
|
|
|
</if>
|
|
@@ -888,25 +897,31 @@
|
|
|
<if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
|
|
|
AND a.beh_dept_name = #{filterPageByDeptVO.deptName}
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.name != null and filterPageByDeptVO.name != ''">
|
|
|
- AND e.name like CONCAT('%', #{filterPageByDeptVO.name},'%')
|
|
|
- </if>
|
|
|
- <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
|
|
|
- AND e.cases_name = #{filterPageByDeptVO.casesName}
|
|
|
- </if>
|
|
|
<if test="filterPageByDeptVO.isReject != null">
|
|
|
AND d.is_reject = #{filterPageByDeptVO.isReject}
|
|
|
</if>
|
|
|
GROUP BY
|
|
|
- e.id,
|
|
|
- e.NAME,
|
|
|
+ d.cases_entry_id,
|
|
|
a.beh_dept_id,
|
|
|
a.beh_dept_name,
|
|
|
- <if test="filterPageByDeptVO.isReject == null">
|
|
|
- d.is_reject,
|
|
|
+ d.is_reject,
|
|
|
+ d.cases_id
|
|
|
+ ) tt1,
|
|
|
+ qc_cases_entry tt2,
|
|
|
+ qc_cases_entry_hospital tt3
|
|
|
+ WHERE
|
|
|
+ tt2.is_deleted = 'N'
|
|
|
+ AND tt3.is_deleted = 'N'
|
|
|
+ AND tt1.hospital_id = tt3.hospital_id
|
|
|
+ AND tt1.cases_id = tt2.cases_id
|
|
|
+ AND tt1.cases_entry_id = tt2.id
|
|
|
+ AND tt2.id = tt3.cases_entry_id
|
|
|
+ <if test="filterPageByDeptVO.name != null and filterPageByDeptVO.name != ''">
|
|
|
+ AND tt2.name like CONCAT('%', #{filterPageByDeptVO.name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
|
|
|
+ AND tt2.cases_name = #{filterPageByDeptVO.casesName}
|
|
|
</if>
|
|
|
- e.cases_id,
|
|
|
- e.cases_name
|
|
|
) t1,
|
|
|
(
|
|
|
SELECT
|
|
@@ -926,7 +941,7 @@
|
|
|
AND a.behospital_code = c.behospital_code
|
|
|
AND a.beh_dept_id = f.dept_id
|
|
|
AND a.is_placefile = '1'
|
|
|
- <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ AND a.qc_type_id != 0
|
|
|
<if test="filterPageByDeptVO.userId!=null">
|
|
|
AND f.user_id = #{filterPageByDeptVO.userId}
|
|
|
</if>
|