|
@@ -41,13 +41,7 @@
|
|
|
|
|
|
<select id="getPage" resultType="com.diagbot.dto.BehospitalInfoDTO">
|
|
<select id="getPage" resultType="com.diagbot.dto.BehospitalInfoDTO">
|
|
SELECT * FROM (
|
|
SELECT * FROM (
|
|
- 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,
|
|
|
|
|
|
+ select t.*,
|
|
CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
|
|
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,
|
|
CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
|
|
g.check_type AS ch_type,
|
|
g.check_type AS ch_type,
|
|
@@ -56,13 +50,9 @@
|
|
h.check_name AS mr_name,
|
|
h.check_name AS mr_name,
|
|
g.check_time AS ch_time,
|
|
g.check_time AS ch_time,
|
|
h.check_time AS mr_time
|
|
h.check_time AS mr_time
|
|
- 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
|
|
|
|
|
|
+ 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( 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
|
|
LEFT JOIN med_qcresult_info b
|
|
on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
|
|
on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
|
|
left join med_home_page c
|
|
left join med_home_page c
|
|
@@ -71,55 +61,61 @@
|
|
on a.behospital_code = e.behospital_code
|
|
on a.behospital_code = e.behospital_code
|
|
AND e.is_deleted = 'N'
|
|
AND e.is_deleted = 'N'
|
|
and e.cases_id = 243
|
|
and e.cases_id = 243
|
|
- where
|
|
|
|
- a.is_deleted = 'N'
|
|
|
|
|
|
+ ) 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'
|
|
<if test="diagnose != null and diagnose != ''">
|
|
<if test="diagnose != null and diagnose != ''">
|
|
- AND a.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
|
|
|
|
+ AND t.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
</if>
|
|
</if>
|
|
<if test="deptName != null and deptName != ''">
|
|
<if test="deptName != null and deptName != ''">
|
|
- and a.beh_dept_name LIKE CONCAT( '%', #{deptName}, '%' )
|
|
|
|
|
|
+ and t.beh_dept_name LIKE CONCAT( '%', #{deptName}, '%' )
|
|
</if>
|
|
</if>
|
|
<if test="doctorName != null and doctorName != ''">
|
|
<if test="doctorName != null and doctorName != ''">
|
|
and CONCAT(
|
|
and CONCAT(
|
|
- IFNULL(a.doctor_name,''),IFNULL(a.beh_doctor_name,''),IFNULL(a.director_doctor_name,''))
|
|
|
|
|
|
+ IFNULL(t.doctor_name,''),IFNULL(t.beh_doctor_name,''),IFNULL(t.director_doctor_name,''))
|
|
like CONCAT('%',#{doctorName},'%')
|
|
like CONCAT('%',#{doctorName},'%')
|
|
</if>
|
|
</if>
|
|
<if test="name != null and name != ''">
|
|
<if test="name != null and name != ''">
|
|
- and a.name like CONCAT('%',#{name},'%')
|
|
|
|
|
|
+ and t.name like CONCAT('%',#{name},'%')
|
|
</if>
|
|
</if>
|
|
<if test="doctorCode != null and doctorCode != ''">
|
|
<if test="doctorCode != null and doctorCode != ''">
|
|
- and (a.doctor_id = #{doctorCode}
|
|
|
|
- or a.beh_doctor_id = #{doctorCode}
|
|
|
|
- or a.director_doctor_id = #{doctorCode})
|
|
|
|
|
|
+ and (t.doctor_id = #{doctorCode}
|
|
|
|
+ or t.beh_doctor_id = #{doctorCode}
|
|
|
|
+ or t.director_doctor_id = #{doctorCode})
|
|
</if>
|
|
</if>
|
|
<if test="fileCode != null and fileCode != ''">
|
|
<if test="fileCode != null and fileCode != ''">
|
|
- and a.file_code like CONCAT('%',#{fileCode},'%')
|
|
|
|
|
|
+ and t.file_code like CONCAT('%',#{fileCode},'%')
|
|
</if>
|
|
</if>
|
|
<if test="hospitalId != null">
|
|
<if test="hospitalId != null">
|
|
- and a.hospital_id = #{hospitalId}
|
|
|
|
|
|
+ and t.hospital_id = #{hospitalId}
|
|
</if>
|
|
</if>
|
|
<if test="behospitalCode != null and behospitalCode != ''">
|
|
<if test="behospitalCode != null and behospitalCode != ''">
|
|
- and a.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
|
|
|
|
+ and t.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
</if>
|
|
</if>
|
|
<if test="behosDateStart != null">
|
|
<if test="behosDateStart != null">
|
|
- <![CDATA[ and a.behospital_date >= #{behosDateStart}]]>
|
|
|
|
|
|
+ <![CDATA[ and t.behospital_date >= #{behosDateStart}]]>
|
|
</if>
|
|
</if>
|
|
<if test="behosDateEnd != null">
|
|
<if test="behosDateEnd != null">
|
|
- <![CDATA[ and a.behospital_date < #{behosDateEnd}]]>
|
|
|
|
|
|
+ <![CDATA[ and t.behospital_date < #{behosDateEnd}]]>
|
|
</if>
|
|
</if>
|
|
<if test="leaveHosDateStart != null">
|
|
<if test="leaveHosDateStart != null">
|
|
- <![CDATA[ and a.leave_hospital_date >= #{leaveHosDateStart}]]>
|
|
|
|
|
|
+ <![CDATA[ and t.leave_hospital_date >= #{leaveHosDateStart}]]>
|
|
</if>
|
|
</if>
|
|
<if test="leaveHosDateEnd != null">
|
|
<if test="leaveHosDateEnd != null">
|
|
- <![CDATA[ and a.leave_hospital_date < #{leaveHosDateEnd}]]>
|
|
|
|
|
|
+ <![CDATA[ and t.leave_hospital_date < #{leaveHosDateEnd}]]>
|
|
</if>
|
|
</if>
|
|
<if test="level != null and level != ''">
|
|
<if test="level != null and level != ''">
|
|
- and b.level = #{level}
|
|
|
|
|
|
+ and t.level = #{level}
|
|
</if>
|
|
</if>
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
- and a.is_placefile = #{isPlacefile}
|
|
|
|
|
|
+ and t.is_placefile = #{isPlacefile}
|
|
</if>
|
|
</if>
|
|
- and a.qc_type_id != 0) p
|
|
|
|
|
|
+ and t.qc_type_id != 0) p
|
|
where p.is_deleted="N"
|
|
where p.is_deleted="N"
|
|
<if test="checkStatus != null ">
|
|
<if test="checkStatus != null ">
|
|
and p.check_status = #{checkStatus}
|
|
and p.check_status = #{checkStatus}
|
|
@@ -3460,7 +3456,7 @@
|
|
<result column="avgScore" property="avgScore"/>
|
|
<result column="avgScore" property="avgScore"/>
|
|
<collection property="excelBehospitalDTOS"
|
|
<collection property="excelBehospitalDTOS"
|
|
ofType="com.diagbot.dto.ExportExcelBehospitalDTO">
|
|
ofType="com.diagbot.dto.ExportExcelBehospitalDTO">
|
|
- <result column="behDoctorName" property="behDoctorName"/>
|
|
|
|
|
|
+ <result column="doctorName" property="doctorName"/>
|
|
<result column="patName" property="patName"/>
|
|
<result column="patName" property="patName"/>
|
|
<result column="behospitalCode" property="behospitalCode"/>
|
|
<result column="behospitalCode" property="behospitalCode"/>
|
|
<result column="behospitalDate" property="behospitalDate"/>
|
|
<result column="behospitalDate" property="behospitalDate"/>
|
|
@@ -3481,7 +3477,7 @@
|
|
<select id="exportExcel" resultMap="ExportExcelMap">
|
|
<select id="exportExcel" resultMap="ExportExcelMap">
|
|
SELECT DISTINCT
|
|
SELECT DISTINCT
|
|
t1.beh_dept_name AS behDeptName,
|
|
t1.beh_dept_name AS behDeptName,
|
|
- t1.beh_doctor_name AS behDoctorName,
|
|
|
|
|
|
+ t1.beh_doctor_name AS doctorName,
|
|
t1.`name` AS patName,
|
|
t1.`name` AS patName,
|
|
t1.behospital_code AS behospitalCode,
|
|
t1.behospital_code AS behospitalCode,
|
|
t1.behospital_date AS behospitalDate,
|
|
t1.behospital_date AS behospitalDate,
|
|
@@ -3530,7 +3526,7 @@
|
|
SELECT
|
|
SELECT
|
|
t1.behDeptId,
|
|
t1.behDeptId,
|
|
t1.behDeptName,
|
|
t1.behDeptName,
|
|
- t1.behDoctorName,
|
|
|
|
|
|
+ t1.doctorName,
|
|
t1.patName,
|
|
t1.patName,
|
|
t1.behospitalCode,
|
|
t1.behospitalCode,
|
|
t1.hospitalId,
|
|
t1.hospitalId,
|
|
@@ -3549,7 +3545,7 @@
|
|
CONCAT(
|
|
CONCAT(
|
|
( CASE WHEN a.director_doctor_name IS NOT NULL AND a.director_doctor_name != '' THEN concat( a.director_doctor_name, '\n' ) ELSE '' END ),
|
|
( CASE WHEN a.director_doctor_name IS NOT NULL AND a.director_doctor_name != '' THEN concat( a.director_doctor_name, '\n' ) ELSE '' END ),
|
|
a.doctor_name
|
|
a.doctor_name
|
|
- ) AS behDoctorName,
|
|
|
|
|
|
+ ) AS doctorName,
|
|
a.`name` AS patName,
|
|
a.`name` AS patName,
|
|
a.behospital_code AS behospitalCode,
|
|
a.behospital_code AS behospitalCode,
|
|
a.behospital_date AS behospitalDate,
|
|
a.behospital_date AS behospitalDate,
|
|
@@ -3756,7 +3752,7 @@
|
|
SELECT
|
|
SELECT
|
|
t1.behDeptId,
|
|
t1.behDeptId,
|
|
t1.behDeptName,
|
|
t1.behDeptName,
|
|
- t1.behDoctorName,
|
|
|
|
|
|
+ t1.doctorName,
|
|
t1.patName,
|
|
t1.patName,
|
|
t1.behospitalCode,
|
|
t1.behospitalCode,
|
|
t1.hospitalId,
|
|
t1.hospitalId,
|
|
@@ -3772,7 +3768,7 @@
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
- a.doctor_name AS behDoctorName,
|
|
|
|
|
|
+ a.doctor_name AS doctorName,
|
|
a.`name` AS patName,
|
|
a.`name` AS patName,
|
|
a.behospital_code AS behospitalCode,
|
|
a.behospital_code AS behospitalCode,
|
|
a.hospital_id AS hospital_id,
|
|
a.hospital_id AS hospital_id,
|
|
@@ -3986,7 +3982,7 @@
|
|
SELECT
|
|
SELECT
|
|
t1.behDeptId,
|
|
t1.behDeptId,
|
|
t1.behDeptName,
|
|
t1.behDeptName,
|
|
- t1.behDoctorName,
|
|
|
|
|
|
+ t1.doctorName,
|
|
t1.patName,
|
|
t1.patName,
|
|
t1.behospitalCode,
|
|
t1.behospitalCode,
|
|
t1.hospitalId,
|
|
t1.hospitalId,
|
|
@@ -4002,7 +3998,7 @@
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
- a.doctor_name AS behDoctorName,
|
|
|
|
|
|
+ a.doctor_name AS doctorName,
|
|
a.beh_doctor_name,
|
|
a.beh_doctor_name,
|
|
a.director_doctor_name,
|
|
a.director_doctor_name,
|
|
a.`name` AS patName,
|
|
a.`name` AS patName,
|
|
@@ -4219,7 +4215,7 @@
|
|
SELECT
|
|
SELECT
|
|
t1.behDeptId,
|
|
t1.behDeptId,
|
|
t1.behDeptName,
|
|
t1.behDeptName,
|
|
- t1.behDoctorName,
|
|
|
|
|
|
+ t1.doctorName,
|
|
t1.patName,
|
|
t1.patName,
|
|
t1.behospitalCode,
|
|
t1.behospitalCode,
|
|
t1.hospitalId,
|
|
t1.hospitalId,
|
|
@@ -4235,7 +4231,7 @@
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
- a.doctor_name AS behDoctorName,
|
|
|
|
|
|
+ a.doctor_name AS doctorName,
|
|
a.`name` AS patName,
|
|
a.`name` AS patName,
|
|
a.behospital_code AS behospitalCode,
|
|
a.behospital_code AS behospitalCode,
|
|
a.behospital_date AS behospitalDate,
|
|
a.behospital_date AS behospitalDate,
|
|
@@ -4688,13 +4684,16 @@
|
|
|
|
|
|
<!-- 条目缺陷质控评分页-科室(内页)-->
|
|
<!-- 条目缺陷质控评分页-科室(内页)-->
|
|
<select id="qcResultShortByDeptPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
<select id="qcResultShortByDeptPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
- SELECT DISTINCT
|
|
|
|
|
|
+ SELECT t.*
|
|
|
|
+ FROM
|
|
|
|
+ (SELECT DISTINCT
|
|
t1.hospital_id AS hospitalId,
|
|
t1.hospital_id AS hospitalId,
|
|
t1.behospital_code AS behospitalCode,
|
|
t1.behospital_code AS behospitalCode,
|
|
t1.bed_code AS bedCode,
|
|
t1.bed_code AS bedCode,
|
|
t1.LEVEL AS LEVEL,
|
|
t1.LEVEL AS LEVEL,
|
|
t1.grade_type AS gradeType,
|
|
t1.grade_type AS gradeType,
|
|
t1.score_res AS scoreRes,
|
|
t1.score_res AS scoreRes,
|
|
|
|
+ t1.scoreBn,
|
|
t1.NAME AS NAME,
|
|
t1.NAME AS NAME,
|
|
t1.sex AS sex,
|
|
t1.sex AS sex,
|
|
t1.beh_dept_id AS behDeptId,
|
|
t1.beh_dept_id AS behDeptId,
|
|
@@ -4712,8 +4711,28 @@
|
|
t1.gmt_create AS gradeTime,
|
|
t1.gmt_create AS gradeTime,
|
|
t1.diagnose,
|
|
t1.diagnose,
|
|
t1.ward_name AS wardName,
|
|
t1.ward_name AS wardName,
|
|
- t2.age,
|
|
|
|
- t1.file_code AS fileCode
|
|
|
|
|
|
+ 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
|
|
FROM
|
|
(
|
|
(
|
|
SELECT DISTINCT
|
|
SELECT DISTINCT
|
|
@@ -4762,15 +4781,12 @@
|
|
AND c.cases_id = d.cases_id
|
|
AND c.cases_id = d.cases_id
|
|
AND c.cases_entry_id = d.id
|
|
AND c.cases_entry_id = d.id
|
|
AND a.qc_type_id != 0
|
|
AND a.qc_type_id != 0
|
|
|
|
+ <if test="qcResultShortPageVO.userId!=null">
|
|
|
|
+ AND e.user_id = #{qcResultShortPageVO.userId}
|
|
|
|
+ </if>
|
|
<if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
|
|
<if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
|
|
and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
|
|
and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
|
|
</if>
|
|
</if>
|
|
- <if test="qcResultShortPageVO.diagnose != null and qcResultShortPageVO.diagnose != ''">
|
|
|
|
- and a.diagnose LIKE CONCAT( '%', #{qcResultShortPageVO.diagnose}, '%' )
|
|
|
|
- </if>
|
|
|
|
- <if test="qcResultShortPageVO.userId != null and qcResultShortPageVO.userId != ''">
|
|
|
|
- AND e.user_id = #{qcResultShortPageVO.userId}
|
|
|
|
- </if>
|
|
|
|
<if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
|
|
<if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
|
|
AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
|
|
AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
|
|
</if>
|
|
</if>
|
|
@@ -4790,21 +4806,11 @@
|
|
<![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
|
|
<![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
|
|
</if>
|
|
</if>
|
|
</if>
|
|
</if>
|
|
- <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
|
|
|
|
- AND a.beh_dept_name = #{qcResultShortPageVO.deptName}
|
|
|
|
- </if>
|
|
|
|
- <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
|
|
|
|
- AND a.doctor_name = #{qcResultShortPageVO.doctorName}
|
|
|
|
- </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 test="qcResultShortPageVO.diagnose != null and qcResultShortPageVO.diagnose != ''">
|
|
|
|
+ AND a.diagnose LIKE CONCAT( '%', #{qcResultShortPageVO.diagnose}, '%' )
|
|
</if>
|
|
</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 test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
|
|
|
|
+ AND a.beh_dept_name LIKE CONCAT( '%', #{qcResultShortPageVO.deptName}, '%' )
|
|
</if>
|
|
</if>
|
|
<if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
<if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
AND b.`level` = #{qcResultShortPageVO.level}
|
|
AND b.`level` = #{qcResultShortPageVO.level}
|
|
@@ -4816,21 +4822,118 @@
|
|
AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
|
|
AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
|
|
</if>
|
|
</if>
|
|
<if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
|
|
<if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
|
|
- AND d.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.casesEntryName}, '%' )
|
|
|
|
|
|
+ AND d.NAME = #{qcResultShortPageVO.casesEntryName}
|
|
</if>
|
|
</if>
|
|
- <if test="qcResultShortPageVO.casesEntryId != null and qcResultShortPageVO.casesEntryId != ''">
|
|
|
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId != null ">
|
|
AND d.id = #{qcResultShortPageVO.casesEntryId}
|
|
AND d.id = #{qcResultShortPageVO.casesEntryId}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="qcResultShortPageVO.casesName != null and qcResultShortPageVO.casesName != ''">
|
|
|
|
+ AND d.cases_name = #{qcResultShortPageVO.casesName}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.casesId != null">
|
|
|
|
+ AND d.cases_id = #{qcResultShortPageVO.casesId}
|
|
|
|
+ </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.isReject != null">
|
|
<if test="qcResultShortPageVO.isReject != null">
|
|
AND c.is_reject = #{qcResultShortPageVO.isReject}
|
|
AND c.is_reject = #{qcResultShortPageVO.isReject}
|
|
</if>
|
|
</if>
|
|
<if test="qcResultShortPageVO.ruleType != null">
|
|
<if test="qcResultShortPageVO.ruleType != null">
|
|
AND d.rule_type = #{qcResultShortPageVO.ruleType}
|
|
AND d.rule_type = #{qcResultShortPageVO.ruleType}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId != null and qcResultShortPageVO.casesEntryId==2495">
|
|
|
|
+ AND TIMESTAMPDIFF(
|
|
|
|
+ DAY,
|
|
|
|
+ DATE( a.behospital_date ),
|
|
|
|
+ DATE( a.leave_hospital_date ))> 30
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.beHosGT31Days != null and qcResultShortPageVO.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 = 0
|
|
|
|
+ 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="qcResultShortPageVO.casesEntryId != null and qcResultShortPageVO.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="qcResultShortPageVO.casesEntryId != null and qcResultShortPageVO.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
|
|
) 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'
|
|
|
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId == null or (qcResultShortPageVO.casesEntryId!=2594 and qcResultShortPageVO.casesEntryId!=2973 and qcResultShortPageVO.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="qcResultShortPageVO.casesEntryId != null and( qcResultShortPageVO.casesEntryId==2594 or qcResultShortPageVO.casesEntryId==2973 or qcResultShortPageVO.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="qcResultShortPageVO.checkStatus != null">
|
|
|
|
+ AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.mrStatus != null">
|
|
|
|
+ AND t.mrStatus = #{qcResultShortPageVO.mrStatus}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.chName != null and qcResultShortPageVO.chName!=''">
|
|
|
|
+ AND t.chName like concat('%', #{qcResultShortPageVO.chName}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.mrName != null and qcResultShortPageVO.mrName!=''">
|
|
|
|
+ AND t.mrName like concat('%', #{qcResultShortPageVO.mrName}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.chTimeStart != null ">
|
|
|
|
+ <![CDATA[ AND t.chTime >= #{qcResultShortPageVO.chTimeStart}]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.chTimeEnd != null ">
|
|
|
|
+ <![CDATA[ AND t.chTime <= #{qcResultShortPageVO.chTimeEnd}]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.mrTimeStart != null ">
|
|
|
|
+ <![CDATA[ AND t.mrTime >= #{qcResultShortPageVO.mrTimeStart}]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.mrTimeEnd != null ">
|
|
|
|
+ <![CDATA[ AND t.mrTime <= #{qcResultShortPageVO.mrTimeEnd}]]>
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<update id="updateBatchByKey">
|
|
<update id="updateBatchByKey">
|
|
@@ -7572,7 +7675,7 @@
|
|
SELECT
|
|
SELECT
|
|
f1.behDeptId,
|
|
f1.behDeptId,
|
|
f1.behDeptName,
|
|
f1.behDeptName,
|
|
- f1.behDoctorName,
|
|
|
|
|
|
+ f1.doctorName,
|
|
f1.patName,
|
|
f1.patName,
|
|
f1.behospitalCode,
|
|
f1.behospitalCode,
|
|
f1.hospitalId,
|
|
f1.hospitalId,
|
|
@@ -7593,7 +7696,7 @@
|
|
f1.mrTime
|
|
f1.mrTime
|
|
FROM
|
|
FROM
|
|
(SELECT
|
|
(SELECT
|
|
- t.doctorName AS behDoctorName,
|
|
|
|
|
|
+ t.doctorName,
|
|
t.`name` AS patName,
|
|
t.`name` AS patName,
|
|
t.behospitalCode AS behospitalCode,
|
|
t.behospitalCode AS behospitalCode,
|
|
t.behospitalDate AS behospitalDate,
|
|
t.behospitalDate AS behospitalDate,
|
|
@@ -10594,6 +10697,9 @@
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
and a.is_placefile = #{isPlacefile}
|
|
and a.is_placefile = #{isPlacefile}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="doctorName != null and doctorName != ''">
|
|
|
|
+ and a.doctor_name = #{doctorName}
|
|
|
|
+ </if>
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
AND a.hospital_id = #{hospitalId}
|
|
AND a.hospital_id = #{hospitalId}
|
|
</if>
|
|
</if>
|
|
@@ -10627,11 +10733,6 @@
|
|
OR a.beh_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
|
|
OR a.beh_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
|
|
OR a.director_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' ))
|
|
OR a.director_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' ))
|
|
</if>
|
|
</if>
|
|
- <if test="doctorName != null and doctorName != ''">
|
|
|
|
- AND (a.doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
|
|
|
|
- OR a.beh_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
|
|
|
|
- OR a.director_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' ))
|
|
|
|
- </if>
|
|
|
|
)be
|
|
)be
|
|
left join med_check_info mci
|
|
left join med_check_info mci
|
|
on mci.is_deleted = 'N'
|
|
on mci.is_deleted = 'N'
|
|
@@ -10698,6 +10799,9 @@
|
|
<if test="deptName != null and deptName != ''">
|
|
<if test="deptName != null and deptName != ''">
|
|
and a.beh_dept_name = #{deptName}
|
|
and a.beh_dept_name = #{deptName}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="doctorName != null and doctorName != ''">
|
|
|
|
+ and a.doctor_name = #{doctorName}
|
|
|
|
+ </if>
|
|
<if test="deptClass != null and deptClass != ''">
|
|
<if test="deptClass != null and deptClass != ''">
|
|
and a.beh_dept_id = #{deptClass}
|
|
and a.beh_dept_id = #{deptClass}
|
|
</if>
|
|
</if>
|
|
@@ -10732,16 +10836,6 @@
|
|
<if test="patName != null and patName != ''">
|
|
<if test="patName != null and patName != ''">
|
|
AND a.NAME LIKE CONCAT( '%', #{patName}, '%' )
|
|
AND a.NAME LIKE CONCAT( '%', #{patName}, '%' )
|
|
</if>
|
|
</if>
|
|
- <if test="doctorId != null and doctorId != ''">
|
|
|
|
- AND (a.doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
|
|
|
|
- OR a.beh_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
|
|
|
|
- OR a.director_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' ))
|
|
|
|
- </if>
|
|
|
|
- <if test="doctorName != null and doctorName != ''">
|
|
|
|
- AND (a.doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
|
|
|
|
- OR a.beh_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
|
|
|
|
- OR a.director_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' ))
|
|
|
|
- </if>
|
|
|
|
GROUP BY
|
|
GROUP BY
|
|
a.doctor_id,
|
|
a.doctor_id,
|
|
a.doctor_name
|
|
a.doctor_name
|
|
@@ -11454,7 +11548,7 @@
|
|
SELECT
|
|
SELECT
|
|
f1.behDeptId,
|
|
f1.behDeptId,
|
|
f1.behDeptName,
|
|
f1.behDeptName,
|
|
- f1.behDoctorName,
|
|
|
|
|
|
+ f1.doctorName,
|
|
f1.patName,
|
|
f1.patName,
|
|
f1.behospitalCode,
|
|
f1.behospitalCode,
|
|
f1.hospitalId,
|
|
f1.hospitalId,
|
|
@@ -11475,7 +11569,7 @@
|
|
f1.mrTime
|
|
f1.mrTime
|
|
FROM
|
|
FROM
|
|
(SELECT
|
|
(SELECT
|
|
- t.doctorName AS behDoctorName,
|
|
|
|
|
|
+ t.doctorName,
|
|
t.`name` AS patName,
|
|
t.`name` AS patName,
|
|
t.behospitalCode AS behospitalCode,
|
|
t.behospitalCode AS behospitalCode,
|
|
t.behospitalDate AS behospitalDate,
|
|
t.behospitalDate AS behospitalDate,
|
|
@@ -12066,6 +12160,9 @@
|
|
AND c.`level`='合格'
|
|
AND c.`level`='合格'
|
|
</if>
|
|
</if>
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
|
|
|
|
+ and a.doctor_name = #{qcResultShortPageVO.doctorName}
|
|
|
|
+ </if>
|
|
<if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
|
|
<if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
|
|
and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
|
|
and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
|
|
</if>
|
|
</if>
|
|
@@ -12296,6 +12393,9 @@
|
|
<if test="qcResultShortPageVO.userId!=null">
|
|
<if test="qcResultShortPageVO.userId!=null">
|
|
AND b.user_id = #{qcResultShortPageVO.userId}
|
|
AND b.user_id = #{qcResultShortPageVO.userId}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
|
|
|
|
+ and a.doctor_name = #{qcResultShortPageVO.doctorName}
|
|
|
|
+ </if>
|
|
<if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
|
|
<if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
|
|
and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
|
|
and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
|
|
</if>
|
|
</if>
|
|
@@ -12416,7 +12516,7 @@
|
|
SELECT
|
|
SELECT
|
|
f1.behDeptId,
|
|
f1.behDeptId,
|
|
f1.behDeptName,
|
|
f1.behDeptName,
|
|
- f1.behDoctorName,
|
|
|
|
|
|
+ f1.doctorName,
|
|
f1.patName,
|
|
f1.patName,
|
|
f1.behospitalCode,
|
|
f1.behospitalCode,
|
|
f1.hospitalId,
|
|
f1.hospitalId,
|
|
@@ -12435,7 +12535,7 @@
|
|
f1.mrTime
|
|
f1.mrTime
|
|
FROM
|
|
FROM
|
|
(SELECT
|
|
(SELECT
|
|
- t.doctorName AS behDoctorName,
|
|
|
|
|
|
+ t.doctorName,
|
|
t.`name` AS patName,
|
|
t.`name` AS patName,
|
|
t.behospitalCode AS behospitalCode,
|
|
t.behospitalCode AS behospitalCode,
|
|
t.behospitalDate AS behospitalDate,
|
|
t.behospitalDate AS behospitalDate,
|
|
@@ -14972,7 +15072,7 @@
|
|
SELECT
|
|
SELECT
|
|
f1.behDeptId,
|
|
f1.behDeptId,
|
|
f1.behDeptName,
|
|
f1.behDeptName,
|
|
- f1.behDoctorName,
|
|
|
|
|
|
+ f1.doctorName,
|
|
f1.patName,
|
|
f1.patName,
|
|
f1.behospitalCode,
|
|
f1.behospitalCode,
|
|
f1.hospitalId,
|
|
f1.hospitalId,
|
|
@@ -16072,7 +16172,7 @@
|
|
SELECT
|
|
SELECT
|
|
f1.behDeptId,
|
|
f1.behDeptId,
|
|
f1.behDeptName,
|
|
f1.behDeptName,
|
|
- f1.behDoctorName,
|
|
|
|
|
|
+ f1.doctorName,
|
|
f1.patName,
|
|
f1.patName,
|
|
f1.behospitalCode,
|
|
f1.behospitalCode,
|
|
f1.hospitalId,
|
|
f1.hospitalId,
|
|
@@ -16093,7 +16193,7 @@
|
|
f1.mrTime
|
|
f1.mrTime
|
|
FROM
|
|
FROM
|
|
(SELECT
|
|
(SELECT
|
|
- t.doctorName AS behDoctorName,
|
|
|
|
|
|
+ t.doctorName,
|
|
t.`name` AS patName,
|
|
t.`name` AS patName,
|
|
t.behospitalCode AS behospitalCode,
|
|
t.behospitalCode AS behospitalCode,
|
|
t.behospitalDate AS behospitalDate,
|
|
t.behospitalDate AS behospitalDate,
|