|
@@ -4550,6 +4550,29 @@
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
+ <resultMap id="ExportDoctorAverage_7" type="com.diagbot.dto.ExportDoctorAverageLevel_7DTO">
|
|
|
+ <result column="behDeptName" property="behDeptName"/>
|
|
|
+ <result column="avgScore" property="avgScore"/>
|
|
|
+ <collection property="excelBehospitalDTOS"
|
|
|
+ ofType="com.diagbot.dto.ExportBehospital_7DTO">
|
|
|
+ <result column="doctorName" property="doctorName"/>
|
|
|
+ <result column="patName" property="patName"/>
|
|
|
+ <result column="behospitalCode" property="behospitalCode"/>
|
|
|
+ <result column="behospitalDate" property="behospitalDate"/>
|
|
|
+ <result column="leaveHospitalDate" property="leaveHospitalDate"/>
|
|
|
+ <result column="score" property="score"/>
|
|
|
+ <result column="scoreBn" property="scoreBn"/>
|
|
|
+ <collection property="exportExcelCaseDTOS" ofType="com.diagbot.dto.ExportCase_7DTO">
|
|
|
+ <result column="caseName" property="caseName"/>
|
|
|
+ <collection property="exportExcelMsgDTOS"
|
|
|
+ ofType="com.diagbot.dto.ExportMsg_7DTO">
|
|
|
+ <result column="msg" property="msg"/>
|
|
|
+ </collection>
|
|
|
+ </collection>
|
|
|
+ </collection>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
<select id="exportExcel" resultMap="ExportExcelMap">
|
|
|
SELECT DISTINCT
|
|
|
t1.beh_dept_name AS behDeptName,
|
|
@@ -19790,28 +19813,28 @@
|
|
|
<if test="doctorAverageStatisticsVO.hospitalId != null and doctorAverageStatisticsVO.hospitalId != ''">
|
|
|
AND a.hospital_id = #{doctorAverageStatisticsVO.hospitalId}
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.deptId != null and doctorAverageStatisticsVO.deptId != ''">
|
|
|
+ <if test="doctorAverageStatisticsVO.deptId != null and doctorAverageStatisticsVO.deptId != '' and doctorAverageStatisticsVO.deptId != '-0'">
|
|
|
AND a.beh_dept_id = #{doctorAverageStatisticsVO.deptId}
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.deptId == '-'">
|
|
|
+ <if test="doctorAverageStatisticsVO.deptId == '-0'">
|
|
|
AND (a.beh_dept_id IS NULL OR a.beh_dept_id = '' OR a.beh_dept_id = '-')
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.deptName != null and doctorAverageStatisticsVO.deptName != ''">
|
|
|
+ <if test="doctorAverageStatisticsVO.deptName != null and doctorAverageStatisticsVO.deptName != '' and doctorAverageStatisticsVO.deptName != '-0'">
|
|
|
AND a.beh_dept_name = #{doctorAverageStatisticsVO.deptName}
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.deptName == '-'">
|
|
|
+ <if test="doctorAverageStatisticsVO.deptName == '-0'">
|
|
|
AND (a.beh_dept_name IS NULL OR a.beh_dept_name = '' OR a.beh_dept_name = '-')
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.doctorId != null and doctorAverageStatisticsVO.doctorId != ''">
|
|
|
+ <if test="doctorAverageStatisticsVO.doctorId != null and doctorAverageStatisticsVO.doctorId != '' and doctorAverageStatisticsVO.doctorId != '-0'">
|
|
|
AND a.doctor_id LIKE CONCAT('%',#{doctorAverageStatisticsVO.doctorId},'%')
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.doctorId == '-'">
|
|
|
+ <if test="doctorAverageStatisticsVO.doctorId == '-0'">
|
|
|
AND (a.doctor_id IS NULL OR a.doctor_id = '' OR a.doctor_id = '-')
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.doctorName != null and doctorAverageStatisticsVO.doctorName != ''">
|
|
|
+ <if test="doctorAverageStatisticsVO.doctorName != null and doctorAverageStatisticsVO.doctorName != '' and doctorAverageStatisticsVO.doctorName != '-0'">
|
|
|
AND a.doctor_name LIKE CONCAT('%',#{doctorAverageStatisticsVO.doctorName},'%')
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.doctorName == '-'">
|
|
|
+ <if test="doctorAverageStatisticsVO.doctorName == '-0'">
|
|
|
AND (a.doctor_name IS NULL OR a.doctor_name = '' OR a.doctor_name = '-')
|
|
|
</if>
|
|
|
<if test="doctorAverageStatisticsVO.isPlacefile != null and doctorAverageStatisticsVO.isPlacefile == 0">
|
|
@@ -19866,28 +19889,28 @@
|
|
|
<if test="doctorAverageStatisticsVO.hospitalId != null and doctorAverageStatisticsVO.hospitalId != ''">
|
|
|
AND a.hospital_id = #{doctorAverageStatisticsVO.hospitalId}
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.deptId != null and doctorAverageStatisticsVO.deptId != ''">
|
|
|
+ <if test="doctorAverageStatisticsVO.deptId != null and doctorAverageStatisticsVO.deptId != '' and doctorAverageStatisticsVO.deptId != '-0'">
|
|
|
AND a.beh_dept_id = #{doctorAverageStatisticsVO.deptId}
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.deptId == '-'">
|
|
|
+ <if test="doctorAverageStatisticsVO.deptId == '-0'">
|
|
|
AND (a.beh_dept_id IS NULL OR a.beh_dept_id = '' OR a.beh_dept_id = '-')
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.deptName != null and doctorAverageStatisticsVO.deptName != ''">
|
|
|
+ <if test="doctorAverageStatisticsVO.deptName != null and doctorAverageStatisticsVO.deptName != '' and doctorAverageStatisticsVO.deptName != '-0'">
|
|
|
AND a.beh_dept_name = #{doctorAverageStatisticsVO.deptName}
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.deptName == '-'">
|
|
|
+ <if test="doctorAverageStatisticsVO.deptName == '-0'">
|
|
|
AND (a.beh_dept_name IS NULL OR a.beh_dept_name = '' OR a.beh_dept_name = '-')
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.doctorId != null and doctorAverageStatisticsVO.doctorId != ''">
|
|
|
+ <if test="doctorAverageStatisticsVO.doctorId != null and doctorAverageStatisticsVO.doctorId != '' and doctorAverageStatisticsVO.doctorId != '-0'">
|
|
|
AND a.doctor_id LIKE CONCAT('%',#{doctorAverageStatisticsVO.doctorId},'%')
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.doctorId == '-'">
|
|
|
+ <if test="doctorAverageStatisticsVO.doctorId == '-0'">
|
|
|
AND (a.doctor_id IS NULL OR a.doctor_id = '' OR a.doctor_id = '-')
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.doctorName != null and doctorAverageStatisticsVO.doctorName != ''">
|
|
|
+ <if test="doctorAverageStatisticsVO.doctorName != null and doctorAverageStatisticsVO.doctorName != '' and doctorAverageStatisticsVO.doctorName != '-0'">
|
|
|
AND a.doctor_name LIKE CONCAT('%',#{doctorAverageStatisticsVO.doctorName},'%')
|
|
|
</if>
|
|
|
- <if test="doctorAverageStatisticsVO.doctorName == '-'">
|
|
|
+ <if test="doctorAverageStatisticsVO.doctorName == '-0'">
|
|
|
AND (a.doctor_name IS NULL OR a.doctor_name = '' OR a.doctor_name = '-')
|
|
|
</if>
|
|
|
<if test="doctorAverageStatisticsVO.isPlacefile != null and doctorAverageStatisticsVO.isPlacefile == 0">
|
|
@@ -19917,4 +19940,330 @@
|
|
|
AND t1.deptId = t2.deptId
|
|
|
AND t1.deptName = t2.deptName
|
|
|
</select>
|
|
|
+<!-- 医生质控平均分-患者列表(等级)-->
|
|
|
+ <select id="doctorAverageLevelPage" resultType="com.diagbot.dto.DoctorAverageLevelDTO">
|
|
|
+ SELECT * FROM (
|
|
|
+ select t.*,
|
|
|
+ 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,
|
|
|
+ g.check_type AS ch_type,
|
|
|
+ h.check_type AS mr_type,
|
|
|
+ g.check_name AS ch_name,
|
|
|
+ h.check_name AS mr_name,
|
|
|
+ g.check_time AS ch_time,
|
|
|
+ h.check_time AS mr_time
|
|
|
+ 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
|
|
|
+ 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'
|
|
|
+ LEFT JOIN med_qcresult_cases e
|
|
|
+ on a.behospital_code = e.behospital_code
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ and e.cases_id = 243
|
|
|
+ ) t
|
|
|
+ LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) 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 != ''">
|
|
|
+ AND t.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ and t.beh_dept_name= #{deptName}
|
|
|
+ </if>
|
|
|
+ <if test="doctorName != null and doctorName != ''">
|
|
|
+ and CONCAT(
|
|
|
+ IFNULL(t.doctor_name,''),IFNULL(t.beh_doctor_name,''),IFNULL(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) p
|
|
|
+ where p.is_deleted="N"
|
|
|
+ <if test="checkStatus != null ">
|
|
|
+ and p.check_status = #{checkStatus}
|
|
|
+ </if>
|
|
|
+ <if test="mrStatus != null ">
|
|
|
+ AND p.mr_status = #{mrStatus}
|
|
|
+ </if>
|
|
|
+ <if test="chName != null and chName !=''">
|
|
|
+ AND p.ch_name like CONCAT('%',#{chName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="mrName != null and mrName !=''">
|
|
|
+ AND p.mr_name like CONCAT('%',#{mrName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="chTimeStart != null">
|
|
|
+ <![CDATA[ and p.ch_time >= #{chTimeStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="chTimeEnd != null">
|
|
|
+ <![CDATA[ and p.ch_time < #{chTimeEnd}]]>
|
|
|
+ </if>
|
|
|
+ <if test="mrTimeStart != null">
|
|
|
+ <![CDATA[ and p.mr_time >= #{mrTimeStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="mrTimeEnd != null">
|
|
|
+ <![CDATA[ and p.mr_time < #{mrTimeEnd}]]>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <!-- 医生质控平均分-患者列表(等级)-导出-->
|
|
|
+ <select id="doctorAverageLevelExport" resultMap="ExportDoctorAverage_7">
|
|
|
+ SELECT * FROM (
|
|
|
+ SELECT tp.*,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,
|
|
|
+ g.check_type AS ch_type,
|
|
|
+ h.check_type AS mr_type,
|
|
|
+ g.check_name AS ch_name,
|
|
|
+ h.check_name AS mr_name,
|
|
|
+ g.check_time AS ch_time,
|
|
|
+ h.check_time AS mr_time
|
|
|
+ FROM (
|
|
|
+ SELECT
|
|
|
+ t1.behDeptId,
|
|
|
+ t1.behDeptName,
|
|
|
+ t1.doctorName,
|
|
|
+ t1.patName,
|
|
|
+ t1.behospitalCode,
|
|
|
+ t1.hospitalId,
|
|
|
+ t1.behospitalDate,
|
|
|
+ t1.leaveHospitalDate,
|
|
|
+ t1.score,
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ t1.msg,
|
|
|
+ t1.caseName,
|
|
|
+ </if>
|
|
|
+ t1.scoreBn,
|
|
|
+ t2.avgScore
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.doctor_name AS doctorName,
|
|
|
+ a.`name` AS patName,
|
|
|
+ a.behospital_code AS behospitalCode,
|
|
|
+ a.behospital_date AS behospitalDate,
|
|
|
+ a.leave_hospital_date AS leaveHospitalDate,
|
|
|
+ b.score_res AS score,
|
|
|
+ e.score_res as scoreBn,
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ c.msg AS msg,
|
|
|
+ d.NAME AS caseName,
|
|
|
+ </if>
|
|
|
+ a.beh_dept_id AS behDeptId,
|
|
|
+ a.beh_dept_name AS behDeptName,
|
|
|
+ a.hospital_id AS hospitalId
|
|
|
+ FROM
|
|
|
+ med_behospital_info a
|
|
|
+ RIGHT JOIN
|
|
|
+ med_qcresult_info b
|
|
|
+ ON a.hospital_id = b.hospital_id
|
|
|
+ AND a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND a.behospital_code = b.behospital_code
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ LEFT JOIN
|
|
|
+ med_qcresult_detail c
|
|
|
+ ON c.is_deleted = 'N'
|
|
|
+ AND b.behospital_code = c.behospital_code
|
|
|
+ AND b.hospital_id = c.hospital_id
|
|
|
+ LEFT JOIN
|
|
|
+ qc_cases d
|
|
|
+ on d.is_deleted = 'N'
|
|
|
+ AND c.cases_id = d.id
|
|
|
+ </if>
|
|
|
+ LEFT JOIN med_qcresult_cases e
|
|
|
+ on b.behospital_code = e.behospital_code
|
|
|
+ and b.hospital_id = e.hospital_id
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ and e.cases_id = 243
|
|
|
+ WHERE
|
|
|
+ 1=1
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{isPlacefile}
|
|
|
+ </if>
|
|
|
+ <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="diagnose != null and diagnose != ''">
|
|
|
+ AND a.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="behosDateStart != null">
|
|
|
+ <![CDATA[ and a.behospital_date >= #{behosDateStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="behosDateEnd != null">
|
|
|
+ <![CDATA[ and a.behospital_date < #{behosDateEnd}]]>
|
|
|
+ </if>
|
|
|
+ <if test="leaveHosDateStart != null ">
|
|
|
+ <![CDATA[ and a.leave_hospital_date >= DATE(#{leaveHosDateStart})]]>
|
|
|
+ </if>
|
|
|
+ <if test="leaveHosDateEnd != null ">
|
|
|
+ <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
|
|
|
+ </if>
|
|
|
+ <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
+ AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="level != null and level != ''">
|
|
|
+ AND b.level = #{level}
|
|
|
+ </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>
|
|
|
+ <if test="doctorCode != null and doctorCode != ''">
|
|
|
+ AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
|
|
|
+ OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
|
|
|
+ OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ and a.beh_dept_name = #{deptName}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND a.name like CONCAT('%',#{name},'%')
|
|
|
+ </if>
|
|
|
+ ) t1,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ROUND( AVG( b.score_res ), 2 ) AS avgScore,
|
|
|
+ a.beh_dept_id AS behDeptId,
|
|
|
+ a.beh_dept_name AS behDeptName
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_info b
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = b.hospital_id
|
|
|
+ AND a.behospital_code = b.behospital_code
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{isPlacefile}
|
|
|
+ </if>
|
|
|
+ <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="diagnose != null and diagnose != ''">
|
|
|
+ AND a.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="behosDateStart != null">
|
|
|
+ <![CDATA[ and a.behospital_date >= #{behosDateStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="behosDateEnd != null">
|
|
|
+ <![CDATA[ and a.behospital_date < #{behosDateEnd}]]>
|
|
|
+ </if>
|
|
|
+ <if test="leaveHosDateStart != null ">
|
|
|
+ <![CDATA[ and a.leave_hospital_date >= DATE(#{leaveHosDateStart})]]>
|
|
|
+ </if>
|
|
|
+ <if test="leaveHosDateEnd != null ">
|
|
|
+ <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
|
|
|
+ </if>
|
|
|
+ <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
+ AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="level != null and level != ''">
|
|
|
+ AND b.level = #{level}
|
|
|
+ </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>
|
|
|
+ <if test="doctorCode != null and doctorCode != ''">
|
|
|
+ AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
|
|
|
+ OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
|
|
|
+ OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ and a.beh_dept_name = #{deptName}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND a.name like CONCAT('%',#{name},'%')
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name
|
|
|
+ ) t2
|
|
|
+ WHERE
|
|
|
+ t1.behDeptId = t2.behDeptId
|
|
|
+ AND t1.behDeptName = t2.behDeptName
|
|
|
+ ORDER BY
|
|
|
+ t1.behDeptName,
|
|
|
+ t1.doctorName,
|
|
|
+ t1.patName,
|
|
|
+ <if test="radioCheck !=null and radioCheck == 1">
|
|
|
+ t1.caseName,
|
|
|
+ </if>
|
|
|
+ t1.behospitalCode
|
|
|
+ )tp
|
|
|
+ LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
|
|
|
+ ON tp.behospitalCode = g.behospital_code
|
|
|
+ AND tp.hospitalId = g.hospital_id
|
|
|
+ LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
|
|
|
+ ON tp.behospitalCode = h.behospital_code
|
|
|
+ AND tp.hospitalId = h.hospital_id
|
|
|
+ ) tu
|
|
|
+ WHERE tu.behospitalCode IS NOT NULL
|
|
|
+ <if test="checkStatus != null ">
|
|
|
+ and tu.check_status = #{checkStatus}
|
|
|
+ </if>
|
|
|
+ <if test="mrStatus != null ">
|
|
|
+ AND tu.mr_status = #{mrStatus}
|
|
|
+ </if>
|
|
|
+ <if test="chName != null and chName !=''">
|
|
|
+ AND tu.ch_name like CONCAT('%',#{chName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="mrName != null and mrName !=''">
|
|
|
+ AND tu.mr_name like CONCAT('%',#{mrName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="chTimeStart != null">
|
|
|
+ <![CDATA[ and tu.ch_time >= #{chTimeStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="chTimeEnd != null">
|
|
|
+ <![CDATA[ and tu.ch_time < #{chTimeEnd}]]>
|
|
|
+ </if>
|
|
|
+ <if test="mrTimeStart != null">
|
|
|
+ <![CDATA[ and tu.mr_time >= #{mrTimeStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="mrTimeEnd != null">
|
|
|
+ <![CDATA[ and tu.mr_time < #{mrTimeEnd}]]>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|