|
|
|
@ -51,8 +51,8 @@
|
|
|
|
|
<select id="selectChildByClo" resultMap="BaseResultMap3" parameterType="com.emr.entity.Archive_Detail_Vo">
|
|
|
|
|
select sum(s.pageNum) pageNum from
|
|
|
|
|
(select count(*) pageNum from
|
|
|
|
|
archive_detail
|
|
|
|
|
where MasterID in (select id from archive_master where inp_no LIKE '%'+(
|
|
|
|
|
archive_detail table1
|
|
|
|
|
inner join (select id from archive_master where inp_no LIKE '%'+(
|
|
|
|
|
select inp_no from archive_master where 1=1
|
|
|
|
|
<if test="patientId != null and patientId != ''">
|
|
|
|
|
and id=#{patientId,jdbcType=VARCHAR}
|
|
|
|
@ -63,7 +63,8 @@
|
|
|
|
|
</if>)
|
|
|
|
|
and patindex('%B%',inp_no) != 0
|
|
|
|
|
and id!=#{patientId,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
) table2
|
|
|
|
|
on table1.MasterID=table2.id
|
|
|
|
|
<if test="assortId != null and assortId != ''">
|
|
|
|
|
and AssortID=#{assortId,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
@ -75,10 +76,12 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectChild" resultMap="BaseResultMap2" parameterType="com.emr.entity.Archive_Detail_Vo">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
a.id, a.PDF_PATH, a.MasterID, a.UpLoadDateTime, a.AssortID, a.Source, a.SubAssort, a.Title, a.flag,
|
|
|
|
|
a.Sys,a.page_number,a.recover_pdf_path
|
|
|
|
|
from
|
|
|
|
|
archive_detail
|
|
|
|
|
where MasterID in (select id from archive_master where inp_no like '%'+(
|
|
|
|
|
archive_detail a
|
|
|
|
|
inner join
|
|
|
|
|
(select id from archive_master where inp_no like '%'+(
|
|
|
|
|
select inp_no from archive_master where 1=1
|
|
|
|
|
<if test="patientId != null and patientId != ''">
|
|
|
|
|
and id=#{patientId,jdbcType=VARCHAR}
|
|
|
|
@ -89,7 +92,8 @@
|
|
|
|
|
</if>)
|
|
|
|
|
and patindex('%B%',inp_no) != 0
|
|
|
|
|
and id!=#{patientId,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
) b
|
|
|
|
|
on a.MasterID=b.id
|
|
|
|
|
<if test="flag != null">
|
|
|
|
|
and flag = #{flag,jdbcType=NVARCHAR}
|
|
|
|
|
</if>
|
|
|
|
@ -97,17 +101,24 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectChildList" resultMap="BaseResultMap" parameterType="com.emr.entity.Archive_Detail">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
a.id, a.PDF_PATH, a.MasterID, a.UpLoadDateTime, a.AssortID, a.Source, a.SubAssort, a.Title, a.flag,
|
|
|
|
|
a.Sys,a.page_number,a.recover_pdf_path
|
|
|
|
|
from
|
|
|
|
|
archive_detail
|
|
|
|
|
where MasterID in (select id from archive_master where inp_no like '%'+(
|
|
|
|
|
archive_detail a
|
|
|
|
|
inner join
|
|
|
|
|
(select id from archive_master where inp_no like '%'+(
|
|
|
|
|
select inp_no from archive_master where 1=1
|
|
|
|
|
<if test="masterid != null and masterid != ''">
|
|
|
|
|
and id=#{masterid,jdbcType=VARCHAR}
|
|
|
|
|
</if>)+'%'
|
|
|
|
|
and visit_id=(select visit_id from Archive_Master where 1=1
|
|
|
|
|
<if test="masterid != null and masterid != ''">
|
|
|
|
|
and id=#{masterid,jdbcType=VARCHAR}
|
|
|
|
|
</if>)
|
|
|
|
|
and patindex('%B%',inp_no) != 0
|
|
|
|
|
and id!=#{masterid,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
) b
|
|
|
|
|
on a.MasterID=b.id
|
|
|
|
|
<if test="flag != null">
|
|
|
|
|
and flag = #{flag,jdbcType=NVARCHAR}
|
|
|
|
|
</if>
|
|
|
|
@ -185,9 +196,8 @@
|
|
|
|
|
emr_fault_detail m
|
|
|
|
|
left join archive_master f
|
|
|
|
|
on m.archive_detail_id=f.id
|
|
|
|
|
where 1=1 and m.back_flag= 3
|
|
|
|
|
<if test="patientId != null">
|
|
|
|
|
and f.id in (select id from archive_master where inp_no like '%'+(
|
|
|
|
|
INNER JOIN (select id from archive_master where inp_no like '%'+(
|
|
|
|
|
select inp_no from archive_master where 1=1
|
|
|
|
|
<if test="patientId != null and patientId != ''">
|
|
|
|
|
and id=#{patientId,jdbcType=VARCHAR}
|
|
|
|
@ -200,25 +210,24 @@
|
|
|
|
|
and patindex('%B%',inp_no) != 0
|
|
|
|
|
union
|
|
|
|
|
select id from archive_master where id=#{patientId,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
)table1
|
|
|
|
|
on f.id=table1.id
|
|
|
|
|
where 1=1 and m.back_flag= 3
|
|
|
|
|
</if>
|
|
|
|
|
) s
|
|
|
|
|
on s.id=t.MasterID
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="patientId != null">
|
|
|
|
|
and t.MasterID in (select id from archive_master where inp_no like '%'+(
|
|
|
|
|
INNER JOIN(select id from archive_master where inp_no like '%'+(
|
|
|
|
|
select inp_no from archive_master where 1=1
|
|
|
|
|
<if test="patientId != null and patientId != ''">
|
|
|
|
|
and id=#{patientId,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="visit != null and patientId != ''">
|
|
|
|
|
and id=#{patientId,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
)+'%'
|
|
|
|
|
and patindex('%B%',inp_no) != 0
|
|
|
|
|
union
|
|
|
|
|
select id from archive_master where id=#{patientId,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
)table2
|
|
|
|
|
on t.MasterID=table2.id
|
|
|
|
|
</if>
|
|
|
|
|
<if test="source != null and source != '' and source!='-1'">
|
|
|
|
|
and t.Source=#{source,jdbcType=VARCHAR}
|
|
|
|
|