|
@@ -41,7 +41,13 @@
|
|
|
|
|
|
<select id="getPage" resultType="com.diagbot.dto.BehospitalInfoDTO">
|
|
|
SELECT * FROM (
|
|
|
- select t.*,
|
|
|
+ select distinct a.*,
|
|
|
+ ifnull(b.level,'未评分') as `level`,
|
|
|
+ b.grade_type,
|
|
|
+ b.score_res,
|
|
|
+ b.gmt_create as grade_time,
|
|
|
+ CONCAT( ifnull(c.age,'') ,ifnull(c.age_unit,'') )as age,
|
|
|
+ e.score_res as score_bn,
|
|
|
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,
|
|
@@ -50,9 +56,13 @@
|
|
|
h.check_name AS mr_name,
|
|
|
g.check_time AS ch_time,
|
|
|
h.check_time AS mr_time
|
|
|
- from (
|
|
|
- select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
|
|
|
- grade_time,IF(c.age is null, null,CONCAT( c.age,IF(c.age_unit is null, "",c.age_unit)))as age,e.score_res as score_bn from med_behospital_info a
|
|
|
+ from med_behospital_info a
|
|
|
+ LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
|
|
|
+ ON a.behospital_code = g.behospital_code
|
|
|
+ AND a.hospital_id = g.hospital_id
|
|
|
+ LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
|
|
|
+ ON a.behospital_code = h.behospital_code
|
|
|
+ AND a.hospital_id = h.hospital_id
|
|
|
LEFT JOIN med_qcresult_info b
|
|
|
on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
|
|
|
left join med_home_page c
|
|
@@ -61,61 +71,55 @@
|
|
|
on a.behospital_code = e.behospital_code
|
|
|
AND e.is_deleted = 'N'
|
|
|
and e.cases_id = 243
|
|
|
- ) t
|
|
|
- LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
|
|
|
- ON t.behospital_code = g.behospital_code
|
|
|
- AND t.hospital_id = g.hospital_id
|
|
|
- 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
|
|
|
- where t.is_deleted = 'N'
|
|
|
+ where
|
|
|
+ a.is_deleted = 'N'
|
|
|
<if test="diagnose != null and diagnose != ''">
|
|
|
- AND t.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
|
+ AND a.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
|
</if>
|
|
|
<if test="deptName != null and deptName != ''">
|
|
|
- and t.beh_dept_name LIKE CONCAT( '%', #{deptName}, '%' )
|
|
|
+ and a.beh_dept_name LIKE CONCAT( '%', #{deptName}, '%' )
|
|
|
</if>
|
|
|
<if test="doctorName != null and doctorName != ''">
|
|
|
and CONCAT(
|
|
|
- IFNULL(t.doctor_name,''),IFNULL(t.beh_doctor_name,''),IFNULL(t.director_doctor_name,''))
|
|
|
+ IFNULL(a.doctor_name,''),IFNULL(a.beh_doctor_name,''),IFNULL(a.director_doctor_name,''))
|
|
|
like CONCAT('%',#{doctorName},'%')
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- and t.name like CONCAT('%',#{name},'%')
|
|
|
+ and a.name like CONCAT('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="doctorCode != null and doctorCode != ''">
|
|
|
- and (t.doctor_id = #{doctorCode}
|
|
|
- or t.beh_doctor_id = #{doctorCode}
|
|
|
- or t.director_doctor_id = #{doctorCode})
|
|
|
+ and (a.doctor_id = #{doctorCode}
|
|
|
+ or a.beh_doctor_id = #{doctorCode}
|
|
|
+ or a.director_doctor_id = #{doctorCode})
|
|
|
</if>
|
|
|
<if test="fileCode != null and fileCode != ''">
|
|
|
- and t.file_code like CONCAT('%',#{fileCode},'%')
|
|
|
+ and a.file_code like CONCAT('%',#{fileCode},'%')
|
|
|
</if>
|
|
|
<if test="hospitalId != null">
|
|
|
- and t.hospital_id = #{hospitalId}
|
|
|
+ and a.hospital_id = #{hospitalId}
|
|
|
</if>
|
|
|
<if test="behospitalCode != null and behospitalCode != ''">
|
|
|
- and t.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
|
+ and a.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
|
</if>
|
|
|
<if test="behosDateStart != null">
|
|
|
- <![CDATA[ and t.behospital_date >= #{behosDateStart}]]>
|
|
|
+ <![CDATA[ and a.behospital_date >= #{behosDateStart}]]>
|
|
|
</if>
|
|
|
<if test="behosDateEnd != null">
|
|
|
- <![CDATA[ and t.behospital_date < #{behosDateEnd}]]>
|
|
|
+ <![CDATA[ and a.behospital_date < #{behosDateEnd}]]>
|
|
|
</if>
|
|
|
<if test="leaveHosDateStart != null">
|
|
|
- <![CDATA[ and t.leave_hospital_date >= #{leaveHosDateStart}]]>
|
|
|
+ <![CDATA[ and a.leave_hospital_date >= #{leaveHosDateStart}]]>
|
|
|
</if>
|
|
|
<if test="leaveHosDateEnd != null">
|
|
|
- <![CDATA[ and t.leave_hospital_date < #{leaveHosDateEnd}]]>
|
|
|
+ <![CDATA[ and a.leave_hospital_date < #{leaveHosDateEnd}]]>
|
|
|
</if>
|
|
|
<if test="level != null and level != ''">
|
|
|
- and t.level = #{level}
|
|
|
+ and b.level = #{level}
|
|
|
</if>
|
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
|
- and t.is_placefile = #{isPlacefile}
|
|
|
+ and a.is_placefile = #{isPlacefile}
|
|
|
</if>
|
|
|
- and t.qc_type_id != 0) p
|
|
|
+ and a.qc_type_id != 0) p
|
|
|
where p.is_deleted="N"
|
|
|
<if test="checkStatus != null ">
|
|
|
and p.check_status = #{checkStatus}
|
|
@@ -349,7 +353,7 @@
|
|
|
b.score_res,
|
|
|
e.score_res as score_bn,
|
|
|
b.gmt_create AS grade_time,
|
|
|
- IF(c.age is null, null,CONCAT( c.age,IF(c.age_unit is null, "",c.age_unit)))as age
|
|
|
+ CONCAT( ifnull(c.age,'') ,ifnull(c.age_unit,'') )as age
|
|
|
FROM
|
|
|
med_behospital_info a
|
|
|
JOIN sys_user_dept d
|
|
@@ -468,7 +472,7 @@
|
|
|
b.score_res,
|
|
|
e.score_res as score_bn,
|
|
|
b.gmt_create AS grade_time,
|
|
|
- IF(c.age is null, null,CONCAT( c.age,IF(c.age_unit is null, "",c.age_unit)))as age
|
|
|
+ CONCAT( ifnull(c.age,'') ,ifnull(c.age_unit,'') )as age
|
|
|
FROM
|
|
|
med_behospital_info a
|
|
|
JOIN
|
|
@@ -582,7 +586,7 @@
|
|
|
h.check_time AS mr_time
|
|
|
from (
|
|
|
select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
|
|
|
- grade_time,IF(c.age is null, null,CONCAT( c.age,IF(c.age_unit is null, "",c.age_unit)))as age, e.score_res as score_bn from med_behospital_info a
|
|
|
+ grade_time,CONCAT( ifnull(c.age,'') ,ifnull(c.age_unit,'') )as age, e.score_res as score_bn from med_behospital_info a
|
|
|
LEFT JOIN med_qcresult_info b
|
|
|
on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
|
|
|
LEFT JOIN med_qcresult_cases e
|
|
@@ -3248,10 +3252,12 @@
|
|
|
t1.behospitalDate,
|
|
|
t1.leaveHospitalDate,
|
|
|
t1.score,
|
|
|
- t1.scoreBn,
|
|
|
- t2.avgScore,
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
t1.msg,
|
|
|
- t1.caseName
|
|
|
+ t1.caseName,
|
|
|
+ </if>
|
|
|
+ t1.scoreBn,
|
|
|
+ t2.avgScore
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
@@ -3265,8 +3271,10 @@
|
|
|
a.leave_hospital_date AS leaveHospitalDate,
|
|
|
b.score_res AS score,
|
|
|
e.score_res as scoreBn,
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
c.msg AS msg,
|
|
|
d.NAME AS caseName,
|
|
|
+ </if>
|
|
|
a.beh_dept_id AS behDeptId,
|
|
|
a.beh_dept_name AS behDeptName,
|
|
|
a.hospital_id AS hospitalId
|
|
@@ -3278,15 +3286,17 @@
|
|
|
AND a.is_deleted = 'N'
|
|
|
AND b.is_deleted = 'N'
|
|
|
AND a.behospital_code = b.behospital_code
|
|
|
- LEFT JOIN
|
|
|
- med_qcresult_detail c
|
|
|
- ON c.is_deleted = 'N'
|
|
|
- AND b.behospital_code = c.behospital_code
|
|
|
- AND b.hospital_id = c.hospital_id
|
|
|
- LEFT JOIN
|
|
|
- qc_cases d
|
|
|
- on d.is_deleted = 'N'
|
|
|
- AND c.cases_id = d.id
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ LEFT JOIN
|
|
|
+ med_qcresult_detail c
|
|
|
+ ON c.is_deleted = 'N'
|
|
|
+ AND b.behospital_code = c.behospital_code
|
|
|
+ AND b.hospital_id = c.hospital_id
|
|
|
+ LEFT JOIN
|
|
|
+ qc_cases d
|
|
|
+ on d.is_deleted = 'N'
|
|
|
+ AND c.cases_id = d.id
|
|
|
+ </if>
|
|
|
LEFT JOIN med_qcresult_cases e
|
|
|
on b.behospital_code = e.behospital_code
|
|
|
and b.hospital_id = e.hospital_id
|
|
@@ -3407,8 +3417,11 @@
|
|
|
t1.behDeptName,
|
|
|
t1.behDoctorName,
|
|
|
t1.patName,
|
|
|
- t1.behospitalCode,
|
|
|
- t1.caseName)tp
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ t1.caseName,
|
|
|
+ </if>
|
|
|
+ t1.behospitalCode
|
|
|
+ )tp
|
|
|
LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
|
|
|
ON tp.behospitalCode = g.behospital_code
|
|
|
AND tp.hospitalId = g.hospital_id
|
|
@@ -3466,9 +3479,11 @@
|
|
|
t1.leaveHospitalDate,
|
|
|
t1.score,
|
|
|
t2.avgScore,
|
|
|
- e.score_res as scoreBn,
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
t1.msg,
|
|
|
- t1.caseName
|
|
|
+ t1.caseName,
|
|
|
+ </if>
|
|
|
+ e.score_res as scoreBn
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
@@ -3479,8 +3494,10 @@
|
|
|
a.behospital_date AS behospitalDate,
|
|
|
a.leave_hospital_date AS leaveHospitalDate,
|
|
|
b.score_res AS score,
|
|
|
- c.msg AS msg,
|
|
|
- d.NAME AS caseName,
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ c.msg AS msg,
|
|
|
+ d.NAME AS caseName,
|
|
|
+ </if>
|
|
|
a.beh_dept_id AS behDeptId,
|
|
|
a.beh_dept_name AS behDeptName,
|
|
|
a.hospital_id AS hospitalId
|
|
@@ -3631,8 +3648,11 @@
|
|
|
t1.behDeptName,
|
|
|
t1.behDoctorName,
|
|
|
t1.patName,
|
|
|
- t1.behospitalCode,
|
|
|
- t1.caseName)tp
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ t1.caseName,
|
|
|
+ </if>
|
|
|
+ t1.behospitalCode
|
|
|
+ )tp
|
|
|
LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
|
|
|
ON tp.behospitalCode = g.behospital_code
|
|
|
AND tp.hospitalId = g.hospital_id
|
|
@@ -3690,9 +3710,11 @@
|
|
|
t1.leaveHospitalDate,
|
|
|
t1.score,
|
|
|
t2.avgScore,
|
|
|
- e.score_res as scoreBn,
|
|
|
- t1.msg,
|
|
|
- t1.caseName
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ t1.msg,
|
|
|
+ t1.caseName,
|
|
|
+ </if>
|
|
|
+ e.score_res as scoreBn
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
@@ -3702,8 +3724,10 @@
|
|
|
a.behospital_date AS behospitalDate,
|
|
|
a.leave_hospital_date AS leaveHospitalDate,
|
|
|
b.score_res AS score,
|
|
|
- c.msg AS msg,
|
|
|
- d.NAME AS caseName,
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ c.msg AS msg,
|
|
|
+ d.NAME AS caseName,
|
|
|
+ </if>
|
|
|
a.beh_dept_id AS behDeptId,
|
|
|
a.beh_dept_name AS behDeptName,
|
|
|
a.hospital_id AS hospitalId
|
|
@@ -3778,7 +3802,7 @@
|
|
|
</if>
|
|
|
) t1 LEFT JOIN med_qcresult_cases e
|
|
|
on t1.behospitalCode = e.behospital_code
|
|
|
- and t1.hospital_id = e.hospital_id
|
|
|
+ and t1.hospitalId = e.hospital_id
|
|
|
AND e.is_deleted = 'N'
|
|
|
and e.cases_id = 243,
|
|
|
(
|
|
@@ -3859,8 +3883,11 @@
|
|
|
t1.behDeptName,
|
|
|
t1.behDoctorName,
|
|
|
t1.patName,
|
|
|
- t1.behospitalCode,
|
|
|
- t1.caseName)tp
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ t1.caseName,
|
|
|
+ </if>
|
|
|
+ t1.behospitalCode
|
|
|
+ )tp
|
|
|
LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
|
|
|
ON tp.behospitalCode = g.behospital_code
|
|
|
AND tp.hospitalId = g.hospital_id
|
|
@@ -3924,7 +3951,7 @@
|
|
|
t1.gmt_create AS gradeTime,
|
|
|
t1.diagnose,
|
|
|
t1.ward_name AS wardName,
|
|
|
- IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
|
|
|
+ CONCAT( ifnull(t2.age,''),ifnull(t2.age_unit,'') )as age,
|
|
|
t1.file_code AS fileCode,
|
|
|
t1.checkStatus,
|
|
|
t1.mrStatus,
|
|
@@ -5190,7 +5217,7 @@
|
|
|
<select id="getAge" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
a.behospital_code as behospitalCode,
|
|
|
- IF(a.age is null, null,CONCAT( a.age,IF(a.age_unit is null, "",a.age_unit)))as age
|
|
|
+ CONCAT( ifnull(a.age,'') ,ifnull(a.age_unit,'') )as age
|
|
|
FROM
|
|
|
med_home_page a
|
|
|
WHERE
|
|
@@ -5237,7 +5264,8 @@
|
|
|
t1.mrName,
|
|
|
t1.chTime,
|
|
|
t1.mrTime,
|
|
|
- t1.file_code AS fileCode
|
|
|
+ CONCAT( ifnull(t2.age,'') ,ifnull(t2.age_unit,'') )as age,
|
|
|
+ t1.file_code AS fileCode
|
|
|
FROM
|
|
|
(
|
|
|
SELECT be.*,
|
|
@@ -5378,13 +5406,17 @@
|
|
|
</if>
|
|
|
<if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
|
|
|
, med_medical_record b,
|
|
|
- med_medical_record_content c
|
|
|
+ med_medical_record_content c,
|
|
|
+ med_home_page t2
|
|
|
WHERE
|
|
|
b.is_deleted = 'N'
|
|
|
and c.is_deleted = 'N'
|
|
|
+ and t2.is_deleted = 'N'
|
|
|
and t1.hospital_id = b.hospital_id
|
|
|
and t1.hospital_id = c.hospital_id
|
|
|
+ and t1.hospital_id = t2.hospital_id
|
|
|
AND t1.behospital_code = b.behospital_code
|
|
|
+ AND t1.behospital_code = t2.behospital_code
|
|
|
AND b.rec_id = c.rec_id
|
|
|
and b.mode_id = '24'
|
|
|
</if>
|
|
@@ -5918,8 +5950,10 @@
|
|
|
f1.score,
|
|
|
f2.avgScore,
|
|
|
f1.scoreBn,
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
f1.msg,
|
|
|
f1.caseName,
|
|
|
+ </if>
|
|
|
f1.checkStatus,
|
|
|
f1.mrStatus,
|
|
|
f1.chName,
|
|
@@ -5935,8 +5969,10 @@
|
|
|
t.leaveHospitalDate AS leaveHospitalDate,
|
|
|
qi.score_res AS score,
|
|
|
t.scoreBn,
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
qd.msg AS msg,
|
|
|
qc.NAME AS caseName,
|
|
|
+ </if>
|
|
|
t.behDeptId,
|
|
|
t.behDeptName,
|
|
|
t.hospitalId,
|
|
@@ -6143,11 +6179,13 @@
|
|
|
LEFT JOIN med_qcresult_info qi ON qi.is_deleted = 'N'
|
|
|
AND t.hospitalId = qi.hospital_id
|
|
|
AND t.behospitalCode = qi.behospital_code
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
LEFT JOIN med_qcresult_detail qd ON qd.is_deleted = 'N'
|
|
|
AND t.hospitalId = qd.hospital_id
|
|
|
AND t.behospitalCode = qd.behospital_code
|
|
|
LEFT JOIN qc_cases qc ON qc.is_deleted = 'N'
|
|
|
AND qd.cases_id = qc.id
|
|
|
+ </if>
|
|
|
where 1=1
|
|
|
<if test="qcResultShortPageVO.checkStatus != null">
|
|
|
and t.checkStatus = #{qcResultShortPageVO.checkStatus}
|
|
@@ -6444,7 +6482,6 @@
|
|
|
t1.gmt_create AS gradeTime,
|
|
|
t1.diagnose AS diagnose,
|
|
|
t1.ward_name AS wardName,
|
|
|
- IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
|
|
|
t1.file_code AS fileCode,
|
|
|
t1.checkStatus AS checkStatus,
|
|
|
t1.mrStatus AS mrStatus,
|
|
@@ -7278,7 +7315,7 @@
|
|
|
t1.gmt_create AS gradeTime,
|
|
|
t1.diagnose,
|
|
|
t1.ward_name AS wardName,
|
|
|
- IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
|
|
|
+ CONCAT( ifnull(t2.age,'') ,ifnull(t2.age_unit,'') )as age,
|
|
|
t1.file_code AS fileCode,
|
|
|
t1.checkStatus,
|
|
|
t1.mrStatus,
|
|
@@ -7433,14 +7470,14 @@
|
|
|
AND d.cases_entry_id = e.id
|
|
|
AND d.cases_id = 243
|
|
|
AND a.qc_type_id != 0
|
|
|
- <if test="qcResultPageVO.titleName != null ">
|
|
|
- <if test="qcResultPageVO.titleName == '不合格数'">
|
|
|
- AND c.`level`='不合格'
|
|
|
- </if>
|
|
|
- <if test="qcResultPageVO.titleName == '合格数'">
|
|
|
- AND c.`level`='合格'
|
|
|
- </if>
|
|
|
- </if>
|
|
|
+<!-- <if test="qcResultPageVO.titleName != null ">-->
|
|
|
+<!-- <if test="qcResultPageVO.titleName == '不合格数'">-->
|
|
|
+<!-- AND c.`level`='不合格'-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="qcResultPageVO.titleName == '合格数'">-->
|
|
|
+<!-- AND c.`level`='合格'-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </if>-->
|
|
|
<if test="qcResultPageVO.isPlacefile != null and qcResultPageVO.isPlacefile != ''">
|
|
|
and a.is_placefile = #{qcResultPageVO.isPlacefile}
|
|
|
</if>
|
|
@@ -7546,7 +7583,7 @@
|
|
|
t1.gmt_create AS gradeTime,
|
|
|
t1.diagnose,
|
|
|
t1.ward_name AS wardName,
|
|
|
- IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
|
|
|
+ CONCAT( ifnull(t2.age,'') ,ifnull(t2.age_unit,'') )as age,
|
|
|
t1.file_code AS fileCode,
|
|
|
t1.checkStatus,
|
|
|
t1.mrStatus,
|
|
@@ -7730,8 +7767,10 @@
|
|
|
f1.score,
|
|
|
f1.scoreBn,
|
|
|
f2.avgScore,
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
f1.msg,
|
|
|
f1.caseName,
|
|
|
+ </if>
|
|
|
f1.checkStatus,
|
|
|
f1.mrStatus,
|
|
|
f1.chName,
|
|
@@ -7746,9 +7785,11 @@
|
|
|
t.behospitalDate AS behospitalDate,
|
|
|
t.leaveHospitalDate AS leaveHospitalDate,
|
|
|
qi.score_res AS score,
|
|
|
- qd.msg AS msg,
|
|
|
t.scoreBn,
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
+ qd.msg AS msg,
|
|
|
qc.NAME AS caseName,
|
|
|
+ </if>
|
|
|
t.behDeptId,
|
|
|
t.behDeptName,
|
|
|
t.hospitalId,
|
|
@@ -7930,6 +7971,7 @@
|
|
|
LEFT JOIN med_qcresult_info qi ON qi.is_deleted = 'N'
|
|
|
AND t.hospitalId = qi.hospital_id
|
|
|
AND t.behospitalCode = qi.behospital_code
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
LEFT JOIN med_qcresult_detail qd ON qd.is_deleted = 'N'
|
|
|
AND t.hospitalId = qd.hospital_id
|
|
|
AND t.behospitalCode = qd.behospital_code
|
|
@@ -7938,6 +7980,7 @@
|
|
|
LEFT JOIN qc_cases_entry qce ON qce.is_deleted = 'N'
|
|
|
AND qd.cases_id = qce.cases_id
|
|
|
AND qd.cases_entry_id = qce.id
|
|
|
+ </if>
|
|
|
where 1=1
|
|
|
<if test="qcResultShortPageVO.checkStatus != null">
|
|
|
AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
|
|
@@ -8060,14 +8103,14 @@
|
|
|
AND c.cases_id = k.cases_id
|
|
|
AND k.cases_id = d.cases_id
|
|
|
AND k.cases_entry_id = d.id
|
|
|
- <if test="qcResultShortPageVO.titleName != null ">
|
|
|
- <if test="qcResultShortPageVO.titleName == '不合格数'">
|
|
|
- AND c.`level`='不合格'
|
|
|
- </if>
|
|
|
- <if test="qcResultShortPageVO.titleName == '合格数'">
|
|
|
- AND c.`level`='合格'
|
|
|
- </if>
|
|
|
- </if>
|
|
|
+<!-- <if test="qcResultShortPageVO.titleName != null ">-->
|
|
|
+<!-- <if test="qcResultShortPageVO.titleName == '不合格数'">-->
|
|
|
+<!-- AND c.`level`='不合格'-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="qcResultShortPageVO.titleName == '合格数'">-->
|
|
|
+<!-- AND c.`level`='合格'-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </if>-->
|
|
|
AND a.qc_type_id != 0
|
|
|
<if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
|
|
|
and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
|
|
@@ -9025,7 +9068,7 @@
|
|
|
t1.gmt_create AS gradeTime,
|
|
|
t1.diagnose,
|
|
|
t1.ward_name AS wardName,
|
|
|
- IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
|
|
|
+ CONCAT( ifnull(t2.age,'') ,ifnull(t2.age_unit,'') )as age,
|
|
|
t1.file_code AS fileCode,
|
|
|
t1.checkStatus,
|
|
|
t1.mrStatus,
|
|
@@ -9268,7 +9311,7 @@
|
|
|
t1.gmt_create AS gradeTime,
|
|
|
t1.diagnose,
|
|
|
t1.ward_name AS wardName,
|
|
|
- IF(t2.age is null, null,CONCAT( t2.age,IF(t2.age_unit is null, "",t2.age_unit)))as age,
|
|
|
+ CONCAT( ifnull(t2.age,'') ,ifnull(t2.age_unit,'') )as age,
|
|
|
t1.file_code AS fileCode,
|
|
|
t1.checkStatus,
|
|
|
t1.mrStatus,
|
|
@@ -9352,7 +9395,7 @@
|
|
|
AND a.beh_dept_name LIKE CONCAT( '%', #{qcResultShortPageVO.deptName}, '%' )
|
|
|
</if>
|
|
|
<if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
|
- AND c.`level` = #{qcResultShortPageVO.level}
|
|
|
+ AND b.`level` = #{qcResultShortPageVO.level}
|
|
|
</if>
|
|
|
<if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
|
|
|
AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
|
|
@@ -9430,8 +9473,10 @@
|
|
|
f1.leaveHospitalDate,
|
|
|
f1.score,
|
|
|
f2.avgScore,
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
f1.msg,
|
|
|
f1.caseName,
|
|
|
+ </if>
|
|
|
f1.checkStatus,
|
|
|
f1.mrStatus,
|
|
|
f1.chName,
|
|
@@ -9446,8 +9491,10 @@
|
|
|
t.behospitalDate AS behospitalDate,
|
|
|
t.leaveHospitalDate AS leaveHospitalDate,
|
|
|
qi.score_res AS score,
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
qd.msg AS msg,
|
|
|
qc.NAME AS caseName,
|
|
|
+ </if>
|
|
|
t.behDeptId,
|
|
|
t.behDeptName,
|
|
|
t.hospitalId,
|
|
@@ -9670,11 +9717,13 @@
|
|
|
LEFT JOIN med_qcresult_info qi ON qi.is_deleted = 'N'
|
|
|
AND t.hospitalId = qi.hospital_id
|
|
|
AND t.behospitalCode = qi.behospital_code
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
LEFT JOIN med_qcresult_detail qd ON qd.is_deleted = 'N'
|
|
|
AND t.hospitalId = qd.hospital_id
|
|
|
AND t.behospitalCode = qd.behospital_code
|
|
|
LEFT JOIN qc_cases qc ON qc.is_deleted = 'N'
|
|
|
AND qd.cases_id = qc.id
|
|
|
+ </if>
|
|
|
where 1=1
|
|
|
<if test="qcResultShortPageVO.checkStatus != null">
|
|
|
AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
|
|
@@ -9966,8 +10015,10 @@
|
|
|
f1.score,
|
|
|
f1.scoreBn,
|
|
|
f2.avgScore,
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
f1.msg,
|
|
|
f1.caseName,
|
|
|
+ </if>
|
|
|
f1.checkStatus,
|
|
|
f1.mrStatus,
|
|
|
f1.chName,
|
|
@@ -9983,8 +10034,10 @@
|
|
|
t.leaveHospitalDate AS leaveHospitalDate,
|
|
|
qi.score_res AS score,
|
|
|
t.scoreBn,
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
qd.msg AS msg,
|
|
|
qc.NAME AS caseName,
|
|
|
+ </if>
|
|
|
t.behDeptId,
|
|
|
t.behDeptName,
|
|
|
t.hospitalId,
|
|
@@ -10146,11 +10199,13 @@
|
|
|
LEFT JOIN med_qcresult_info qi ON qi.is_deleted = 'N'
|
|
|
AND t.hospitalId = qi.hospital_id
|
|
|
AND t.behospitalCode = qi.behospital_code
|
|
|
+ <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
|
|
|
LEFT JOIN med_qcresult_detail qd ON qd.is_deleted = 'N'
|
|
|
AND t.hospitalId = qd.hospital_id
|
|
|
AND t.behospitalCode = qd.behospital_code
|
|
|
LEFT JOIN qc_cases qc ON qc.is_deleted = 'N'
|
|
|
AND qd.cases_id = qc.id
|
|
|
+ </if>
|
|
|
where 1=1
|
|
|
<if test="qcResultShortPageVO.checkStatus != null">
|
|
|
AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
|