@ -219,6 +219,10 @@
<!-- 不带科室的出院条件查询 -->
<sql id= "beHospitalSeach1" >
and ArchiveState != '1024' and ArchiveState != '128' and YEAR(discharge_date_time) != '1801'
/**根据待审核节点查询*/
<include refid= "selectByInfo" > </include>
/**根据审核状态查询*/
<include refid= "selectByStatus" > </include>
<if test= "inpNo != null and inpNo != ''" >
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
@ -389,19 +393,19 @@
<choose >
<!-- 医生 -->
<when test= "status == 2" >
AND ArchiveState IN ('2','18','50','514','6','22','54','518','14','30','526','64','1024')
AND ArchiveState IN ('2','18','50','514','768',' 6','22','54','518','14','30','62 ','526','64','1024')
</when>
<when test= "status == 3" >
AND ArchiveState IN ('6','22','54','518','14','30','526','64','1024')
AND ArchiveState IN ('6','22','54','518','14','30','62',' 526','64','1024')
</when>
<when test= "status == 4" >
AND ArchiveState IN ('14','30','526','64','1024')
AND ArchiveState IN ('14','30','62',' 526','64','1024')
</when>
<when test= "status == 5" >
AND ArchiveState IN ('16','18','22','40','528','48','50','54','304','64','1024')
AND ArchiveState IN ('16','18','22','40','528','768',' 48','50','54','62 ','304','64','1024')
</when>
<when test= "status == 6" >
AND ArchiveState IN ('48','50','54','304','64','1024')
AND ArchiveState IN ('48','50','54','62',' 304','64','1024')
</when>
<when test= "status == 7" >
AND ArchiveState IN ('64')
@ -497,7 +501,28 @@
days
END from emr_overtime_set where id = 1) days
from archive_master m
where 1=1 and (ArchiveState = '64' or ArchiveState = '1024')
where 1=1 and ArchiveState in ('64','1024')
<!-- 查询纸质签收状态 -->
<if test= "isSign != null" >
and patient_id
<choose >
<!-- 已签收 -->
<when test= "isSign == 1" >
in
</when>
<otherwise >
not in
</otherwise>
</choose>
(
<choose >
<when test= "patientIdsForSign != null" >
<foreach collection= "patientIdsForSign" item= "item" separator= "," > #{item}</foreach>
</when>
<otherwise > '无效'</otherwise>
</choose>
)
</if>
<if test= "id != null and id != ''" >
and m.id = #{id,jdbcType=NVARCHAR}
</if>
@ -555,7 +580,6 @@
and m.admission_date_time < = #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test= "checkDoctor != null" >
and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR}
</if>
@ -1152,4 +1176,9 @@
ORDER BY
DOCTOR_IN_CHARGE
</select>
<!-- 查询需要查询纸质状态的记账号集合 -->
<select id= "selectPatientIdsForSign" resultMap= "BaseResultMap" >
select patient_id from archive_master where ArchiveState in ('64','1024')
order by discharge_date_time desc
</select>
</mapper>