|
@@ -659,8 +659,8 @@
|
|
|
AND a.behospital_code = b.behospital_code
|
|
|
AND a.is_placefile = '1'
|
|
|
AND (
|
|
|
- ( IFNULL( b.newborn_day, '' ) != '' AND b.newborn_day != '0' )
|
|
|
- OR ( IFNULL( b.newborn_month, '' )!= '' AND b.newborn_month != '0' )
|
|
|
+ ( IFNULL( b.newborn_day, '' ) != '' AND b.newborn_day != '0' AND b.newborn_day != '-' )
|
|
|
+ OR ( IFNULL( b.newborn_month, '' )!= '' AND b.newborn_month != '0' AND b.newborn_month != '-' )
|
|
|
)
|
|
|
<![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
@@ -782,8 +782,8 @@
|
|
|
AND a.behospital_code = b.behospital_code
|
|
|
AND a.beh_dept_id = c.dept_id
|
|
|
AND (
|
|
|
- ( IFNULL( b.newborn_day, '' ) != '' AND b.newborn_day != '0' )
|
|
|
- OR ( IFNULL( b.newborn_month, '' )!= '' AND b.newborn_month != '0' )
|
|
|
+ ( IFNULL( b.newborn_day, '' ) != '' AND b.newborn_day != '0' AND b.newborn_day != '-' )
|
|
|
+ OR ( IFNULL( b.newborn_month, '' )!= '' AND b.newborn_month != '0' AND b.newborn_month != '-' )
|
|
|
)
|
|
|
AND a.is_placefile = '1'
|
|
|
<![CDATA[AND a.qc_type_id <>0 ]]>
|
|
@@ -3743,7 +3743,7 @@
|
|
|
r2.behospital_code AS lastBehospitalCode,
|
|
|
r2.behospital_date AS lastBehospitalDate,
|
|
|
r2.leave_hospital_date AS lastLeaveHospitalDate,
|
|
|
- TIMESTAMPDIFF( DAY, DATE( r2.leave_hospital_date ), DATE( r1.behospital_date ) ) AS diffDay
|
|
|
+ TIMESTAMPDIFF( DAY, DATE( r2.leave_hospital_date ), DATE( r1.behospital_date ) ) AS diffDays
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
@@ -4113,8 +4113,8 @@
|
|
|
AND t1.hospital_id = t2.hospital_id
|
|
|
AND t1.behospital_code = t2.behospital_code
|
|
|
AND (
|
|
|
- ( IFNULL( t2.newborn_day, '' ) != '' AND t2.newborn_day != '0' )
|
|
|
- OR ( IFNULL( t2.newborn_month, '' )!= '' AND t2.newborn_month != '0' )
|
|
|
+ ( IFNULL( t2.newborn_day, '' ) != '' AND t2.newborn_day != '0' AND t2.newborn_day != '-' )
|
|
|
+ OR ( IFNULL( t2.newborn_month, '' )!= '' AND t2.newborn_month != '0' AND t2.newborn_month != '-' )
|
|
|
)
|
|
|
</if>
|
|
|
<if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
|
|
@@ -4688,8 +4688,8 @@
|
|
|
AND t1.hospital_id = t2.hospital_id
|
|
|
AND t1.behospital_code = t2.behospital_code
|
|
|
AND (
|
|
|
- ( IFNULL( t2.newborn_day, '' ) != '' AND t2.newborn_day != '0' )
|
|
|
- OR ( IFNULL( t2.newborn_month, '' )!= '' AND t2.newborn_month != '0' )
|
|
|
+ ( IFNULL( t2.newborn_day, '' ) != '' AND t2.newborn_day != '0' AND t2.newborn_day != '-' )
|
|
|
+ OR ( IFNULL( t2.newborn_month, '' )!= '' AND t2.newborn_month != '0' AND t2.newborn_month != '-' )
|
|
|
)
|
|
|
</if>
|
|
|
<if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
|
|
@@ -4861,8 +4861,8 @@
|
|
|
AND t1.hospital_id = t2.hospital_id
|
|
|
AND t1.behospital_code = t2.behospital_code
|
|
|
AND (
|
|
|
- ( IFNULL( t2.newborn_day, '' ) != '' AND t2.newborn_day != '0' )
|
|
|
- OR ( IFNULL( t2.newborn_month, '' )!= '' AND t2.newborn_month != '0' )
|
|
|
+ ( IFNULL( t2.newborn_day, '' ) != '' AND t2.newborn_day != '0' AND t2.newborn_day != '-' )
|
|
|
+ OR ( IFNULL( t2.newborn_month, '' )!= '' AND t2.newborn_month != '0' AND t2.newborn_month != '-' )
|
|
|
)
|
|
|
</if>
|
|
|
<if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
|
|
@@ -5302,4 +5302,775 @@
|
|
|
f1.behDeptId = f2.behDeptId
|
|
|
AND f1.behDeptName = f2.behDeptName
|
|
|
</select>
|
|
|
+
|
|
|
+ <!-- 未整改病历统计-->
|
|
|
+ <select id="unModifyMRStatistics" resultType="com.diagbot.dto.UnModifyMRDetailDTO" parameterType="com.diagbot.vo.FilterUnModifyMRVO">
|
|
|
+ SELECT
|
|
|
+ a.beh_dept_id AS deptId,
|
|
|
+ a.beh_dept_name AS deptName,
|
|
|
+ d.id AS casesEntryId,
|
|
|
+ d.NAME AS casesEntryName,
|
|
|
+ count(*) AS casesEntryNum
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_info b,
|
|
|
+ med_qcresult_detail c,
|
|
|
+ qc_cases_entry d
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = b.hospital_id
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.behospital_code = b.behospital_code
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND c.cases_entry_id = d.id
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ AND a.is_placefile = '1'
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND a.beh_dept_name like CONCAT('%', #{name}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="casesEntryIds != null and casesEntryIds.size()>0">
|
|
|
+ AND c.cases_entry_id IN
|
|
|
+ <foreach collection="casesEntryIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name,
|
|
|
+ c.cases_entry_id,
|
|
|
+ d.NAME
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 未整改病历质控评分页(内页)-->
|
|
|
+ <select id="unModifyMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
|
+ SELECT t.*
|
|
|
+ FROM
|
|
|
+ (SELECT DISTINCT
|
|
|
+ t1.hospital_id AS hospitalId,
|
|
|
+ t1.behospital_code AS behospitalCode,
|
|
|
+ t1.bed_code AS bedCode,
|
|
|
+ t1.LEVEL AS LEVEL,
|
|
|
+ t1.grade_type AS gradeType,
|
|
|
+ t1.score_res AS scoreRes,
|
|
|
+ t1.NAME AS NAME,
|
|
|
+ t1.sex AS sex,
|
|
|
+ t1.beh_dept_id AS behDeptId,
|
|
|
+ t1.beh_dept_name AS behDeptName,
|
|
|
+ t1.doctor_id AS doctorId,
|
|
|
+ t1.doctor_name AS doctorName,
|
|
|
+ t1.beh_doctor_id AS behDoctorId,
|
|
|
+ t1.beh_doctor_name AS behDoctorName,
|
|
|
+ t1.director_doctor_id AS directorDoctorId,
|
|
|
+ t1.director_doctor_name AS directorDoctorName,
|
|
|
+ t1.birthday AS birthday,
|
|
|
+ t1.behospital_date AS behospitalDate,
|
|
|
+ t1.leave_hospital_date AS leaveHospitalDate,
|
|
|
+ t1.placefile_date AS placefileDate,
|
|
|
+ t1.gmt_create AS gradeTime,
|
|
|
+ t1.diagnose,
|
|
|
+ t1.ward_name AS wardName,
|
|
|
+ t2.age,
|
|
|
+ t1.file_code AS fileCode,
|
|
|
+ t1.checkStatus
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ be.*,
|
|
|
+ ifnull(mci.status,0) AS checkStatus
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT DISTINCT
|
|
|
+ a.hospital_id,
|
|
|
+ a.behospital_code,
|
|
|
+ a.bed_code,
|
|
|
+ a.file_code,
|
|
|
+ b.LEVEL,
|
|
|
+ b.grade_type,
|
|
|
+ b.score_res,
|
|
|
+ a.NAME,
|
|
|
+ a.sex,
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name,
|
|
|
+ a.birthday,
|
|
|
+ a.behospital_date,
|
|
|
+ a.leave_hospital_date,
|
|
|
+ a.doctor_id,
|
|
|
+ a.doctor_name,
|
|
|
+ a.beh_doctor_id,
|
|
|
+ a.beh_doctor_name,
|
|
|
+ a.director_doctor_id,
|
|
|
+ a.director_doctor_name,
|
|
|
+ a.diagnose,
|
|
|
+ a.placefile_date,
|
|
|
+ a.ward_name,
|
|
|
+ b.gmt_create
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_info b,
|
|
|
+ med_qcresult_detail c,
|
|
|
+ qc_cases_entry d
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = b.hospital_id
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.behospital_code = b.behospital_code
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND c.cases_id = d.cases_id
|
|
|
+ AND c.cases_entry_id = d.id
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ AND a.is_placefile = 1
|
|
|
+ <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.endDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
|
|
|
+ AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
|
+ AND b.`level` = #{qcResultShortPageVO.level}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
|
|
|
+ AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.patName != null and qcResultShortPageVO.patName != ''">
|
|
|
+ AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
|
|
|
+ AND d.NAME = #{qcResultShortPageVO.casesEntryName}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
|
|
|
+ AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
|
|
|
+ OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
|
|
|
+ OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
|
|
|
+ AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
+ OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
+ OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId != null ">
|
|
|
+ AND d.id = #{qcResultShortPageVO.casesEntryId}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.isReject != null">
|
|
|
+ AND c.is_reject = #{qcResultShortPageVO.isReject}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.ruleType != null">
|
|
|
+ AND d.rule_type = #{qcResultShortPageVO.ruleType}
|
|
|
+ </if>
|
|
|
+ )be
|
|
|
+ left join med_check_info mci
|
|
|
+ on mci.is_deleted = 'N'
|
|
|
+ and be.hospital_id = mci.hospital_id
|
|
|
+ and be.behospital_code = mci.behospital_code
|
|
|
+ ) t1
|
|
|
+ LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
|
|
|
+ AND t1.behospital_code = t2.behospital_code
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
+ ) t
|
|
|
+ where 1=1
|
|
|
+ <if test="qcResultShortPageVO.checkStatus != null">
|
|
|
+ AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 未整改病历缺陷评分详情页导出-->
|
|
|
+ <select id="unModifyMRPageExport" resultMap="ExportExcelMap">
|
|
|
+ SELECT
|
|
|
+ f1.behDeptId,
|
|
|
+ f1.behDeptName,
|
|
|
+ f1.behDoctorName,
|
|
|
+ f1.patName,
|
|
|
+ f1.behospitalCode,
|
|
|
+ f1.hospitalId,
|
|
|
+ f1.behospitalDate,
|
|
|
+ f1.leaveHospitalDate,
|
|
|
+ f1.score,
|
|
|
+ f2.avgScore,
|
|
|
+ f1.msg,
|
|
|
+ f1.caseName,
|
|
|
+ f1.checkStatus
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ CONCAT( ifnull( t.directorDoctorName, '' ), '\n', t.doctorName ) AS behDoctorName,
|
|
|
+ t.`name` AS patName,
|
|
|
+ t.behospitalCode AS behospitalCode,
|
|
|
+ t.behospitalDate AS behospitalDate,
|
|
|
+ t.leaveHospitalDate AS leaveHospitalDate,
|
|
|
+ qi.score_res AS score,
|
|
|
+ qd.msg AS msg,
|
|
|
+ qc.NAME AS caseName,
|
|
|
+ t.behDeptId,
|
|
|
+ t.behDeptName,
|
|
|
+ t.hospitalId,
|
|
|
+ t.checkStatus
|
|
|
+ FROM
|
|
|
+ (SELECT DISTINCT
|
|
|
+ t1.hospital_id AS hospitalId,
|
|
|
+ t1.behospital_code AS behospitalCode,
|
|
|
+ t1.bed_code AS bedCode,
|
|
|
+ t1.LEVEL AS LEVEL,
|
|
|
+ t1.grade_type AS gradeType,
|
|
|
+ t1.score_res AS scoreRes,
|
|
|
+ t1.NAME AS NAME,
|
|
|
+ t1.sex AS sex,
|
|
|
+ t1.beh_dept_id AS behDeptId,
|
|
|
+ t1.beh_dept_name AS behDeptName,
|
|
|
+ t1.doctor_id AS doctorId,
|
|
|
+ t1.doctor_name AS doctorName,
|
|
|
+ t1.beh_doctor_id AS behDoctorId,
|
|
|
+ t1.beh_doctor_name AS behDoctorName,
|
|
|
+ t1.director_doctor_id AS directorDoctorId,
|
|
|
+ t1.director_doctor_name AS directorDoctorName,
|
|
|
+ t1.birthday AS birthday,
|
|
|
+ t1.behospital_date AS behospitalDate,
|
|
|
+ t1.leave_hospital_date AS leaveHospitalDate,
|
|
|
+ t1.placefile_date AS placefileDate,
|
|
|
+ t1.gmt_create AS gradeTime,
|
|
|
+ t1.diagnose,
|
|
|
+ t1.ward_name AS wardName,
|
|
|
+ t2.age,
|
|
|
+ t1.file_code AS fileCode,
|
|
|
+ t1.checkStatus
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ be.*,
|
|
|
+ ifnull(mci.status,0) AS checkStatus
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT DISTINCT
|
|
|
+ a.hospital_id,
|
|
|
+ a.behospital_code,
|
|
|
+ a.bed_code,
|
|
|
+ a.file_code,
|
|
|
+ b.LEVEL,
|
|
|
+ b.grade_type,
|
|
|
+ b.score_res,
|
|
|
+ a.NAME,
|
|
|
+ a.sex,
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name,
|
|
|
+ a.birthday,
|
|
|
+ a.behospital_date,
|
|
|
+ a.leave_hospital_date,
|
|
|
+ a.doctor_id,
|
|
|
+ a.doctor_name,
|
|
|
+ a.beh_doctor_id,
|
|
|
+ a.beh_doctor_name,
|
|
|
+ a.director_doctor_id,
|
|
|
+ a.director_doctor_name,
|
|
|
+ a.diagnose,
|
|
|
+ a.placefile_date,
|
|
|
+ a.ward_name,
|
|
|
+ b.gmt_create
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_info b,
|
|
|
+ med_qcresult_detail c,
|
|
|
+ qc_cases_entry d
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = b.hospital_id
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.behospital_code = b.behospital_code
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND c.cases_id = d.cases_id
|
|
|
+ AND c.cases_entry_id = d.id
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ AND a.is_placefile = 1
|
|
|
+ <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.endDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
|
|
|
+ AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
|
+ AND b.`level` = #{qcResultShortPageVO.level}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
|
|
|
+ AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.patName != null and qcResultShortPageVO.patName != ''">
|
|
|
+ AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
|
|
|
+ AND d.NAME = #{qcResultShortPageVO.casesEntryName}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
|
|
|
+ AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
|
|
|
+ OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
|
|
|
+ OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
|
|
|
+ AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
+ OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
+ OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId != null ">
|
|
|
+ AND d.id = #{qcResultShortPageVO.casesEntryId}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.isReject != null">
|
|
|
+ AND c.is_reject = #{qcResultShortPageVO.isReject}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.ruleType != null">
|
|
|
+ AND d.rule_type = #{qcResultShortPageVO.ruleType}
|
|
|
+ </if>
|
|
|
+ )be
|
|
|
+ left join med_check_info mci
|
|
|
+ on mci.is_deleted = 'N'
|
|
|
+ and be.hospital_id = mci.hospital_id
|
|
|
+ and be.behospital_code = mci.behospital_code
|
|
|
+ ) t1
|
|
|
+ LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
|
|
|
+ AND t1.behospital_code = t2.behospital_code
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
+ ) t
|
|
|
+ LEFT JOIN med_qcresult_info qi ON qi.is_deleted = 'N'
|
|
|
+ AND t.hospitalId = qi.hospital_id
|
|
|
+ AND t.behospitalCode = qi.behospital_code
|
|
|
+ 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
|
|
|
+ where 1=1
|
|
|
+ <if test="qcResultShortPageVO.checkStatus != null">
|
|
|
+ AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
|
|
|
+ </if>
|
|
|
+ )f1,
|
|
|
+ (SELECT
|
|
|
+ ROUND( AVG( qi.score_res ), 2 ) AS avgScore,
|
|
|
+ t.behDeptId,
|
|
|
+ t.behDeptName
|
|
|
+ FROM
|
|
|
+ (SELECT DISTINCT
|
|
|
+ t1.hospital_id AS hospitalId,
|
|
|
+ t1.behospital_code AS behospitalCode,
|
|
|
+ t1.bed_code AS bedCode,
|
|
|
+ t1.LEVEL AS LEVEL,
|
|
|
+ t1.grade_type AS gradeType,
|
|
|
+ t1.score_res AS scoreRes,
|
|
|
+ t1.NAME AS NAME,
|
|
|
+ t1.sex AS sex,
|
|
|
+ t1.beh_dept_id AS behDeptId,
|
|
|
+ t1.beh_dept_name AS behDeptName,
|
|
|
+ t1.doctor_id AS doctorId,
|
|
|
+ t1.doctor_name AS doctorName,
|
|
|
+ t1.beh_doctor_id AS behDoctorId,
|
|
|
+ t1.beh_doctor_name AS behDoctorName,
|
|
|
+ t1.director_doctor_id AS directorDoctorId,
|
|
|
+ t1.director_doctor_name AS directorDoctorName,
|
|
|
+ t1.birthday AS birthday,
|
|
|
+ t1.behospital_date AS behospitalDate,
|
|
|
+ t1.leave_hospital_date AS leaveHospitalDate,
|
|
|
+ t1.placefile_date AS placefileDate,
|
|
|
+ t1.gmt_create AS gradeTime,
|
|
|
+ t1.diagnose,
|
|
|
+ t1.ward_name AS wardName,
|
|
|
+ t2.age,
|
|
|
+ t1.file_code AS fileCode,
|
|
|
+ t1.checkStatus
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ be.*,
|
|
|
+ ifnull(mci.status,0) AS checkStatus
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT DISTINCT
|
|
|
+ a.hospital_id,
|
|
|
+ a.behospital_code,
|
|
|
+ a.bed_code,
|
|
|
+ a.file_code,
|
|
|
+ b.LEVEL,
|
|
|
+ b.grade_type,
|
|
|
+ b.score_res,
|
|
|
+ a.NAME,
|
|
|
+ a.sex,
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name,
|
|
|
+ a.birthday,
|
|
|
+ a.behospital_date,
|
|
|
+ a.leave_hospital_date,
|
|
|
+ a.doctor_id,
|
|
|
+ a.doctor_name,
|
|
|
+ a.beh_doctor_id,
|
|
|
+ a.beh_doctor_name,
|
|
|
+ a.director_doctor_id,
|
|
|
+ a.director_doctor_name,
|
|
|
+ a.diagnose,
|
|
|
+ a.placefile_date,
|
|
|
+ a.ward_name,
|
|
|
+ b.gmt_create
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_info b,
|
|
|
+ med_qcresult_detail c,
|
|
|
+ qc_cases_entry d
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = b.hospital_id
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.behospital_code = b.behospital_code
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND c.cases_id = d.cases_id
|
|
|
+ AND c.cases_entry_id = d.id
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ AND a.is_placefile = 1
|
|
|
+ <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.endDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
|
|
|
+ AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
|
+ AND b.`level` = #{qcResultShortPageVO.level}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
|
|
|
+ AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.patName != null and qcResultShortPageVO.patName != ''">
|
|
|
+ AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
|
|
|
+ AND d.NAME = #{qcResultShortPageVO.casesEntryName}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
|
|
|
+ AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
|
|
|
+ OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
|
|
|
+ OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
|
|
|
+ AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
+ OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
+ OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId != null ">
|
|
|
+ AND d.id = #{qcResultShortPageVO.casesEntryId}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.isReject != null">
|
|
|
+ AND c.is_reject = #{qcResultShortPageVO.isReject}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.ruleType != null">
|
|
|
+ AND d.rule_type = #{qcResultShortPageVO.ruleType}
|
|
|
+ </if>
|
|
|
+ )be
|
|
|
+ left join med_check_info mci
|
|
|
+ on mci.is_deleted = 'N'
|
|
|
+ and be.hospital_id = mci.hospital_id
|
|
|
+ and be.behospital_code = mci.behospital_code
|
|
|
+
|
|
|
+ ) t1
|
|
|
+ LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
|
|
|
+ AND t1.behospital_code = t2.behospital_code
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
+
|
|
|
+ ) t
|
|
|
+ LEFT JOIN med_qcresult_info qi ON qi.is_deleted = 'N'
|
|
|
+ AND t.hospitalId = qi.hospital_id
|
|
|
+ AND t.behospitalCode = qi.behospital_code
|
|
|
+ where 1=1
|
|
|
+ <if test="qcResultShortPageVO.checkStatus != null">
|
|
|
+ AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ t.behDeptId,
|
|
|
+ t.behDeptName
|
|
|
+ )f2
|
|
|
+ WHERE
|
|
|
+ f1.behDeptId = f2.behDeptId
|
|
|
+ AND f1.behDeptName = f2.behDeptName
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 31天再入院详情页-->
|
|
|
+ <select id="reHos31DaysPage" resultType="com.diagbot.dto.ReBeHosMergeDTO">
|
|
|
+ SELECT
|
|
|
+ t.fileCode,
|
|
|
+ t.diagnose,
|
|
|
+ t.NAME,
|
|
|
+ t.sex,
|
|
|
+ t.hospitalId,
|
|
|
+ t.behDeptId,
|
|
|
+ t.behDeptName,
|
|
|
+ t.behospitalCode,
|
|
|
+ t.behospitalDate,
|
|
|
+ t.leaveHospitalDate,
|
|
|
+ t.lastBehDeptId,
|
|
|
+ t.lastBehDeptName,
|
|
|
+ t.lastBehospitalCode,
|
|
|
+ t.lastBehospitalDate,
|
|
|
+ t.lastLeaveHospitalDate,
|
|
|
+ t.diffDays,
|
|
|
+ mqi.score_res AS scoreRes,
|
|
|
+ mqi.LEVEL AS LEVEL,
|
|
|
+ mqi_last.score_res AS lastScoreRes,
|
|
|
+ mqi_last.LEVEL AS lastLevel
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ be.fileCode,
|
|
|
+ be.diagnose,
|
|
|
+ be.NAME,
|
|
|
+ be.sex,
|
|
|
+ be.hospitalId,
|
|
|
+ be.behDeptId,
|
|
|
+ be.behDeptName,
|
|
|
+ be.behospitalCode,
|
|
|
+ be.behospitalDate,
|
|
|
+ be.leaveHospitalDate,
|
|
|
+ be.lastBehDeptId,
|
|
|
+ be.lastBehDeptName,
|
|
|
+ be.lastBehospitalCode,
|
|
|
+ be.lastBehospitalDate,
|
|
|
+ be.lastLeaveHospitalDate,
|
|
|
+ be.diffDays
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ r1.file_code AS fileCode,
|
|
|
+ r1.diagnose,
|
|
|
+ r1.NAME,
|
|
|
+ r1.sex,
|
|
|
+ r1.hospital_id AS hospitalId,
|
|
|
+ r1.beh_dept_id AS behDeptId,
|
|
|
+ r1.beh_dept_name AS behDeptName,
|
|
|
+ r1.behospital_code AS behospitalCode,
|
|
|
+ r1.behospital_date AS behospitalDate,
|
|
|
+ r1.leave_hospital_date AS leaveHospitalDate,
|
|
|
+ r2.beh_dept_id AS lastBehDeptId,
|
|
|
+ r2.beh_dept_name AS lastBehDeptName,
|
|
|
+ r2.behospital_code AS lastBehospitalCode,
|
|
|
+ r2.behospital_date AS lastBehospitalDate,
|
|
|
+ r2.leave_hospital_date AS lastLeaveHospitalDate,
|
|
|
+ TIMESTAMPDIFF( DAY, DATE( r2.leave_hospital_date ), DATE( r1.behospital_date ) ) AS diffDays
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ( @rownum := @rownum + 1 ) AS rownum,
|
|
|
+ t1.file_code,
|
|
|
+ t1.diagnose,
|
|
|
+ t1.NAME,
|
|
|
+ t1.sex,
|
|
|
+ t1.hospital_id,
|
|
|
+ t1.beh_dept_id,
|
|
|
+ t1.beh_dept_name,
|
|
|
+ t1.behospital_code,
|
|
|
+ t1.behospital_date,
|
|
|
+ t1.leave_hospital_date
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ tt1.file_code,
|
|
|
+ tt1.diagnose,
|
|
|
+ tt2.NAME,
|
|
|
+ tt2.sex,
|
|
|
+ tt2.hospital_id,
|
|
|
+ tt2.beh_dept_id,
|
|
|
+ tt2.beh_dept_name,
|
|
|
+ tt2.behospital_code,
|
|
|
+ tt2.behospital_date,
|
|
|
+ tt2.leave_hospital_date
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.file_code,
|
|
|
+ a.diagnose
|
|
|
+ FROM
|
|
|
+ med_behospital_info a
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND a.is_placefile = 1
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ AND IFNULL( a.diagnose, '' )!= ''
|
|
|
+ AND IFNULL( a.file_code, '' )!= ''
|
|
|
+ <if test="reBeHosPageVO.hospitalId != null and reBeHosPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{reBeHosPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.startDate != null">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{reBeHosPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.endDate != null">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{reBeHosPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.fileCode != null and reBeHosPageVO.fileCode != ''">
|
|
|
+ AND a.file_code like concat('%', #{reBeHosPageVO.fileCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.name != null and reBeHosPageVO.name != ''">
|
|
|
+ AND a.name like concat('%', #{reBeHosPageVO.name},'%')
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ a.file_code,
|
|
|
+ a.diagnose
|
|
|
+ HAVING
|
|
|
+ count(*)> 1
|
|
|
+ ) tt1,
|
|
|
+ med_behospital_info tt2
|
|
|
+ WHERE
|
|
|
+ tt2.is_deleted = 'N'
|
|
|
+ AND tt2.is_placefile = 1
|
|
|
+ AND tt2.qc_type_id != 0
|
|
|
+ AND tt1.file_code = tt2.file_code
|
|
|
+ AND tt1.diagnose = tt2.diagnose
|
|
|
+ <if test="reBeHosPageVO.hospitalId != null and reBeHosPageVO.hospitalId != ''">
|
|
|
+ AND tt2.hospital_id = #{reBeHosPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.startDate != null">
|
|
|
+ <![CDATA[ AND tt2.leave_hospital_date >= #{reBeHosPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.endDate != null">
|
|
|
+ <![CDATA[ AND tt2.leave_hospital_date <= #{reBeHosPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.fileCode != null and reBeHosPageVO.fileCode != ''">
|
|
|
+ AND tt2.file_code like concat('%', #{reBeHosPageVO.fileCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.name != null and reBeHosPageVO.name != ''">
|
|
|
+ AND tt2.name like concat('%', #{reBeHosPageVO.name},'%')
|
|
|
+ </if>
|
|
|
+ ORDER BY
|
|
|
+ tt1.file_code,
|
|
|
+ tt1.diagnose,
|
|
|
+ tt2.behospital_date DESC
|
|
|
+ ) t1,
|
|
|
+ ( SELECT @rownum := 0 ) r
|
|
|
+ ) r1
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ ( @INDEX := @INDEX + 1 ) AS rownum,
|
|
|
+ t1.file_code,
|
|
|
+ t1.diagnose,
|
|
|
+ t1.NAME,
|
|
|
+ t1.sex,
|
|
|
+ t1.hospital_id,
|
|
|
+ t1.beh_dept_id,
|
|
|
+ t1.beh_dept_name,
|
|
|
+ t1.behospital_code,
|
|
|
+ t1.behospital_date,
|
|
|
+ t1.leave_hospital_date
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ tt1.file_code,
|
|
|
+ tt1.diagnose,
|
|
|
+ tt2.NAME,
|
|
|
+ tt2.sex,
|
|
|
+ tt2.hospital_id,
|
|
|
+ tt2.beh_dept_id,
|
|
|
+ tt2.beh_dept_name,
|
|
|
+ tt2.behospital_code,
|
|
|
+ tt2.behospital_date,
|
|
|
+ tt2.leave_hospital_date
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.file_code,
|
|
|
+ a.diagnose
|
|
|
+ FROM
|
|
|
+ med_behospital_info a
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND a.is_placefile = 1
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ AND IFNULL( a.diagnose, '' )!= ''
|
|
|
+ AND IFNULL( a.file_code, '' )!= ''
|
|
|
+ <if test="reBeHosPageVO.hospitalId != null and reBeHosPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{reBeHosPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{reBeHosPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.endDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{reBeHosPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.fileCode != null and reBeHosPageVO.fileCode != ''">
|
|
|
+ AND a.file_code like concat('%', #{reBeHosPageVO.fileCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.name != null and reBeHosPageVO.name != ''">
|
|
|
+ AND a.name like concat('%', #{reBeHosPageVO.name},'%')
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ a.file_code,
|
|
|
+ a.diagnose
|
|
|
+ HAVING
|
|
|
+ count(*)> 1
|
|
|
+ ) tt1,
|
|
|
+ med_behospital_info tt2
|
|
|
+ WHERE
|
|
|
+ tt2.is_deleted = 'N'
|
|
|
+ AND tt2.is_placefile = 1
|
|
|
+ AND tt2.qc_type_id != 0
|
|
|
+ AND tt1.file_code = tt2.file_code
|
|
|
+ AND tt1.diagnose = tt2.diagnose
|
|
|
+ <if test="reBeHosPageVO.hospitalId != null and reBeHosPageVO.hospitalId != ''">
|
|
|
+ AND tt2.hospital_id = #{reBeHosPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.startDate != null ">
|
|
|
+ <![CDATA[ AND tt2.leave_hospital_date >= #{reBeHosPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.endDate != null ">
|
|
|
+ <![CDATA[ AND tt2.leave_hospital_date <= #{reBeHosPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.fileCode != null and reBeHosPageVO.fileCode != ''">
|
|
|
+ AND tt2.file_code like concat('%', #{reBeHosPageVO.fileCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="reBeHosPageVO.name != null and reBeHosPageVO.name != ''">
|
|
|
+ AND tt2.name like concat('%', #{reBeHosPageVO.name},'%')
|
|
|
+ </if>
|
|
|
+ ORDER BY
|
|
|
+ tt1.file_code,
|
|
|
+ tt1.diagnose,
|
|
|
+ tt2.behospital_date DESC
|
|
|
+ ) t1,(
|
|
|
+ SELECT
|
|
|
+ @INDEX := 0
|
|
|
+ ) r
|
|
|
+ ) r2 ON r1.file_code = r2.file_code
|
|
|
+ AND r1.rownum = r2.rownum - 1
|
|
|
+ ) be
|
|
|
+ WHERE
|
|
|
+ be.diffDays IS NOT NULL
|
|
|
+ AND be.diffDays BETWEEN 0
|
|
|
+ AND 31
|
|
|
+ ) t
|
|
|
+ LEFT JOIN med_qcresult_info mqi ON mqi.is_deleted = 'N'
|
|
|
+ AND t.hospitalId = mqi.hospital_id
|
|
|
+ AND t.behospitalCode = mqi.behospital_code
|
|
|
+ LEFT JOIN med_qcresult_info mqi_last ON mqi_last.is_deleted = 'N'
|
|
|
+ AND t.hospitalId = mqi_last.hospital_id
|
|
|
+ AND t.lastBehospitalCode = mqi_last.behospital_code
|
|
|
+ </select>
|
|
|
</mapper>
|