修改病案室页面婴儿的纸质扫描状态跟随母亲

master
zengwh 4 years ago
parent 724ecfdde2
commit 35119daaf0

@ -95,4 +95,5 @@ public interface Archive_MasterMapper {
@Param("reDeadDate")String reDeadDate,
@Param("startDateTo")String startDateTo,
@Param("endDateTo")String endDateTo);
List<String> selectBabyIdWithScan();
}

@ -223,6 +223,8 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
Emr_Dictionary dictionary = new Emr_Dictionary();
dictionary.setTypecode("dept_code");
List<Emr_Dictionary> dictionaries = dictionaryMapper.dicByTypeCode(dictionary);
//查询孕妇有扫描的婴儿的id
List<String> scanBabyIdList = archiveMasterMapper.selectBabyIdWithScan();
for (Archive_Master_Vo masterVo : list) {
//科室名称编码转名称
deptNameCode2Name(dictionaries, masterVo);
@ -233,6 +235,14 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
}else if(status.equals(EnumVerify.DocState.CallBacked.getCode())){
masterVo.setStatus(EnumVerify.DocState.CallBacked.getName());
}
if(!CollectionUtils.isEmpty(scanBabyIdList) && (StringUtils.isBlank(archiveMasterVo.getCheckName()) || "1".equals(archiveMasterVo.getCheckName()))){
for(String scanBabyId : scanBabyIdList){
if(masterVo.getId().equals(scanBabyId)){
masterVo.setCheckName("是");
break;
}
}
}
}
}
return list;

@ -753,13 +753,12 @@
</choose>
</if>
<if test="checkName != null and checkName != ''">
AND MasterID IS
<choose>
<when test="checkName == 0">
NULL
AND MasterID IS NULL AND id not in (<include refid="selectBabyIdWithScanSql"></include>)
</when>
<when test="checkName == 1">
NOT NULL
AND (MasterID IS NOT NULL or id in (<include refid="selectBabyIdWithScanSql"></include>))
</when>
</choose>
</if>
@ -1592,4 +1591,22 @@
AND ArchiveState != '128'
<include refid="disDateRangeWhereSql"></include>)
</select>
<!--查询孕妇有扫描的婴儿的id-->
<select id="selectBabyIdWithScan" resultType="java.lang.String">
<include refid="selectBabyIdWithScanSql"></include>
</select>
<sql id="selectBabyIdWithScanSql">
SELECT
b.ID
FROM
archive_detail
INNER JOIN archive_master ON archive_master.id = archive_detail.MasterID
LEFT JOIN archive_master b ON archive_master.patient_id = b.ID_NO
WHERE
Source = '扫描上传'
AND archive_detail.flag = '0'
AND b.id IS NOT NULL
GROUP BY
b.ID
</sql>
</mapper>
Loading…
Cancel
Save