|
|
|
@ -170,20 +170,12 @@
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectByCol" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap">
|
|
|
|
|
select distinct m.id,m.patient_id,m.inp_no,m.cmt_doctor,m.cmt_nurse,m.visit_id,m.name,m.sex,ISNULL(f.name, m.dept_name) dept_name
|
|
|
|
|
select distinct m.id,m.patient_id,m.inp_no,m.cmt_doctor,m.cmt_nurse,m.visit_id,m.name,m.sex,m.dept_name
|
|
|
|
|
,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time
|
|
|
|
|
,ISNULL(d.name,m.dept_admission_to) dept_admission_to,m.check_doctor,m.doctor_name,m.nurse_name,m.checked_datetime,m.checked_doctor
|
|
|
|
|
,m.dept_admission_to,m.check_doctor,m.doctor_name,m.nurse_name,m.checked_datetime,m.checked_doctor
|
|
|
|
|
,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned,m.is_scanning,bed_number
|
|
|
|
|
,ISNULL(printTable.num, 0) printNum
|
|
|
|
|
,ISNULL(m.print_flag, 0) printNum
|
|
|
|
|
from archive_master m
|
|
|
|
|
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
|
|
|
|
|
typeCode='dept_code' ))d
|
|
|
|
|
on m.dept_admission_to=d.code
|
|
|
|
|
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
|
|
|
|
|
typeCode='dept_code' )) f
|
|
|
|
|
on m.dept_name=f.code
|
|
|
|
|
LEFT JOIN (select MasterID,COUNT(*) num from archive_printInfo group by MasterID) printTable
|
|
|
|
|
on m.id=printTable.MasterID
|
|
|
|
|
where 1=1
|
|
|
|
|
and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%' and m.Is_Valid!=1
|
|
|
|
|
<if test="deptAdmissionTo!= null and deptAdmissionTo!= ''">
|
|
|
|
@ -1749,21 +1741,7 @@
|
|
|
|
|
from archive_master where 1=1 and ArchiveState not in('作废','已封存','取消入院') and Is_Valid!=1
|
|
|
|
|
) m
|
|
|
|
|
on f.master_id=m.master_id
|
|
|
|
|
-- LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where typeCode='dept_code' )) c
|
|
|
|
|
-- on m.dept_name=c.code
|
|
|
|
|
--
|
|
|
|
|
-- LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where typeCode='dept_code' )) e
|
|
|
|
|
-- on m.dept_admission_to=e.code
|
|
|
|
|
<where> 1=1 and m.master_id!='' and m.master_id is not null
|
|
|
|
|
<!--<if test="(overdueDaysTwo != null and overdueDaysTwo != '') ">-->
|
|
|
|
|
<!--and-->
|
|
|
|
|
<!--DATEDIFF(dd,(SELECT max(b.date)-->
|
|
|
|
|
<!--FROM (select top 4 date from emr_holiday_set where date >= CONVERT (-->
|
|
|
|
|
<!--VARCHAR (10),-->
|
|
|
|
|
<!--m.discharge_date_time,-->
|
|
|
|
|
<!--120-->
|
|
|
|
|
<!--) and flag= 1 order by date asc) as b), CONVERT(VARCHAR(20),f.handle_time,23)) >=#{overdueDaysTwo,jdbcType=NCHAR}-->
|
|
|
|
|
<!--</if>-->
|
|
|
|
|
<if test="id != null and id != ''">
|
|
|
|
|
and m.id = #{id,jdbcType=NVARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|