|
@@ -133,12 +133,19 @@
|
|
|
<if test="name !=null and name != ''">
|
|
|
and a.`name` LIKE CONCAT('%',#{name},'%')
|
|
|
</if>
|
|
|
- <if test="deptList !=null and deptList.size()!=0">
|
|
|
+ <if test="deptList !=null and deptList.size()!=0 and (jobType == 0 or jobType ==1)">
|
|
|
and a.beh_dept_id in
|
|
|
<foreach collection="deptList" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ <if test="deptList !=null and deptList.size()!=0 and jobType == 2">
|
|
|
+ and a.beh_dept_id not in
|
|
|
+ <foreach collection="deptList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </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'
|
|
@@ -155,7 +162,8 @@
|
|
|
a.`name`,
|
|
|
b.`value`,
|
|
|
a.id,
|
|
|
- a.job_distributor jobDistributor
|
|
|
+ a.job_distributor jobDistributor,
|
|
|
+ a.job_distribution_name jobDistributorName
|
|
|
from
|
|
|
(select
|
|
|
a.behospital_code,
|
|
@@ -166,7 +174,8 @@
|
|
|
a.hospital_id,
|
|
|
a.beh_dept_id,
|
|
|
b.id,
|
|
|
- b.job_distributor
|
|
|
+ b.job_distributor,
|
|
|
+ b.job_distribution_name
|
|
|
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'
|
|
@@ -203,9 +212,6 @@
|
|
|
mbi.file_code fileCode,
|
|
|
mbi.sex,
|
|
|
mhp.age,
|
|
|
- TIMESTAMPDIFF(year,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) as ageYear,
|
|
|
- TIMESTAMPDIFF(month,DATE_ADD(ifnull(mhp.birthday,mbi.birthday),INTERVAL TIMESTAMPDIFF(year,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) year),mbi.behospital_date) as ageMon,
|
|
|
- TIMESTAMPDIFF(day,DATE_ADD(ifnull(mhp.birthday,mbi.birthday),INTERVAL TIMESTAMPDIFF(month,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) month),mbi.behospital_date) as ageDay,
|
|
|
mbi.beh_dept_name behDeptName,
|
|
|
mbi.leave_hospital_date leaveHospitalDate,
|
|
|
mhp.behospital_day_num behospitalDayNum,
|
|
@@ -287,6 +293,27 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!--获取核查任务年龄-->
|
|
|
+ <select id="getCheckWorkAgeByCodes" resultType="com.diagbot.dto.CheckWorkDTO">
|
|
|
+ SELECT
|
|
|
+ mbi.behospital_code behospitalCode,
|
|
|
+ mhp.age,
|
|
|
+ TIMESTAMPDIFF(year,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) as ageYear,
|
|
|
+ TIMESTAMPDIFF(month,DATE_ADD(ifnull(mhp.birthday,mbi.birthday),INTERVAL TIMESTAMPDIFF(year,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) year),mbi.behospital_date) as ageMon,
|
|
|
+ TIMESTAMPDIFF(day,DATE_ADD(ifnull(mhp.birthday,mbi.birthday),INTERVAL TIMESTAMPDIFF(month,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) month),mbi.behospital_date) as ageDay
|
|
|
+ FROM
|
|
|
+ med_behospital_info mbi
|
|
|
+ LEFT JOIN med_home_page mhp
|
|
|
+ ON mbi.behospital_code=mhp.behospital_code
|
|
|
+ AND mbi.hospital_id = mhp.hospital_id AND mhp.is_deleted = 'N'
|
|
|
+ WHERE mbi.hospital_id=#{hospitalId} AND mbi.is_deleted = 'N'
|
|
|
+ <if test="behospitalCodes !=null and behospitalCodes.size > 0">
|
|
|
+ and mbi.behospital_code in
|
|
|
+ <foreach collection="behospitalCodes" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
<!--通过住院号,取消核查任务-->
|
|
|
<update id="deleteBatchCodes">
|
|
|
<foreach collection="list" item="item" separator=";">
|