|
@@ -2496,4 +2496,427 @@
|
|
|
) t2
|
|
|
)t
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 缺陷详情-个人(分页) -->
|
|
|
+ <select id="getDoctorDetailPage" resultType="com.diagbot.dto.GetDoctorDetailPageDTO">
|
|
|
+ SELECT
|
|
|
+ t.*
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ t1.deptId,
|
|
|
+ t1.deptName,
|
|
|
+ t1.id,
|
|
|
+ t1.NAME,
|
|
|
+ t1.casesId,
|
|
|
+ t1.casesName,
|
|
|
+ t1.num,
|
|
|
+ t2.totleNum,
|
|
|
+ t1.doctorId,
|
|
|
+ t1.ruleType,
|
|
|
+ t1.isReject,
|
|
|
+ t1.doctorName,
|
|
|
+ ROUND( t1.num / t2.totleNum, 4 ) AS percent,
|
|
|
+ CONCAT( ROUND( t1.num / t2.totleNum * 100, 2 ), '%' ) AS percentStr
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ tt1.beh_dept_id AS deptId,
|
|
|
+ tt1.beh_dept_name AS deptName,
|
|
|
+ tt2.id AS id,
|
|
|
+ tt2.NAME AS NAME,
|
|
|
+ tt2.cases_id AS casesId,
|
|
|
+ tt2.cases_name AS casesName,
|
|
|
+ tt1.num,
|
|
|
+ tt1.doctor_id AS doctorId,
|
|
|
+ tt1.doctor_name AS doctorName,
|
|
|
+ tt2.rule_type AS ruleType,
|
|
|
+ tt1.is_reject AS isReject
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name,
|
|
|
+ d.cases_id,
|
|
|
+ d.cases_entry_id,
|
|
|
+ CASE a.doctor_id WHEN NULL THEN "-" ELSE a.doctor_id END doctor_id,
|
|
|
+ CASE a.doctor_name WHEN NULL THEN "-" ELSE a.doctor_name END doctor_name,
|
|
|
+ d.is_reject,
|
|
|
+ count(*) AS num
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_detail d
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = d.hospital_id
|
|
|
+ AND a.behospital_code = d.behospital_code
|
|
|
+ <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{getDoctorDetailPageVO.isPlacefile}
|
|
|
+ </if>
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ <if test="getDoctorDetailPageVO.hospitalId != null and getDoctorDetailPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{getDoctorDetailPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile == 0">
|
|
|
+ <if test="getDoctorDetailPageVO.startDate != null and getDoctorDetailPageVO.startDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{getDoctorDetailPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.endDate != null and getDoctorDetailPageVO.endDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{getDoctorDetailPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile == 1">
|
|
|
+ <if test="getDoctorDetailPageVO.startDate != null and getDoctorDetailPageVO.startDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{getDoctorDetailPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.endDate != null and getDoctorDetailPageVO.endDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{getDoctorDetailPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.deptName != null and getDoctorDetailPageVO.deptName != ''">
|
|
|
+ AND a.beh_dept_name = #{getDoctorDetailPageVO.deptName}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.deptId != null and getDoctorDetailPageVO.deptId != ''">
|
|
|
+ AND a.beh_dept_id = #{getDoctorDetailPageVO.deptId}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.doctorId != null and getDoctorDetailPageVO.doctorId != ''">
|
|
|
+ AND a.doctor_id = #{getDoctorDetailPageVO.doctorId}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.doctorName != null and getDoctorDetailPageVO.doctorName != ''">
|
|
|
+ AND a.doctor_name = #{getDoctorDetailPageVO.doctorName}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.casesId != null and getDoctorDetailPageVO.casesId != 0">
|
|
|
+ AND d.cases_id = #{getDoctorDetailPageVO.casesId}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.isReject != null">
|
|
|
+ AND d.is_reject = #{getDoctorDetailPageVO.isReject}
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ d.cases_entry_id,
|
|
|
+ d.cases_id
|
|
|
+ ) tt1,
|
|
|
+ qc_cases_entry tt2
|
|
|
+ WHERE
|
|
|
+ tt2.is_deleted = 'N'
|
|
|
+ AND tt1.cases_id = tt2.cases_id
|
|
|
+ AND tt1.cases_entry_id = tt2.id
|
|
|
+ <if test="getDoctorDetailPageVO.casesName != null and getDoctorDetailPageVO.casesName != ''">
|
|
|
+ AND tt2.cases_name like CONCAT('%', #{getDoctorDetailPageVO.casesName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.name != null and getDoctorDetailPageVO.name != ''">
|
|
|
+ AND tt2.name like CONCAT('%', #{getDoctorDetailPageVO.name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.ruleType != null">
|
|
|
+ AND tt2.rule_type = #{getDoctorDetailPageVO.ruleType}
|
|
|
+ </if>
|
|
|
+ ) t1,(
|
|
|
+ SELECT
|
|
|
+ count(*) AS totleNum
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_detail d,
|
|
|
+ qc_cases_entry e
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = d.hospital_id
|
|
|
+ AND a.behospital_code = d.behospital_code
|
|
|
+ <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{getDoctorDetailPageVO.isPlacefile}
|
|
|
+ </if>
|
|
|
+ AND e.cases_id = d.cases_id
|
|
|
+ AND e.id = d.cases_entry_id
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ <if test="getDoctorDetailPageVO.hospitalId != null and getDoctorDetailPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{getDoctorDetailPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile == 0">
|
|
|
+ <if test="getDoctorDetailPageVO.startDate != null and getDoctorDetailPageVO.startDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{getDoctorDetailPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.endDate != null and getDoctorDetailPageVO.endDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{getDoctorDetailPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile == 1">
|
|
|
+ <if test="getDoctorDetailPageVO.startDate != null and getDoctorDetailPageVO.startDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{getDoctorDetailPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.endDate != null and getDoctorDetailPageVO.endDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{getDoctorDetailPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.deptName != null and getDoctorDetailPageVO.deptName != ''">
|
|
|
+ AND a.beh_dept_name = #{getDoctorDetailPageVO.deptName}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.doctorName != null and getDoctorDetailPageVO.doctorName != ''">
|
|
|
+ AND a.doctor_name = #{getDoctorDetailPageVO.doctorName}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.deptId != null and getDoctorDetailPageVO.deptId != ''">
|
|
|
+ AND a.beh_dept_id = #{getDoctorDetailPageVO.deptId}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.doctorId != null and getDoctorDetailPageVO.doctorId != ''">
|
|
|
+ AND a.doctor_id = #{getDoctorDetailPageVO.doctorId}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.isReject != null">
|
|
|
+ AND d.is_reject = #{getDoctorDetailPageVO.isReject}
|
|
|
+ </if>
|
|
|
+ <if test="getDoctorDetailPageVO.ruleType != null">
|
|
|
+ AND e.rule_type = #{getDoctorDetailPageVO.ruleType}
|
|
|
+ </if>
|
|
|
+ ) t2
|
|
|
+ )t
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 获取缺陷数量对应的病历 -->
|
|
|
+ <select id="getDetailRecordListPage" resultType="com.diagbot.dto.GetDetailRecordListPageDTO">
|
|
|
+ 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.scoreBn,
|
|
|
+ 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,
|
|
|
+ CONCAT( ifnull(t2.age,''),ifnull(t2.age_unit,'') )as age,
|
|
|
+ t1.file_code AS fileCode,
|
|
|
+ t1.checkStatus,
|
|
|
+ t1.mrStatus,
|
|
|
+ t1.chName,
|
|
|
+ t1.mrName,
|
|
|
+ t1.chTime,
|
|
|
+ t1.mrTime
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT DISTINCT
|
|
|
+ tt1.*
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ be.*,
|
|
|
+ ifnull(mci.status,0) AS checkStatus,
|
|
|
+ ifnull(hm_mci.status,0) AS mrStatus,
|
|
|
+ mci.check_name as chName,
|
|
|
+ e.score_res as scoreBn,
|
|
|
+ hm_mci.check_name as mrName,
|
|
|
+ mci.gmt_create as chTime,
|
|
|
+ hm_mci.gmt_create as mrTime
|
|
|
+ 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
|
|
|
+ <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{getDetailRecordListPageVO.isPlacefile}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.hospitalId != null and getDetailRecordListPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{getDetailRecordListPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile == 0">
|
|
|
+ <if test="getDetailRecordListPageVO.startDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{getDetailRecordListPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.endDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{getDetailRecordListPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile == 1">
|
|
|
+ <if test="getDetailRecordListPageVO.startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{getDetailRecordListPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.endDate != null">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{getDetailRecordListPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.diagnose != null and getDetailRecordListPageVO.diagnose != ''">
|
|
|
+ AND a.diagnose LIKE CONCAT( '%', #{getDetailRecordListPageVO.diagnose}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.deptName != null and getDetailRecordListPageVO.deptName != ''">
|
|
|
+ AND a.beh_dept_name = #{getDetailRecordListPageVO.deptName}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.level != null and getDetailRecordListPageVO.level != ''">
|
|
|
+ AND b.`level` = #{getDetailRecordListPageVO.level}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.behospitalCode != null and getDetailRecordListPageVO.behospitalCode != ''">
|
|
|
+ AND a.behospital_code LIKE CONCAT( '%', #{getDetailRecordListPageVO.behospitalCode}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.patName != null and getDetailRecordListPageVO.patName != ''">
|
|
|
+ AND a.NAME LIKE CONCAT( '%', #{getDetailRecordListPageVO.patName}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.casesEntryName != null and getDetailRecordListPageVO.casesEntryName != ''">
|
|
|
+ AND d.NAME = #{getDetailRecordListPageVO.casesEntryName}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.casesEntryId != null ">
|
|
|
+ AND d.id = #{getDetailRecordListPageVO.casesEntryId}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.casesName != null and getDetailRecordListPageVO.casesName != ''">
|
|
|
+ AND d.cases_name = #{getDetailRecordListPageVO.casesName}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.casesId != null">
|
|
|
+ AND d.cases_id = #{getDetailRecordListPageVO.casesId}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.doctorId != null and getDetailRecordListPageVO.doctorId != ''">
|
|
|
+ AND (a.doctor_id LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorId}, '%' )
|
|
|
+ OR a.beh_doctor_id LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorId}, '%' )
|
|
|
+ OR a.director_doctor_id LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorId}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.doctorName != null and getDetailRecordListPageVO.doctorName != ''">
|
|
|
+ AND (a.doctor_name LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorName}, '%' )
|
|
|
+ OR a.beh_doctor_name LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorName}, '%' )
|
|
|
+ OR a.director_doctor_name LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorName}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.isReject != null">
|
|
|
+ AND c.is_reject = #{getDetailRecordListPageVO.isReject}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.ruleType != null">
|
|
|
+ AND d.rule_type = #{getDetailRecordListPageVO.ruleType}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2495">
|
|
|
+ AND TIMESTAMPDIFF(
|
|
|
+ DAY,
|
|
|
+ DATE( a.behospital_date ),
|
|
|
+ DATE( a.leave_hospital_date ))> 30
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.beHosGT31Days != null and getDetailRecordListPageVO.beHosGT31Days==1">
|
|
|
+ AND TIMESTAMPDIFF(
|
|
|
+ DAY,
|
|
|
+ DATE( a.behospital_date ),
|
|
|
+ DATE( a.leave_hospital_date ))> 31
|
|
|
+ </if>
|
|
|
+ )be
|
|
|
+ left join med_check_info mci
|
|
|
+ on mci.is_deleted = 'N'
|
|
|
+ and mci.check_type in(0,2)
|
|
|
+ and be.hospital_id = mci.hospital_id
|
|
|
+ and be.behospital_code = mci.behospital_code
|
|
|
+ left join med_check_info hm_mci
|
|
|
+ on hm_mci.is_deleted = 'N'
|
|
|
+ and hm_mci.check_type = 1
|
|
|
+ and be.hospital_id = hm_mci.hospital_id
|
|
|
+ and be.behospital_code = hm_mci.behospital_code
|
|
|
+ LEFT JOIN med_qcresult_cases e
|
|
|
+ on be.behospital_code = e.behospital_code
|
|
|
+ and be.hospital_id = e.hospital_id
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ and e.cases_id = 243
|
|
|
+ )tt1
|
|
|
+ <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2511">
|
|
|
+ ,med_medical_record tt2
|
|
|
+ WHERE
|
|
|
+ tt2.is_deleted = 'N'
|
|
|
+ AND tt1.hospital_id = tt2.hospital_id
|
|
|
+ AND tt1.behospital_code = tt2.behospital_code
|
|
|
+ AND tt2.mode_id = 30
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2419">
|
|
|
+ ,med_crisis_info tt2
|
|
|
+ WHERE
|
|
|
+ tt2.is_deleted = 'N'
|
|
|
+ AND tt1.hospital_id = tt2.hospital_id
|
|
|
+ AND tt1.behospital_code = tt2.behospital_code
|
|
|
+ </if>
|
|
|
+ ) t1
|
|
|
+ <if test="getDetailRecordListPageVO.casesEntryId == null or (getDetailRecordListPageVO.casesEntryId!=2594 and getDetailRecordListPageVO.casesEntryId!=2973 and getDetailRecordListPageVO.casesEntryId!=2930)">
|
|
|
+ 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'
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.casesEntryId != null and( getDetailRecordListPageVO.casesEntryId==2594 or getDetailRecordListPageVO.casesEntryId==2973 or getDetailRecordListPageVO.casesEntryId==2930)">
|
|
|
+ , med_home_page t2
|
|
|
+ , med_home_operation_info t3
|
|
|
+ WHERE t1.hospital_id = t2.hospital_id
|
|
|
+ AND t1.behospital_code = t2.behospital_code
|
|
|
+ AND t2.home_page_id = t3.home_page_id
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
+ AND t3.is_deleted = 'N'
|
|
|
+ </if>
|
|
|
+ ) t
|
|
|
+ where 1=1
|
|
|
+ <if test="getDetailRecordListPageVO.checkStatus != null">
|
|
|
+ AND t.checkStatus = #{getDetailRecordListPageVO.checkStatus}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.mrStatus != null">
|
|
|
+ AND t.mrStatus = #{getDetailRecordListPageVO.mrStatus}
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.chName != null and getDetailRecordListPageVO.chName!=''">
|
|
|
+ AND t.chName like concat('%', #{getDetailRecordListPageVO.chName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.mrName != null and getDetailRecordListPageVO.mrName!=''">
|
|
|
+ AND t.mrName like concat('%', #{getDetailRecordListPageVO.mrName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.chTimeStart != null ">
|
|
|
+ <![CDATA[ AND t.chTime >= #{getDetailRecordListPageVO.chTimeStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.chTimeEnd != null ">
|
|
|
+ <![CDATA[ AND t.chTime <= #{getDetailRecordListPageVO.chTimeEnd}]]>
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.mrTimeStart != null ">
|
|
|
+ <![CDATA[ AND t.mrTime >= #{getDetailRecordListPageVO.mrTimeStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="getDetailRecordListPageVO.mrTimeEnd != null ">
|
|
|
+ <![CDATA[ AND t.mrTime <= #{getDetailRecordListPageVO.mrTimeEnd}]]>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|