|
@@ -2054,14 +2054,14 @@
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
+ t1.deptId,
|
|
|
+ t1.deptName,
|
|
|
t1.id,
|
|
|
t1.NAME,
|
|
|
t1.casesId,
|
|
|
t1.casesName,
|
|
|
t1.ruleType,
|
|
|
t1.isReject,
|
|
|
- t1.deptId,
|
|
|
- t1.deptName,
|
|
|
t1.num,
|
|
|
t2.totleNum,
|
|
|
ROUND( t1.num / t2.totleNum, 4 ) AS percent,
|
|
@@ -2069,15 +2069,15 @@
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
- tt2.id,
|
|
|
- tt2.NAME,
|
|
|
+ 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,
|
|
|
- tt2.rule_type AS ruleType,
|
|
|
tt1.num,
|
|
|
- tt1.is_reject AS isReject,
|
|
|
- tt1.beh_dept_id AS deptId,
|
|
|
- tt1.beh_dept_name AS deptName
|
|
|
+ tt2.rule_type AS ruleType,
|
|
|
+ tt1.is_reject AS isReject
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
@@ -2085,8 +2085,8 @@
|
|
|
a.beh_dept_name,
|
|
|
d.cases_id,
|
|
|
d.cases_entry_id,
|
|
|
- count(*) AS num,
|
|
|
- d.is_reject
|
|
|
+ d.is_reject,
|
|
|
+ count(*) AS num
|
|
|
FROM
|
|
|
med_behospital_info a,
|
|
|
med_qcresult_detail d,
|
|
@@ -2098,49 +2098,44 @@
|
|
|
AND a.hospital_id = d.hospital_id
|
|
|
AND a.hospital_id = f.hospital_id
|
|
|
AND a.behospital_code = d.behospital_code
|
|
|
- <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
|
|
|
- and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
|
|
|
- </if>
|
|
|
AND a.beh_dept_id = f.dept_id
|
|
|
- AND a.qc_type_id != 0
|
|
|
<if test="filterPageByDeptVO.userId!=null">
|
|
|
AND f.user_id = #{filterPageByDeptVO.userId}
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.hospitalId != null and filterPageByDeptVO.hospitalId != ''">
|
|
|
- AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
|
|
|
+ <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{filterPageVO.isPlacefile}
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile == 0">
|
|
|
- <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
|
|
|
- <![CDATA[ AND a.behospital_date >= #{filterPageByDeptVO.startDate}]]>
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{filterPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
|
|
|
+ <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
|
|
|
- <![CDATA[ AND a.behospital_date <= #{filterPageByDeptVO.endDate}]]>
|
|
|
+ <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
|
|
|
</if>
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile == 1">
|
|
|
- <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
|
|
|
- <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
|
|
|
+ <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
|
|
|
+ <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
|
|
|
- <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
|
|
|
+ <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
|
|
|
</if>
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
|
|
|
- AND a.beh_dept_name = #{filterPageByDeptVO.deptName}
|
|
|
+ <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
|
|
|
+ AND a.beh_dept_name = #{filterPageVO.deptName}
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
|
|
|
- <if test="filterPageByDeptVO.doctorName=='未知'">
|
|
|
- AND (a.doctor_name is null OR a.doctor_name='')
|
|
|
- </if>
|
|
|
- <if test="filterPageByDeptVO.doctorName!='未知'">
|
|
|
- AND a.doctor_name = #{filterPageByDeptVO.doctorName}
|
|
|
- </if>
|
|
|
+ <if test="filterPageVO.doctorName != null and filterPageVO.doctorName != ''">
|
|
|
+ AND a.doctor_name like CONCAT('%', #{filterPageVO.doctorName}, '%')
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.casesId != null and filterPageByDeptVO.casesId != 0">
|
|
|
- AND d.cases_id = #{filterPageByDeptVO.casesId}
|
|
|
+ <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
|
|
|
+ AND d.cases_id = #{filterPageVO.casesId}
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.isReject != null ">
|
|
|
- AND d.is_reject = #{filterPageByDeptVO.isReject}
|
|
|
+ <if test="filterPageVO.isReject != null">
|
|
|
+ AND d.is_reject = #{filterPageVO.isReject}
|
|
|
</if>
|
|
|
GROUP BY
|
|
|
d.cases_entry_id,
|
|
@@ -2151,14 +2146,14 @@
|
|
|
tt2.is_deleted = 'N'
|
|
|
AND tt1.cases_id = tt2.cases_id
|
|
|
AND tt1.cases_entry_id = tt2.id
|
|
|
- <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
|
|
|
- AND tt2.cases_name = #{filterPageByDeptVO.casesName}
|
|
|
+ <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
|
|
|
+ AND tt2.cases_name like CONCAT('%', #{filterPageVO.casesName},'%')
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.name != null and filterPageByDeptVO.name != ''">
|
|
|
- AND tt2.name like CONCAT('%', #{filterPageByDeptVO.name},'%')
|
|
|
+ <if test="filterPageVO.name != null and filterPageVO.name != ''">
|
|
|
+ AND tt2.name like CONCAT('%', #{filterPageVO.name},'%')
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.ruleType != null ">
|
|
|
- AND tt2.rule_type = #{filterPageByDeptVO.ruleType}
|
|
|
+ <if test="filterPageVO.ruleType != null">
|
|
|
+ AND tt2.rule_type = #{filterPageVO.ruleType}
|
|
|
</if>
|
|
|
) t1,(
|
|
|
SELECT
|
|
@@ -2176,60 +2171,54 @@
|
|
|
AND a.hospital_id = d.hospital_id
|
|
|
AND a.hospital_id = f.hospital_id
|
|
|
AND a.behospital_code = d.behospital_code
|
|
|
- <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
|
|
|
- and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
|
|
|
- </if>
|
|
|
- AND d.cases_id = e.cases_id
|
|
|
- AND d.cases_entry_id = e.id
|
|
|
AND a.beh_dept_id = f.dept_id
|
|
|
- AND a.qc_type_id != 0
|
|
|
<if test="filterPageByDeptVO.userId!=null">
|
|
|
AND f.user_id = #{filterPageByDeptVO.userId}
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.hospitalId != null and filterPageByDeptVO.hospitalId != ''">
|
|
|
- AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
|
|
|
+ <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{filterPageVO.isPlacefile}
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile == 0">
|
|
|
- <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
|
|
|
- <![CDATA[ AND a.behospital_date >= #{filterPageByDeptVO.startDate}]]>
|
|
|
+ AND e.cases_id = d.cases_id
|
|
|
+ AND e.id = d.cases_entry_id
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{filterPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
|
|
|
+ <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
|
|
|
- <![CDATA[ AND a.behospital_date <= #{filterPageByDeptVO.endDate}]]>
|
|
|
+ <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
|
|
|
</if>
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile == 1">
|
|
|
- <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
|
|
|
- <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
|
|
|
+ <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
|
|
|
+ <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
|
|
|
- <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
|
|
|
+ <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
|
|
|
</if>
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
|
|
|
- AND a.beh_dept_name = #{filterPageByDeptVO.deptName}
|
|
|
+ <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
|
|
|
+ AND a.beh_dept_name = #{filterPageVO.deptName}
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
|
|
|
- <if test="filterPageByDeptVO.doctorName=='未知'">
|
|
|
- AND (a.doctor_name is null OR a.doctor_name='')
|
|
|
- </if>
|
|
|
- <if test="filterPageByDeptVO.doctorName!='未知'">
|
|
|
- AND a.doctor_name = #{filterPageByDeptVO.doctorName}
|
|
|
- </if>
|
|
|
+ <if test="filterPageVO.doctorName != null and filterPageVO.doctorName != ''">
|
|
|
+ AND a.doctor_name like CONCAT('%', #{filterPageVO.doctorName}, '%')
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.casesId != null and filterPageByDeptVO.casesId != 0">
|
|
|
- AND d.cases_id = #{filterPageByDeptVO.casesId}
|
|
|
+ <if test="filterPageVO.isReject != null">
|
|
|
+ AND d.is_reject = #{filterPageVO.isReject}
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.isReject != null">
|
|
|
- AND d.is_reject = #{filterPageByDeptVO.isReject}
|
|
|
+ <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
|
|
|
+ AND d.cases_id = #{filterPageVO.casesId}
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
|
|
|
- AND e.cases_name = #{filterPageByDeptVO.casesName}
|
|
|
+ <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
|
|
|
+ AND e.cases_name like CONCAT('%', #{filterPageVO.casesName},'%')
|
|
|
</if>
|
|
|
- <if test="filterPageByDeptVO.ruleType != null ">
|
|
|
- AND e.rule_type = #{filterPageByDeptVO.ruleType}
|
|
|
+ <if test="filterPageVO.ruleType != null">
|
|
|
+ AND e.rule_type = #{filterPageVO.ruleType}
|
|
|
</if>
|
|
|
) t2
|
|
|
)t
|
|
|
- order by t.id DESC
|
|
|
</select>
|
|
|
</mapper>
|