|
|
@ -23,7 +23,7 @@
|
|
|
|
<result column="DISCHARGE_DISPOSITION" jdbcType="NVARCHAR" property="dischargeDisposition" />
|
|
|
|
<result column="DISCHARGE_DISPOSITION" jdbcType="NVARCHAR" property="dischargeDisposition" />
|
|
|
|
<result column="dept_code_lend" jdbcType="NVARCHAR" property="deptCodeLend" />
|
|
|
|
<result column="dept_code_lend" jdbcType="NVARCHAR" property="deptCodeLend" />
|
|
|
|
<result column="isscaned" jdbcType="NVARCHAR" property="isscaned" />
|
|
|
|
<result column="isscaned" jdbcType="NVARCHAR" property="isscaned" />
|
|
|
|
<result column="isScanning" jdbcType="NVARCHAR" property="is_scanning" />
|
|
|
|
<result column="is_scanning" jdbcType="NVARCHAR" property="isScanning" />
|
|
|
|
<result column="bed_number" jdbcType="NVARCHAR" property="bedNumber" />
|
|
|
|
<result column="bed_number" jdbcType="NVARCHAR" property="bedNumber" />
|
|
|
|
|
|
|
|
|
|
|
|
<result column="cmt_doctor" jdbcType="INTEGER" property="cmtDoctor"/>
|
|
|
|
<result column="cmt_doctor" jdbcType="INTEGER" property="cmtDoctor"/>
|
|
|
@ -41,30 +41,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<!--<resultMap id="BaseResultMap2" type="com.emr.entity.Archive_MasterVo">-->
|
|
|
|
<resultMap id="BaseResultMap2" type="com.emr.entity.Archive_Master_Vo">
|
|
|
|
<!--<id column="id" jdbcType="NVARCHAR" property="id"/>-->
|
|
|
|
<id column="id" jdbcType="NVARCHAR" property="id" />
|
|
|
|
<!--<result column="patient_id" jdbcType="NVARCHAR" property="patientId"/>-->
|
|
|
|
<result column="patient_id" jdbcType="NVARCHAR" property="patientId" />
|
|
|
|
<!--<result column="inp_no" jdbcType="NVARCHAR" property="inpNo"/>-->
|
|
|
|
<result column="inp_no" jdbcType="NVARCHAR" property="inpNo" />
|
|
|
|
<!--<result column="visit_id" jdbcType="NVARCHAR" property="visitId"/>-->
|
|
|
|
<result column="visit_id" jdbcType="NVARCHAR" property="visitId" />
|
|
|
|
<!--<result column="name" jdbcType="NVARCHAR" property="name"/>-->
|
|
|
|
<result column="name" jdbcType="NVARCHAR" property="name" />
|
|
|
|
<!--<result column="sex" jdbcType="NVARCHAR" property="sex"/>-->
|
|
|
|
<result column="sex" jdbcType="NVARCHAR" property="sex" />
|
|
|
|
<!--<result column="dept_name" jdbcType="NVARCHAR" property="deptName"/>-->
|
|
|
|
<result column="dept_name" jdbcType="NVARCHAR" property="deptName" />
|
|
|
|
<!--<result column="discharge_date_time" jdbcType="NVARCHAR" property="dischargeDateTime"/>-->
|
|
|
|
<result column="discharge_date_time" jdbcType="NVARCHAR" property="dischargeDateTime" />
|
|
|
|
<!--<result column="ArchiveState" jdbcType="NVARCHAR" property="archivestate"/>-->
|
|
|
|
<result column="ArchiveState" jdbcType="NVARCHAR" property="archivestate" />
|
|
|
|
<!--<result column="admission_date_time" jdbcType="NVARCHAR" property="admissionDateTime"/>-->
|
|
|
|
<result column="admission_date_time" jdbcType="NVARCHAR" property="admissionDateTime" />
|
|
|
|
<!--<result column="dept_admission_to" jdbcType="NVARCHAR" property="deptAdmissionTo"/>-->
|
|
|
|
<result column="dept_admission_to" jdbcType="NVARCHAR" property="deptAdmissionTo" />
|
|
|
|
<!--<result column="check_doctor" jdbcType="NVARCHAR" property="checkDoctor"/>-->
|
|
|
|
<result column="check_doctor" jdbcType="NVARCHAR" property="checkDoctor" />
|
|
|
|
<!--<result column="check_datetime" jdbcType="NVARCHAR" property="checkDatetime"/>-->
|
|
|
|
<result column="check_datetime" jdbcType="NVARCHAR" property="checkDatetime" />
|
|
|
|
<!--<result column="checked_doctor" jdbcType="NVARCHAR" property="checkedDoctor"/>-->
|
|
|
|
<result column="checked_doctor" jdbcType="NVARCHAR" property="checkedDoctor" />
|
|
|
|
<!--<result column="checked_datetime" jdbcType="NVARCHAR" property="checkedDatetime"/>-->
|
|
|
|
<result column="checked_datetime" jdbcType="NVARCHAR" property="checkedDatetime" />
|
|
|
|
<!--<result column="LockInfo" jdbcType="NVARCHAR" property="lockinfo"/>-->
|
|
|
|
<result column="LockInfo" jdbcType="NVARCHAR" property="lockinfo" />
|
|
|
|
<!--<result column="DOCTOR_IN_CHARGE" jdbcType="NVARCHAR" property="doctorInCharge"/>-->
|
|
|
|
<result column="DOCTOR_IN_CHARGE" jdbcType="NVARCHAR" property="doctorInCharge" />
|
|
|
|
<!--<result column="ID_NO" jdbcType="NVARCHAR" property="idNo"/>-->
|
|
|
|
<result column="ID_NO" jdbcType="NVARCHAR" property="idNo" />
|
|
|
|
<!--<result column="DISCHARGE_DISPOSITION" jdbcType="NVARCHAR" property="dischargeDisposition"/>-->
|
|
|
|
<result column="DISCHARGE_DISPOSITION" jdbcType="NVARCHAR" property="dischargeDisposition" />
|
|
|
|
<!--<result column="dept_code_lend" jdbcType="NVARCHAR" property="deptCodeLend"/>-->
|
|
|
|
<result column="dept_code_lend" jdbcType="NVARCHAR" property="deptCodeLend" />
|
|
|
|
<!--<result column="startDateTo" jdbcType="NVARCHAR" property="startDateTo"/>-->
|
|
|
|
<result column="isscaned" jdbcType="NVARCHAR" property="isscaned" />
|
|
|
|
<!--<result column="endDateTo" jdbcType="NVARCHAR" property="endDateTo"/>-->
|
|
|
|
<result column="is_scanning" jdbcType="NVARCHAR" property="isScanning" />
|
|
|
|
<!--</resultMap>-->
|
|
|
|
<result column="bed_number" jdbcType="NVARCHAR" property="bedNumber" />
|
|
|
|
|
|
|
|
<result column="cmt_doctor" jdbcType="INTEGER" property="cmtDoctor"/>
|
|
|
|
|
|
|
|
<result column="cmt_nurse" jdbcType="INTEGER" property="cmtNurse"/>
|
|
|
|
|
|
|
|
<result column="doctor_name" jdbcType="NVARCHAR" property="doctorName"/>
|
|
|
|
|
|
|
|
<result column="nurse_name" jdbcType="NVARCHAR" property="nurseName"/>
|
|
|
|
|
|
|
|
<result column="cmt_doctor_date" jdbcType="NVARCHAR" property="cmtDoctorDate"/>
|
|
|
|
|
|
|
|
<result column="cmt_nurse_date" jdbcType="NVARCHAR" property="cmtNurseDate"/>
|
|
|
|
|
|
|
|
<result column="emr_doctor_cmt" jdbcType="NVARCHAR" property="emrDoctorCmt"/>
|
|
|
|
|
|
|
|
<result column="emr_nure_cmt" jdbcType="NVARCHAR" property="emrNureCmt"/>
|
|
|
|
|
|
|
|
<result column="first_instance" jdbcType="NVARCHAR" property="firstInstance"/>
|
|
|
|
|
|
|
|
<result column="death_flag" jdbcType="NVARCHAR" property="deathFlag"/>
|
|
|
|
|
|
|
|
<result column="transfer_dept" jdbcType="NVARCHAR" property="transferDept"/>
|
|
|
|
|
|
|
|
<result column="fid" jdbcType="NVARCHAR" property="fid"/>
|
|
|
|
|
|
|
|
<result column="handle_id" jdbcType="NVARCHAR" property="handleId"/>
|
|
|
|
|
|
|
|
<result column="handle_name" jdbcType="NVARCHAR" property="handleName"/>
|
|
|
|
|
|
|
|
<result column="handle_time" jdbcType="NVARCHAR" property="handleTime"/>
|
|
|
|
|
|
|
|
<result column="following_type" jdbcType="NVARCHAR" property="followingType"/>
|
|
|
|
|
|
|
|
<result column="following_content" jdbcType="NVARCHAR" property="followingContent"/>
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
id, patient_id, inp_no, visit_id, name, sex, dept_name, discharge_date_time, ArchiveState,
|
|
|
|
id, patient_id, inp_no, visit_id, name, sex, dept_name, discharge_date_time, ArchiveState,
|
|
|
|
admission_date_time, dept_admission_to, check_doctor, check_datetime, checked_doctor, transfer_dept,
|
|
|
|
admission_date_time, dept_admission_to, check_doctor, check_datetime, checked_doctor, transfer_dept,
|
|
|
@ -921,10 +939,10 @@
|
|
|
|
<if test="isScanning != null and isScanning != ''">
|
|
|
|
<if test="isScanning != null and isScanning != ''">
|
|
|
|
is_scanning = #{isScanning,jdbcType=NVARCHAR},
|
|
|
|
is_scanning = #{isScanning,jdbcType=NVARCHAR},
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="cmtDoctor != null">
|
|
|
|
<if test="cmtDoctor >-1">
|
|
|
|
cmt_doctor = #{cmtDoctor,jdbcType=INTEGER},
|
|
|
|
cmt_doctor = #{cmtDoctor,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="cmtNurse != null">
|
|
|
|
<if test="cmtNurse >-1">
|
|
|
|
cmt_nurse = #{cmtNurse,jdbcType=INTEGER},
|
|
|
|
cmt_nurse = #{cmtNurse,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="doctorName != null " >
|
|
|
|
<if test="doctorName != null " >
|
|
|
@ -981,4 +999,97 @@
|
|
|
|
<select id="getFName" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
|
<select id="getFName" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
|
SELECT `name` FROM `power_user` WHERE user_name = #{userName}
|
|
|
|
SELECT `name` FROM `power_user` WHERE user_name = #{userName}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectHandleDetail" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">
|
|
|
|
|
|
|
|
SELECT m.id
|
|
|
|
|
|
|
|
,m.patient_id
|
|
|
|
|
|
|
|
,m.inp_no
|
|
|
|
|
|
|
|
,m.visit_id
|
|
|
|
|
|
|
|
,m.name
|
|
|
|
|
|
|
|
,m.sex
|
|
|
|
|
|
|
|
,g.name 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
|
|
|
|
|
|
|
|
,d.name dept_admission_to
|
|
|
|
|
|
|
|
,m.check_doctor
|
|
|
|
|
|
|
|
,m.check_datetime
|
|
|
|
|
|
|
|
,m.checked_doctor
|
|
|
|
|
|
|
|
,m.checked_datetime
|
|
|
|
|
|
|
|
,m.LockInfo
|
|
|
|
|
|
|
|
,m.DOCTOR_IN_CHARGE
|
|
|
|
|
|
|
|
,m.ID_NO
|
|
|
|
|
|
|
|
,m.DISCHARGE_DISPOSITION
|
|
|
|
|
|
|
|
,m.dept_code_lend
|
|
|
|
|
|
|
|
,m.cmt_doctor
|
|
|
|
|
|
|
|
,m.cmt_nurse
|
|
|
|
|
|
|
|
,m.doctor_name
|
|
|
|
|
|
|
|
,m.nurse_name
|
|
|
|
|
|
|
|
,m.cmt_doctor_date
|
|
|
|
|
|
|
|
,m.cmt_nurse_date
|
|
|
|
|
|
|
|
,m.emr_doctor_cmt
|
|
|
|
|
|
|
|
,m.emr_nure_cmt
|
|
|
|
|
|
|
|
,m.death_flag
|
|
|
|
|
|
|
|
,m.first_instance
|
|
|
|
|
|
|
|
,m.transfer_dept
|
|
|
|
|
|
|
|
,m.IsScaned
|
|
|
|
|
|
|
|
,m.bed_number
|
|
|
|
|
|
|
|
,m.is_scanning
|
|
|
|
|
|
|
|
,f.id as fid
|
|
|
|
|
|
|
|
,f.following_type
|
|
|
|
|
|
|
|
,f.following_content
|
|
|
|
|
|
|
|
,CONVERT(varchar(10),f.handle_time, 120)handle_time
|
|
|
|
|
|
|
|
,f.handle_id
|
|
|
|
|
|
|
|
,f.handle_name
|
|
|
|
|
|
|
|
,f.remark
|
|
|
|
|
|
|
|
FROM archive_master m
|
|
|
|
|
|
|
|
LEFT JOIN Archive_Master_Following f
|
|
|
|
|
|
|
|
on m.id=f.master_id
|
|
|
|
|
|
|
|
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' )) g
|
|
|
|
|
|
|
|
on m.dept_name=g.code
|
|
|
|
|
|
|
|
where 1=1
|
|
|
|
|
|
|
|
<if test="id != null and id != ''">
|
|
|
|
|
|
|
|
and m.id = #{id,jdbcType=NVARCHAR}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="inpNo != null and inpNo != ''">
|
|
|
|
|
|
|
|
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="visitId != null and visitId != ''">
|
|
|
|
|
|
|
|
and m.visit_id=#{visitId,jdbcType=NCHAR}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="name != null and name != ''">
|
|
|
|
|
|
|
|
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="deptName!= null and deptName!= ''">
|
|
|
|
|
|
|
|
and m.dept_name in
|
|
|
|
|
|
|
|
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
|
|
|
|
|
|
|
|
#{item}
|
|
|
|
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="handleTime != null">
|
|
|
|
|
|
|
|
and f.handle_time = #{handleTime,jdbcType=NVARCHAR}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<choose>
|
|
|
|
|
|
|
|
<when test="startHandleTime != null and startHandleTime != '' and endHandleTime != null and endHandleTime != ''">
|
|
|
|
|
|
|
|
and f.handle_time between CONVERT(VARCHAR(10),#{startHandleTime,jdbcType=NCHAR},120) and
|
|
|
|
|
|
|
|
#{endHandleTime,jdbcType=NCHAR}+ ' 23:59:59'
|
|
|
|
|
|
|
|
</when>
|
|
|
|
|
|
|
|
<when test="startHandleTime != null and startHandleTime != ''">
|
|
|
|
|
|
|
|
and f.handle_time >= CONVERT(VARCHAR(10),#{startHandleTime,jdbcType=NCHAR},120)
|
|
|
|
|
|
|
|
</when>
|
|
|
|
|
|
|
|
<when test="endHandleTime != null and endHandleTime != ''">
|
|
|
|
|
|
|
|
and f.handle_time <= #{endHandleTime,jdbcType=NCHAR}+ ' 23:59:59'
|
|
|
|
|
|
|
|
</when>
|
|
|
|
|
|
|
|
</choose>
|
|
|
|
|
|
|
|
<if test="handleName != null and handleName != ''">
|
|
|
|
|
|
|
|
and f.handle_name like '%'+#{handleName,jdbcType=NCHAR}+'%'
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="followingType != null and followingType != ''">
|
|
|
|
|
|
|
|
and f.following_type in(#{followingType,jdbcType=NVARCHAR})
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
ORDER BY f.handle_time desc
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|