|
@@ -2493,4 +2493,77 @@
|
|
|
t1.behospitalCode,
|
|
|
t1.casesName
|
|
|
</select>
|
|
|
+
|
|
|
+ <!-- 条目缺陷质控评分页(内页)-->
|
|
|
+ <select id="qcResultShortPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
|
+ SELECT
|
|
|
+ t1.hospital_id AS hospitalId,
|
|
|
+ t1.behospital_code AS behospitalCode,
|
|
|
+ t1.LEVEL AS level,
|
|
|
+ t1.score_res AS scoreRes,
|
|
|
+ t1.NAME AS patName,
|
|
|
+ t1.sex AS sex,
|
|
|
+ t1.beh_dept_id AS behDeptId,
|
|
|
+ t1.beh_dept_name AS behDeptName,
|
|
|
+ t1.leave_hospital_date AS leaveHospitalDate,
|
|
|
+ t2.age
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT DISTINCT
|
|
|
+ a.hospital_id,
|
|
|
+ a.behospital_code,
|
|
|
+ b.LEVEL,
|
|
|
+ b.score_res,
|
|
|
+ a.NAME,
|
|
|
+ a.sex,
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name,
|
|
|
+ DATE_FORMAT( a.leave_hospital_date, '%Y-%m-%d' ) AS leave_hospital_date
|
|
|
+ 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 >= DATE(#{qcResultShortPageVO.startDate})]]>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.endDate != null ">
|
|
|
+ <![CDATA[AND a.leave_hospital_date < 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 LIKE CONCAT( '%', #{qcResultShortPageVO.casesEntryName}, '%' )
|
|
|
+ </if>
|
|
|
+ ) 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'
|
|
|
+ </select>
|
|
|
</mapper>
|