|
@@ -999,10 +999,11 @@
|
|
|
</select>
|
|
|
|
|
|
<!--质控评分(科室)分页-->
|
|
|
- <select id="getPageByDept" resultType="com.diagbot.dto.BehospitalInfoDTO">
|
|
|
+ <select id="getPageByDept" resultType="com.diagbot.dto.BehospitalInfoDeptDTO">
|
|
|
SELECT * from (
|
|
|
SELECT
|
|
|
t.*,
|
|
|
+ t3.name as medoupName,
|
|
|
CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
|
|
|
CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
|
|
|
g.check_type as ch_type,
|
|
@@ -1044,7 +1045,18 @@
|
|
|
LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
|
|
|
ON t.behospital_code = h.behospital_code
|
|
|
AND t.hospital_id = h.hospital_id
|
|
|
+ LEFT JOIN bas_doctor_info t2 ON t.doctor_id = t2.doctor_id
|
|
|
+ AND t.hospital_id = t2.hospital_id
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
+ LEFT JOIN sys_medoup t3 ON t2.group_id = t3.`code`
|
|
|
+ AND t3.is_deleted = 'N'
|
|
|
where t.is_deleted = 'N'
|
|
|
+ <if test="medoupName != null and medoupName != ''">
|
|
|
+ AND t3.name = #{medoupName}
|
|
|
+ </if>
|
|
|
+ <if test="wardName != null and wardName != ''">
|
|
|
+ AND t.ward_name = #{wardName}
|
|
|
+ </if>
|
|
|
<if test="diagnose != null and diagnose != ''">
|
|
|
AND t.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
|
</if>
|
|
@@ -4416,9 +4428,9 @@
|
|
|
</select>
|
|
|
|
|
|
<!-- 科室质控评分导出到excel-->
|
|
|
- <select id="exportQcresultByDept" resultMap="ExportExcelMap" parameterType="com.diagbot.vo.ExportQcresultVO">
|
|
|
+ <select id="exportQcresultByDept" resultMap="ExportExcelMapByDept" parameterType="com.diagbot.vo.ExportQcresultVO">
|
|
|
SELECT * FROM (
|
|
|
- SELECT tp.*,CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
|
|
|
+ SELECT tp.*,t3.name as medoupName,CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
|
|
|
CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
|
|
|
g.check_type AS ch_type,
|
|
|
h.check_type AS mr_type,
|
|
@@ -4431,7 +4443,9 @@
|
|
|
t1.behDeptId,
|
|
|
t1.behDeptName,
|
|
|
t1.doctorName,
|
|
|
+ t1.doctor_id as doctorId,
|
|
|
t1.patName,
|
|
|
+ t1.wardName,
|
|
|
t1.behospitalCode,
|
|
|
t1.hospitalId,
|
|
|
t1.behospitalDate,
|
|
@@ -4447,7 +4461,9 @@
|
|
|
(
|
|
|
SELECT
|
|
|
a.doctor_name AS doctorName,
|
|
|
+ a.doctor_id,
|
|
|
a.`name` AS patName,
|
|
|
+ a.ward_name as wardName,
|
|
|
a.behospital_code AS behospitalCode,
|
|
|
a.hospital_id AS hospital_id,
|
|
|
a.behospital_date AS behospitalDate,
|
|
@@ -4485,6 +4501,9 @@
|
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
|
and a.is_placefile = #{isPlacefile}
|
|
|
</if>
|
|
|
+ <if test="wardName != null and wardName != ''">
|
|
|
+ AND a.ward_name = #{wardName}
|
|
|
+ </if>
|
|
|
<![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
|
AND a.hospital_id = #{hospitalId}
|
|
@@ -4536,7 +4555,9 @@
|
|
|
SELECT
|
|
|
ROUND( AVG( b.score_res ), 2 ) AS avgScore,
|
|
|
a.beh_dept_id AS behDeptId,
|
|
|
- a.beh_dept_name AS behDeptName
|
|
|
+ a.beh_dept_name AS behDeptName,
|
|
|
+ a.doctor_id AS doctorId,
|
|
|
+ a.doctor_name AS doctorName
|
|
|
FROM
|
|
|
med_behospital_info a,
|
|
|
med_qcresult_info b,
|
|
@@ -4552,6 +4573,9 @@
|
|
|
<if test="diagnose != null and diagnose != ''">
|
|
|
AND a.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
|
</if>
|
|
|
+ <if test="wardName != null and wardName != ''">
|
|
|
+ AND a.ward_name = #{wardName}
|
|
|
+ </if>
|
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
|
and a.is_placefile = #{isPlacefile}
|
|
|
</if>
|
|
@@ -4598,11 +4622,14 @@
|
|
|
</if>
|
|
|
GROUP BY
|
|
|
a.beh_dept_id,
|
|
|
- a.beh_dept_name
|
|
|
+ a.beh_dept_name,
|
|
|
+ a.doctor_id,
|
|
|
+ a.doctor_name
|
|
|
) t2
|
|
|
WHERE
|
|
|
t1.behDeptId = t2.behDeptId
|
|
|
AND t1.behDeptName = t2.behDeptName
|
|
|
+ AND t1.doctor_id = t2.doctorId
|
|
|
ORDER BY
|
|
|
t1.behDeptName,
|
|
|
t1.doctorName,
|
|
@@ -4618,6 +4645,15 @@
|
|
|
LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
|
|
|
ON tp.behospitalCode = h.behospital_code
|
|
|
AND tp.hospitalId = h.hospital_id
|
|
|
+ LEFT JOIN bas_doctor_info t2 ON tp.doctorId = t2.doctor_id
|
|
|
+ AND tp.hospitalId = t2.hospital_id
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
+ LEFT JOIN sys_medoup t3 ON t2.group_id = t3.`code`
|
|
|
+ AND t3.is_deleted = 'N'
|
|
|
+ where 1=1
|
|
|
+ <if test="medoupName != null and medoupName != ''">
|
|
|
+ AND t3.name = #{medoupName}
|
|
|
+ </if>
|
|
|
) tu
|
|
|
WHERE tu.behospitalCode IS NOT NULL
|
|
|
<if test="checkStatus != null ">
|
|
@@ -5367,7 +5403,7 @@
|
|
|
</select>
|
|
|
|
|
|
<!-- 条目缺陷质控评分页-科室(内页)-->
|
|
|
- <select id="qcResultShortByDeptPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
|
+ <select id="qcResultShortByDeptPage" resultType="com.diagbot.dto.QcResultShortDeptDTO">
|
|
|
SELECT t.*,t3.name as medoupName
|
|
|
FROM
|
|
|
(SELECT DISTINCT
|
|
@@ -11162,7 +11198,7 @@
|
|
|
|
|
|
|
|
|
<!-- 不合格/合格数病历号(内页)科室-->
|
|
|
- <select id="getIsGoodLevelByDept" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
|
+ <select id="getIsGoodLevelByDept" resultType="com.diagbot.dto.QcResultShortDeptDTO">
|
|
|
select m.*,t3.name as medoupName from(
|
|
|
SELECT t.*
|
|
|
FROM
|