@ -22,65 +22,118 @@
<result column= "ID_NO" jdbcType= "NVARCHAR" property= "idNo" />
<result column= "DISCHARGE_DISPOSITION" jdbcType= "NVARCHAR" property= "dischargeDisposition" />
<result column= "dept_code_lend" jdbcType= "NVARCHAR" property= "deptCodeLend" />
<result column= "isscaned" jdbcType= "NVARCHAR" property= "isscaned" />
<result column= "is_scanning" jdbcType= "NVARCHAR" property= "isScanning" />
<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= "score" jdbcType= "NVARCHAR" property= "score" />
</resultMap>
<!-- <resultMap id="BaseResultMap2" type="com.emr.entity.Archive_MasterVo"> -->
<!-- <id column="id" jdbcType="NVARCHAR" property="id"/> -->
<!-- <result column="patient_id" jdbcType="NVARCHAR" property="patientId"/> -->
<!-- <result column="inp_no" jdbcType="NVARCHAR" property="inpNo"/> -->
<!-- <result column="visit_id" jdbcType="NVARCHAR" property="visitId"/> -->
<!-- <result column="name" jdbcType="NVARCHAR" property="name"/> -->
<!-- <result column="sex" jdbcType="NVARCHAR" property="sex"/> -->
<!-- <result column="dept_name" jdbcType="NVARCHAR" property="deptName"/> -->
<!-- <result column="discharge_date_time" jdbcType="NVARCHAR" property="dischargeDateTime"/> -->
<!-- <result column="ArchiveState" jdbcType="NVARCHAR" property="archivestate"/> -->
<!-- <result column="admission_date_time" jdbcType="NVARCHAR" property="admissionDateTime"/> -->
<!-- <result column="dept_admission_to" jdbcType="NVARCHAR" property="deptAdmissionTo"/> -->
<!-- <result column="check_doctor" jdbcType="NVARCHAR" property="checkDoctor"/> -->
<!-- <result column="check_datetime" jdbcType="NVARCHAR" property="checkDatetime"/> -->
<!-- <result column="checked_doctor" jdbcType="NVARCHAR" property="checkedDoctor"/> -->
<!-- <result column="checked_datetime" jdbcType="NVARCHAR" property="checkedDatetime"/> -->
<!-- <result column="LockInfo" jdbcType="NVARCHAR" property="lockinfo"/> -->
<!-- <result column="DOCTOR_IN_CHARGE" jdbcType="NVARCHAR" property="doctorInCharge"/> -->
<!-- <result column="ID_NO" jdbcType="NVARCHAR" property="idNo"/> -->
<!-- <result column="DISCHARGE_DISPOSITION" jdbcType="NVARCHAR" property="dischargeDisposition"/> -->
<!-- <result column="dept_code_lend" jdbcType="NVARCHAR" property="deptCodeLend"/> -->
<!-- <result column="startDateTo" jdbcType="NVARCHAR" property="startDateTo"/> -->
<!-- <result column="endDateTo" jdbcType="NVARCHAR" property="endDateTo"/> -->
<!-- </resultMap> -->
<resultMap id= "BaseResultMap2" type= "com.emr.entity.Archive_Master_Vo" >
<id column= "id" jdbcType= "NVARCHAR" property= "id" />
<result column= "patient_id" jdbcType= "NVARCHAR" property= "patientId" />
<result column= "inp_no" jdbcType= "NVARCHAR" property= "inpNo" />
<result column= "visit_id" jdbcType= "NVARCHAR" property= "visitId" />
<result column= "name" jdbcType= "NVARCHAR" property= "name" />
<result column= "sex" jdbcType= "NVARCHAR" property= "sex" />
<result column= "dept_name" jdbcType= "NVARCHAR" property= "deptName" />
<result column= "discharge_date_time" jdbcType= "NVARCHAR" property= "dischargeDateTime" />
<result column= "ArchiveState" jdbcType= "NVARCHAR" property= "archivestate" />
<result column= "admission_date_time" jdbcType= "NVARCHAR" property= "admissionDateTime" />
<result column= "dept_admission_to" jdbcType= "NVARCHAR" property= "deptAdmissionTo" />
<result column= "check_doctor" jdbcType= "NVARCHAR" property= "checkDoctor" />
<result column= "check_datetime" jdbcType= "NVARCHAR" property= "checkDatetime" />
<result column= "checked_doctor" jdbcType= "NVARCHAR" property= "checkedDoctor" />
<result column= "checked_datetime" jdbcType= "NVARCHAR" property= "checkedDatetime" />
<result column= "LockInfo" jdbcType= "NVARCHAR" property= "lockinfo" />
<result column= "DOCTOR_IN_CHARGE" jdbcType= "NVARCHAR" property= "doctorInCharge" />
<result column= "ID_NO" jdbcType= "NVARCHAR" property= "idNo" />
<result column= "DISCHARGE_DISPOSITION" jdbcType= "NVARCHAR" property= "dischargeDisposition" />
<result column= "dept_code_lend" jdbcType= "NVARCHAR" property= "deptCodeLend" />
<result column= "isscaned" jdbcType= "NVARCHAR" property= "isscaned" />
<result column= "is_scanning" jdbcType= "NVARCHAR" property= "isScanning" />
<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" />
<result column= "overdue" jdbcType= "NVARCHAR" property= "overdue" />
<result column= "create_time" jdbcType= "NVARCHAR" property= "createTime" />
<result column= "score" jdbcType= "NVARCHAR" property= "score" />
</resultMap>
<sql id= "Base_Column_List" >
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,
checked_datetime, LockInfo, DOCTOR_IN_CHARGE, ID_NO, DISCHARGE_DISPOSITION, dept_code_lend
admission_date_time, dept_admission_to, check_doctor, check_datetime, checked_doctor, transfer_dept,
checked_datetime, LockInfo, DOCTOR_IN_CHARGE, ID_NO, DISCHARGE_DISPOSITION, dept_code_lend,isscaned,is_scanning,
cmt_doctor,cmt_nurse,doctor_name,nurse_name,cmt_doctor_date,cmt_nurse_date,emr_doctor_cmt,emr_nure_cmt,death_flag,bed_number
</sql>
<select id= "selectByPrimaryKey" parameterType= "java.lang.String" resultMap= "BaseResultMap" >
<select id= "selectBy Id " parameterType= "java.lang.String" resultMap= "BaseResultMap" >
select
<include refid= "Base_Column_List" />
from archive_master
where id = #{id,jdbcType=NVARCHAR}
</select>
<select id= "selectByCol" parameterType= "com.emr.entity.Archive_Master_Vo" resultMap= "BaseResultMap" >
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.name
dept_name,m.discharge_date_time,m.ArchiveState,m.admission_date_time,d.name dept_admission_to
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend
select distinct m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.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.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
from archive_master m
LEFT JOIN emr_dictionary d
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 emr_dictionary f
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
where 1=1
<if test= "deptAdmissionTo!= null and deptAdmissionTo!= ''" >
and m.dept_admission_to in
<foreach item= "item" collection= "deptAdmissionTo.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
and (m.dept_admission_to in
<foreach item= "item" collection= "deptAdmissionTo.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
or m.transfer_dept in
<foreach item= "item" collection= "deptAdmissionTo.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
)
</if>
<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= "bedNumber != null and bedNumber != ''" >
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
</if>
<if test= "visitId != null and visitId != ''" >
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
@ -96,9 +149,12 @@
<if test= "sex != null" >
and m.sex = #{sex,jdbcType=NVARCHAR}
</if>
<if test= "deptName != null and deptName != ''" >
and m.dept_name = #{deptName,jdbcType=NVARCHAR}
</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= "dischargeDateTime != null" >
and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}
</if>
@ -141,26 +197,46 @@
<if test= "deptCodeLend != null" >
and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}
</if>
<if test= "isscaned != null and isscaned != ''" >
and m.isscaned = #{isscaned,jdbcType=NVARCHAR}
</if>
<if test= "isScanning != null and isScanning != ''" >
and m.is_scanning = #{isScanning,jdbcType=NVARCHAR}
</if>
ORDER BY m.admission_date_time desc
</select>
<select id= "selectByColumn" parameterType= "com.emr.entity.Archive_Master_Vo" resultMap= "BaseResultMap" >
<!-- select -->
<!-- <include refid="Base_Column_List"/> -->
<!-- from archive_master -->
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.name
dept_name,m.discharge_date_time,m.ArchiveState,m.admission_date_time,d.name dept_admission_to
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend
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.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,
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.bed_number,ISNULL(s.bedNumber, 0) bedNumber
from archive_master m
LEFT JOIN emr_dictionary d
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 emr_dictionary f
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
where 1=1 and ArchiveState in('归档中','复审退回','初审')
LEFT JOIN(select archive_detail_id,count(*) bedNumber from emr_fault_detail where 1=1 and content!='' and content is not null and back_flag is not null GROUP BY archive_detail_id) s
on m.id=s.archive_detail_id
where 1=1 and ArchiveState in('归档中','提交','主任退回')
<if test= "emrCmit!=null and emrCmit!=''" >
<if test= "emrCmit==1" >
and m.emr_doctor_cmt='提交'
</if>
<if test= "emrCmit==2" >
and m.emr_nure_cmt='提交'
</if>
</if>
<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= "bedNumber != null and bedNumber != ''" >
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
</if>
<if test= "visitId != null and visitId != ''" >
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
@ -215,8 +291,14 @@
<if test= "lockinfo != null" >
and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR}
</if>
<if test= "doctorInCharge != null" >
and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR}
<!-- <if test="doctorInCharge != null"> -->
<!-- and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR} -->
<!-- </if> -->
<if test= "doctorInCharge!= null and doctorInCharge!= ''" >
and m.DOCTOR_IN_CHARGE in
<foreach item= "item" collection= "doctorInCharge.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
</if>
<if test= "dischargeDisposition != null" >
and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR}
@ -224,24 +306,39 @@
<if test= "deptCodeLend != null" >
and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}
</if>
<if test= "isscaned != null and isscaned != ''" >
and m.isscaned = #{isscaned,jdbcType=NVARCHAR}
</if>
<if test= "isScanning != null and isScanning != ''" >
and m.is_scanning = #{isScanning,jdbcType=NVARCHAR}
</if>
ORDER BY m.discharge_date_time desc
</select>
<select id= "selectByLast" parameterType= "com.emr.entity.Archive_Master_Vo" resultMap= "BaseResultMap" >
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.name
dept_name,m.discharge_date_time,m.ArchiveState,m.admission_date_time,d.name dept_admission_to
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend
<select id= "selectByLast" parameterType= "com.emr.entity.Archive_Master_Vo" resultMap= "BaseResultMap2" >
select DISTINCT m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.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.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned,
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.is_scanning,bed_number,amf.following_type
from archive_master m
LEFT JOIN emr_dictionary d
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 emr_dictionary f
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
where 1=1 and ArchiveState in('初审')
left join Archive_Master_Following amf
on m.id=amf.master_id and amf.following_type=9
where 1=1 and ArchiveState in('初审')
<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= "bedNumber != null and bedNumber != ''" >
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
</if>
<if test= "visitId != null and visitId != ''" >
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
@ -318,25 +415,38 @@
<if test= "deptCodeLend != null" >
and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}
</if>
<if test= "isscaned != null and isscaned != ''" >
and m.isscaned = #{isscaned,jdbcType=NVARCHAR}
</if>
<if test= "isScanning != null and isScanning != ''" >
and m.is_scanning = #{isScanning,jdbcType=NVARCHAR}
</if>
ORDER BY m.discharge_date_time desc
</select>
<select id= "selectByUnfile" parameterType= "com.emr.entity.Archive_Master_Vo" resultMap= "BaseResultMap" >
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.name
dept_name,m.discharge_date_time,m.ArchiveState,m.admission_date_time,d.name dept_admission_to
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend
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.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned,
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.is_scanning,bed_number
from archive_master m
LEFT JOIN emr_dictionary d
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 emr_dictionary f
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
where 1=1
and m.ArchiveState in('归档中','初审','复审退回')
-- and m.ArchiveState in('归档中','初审','复审退回','提交','主任退回' )
<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= "bedNumber != null and bedNumber != ''" >
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
</if>
<if test= "visitId != null and visitId != ''" >
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
@ -359,8 +469,14 @@
</foreach>
</if>
<if test= "deptAdmissionTo != null and deptAdmissionTo!=''" >
and m.dept_admission_to = #{deptAdmissionTo,jdbcType=NVARCHAR}
and m.dept_admission_to in
<foreach item= "item" collection= "deptAdmissionTo.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
</if>
<!-- <if test="deptAdmissionTo != null and deptAdmissionTo!=''"> -->
<!-- and m.dept_admission_to = #{deptAdmissionTo,jdbcType=NVARCHAR} -->
<!-- </if> -->
<if test= "dischargeDateTime != null" >
and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}
</if>
@ -413,9 +529,199 @@
<if test= "deptCodeLend != null" >
and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}
</if>
<if test= "isscaned != null and isscaned != ''" >
and m.isscaned = #{isscaned,jdbcType=NVARCHAR}
</if>
<if test= "isScanning != null and isScanning != ''" >
and m.is_scanning = #{isScanning,jdbcType=NVARCHAR}
</if>
<if test= "deathFlag != null and deathFlag != ''" >
and m.death_flag = #{deathFlag,jdbcType=NVARCHAR}
</if>
ORDER BY m.discharge_date_time desc
</select>
<select id= "selectByCmtCol" parameterType= "com.emr.entity.Archive_Master_Vo" resultMap= "BaseResultMap" >
<!-- select -->
<!-- <include refid="Base_Column_List"/> -->
<!-- from archive_master -->
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.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.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,
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,bed_number
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
where 1=1 and ArchiveState in('提交','主任退回','归档中','复审退回')
<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= "bedNumber != null and bedNumber != ''" >
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
</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= "archivestate != null and archivestate != ''" >
and m.ArchiveState=#{archivestate,jdbcType=NVARCHAR}
</if>
<if test= "idNo != null and idNo != ''" >
and m.ID_NO like '%'+#{idNo,jdbcType=NCHAR}+'%'
</if>
<if test= "sex != null" >
and m.sex = #{sex,jdbcType=NVARCHAR}
</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= "dischargeDateTime != null" >
and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}
</if>
<choose >
<when test= "startDateTo != null and startDateTo != '' and endDateTo != null and endDateTo != ''" >
and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) and
#{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test= "startDateTo != null and startDateTo != ''" >
and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120)
</when>
<when test= "endDateTo != null and endDateTo != ''" >
and m.discharge_date_time < = #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test= "deptAdmissionTo != null and deptAdmissionTo!=''" >
and m.dept_admission_to = #{deptAdmissionTo,jdbcType=NVARCHAR}
</if>
<if test= "checkDoctor != null" >
and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR}
</if>
<if test= "checkedDoctor != null" >
and checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR}
</if>
<if test= "checkDatetime != null" >
and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR}
</if>
<if test= "checkedDatetime != null" >
and m.checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR}
</if>
<if test= "lockinfo != null" >
and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR}
</if>
<if test= "doctorInCharge != null" >
and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR}
</if>
<if test= "dischargeDisposition != null" >
and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR}
</if>
<if test= "deptCodeLend != null" >
and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}
</if>
<if test= "isscaned != null and isscaned != ''" >
and m.isscaned = #{isscaned,jdbcType=NVARCHAR}
</if>
<if test= "isScanning != null and isScanning != ''" >
and m.is_scanning = #{isScanning,jdbcType=NVARCHAR}
</if>
ORDER BY m.discharge_date_time desc
</select>
<select id= "getDoctorInCharge" parameterType= "com.emr.entity.Archive_Master" resultMap= "BaseResultMap" >
select DISTINCT m.DOCTOR_IN_CHARGE from archive_master m
where 1=1 --m.ArchiveState in('归档中','初审','提交','主任退回')
<if test= "archivestate!= null and archivestate!= ''" >
and m.ArchiveState in
<foreach item= "item" collection= "archivestate.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
</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= "doctorInCharge!= null and doctorInCharge!= ''" >
and m.DOCTOR_IN_CHARGE in
<foreach item= "item" collection= "doctorInCharge.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
</if>
</select>
<select id= "bbSel" parameterType= "com.emr.entity.Archive_Master_Vo" resultMap= "BaseResultMap" >
SELECT DISTINCT U.dept_name,E.name,isnull( D.checkDoctor,0) checkDoctor,isnull( A.lockinfo,0) lockinfo,isnull(B.inpNo,0) inpNo,isnull(C.visitId,0) visitId FROM (SELECT dept_name,discharge_date_time from archive_master) U
LEFT JOIN (
select s.dept_name,count(*) as lockinfo from archive_master as s where 1=1 and s.ArchiveState not in('在院','归档中','复审退回','主任退回') GROUP BY s.dept_name
) A ON U.dept_name=A.dept_name
LEFT JOIN (
select dept_name,count(*) as inpNo from archive_master where 1=1 and ArchiveState in('在院','归档中','复审退回','主任退回') GROUP BY dept_name
) B ON U.dept_name=B.dept_name
LEFT JOIN (
select dept_name,count(*) as visitId from archive_master where 1=1 and ArchiveState in('在院','归档中','复审退回','主任退回') and CEILING(DATEDIFF(hour,discharge_date_time,GETDATE())/24.00)>3 GROUP BY dept_name
) C ON U.dept_name=C.dept_name
LEFT JOIN (
select s.dept_name,count(*) as checkDoctor from archive_master as s where 1=1 and s.ArchiveState='在院' GROUP BY s.dept_name
) D ON U.dept_name=D.dept_name
LEFT JOIN (
select * from emr_dictionary
) E ON U.dept_name=E.code
where 1=1
<if test= "deptName!= null and deptName!= ''" >
and U.dept_name in
<foreach item= "item" collection= "deptName.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
</if>
<choose >
<when test= "startDateTo != null and startDateTo != '' and endDateTo != null and endDateTo != ''" >
and CONVERT(varchar(100),U.discharge_date_time, 23) between #{startDateTo,jdbcType=NCHAR} and #{endDateTo,jdbcType=NCHAR}
</when>
<when test= "startDateTo != null and startDateTo != ''" >
and CONVERT(varchar(100),U.discharge_date_time, 23) >= #{startDateTo,jdbcType=NCHAR}
</when>
<when test= "endDateTo != null and endDateTo != ''" >
and CONVERT(varchar(100),U.discharge_date_time, 23) < = #{endDateTo,jdbcType=NCHAR}
</when>
</choose>
</select>
<select id= "bbSel2" parameterType= "com.emr.entity.Archive_Master_Vo" resultMap= "BaseResultMap" >
select id,inp_no,visit_id,U.name,dept_name,E.name doctor_name,DOCTOR_IN_CHARGE,ArchiveState,CONVERT(varchar(100),admission_date_time, 120) admission_date_time,CONVERT(varchar(100),U.discharge_date_time, 120) discharge_date_time,GETDATE() nowt,CEILING(DATEDIFF(hour,U.discharge_date_time,GETDATE())/24.00)-3 nurse_name,bed_number
from archive_master U
LEFT JOIN (
select code,name from emr_dictionary
) E
ON U.dept_name=E.code
where 1=1 and U.ArchiveState in('归档中','提交','主任退回','复审退回')
and CEILING(DATEDIFF(hour,U.discharge_date_time,GETDATE())/24.00)>3
<if test= "deptName!= null and deptName!= ''" >
and U.dept_name in
<foreach item= "item" collection= "deptName.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
</if>
<choose >
<when test= "startDateTo != null and startDateTo != '' and endDateTo != null and endDateTo != ''" >
and CONVERT(varchar(100),U.discharge_date_time, 23) between #{startDateTo,jdbcType=NCHAR} and #{endDateTo,jdbcType=NCHAR}
</when>
<when test= "startDateTo != null and startDateTo != ''" >
and CONVERT(varchar(100),U.discharge_date_time, 23) >= #{startDateTo,jdbcType=NCHAR}
</when>
<when test= "endDateTo != null and endDateTo != ''" >
and CONVERT(varchar(100),U.discharge_date_time, 23) < = #{endDateTo,jdbcType=NCHAR}
</when>
</choose>
</select>
<delete id= "deleteByPrimaryKey" parameterType= "java.lang.String" >
delete from archive_master
where id = #{id,jdbcType=NVARCHAR}
@ -427,14 +733,14 @@
admission_date_time, dept_admission_to, check_doctor,
check_datetime, checked_doctor, checked_datetime,
LockInfo, DOCTOR_IN_CHARGE, ID_NO,
DISCHARGE_DISPOSITION, dept_code_lend)
DISCHARGE_DISPOSITION, dept_code_lend,isscaned,first_instance )
values (#{id,jdbcType=NVARCHAR}, #{patientId,jdbcType=NVARCHAR}, #{inpNo,jdbcType=NVARCHAR},
#{visitId,jdbcType=NVARCHAR}, #{name,jdbcType=NVARCHAR}, #{sex,jdbcType=NVARCHAR},
#{deptName,jdbcType=NVARCHAR}, #{dischargeDateTime,jdbcType=NVARCHAR}, #{archivestate,jdbcType=NVARCHAR},
#{admissionDateTime,jdbcType=NVARCHAR}, #{deptAdmissionTo,jdbcType=NVARCHAR}, #{checkDoctor,jdbcType=NVARCHAR},
#{checkDatetime,jdbcType=NVARCHAR}, #{checkedDoctor,jdbcType=NVARCHAR}, #{checkedDatetime,jdbcType=NVARCHAR},
#{lockinfo,jdbcType=NVARCHAR}, #{doctorInCharge,jdbcType=NVARCHAR}, #{idNo,jdbcType=NVARCHAR},
#{dischargeDisposition,jdbcType=NVARCHAR}, #{deptCodeLend,jdbcType=NVARCHAR})
#{dischargeDisposition,jdbcType=NVARCHAR}, #{deptCodeLend,jdbcType=NVARCHAR}, #{isscaned,jdbcType=NVARCHAR}, #{firstInstance,jdbcType=NVARCHAR} )
</insert>
<insert id= "insertSelective" parameterType= "com.emr.entity.Archive_Master" >
insert into archive_master
@ -499,6 +805,12 @@
<if test= "deptCodeLend != null" >
dept_code_lend,
</if>
<if test= "isscaned != null and isscaned != ''" >
isscaned,
</if>
<if test= "firstInstance != null" >
first_instance,
</if>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "id != null" >
@ -561,6 +873,12 @@
<if test= "deptCodeLend != null" >
#{deptCodeLend,jdbcType=NVARCHAR},
</if>
<if test= "isscaned != null and isscaned != ''" >
#{isscaned,jdbcType=NVARCHAR},
</if>
<if test= "firstInstance != null" >
#{firstInstance,jdbcType=NVARCHAR},
</if>
</trim>
</insert>
<update id= "updateByClo" parameterType= "com.emr.entity.Archive_Master" >
@ -623,6 +941,42 @@
<if test= "deptCodeLend != null" >
dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR},
</if>
<if test= "isscaned != null and isscaned != ''" >
isscaned = #{isscaned,jdbcType=NVARCHAR},
</if>
<if test= "isScanning != null and isScanning != ''" >
is_scanning = #{isScanning,jdbcType=NVARCHAR},
</if>
<if test= "cmtDoctor >-1" >
cmt_doctor = #{cmtDoctor,jdbcType=INTEGER},
</if>
<if test= "cmtNurse >-1" >
cmt_nurse = #{cmtNurse,jdbcType=INTEGER},
</if>
<if test= "doctorName != null " >
doctor_name = #{doctorName,jdbcType=NVARCHAR},
</if>
<if test= "nurseName != null " >
nurse_name = #{nurseName,jdbcType=NVARCHAR},
</if>
<if test= "cmtDoctorDate != null and cmtDoctorDate != ''" >
cmt_doctor_date = #{cmtDoctorDate,jdbcType=NVARCHAR},
</if>
<if test= "cmtDoctorDate ==''" >
cmt_doctor_date=null,
</if>
<if test= "cmtNurseDate != null and cmtNurseDate != ''" >
cmt_nurse_date = #{cmtNurseDate,jdbcType=NVARCHAR},
</if>
<if test= "cmtNurseDate ==''" >
cmt_nurse_date=null,
</if>
<if test= "firstInstance != null and firstInstance != ''" >
first_instance=#{firstInstance,jdbcType=NVARCHAR},
</if>
<if test= "score != null and score != ''" >
score=#{score,jdbcType=NVARCHAR},
</if>
</set>
where id = #{id,jdbcType=NVARCHAR}
</update>
@ -646,7 +1000,229 @@
DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR},
ID_NO = #{idNo,jdbcType=NVARCHAR},
DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR},
dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}
dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR},
isscaned = #{isscaned,jdbcType=NVARCHAR},
is_scanning = #{isScanning,jdbcType=NVARCHAR},
first_instance=#{firstInstance,jdbcType=NVARCHAR}
bed_number=#{bedNumber,jdbcType=NVARCHAR}
where id = #{id,jdbcType=NVARCHAR}
</update>
<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 and f.following_type in(8,9)
<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= "handleId != null and handleId != ''" >
and f.handle_id in
<foreach item= "item" collection= "handleId.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
</if>
<if test= "followingType != null and followingType != ''" >
and f.following_type = #{followingType,jdbcType=NVARCHAR}
</if>
ORDER BY f.handle_time desc
</select>
<select id= "selectOverdue" parameterType= "com.emr.entity.Archive_Master_Vo" resultMap= "BaseResultMap2" >
select DISTINCT m.id,m.patient_id, m.inp_no,m.visit_id,m.name,g.name dept_name,
m.discharge_date_time,t.name dept_admission_to,
CONVERT(varchar(10),m.admission_date_time, 120)admission_date_time,
d.create_time,m.first_instance,m.DOCTOR_IN_CHARGE,m.death_flag,[dbo].[getWorkday](m.discharge_date_time,d.create_time) overdue
from Archive_Master m join emr_dictionary e on m.dept_name = e.code
join emr_fault_detail d on m.ID=d.archive_detail_id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) t
on m.dept_admission_to=t.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
--判断初审以及状态为null
and d.archive_state in ('初审', null)
--或者初审时间,时间最小
and d.create_time in (select create_time from emr_fault_detail A where create_time=(select min(create_time) from emr_fault_detail B where A.[archive_detail_id]=B.[archive_detail_id]))
<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= "deptAdmissionTo != null and deptAdmissionTo!=''" >
and m.dept_admission_to in
<foreach item= "item" collection= "deptAdmissionTo.split(',')" open= "(" separator= "," close= ")" >
#{item}
</foreach>
</if>
<if test= "dischargeDateTime != null" >
and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}
</if>
<choose >
<when test= "startDate != null and startDate != '' and endDate != null and endDate != ''" >
and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
#{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test= "startDate != null and startDate != ''" >
and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</when>
<when test= "endDate != null and endDate != ''" >
and m.discharge_date_time < = #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test= "createTime != null" >
and d.create_time = #{createTime,jdbcType=NVARCHAR}
</if>
<choose >
<when test= "createTimeStart != null and createTimeStart != '' and createTimeEnd != null and createTimeEnd != ''" >
and d.create_time between CONVERT(VARCHAR(10),#{createTimeStart,jdbcType=NCHAR},120) and
#{createTimeEnd,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test= "createTimeStart != null and createTimeStart != ''" >
and d.create_time >= CONVERT(VARCHAR(10),#{createTimeStart,jdbcType=NCHAR},120)
</when>
<when test= "createTimeEnd != null and createTimeEnd != ''" >
and d.create_time < = #{createTimeEnd,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test= "deathFlag != null and deathFlag != ''" >
and m.death_flag = #{deathFlag,jdbcType=NVARCHAR}
<if test= "deathFlag == '0'.toString()" >
and [dbo].[getWorkday](m.discharge_date_time,d.create_time)>3
</if>
<if test= "deathFlag == '1'.toString()" >
and [dbo].[getWorkday](m.discharge_date_time,d.create_time)>7
</if>
</if>
<if test= "overdueDays != null and overdueDays != ''" >
and [dbo].[getWorkday](m.discharge_date_time,d.create_time)>=#{overdueDays,jdbcType=NCHAR}
</if>
</select>
<!-- 封存日志 -->
<select id= "selectByFollowinglog" parameterType= "com.emr.entity.Archive_Master_Vo" resultMap= "BaseResultMap2" >
select m.INP_NO,m.VISIT_ID,m.name,m.sex,f.handle_name,f.handle_time, m.archiveState ,f.following_content from Archive_Master m
INNER JOIN Archive_Master_Following f on m.ID=f.master_id
where 1=1 AND f.following_type in('11','12')
<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= "archivestate != null and archivestate != ''" >
and m.ArchiveState=#{archivestate,jdbcType=NVARCHAR}
</if>
<if test= "handleName != null and handleName != ''" >
and f.handle_name=#{handleName,jdbcType=NVARCHAR}
</if>
<if test= "followingContent != null and followingContent != ''" >
and f.following_content=#{followingContent,jdbcType=NVARCHAR}
</if>
<choose >
<when test= "startDate != null and startDate != '' and endDate != null and endDate != ''" >
and f.handle_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
#{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test= "startDate != null and startDate != ''" >
and f.handle_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</when>
<when test= "endDate != null and endDate != ''" >
and f.handle_time < = #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
ORDER BY f.handle_time desc
</select>
</mapper>