|
@@ -391,6 +391,75 @@
|
|
|
and t.is_placefile = 1
|
|
|
</select>
|
|
|
|
|
|
+ <!--质控评分(医疗组)分页-->
|
|
|
+ <select id="getPageByGroup" resultType="com.diagbot.dto.BehospitalInfoDTO">
|
|
|
+ select * from (
|
|
|
+ select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
|
|
|
+ grade_time, c.age from med_behospital_info a
|
|
|
+ LEFT JOIN med_qcresult_info b
|
|
|
+ on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
|
|
|
+ left join med_home_page c
|
|
|
+ on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
|
|
|
+ ) t
|
|
|
+ where t.is_deleted = 'N' and
|
|
|
+ t.doctor_id in (
|
|
|
+ SELECT doctor_id FROM `bas_doctor_info`
|
|
|
+ where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
|
|
|
+ select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
|
|
|
+ where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
|
|
|
+ and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
|
|
|
+ and c1.username = c3.doctor_id
|
|
|
+ and c2.hospital_id = #{hospitalId}
|
|
|
+ and c1.id = #{userId}
|
|
|
+ )
|
|
|
+ )
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
+ and t.beh_dept_id = #{deptId}
|
|
|
+ </if>
|
|
|
+ <if test="doctorName != null and doctorName != ''">
|
|
|
+ and (t.doctor_name like CONCAT('%',#{doctorName},'%')
|
|
|
+ or t.beh_doctor_name like CONCAT('%',#{doctorName},'%')
|
|
|
+ or t.director_doctor_name like CONCAT('%',#{doctorName},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and t.name like CONCAT('%',#{name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="doctorCode != null and doctorCode != ''">
|
|
|
+ and (t.doctor_id = #{doctorCode}
|
|
|
+ or t.beh_doctor_id = #{doctorCode}
|
|
|
+ or t.director_doctor_id = #{doctorCode})
|
|
|
+ </if>
|
|
|
+ <if test="fileCode != null and fileCode != ''">
|
|
|
+ and t.file_code like CONCAT('%',#{fileCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="hospitalId != null">
|
|
|
+ and t.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
+ and t.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="behosDateStart != null">
|
|
|
+ <![CDATA[ and t.behospital_date >= #{behosDateStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="behosDateEnd != null">
|
|
|
+ <![CDATA[ and t.behospital_date < #{behosDateEnd}]]>
|
|
|
+ </if>
|
|
|
+ <if test="leaveHosDateStart != null">
|
|
|
+ <![CDATA[ and t.leave_hospital_date >= #{leaveHosDateStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="leaveHosDateEnd != null">
|
|
|
+ <![CDATA[ and t.leave_hospital_date < #{leaveHosDateEnd}]]>
|
|
|
+ </if>
|
|
|
+ <if test="level != null and level != ''">
|
|
|
+ and t.level = #{level}
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
+ and t.is_placefile = #{isPlacefile}
|
|
|
+ </if>
|
|
|
+ and t.qc_type_id != 0
|
|
|
+ and t.is_placefile = 1
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 出院总人数统计-全院-首页 -->
|
|
|
<select id="leaveHosCount" parameterType="com.diagbot.vo.FilterVO" resultType="int">
|
|
|
SELECT
|