|
@@ -4575,13 +4575,9 @@
|
|
|
<select id="exportQcresultByDept" resultMap="ExportExcelMapByDept" parameterType="com.diagbot.vo.ExportQcresultVO">
|
|
|
SELECT * FROM (
|
|
|
SELECT tp.*,t3.name as medoup_name,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,
|
|
|
g.check_name AS ch_name,
|
|
|
- h.check_name AS mr_name,
|
|
|
- g.check_time AS ch_time,
|
|
|
- h.check_time AS mr_time
|
|
|
+ g.check_time AS ch_time
|
|
|
FROM (
|
|
|
SELECT
|
|
|
t1.behDeptId,
|
|
@@ -4788,12 +4784,9 @@
|
|
|
</if>
|
|
|
t1.behospitalCode
|
|
|
)tp
|
|
|
- LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
|
|
|
+ LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
|
|
|
ON tp.behospitalCode = g.behospital_code
|
|
|
AND tp.hospitalId = g.hospital_id
|
|
|
- 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'
|
|
@@ -5103,6 +5096,7 @@
|
|
|
t1.behDeptId,
|
|
|
t1.behDeptName,
|
|
|
t1.doctorName,
|
|
|
+ t1.fileCode,
|
|
|
t1.patName,
|
|
|
t1.behospitalCode,
|
|
|
t1.hospitalId,
|
|
@@ -5120,6 +5114,7 @@
|
|
|
SELECT
|
|
|
a.doctor_name AS doctorName,
|
|
|
a.beh_doctor_name,
|
|
|
+ a.file_code as fileCode,
|
|
|
a.director_doctor_name,
|
|
|
a.`name` AS patName,
|
|
|
a.behospital_code AS behospitalCode,
|
|
@@ -5280,6 +5275,8 @@
|
|
|
<if test="name != null and name != ''">
|
|
|
AND a.name like CONCAT('%',#{name},'%')
|
|
|
</if>
|
|
|
+ GROUP BY a.beh_dept_id,
|
|
|
+ a.beh_dept_name
|
|
|
) t2
|
|
|
WHERE
|
|
|
t1.behDeptId = t2.behDeptId
|
|
@@ -5293,7 +5290,7 @@
|
|
|
</if>
|
|
|
t1.behospitalCode
|
|
|
)tp
|
|
|
- LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
|
|
|
+ LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
|
|
|
ON tp.behospitalCode = g.behospital_code
|
|
|
AND tp.hospitalId = g.hospital_id
|
|
|
LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
|
|
@@ -5343,6 +5340,7 @@
|
|
|
t1.behDeptName,
|
|
|
t1.doctorName,
|
|
|
t1.patName,
|
|
|
+ t1.fileCode,
|
|
|
t1.behospitalCode,
|
|
|
t1.hospitalId,
|
|
|
t1.behospitalDate,
|
|
@@ -5359,6 +5357,7 @@
|
|
|
SELECT
|
|
|
a.doctor_name AS doctorName,
|
|
|
a.`name` AS patName,
|
|
|
+ a.file_code as fileCode,
|
|
|
a.behospital_code AS behospitalCode,
|
|
|
a.behospital_date AS behospitalDate,
|
|
|
a.leave_hospital_date AS leaveHospitalDate,
|
|
@@ -5527,7 +5526,7 @@
|
|
|
</if>
|
|
|
t1.behospitalCode
|
|
|
)tp
|
|
|
- LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
|
|
|
+ LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
|
|
|
ON tp.behospitalCode = g.behospital_code
|
|
|
AND tp.hospitalId = g.hospital_id
|
|
|
LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
|