|
@@ -27,8 +27,11 @@
|
|
|
</resultMap>
|
|
|
<!--通过核查人员id获取核查人员的核查任务数-->
|
|
|
<select id="getJobNumByUserId" resultType="com.diagbot.dto.DeptCheckUserDTO">
|
|
|
- SELECT check_id doctorId, count(*) as jobNum
|
|
|
- from med_check_info
|
|
|
+ SELECT
|
|
|
+ check_id doctorId,
|
|
|
+ count(*) as jobNum
|
|
|
+ from
|
|
|
+ med_check_info
|
|
|
where is_deleted = 'N' and job_distribution_name is not null
|
|
|
<if test="jobType != null and jobType != ''">
|
|
|
and job_type = #{jobType}
|
|
@@ -44,22 +47,44 @@
|
|
|
|
|
|
<!--获取待分配核查任务列表-->
|
|
|
<select id="getCheckList" resultType="com.diagbot.dto.CheckJobDTO">
|
|
|
- SELECT a.behospital_code behospitalCode,a.beh_dept_name behospitalDept,
|
|
|
- a.doctor_name attendingDoctor,a.leave_hospital_date leaveHospitalDate,
|
|
|
- a.`name`,b.`value`,a.id from
|
|
|
- (select a.behospital_code,a.`name`,a.beh_dept_name,a.doctor_name,a.leave_hospital_date,a.hospital_id,
|
|
|
- a.beh_dept_id,b.id from med_behospital_info a ,med_check_info b
|
|
|
+ SELECT
|
|
|
+ a.behospital_code behospitalCode,
|
|
|
+ a.beh_dept_name behospitalDept,
|
|
|
+ a.doctor_name attendingDoctor,
|
|
|
+ a.leave_hospital_date leaveHospitalDate,
|
|
|
+ a.`name`,
|
|
|
+ b.`value`,
|
|
|
+ a.id
|
|
|
+ from
|
|
|
+ (select
|
|
|
+ a.behospital_code,
|
|
|
+ a.`name`,
|
|
|
+ a.beh_dept_name,
|
|
|
+ a.doctor_name,
|
|
|
+ a.leave_hospital_date,
|
|
|
+ a.hospital_id,
|
|
|
+ a.beh_dept_id,
|
|
|
+ b.id
|
|
|
+ from
|
|
|
+ med_behospital_info a ,med_check_info b
|
|
|
where a.behospital_code = b.behospital_code and a.hospital_id = b.hospital_id and a.is_deleted = 'N'
|
|
|
and b.is_deleted = 'N' and b.job_distribution_name is NULL and b.`status` = 0
|
|
|
<if test="jobType !=null and jobType != ''">
|
|
|
and b.job_type = #{jobType}
|
|
|
</if>
|
|
|
- <if test="startTime !=null and startTime != '' and endTime !=null and endTime != ''">
|
|
|
- and b.job_create_time BETWEEN #{startTime} AND #{endTime}
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ <![CDATA[ AND b.job_create_time >= #{startTime}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ <![CDATA[ AND b.job_create_time < #{endTime}]]>
|
|
|
</if>
|
|
|
- <if test="behosDateStart !=null and behosDateStart != '' and behosDateEnd !=null and behosDateEnd != ''">
|
|
|
- and a.leave_hospital_date BETWEEN #{behosDateStart} AND #{behosDateEnd}
|
|
|
+
|
|
|
+ <if test="behosDateStart != null and behosDateStart != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{behosDateStart}]]>
|
|
|
</if>
|
|
|
+ <if test="behosDateEnd != null and behosDateEnd != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date < #{behosDateEnd}]]>
|
|
|
+ </if>
|
|
|
<if test="doctorName !=null and doctorName != ''">
|
|
|
and a.doctor_name = #{doctorName}
|
|
|
</if>
|
|
@@ -89,22 +114,44 @@
|
|
|
|
|
|
<!--获取指定核查人员的核查任务-->
|
|
|
<select id="getCheckListByUserId" resultType="com.diagbot.dto.CheckJobDTO">
|
|
|
- SELECT a.behospital_code behospitalCode,a.beh_dept_name behospitalDept,
|
|
|
- a.doctor_name attendingDoctor,a.leave_hospital_date leaveHospitalDate,
|
|
|
- a.`name`,b.`value`,a.id from
|
|
|
- (select a.behospital_code,a.`name`,a.beh_dept_name,a.doctor_name,a.leave_hospital_date,a.hospital_id,
|
|
|
- a.beh_dept_id,b.id from med_behospital_info a ,med_check_info b
|
|
|
- where a.behospital_code = b.behospital_code and a.hospital_id = b.hospital_id and a.is_deleted = 'N'
|
|
|
- and b.is_deleted = 'N' and b.`status` = 0
|
|
|
- <if test="startTime !=null and startTime != '' and endTime !=null and endTime != ''">
|
|
|
- and b.job_create_time BETWEEN #{startTime} AND #{endTime}
|
|
|
- </if>
|
|
|
- <if test="behosDateStart !=null and behosDateStart != '' and behosDateEnd !=null and behosDateEnd != ''">
|
|
|
- and a.leave_hospital_date BETWEEN #{behosDateStart} AND #{behosDateEnd}
|
|
|
- </if>
|
|
|
- <if test="checkId !=null and checkId != ''">
|
|
|
- and b.check_id = #{checkId}
|
|
|
- </if>) a LEFT JOIN med_behospital_type b on a.behospital_code = b.behospital_code
|
|
|
+ SELECT
|
|
|
+ a.behospital_code behospitalCode,
|
|
|
+ a.beh_dept_name behospitalDept,
|
|
|
+ a.doctor_name attendingDoctor,
|
|
|
+ a.leave_hospital_date leaveHospitalDate,
|
|
|
+ a.`name`,b.`value`,
|
|
|
+ a.id
|
|
|
+ from
|
|
|
+ (select
|
|
|
+ a.behospital_code,
|
|
|
+ a.`name`,
|
|
|
+ a.beh_dept_name,
|
|
|
+ a.doctor_name,
|
|
|
+ a.leave_hospital_date,
|
|
|
+ a.hospital_id,
|
|
|
+ a.beh_dept_id,
|
|
|
+ b.id
|
|
|
+ from
|
|
|
+ med_behospital_info a ,med_check_info b
|
|
|
+ where a.behospital_code = b.behospital_code and a.hospital_id = b.hospital_id and a.is_deleted = 'N'
|
|
|
+ and b.is_deleted = 'N' and b.`status` = 0
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ <![CDATA[ AND b.job_create_time >= #{startTime}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ <![CDATA[ AND b.job_create_time < #{endTime}]]>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="behosDateStart != null and behosDateStart != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{behosDateStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="behosDateEnd != null and behosDateEnd != ''">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date < #{behosDateEnd}]]>
|
|
|
+ </if>
|
|
|
+ <if test="checkId !=null and checkId != ''">
|
|
|
+ and b.check_id = #{checkId}
|
|
|
+ </if>
|
|
|
+ ) a LEFT JOIN med_behospital_type b on a.behospital_code = b.behospital_code
|
|
|
and a.hospital_id = b.hospital_id and b.is_deleted = 'N' ORDER BY b.`value` DESC ,a.leave_hospital_date DESC
|
|
|
</select>
|
|
|
<select id="getCheckWorkPage" resultType="com.diagbot.dto.CheckWorkDTO">
|