|
|
|
@ -297,6 +297,8 @@
|
|
|
|
|
LEFT JOIN (select zyh,jzh,COUNT(*) num from archive_other_ext where T2!='1801-02-03 00:00:00.000' group by zyh,jzh) extNurse
|
|
|
|
|
on m.inp_no=extNurse.zyh
|
|
|
|
|
and m.visit_id=extNurse.jzh
|
|
|
|
|
LEFT JOIN (select MasterID,COUNT(*) num from archive_printInfo group by MasterID) printTable
|
|
|
|
|
on m.id=printTable.MasterID
|
|
|
|
|
where 1=1 and ArchiveState in('归档中','提交','主任退回') and m.Is_Valid!=1
|
|
|
|
|
and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%'
|
|
|
|
|
<if test="emrCmit!=null and emrCmit!=''">
|
|
|
|
@ -308,18 +310,12 @@
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="printNum != null and printNum != ''">
|
|
|
|
|
and m.id
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="printNum == 1">
|
|
|
|
|
in
|
|
|
|
|
and printTable.MasterID is not null
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>not in</otherwise>
|
|
|
|
|
<otherwise>and printTable.MasterID is null</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
(
|
|
|
|
|
<foreach collection="id.split(',')" item="item" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="inpNo != null and inpNo != ''">
|
|
|
|
|
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
|
|
|
@ -434,18 +430,12 @@
|
|
|
|
|
where 1=1 and ArchiveState in('初审') and m.Is_Valid!=1
|
|
|
|
|
and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%'
|
|
|
|
|
<if test="printNum != null and printNum != ''">
|
|
|
|
|
and m.id
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="printNum == 1">
|
|
|
|
|
in
|
|
|
|
|
and printTable.MasterID is not null
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>not in</otherwise>
|
|
|
|
|
<otherwise>and printTable.MasterID is null</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
(
|
|
|
|
|
<foreach collection="id.split(',')" item="item" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="inpNo != null and inpNo != ''">
|
|
|
|
|
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
|
|
|
@ -708,18 +698,12 @@
|
|
|
|
|
and patindex('%B%',m.inp_no) in (0,1)
|
|
|
|
|
and m.ArchiveState not in('作废','已封存') and m.Is_Valid!=1 and inp_no not like 'LG%'
|
|
|
|
|
<if test="printNum != null and printNum != ''">
|
|
|
|
|
and m.id
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="printNum == 1">
|
|
|
|
|
in
|
|
|
|
|
and printTable.MasterID is not null
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>not in</otherwise>
|
|
|
|
|
<otherwise>and printTable.MasterID is null</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
(
|
|
|
|
|
<foreach collection="id.split(',')" item="item" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="inpNo != null and inpNo != ''">
|
|
|
|
|
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
|
|
|
@ -848,18 +832,12 @@
|
|
|
|
|
where 1=1 and ArchiveState in('提交','主任退回','归档中','复审退回')
|
|
|
|
|
and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%' and m.Is_Valid!=1
|
|
|
|
|
<if test="printNum != null and printNum != ''">
|
|
|
|
|
and m.id
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="printNum == 1">
|
|
|
|
|
in
|
|
|
|
|
and printTable.MasterID is not null
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>not in</otherwise>
|
|
|
|
|
<otherwise>and printTable.MasterID is null</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
(
|
|
|
|
|
<foreach collection="id.split(',')" item="item" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="inpNo != null and inpNo != ''">
|
|
|
|
|
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
|
|
|
|