|
@@ -133,12 +133,19 @@
|
|
<if test="name !=null and name != ''">
|
|
<if test="name !=null and name != ''">
|
|
and a.`name` LIKE CONCAT('%',#{name},'%')
|
|
and a.`name` LIKE CONCAT('%',#{name},'%')
|
|
</if>
|
|
</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
|
|
and a.beh_dept_id in
|
|
<foreach collection="deptList" item="item" open="(" close=")" separator=",">
|
|
<foreach collection="deptList" item="item" open="(" close=")" separator=",">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</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
|
|
) 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'
|
|
and a.hospital_id = b.hospital_id and b.is_deleted = 'N'
|
|
@@ -155,7 +162,8 @@
|
|
a.`name`,
|
|
a.`name`,
|
|
b.`value`,
|
|
b.`value`,
|
|
a.id,
|
|
a.id,
|
|
- a.job_distributor jobDistributor
|
|
|
|
|
|
+ a.job_distributor jobDistributor,
|
|
|
|
+ a.job_distribution_name jobDistributorName
|
|
from
|
|
from
|
|
(select
|
|
(select
|
|
a.behospital_code,
|
|
a.behospital_code,
|
|
@@ -166,7 +174,8 @@
|
|
a.hospital_id,
|
|
a.hospital_id,
|
|
a.beh_dept_id,
|
|
a.beh_dept_id,
|
|
b.id,
|
|
b.id,
|
|
- b.job_distributor
|
|
|
|
|
|
+ b.job_distributor,
|
|
|
|
+ b.job_distribution_name
|
|
from
|
|
from
|
|
med_behospital_info a ,med_check_info b
|
|
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'
|
|
where a.behospital_code = b.behospital_code and a.hospital_id = b.hospital_id and a.is_deleted = 'N'
|
|
@@ -199,19 +208,16 @@
|
|
<select id="getCheckWorkPage" resultType="com.diagbot.dto.CheckWorkDTO">
|
|
<select id="getCheckWorkPage" resultType="com.diagbot.dto.CheckWorkDTO">
|
|
SELECT
|
|
SELECT
|
|
mbi.behospital_code behospitalCode,
|
|
mbi.behospital_code behospitalCode,
|
|
- mbi.name,
|
|
|
|
|
|
+ mbi.`name`,
|
|
mbi.file_code fileCode,
|
|
mbi.file_code fileCode,
|
|
mbi.sex,
|
|
mbi.sex,
|
|
mhp.age,
|
|
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.beh_dept_name behDeptName,
|
|
mbi.leave_hospital_date leaveHospitalDate,
|
|
mbi.leave_hospital_date leaveHospitalDate,
|
|
mhp.behospital_day_num behospitalDayNum,
|
|
mhp.behospital_day_num behospitalDayNum,
|
|
mbi.doctor_name doctorName,
|
|
mbi.doctor_name doctorName,
|
|
mqi.score_res scoreRes,
|
|
mqi.score_res scoreRes,
|
|
- mqi.level,
|
|
|
|
|
|
+ mqi.`level`,
|
|
mbi.diagnose,
|
|
mbi.diagnose,
|
|
CASE WHEN mbt.behospital_type='出院病人' THEN '6'
|
|
CASE WHEN mbt.behospital_type='出院病人' THEN '6'
|
|
WHEN mbt.behospital_type='死亡病人' THEN '6'
|
|
WHEN mbt.behospital_type='死亡病人' THEN '6'
|
|
@@ -256,7 +262,7 @@
|
|
AND mci.job_create_time is null
|
|
AND mci.job_create_time is null
|
|
</if>
|
|
</if>
|
|
<if test="name != null and name != ''">
|
|
<if test="name != null and name != ''">
|
|
- AND mbi.name like CONCAT('%',#{name},'%')
|
|
|
|
|
|
+ AND mbi.`name` like CONCAT('%',#{name},'%')
|
|
</if>
|
|
</if>
|
|
<if test="behospitalCode != null and behospitalCode != ''">
|
|
<if test="behospitalCode != null and behospitalCode != ''">
|
|
AND mbi.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
AND mbi.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
@@ -280,13 +286,34 @@
|
|
AND mbi.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
AND mbi.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
</if>
|
|
</if>
|
|
<if test="level != null and level != ''">
|
|
<if test="level != null and level != ''">
|
|
- AND mqi.level= #{level}
|
|
|
|
|
|
+ AND mqi.`level`= #{level}
|
|
</if>
|
|
</if>
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
AND mbi.is_placefile = #{isPlacefile}
|
|
AND mbi.is_placefile = #{isPlacefile}
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</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">
|
|
<update id="deleteBatchCodes">
|
|
<foreach collection="list" item="item" separator=";">
|
|
<foreach collection="list" item="item" separator=";">
|