|
@@ -36,6 +36,85 @@
|
|
|
and t.behospital_code = #{behospitalCode}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <!--获取缺陷检验项信息-->
|
|
|
+ <select id="getBadCheckInfo" resultType="java.lang.String">
|
|
|
+ select
|
|
|
+ distinct
|
|
|
+ b.repNo
|
|
|
+ from(
|
|
|
+ SELECT
|
|
|
+ t1.rep_no as repNo,
|
|
|
+ t1.rep_name as examineItemName,
|
|
|
+ t1.rep_type_name as examineItemType,
|
|
|
+ CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
|
|
|
+ DATE_FORMAT( t1.rep_date, '%Y-%m-%d %H:%i:%s' ) as rTime,
|
|
|
+ DATE_FORMAT( t1.check_date, '%Y-%m-%d %H:%i:%s' ) as cTime,
|
|
|
+ t1.apply_doctor as doctorName,
|
|
|
+ t1.hospital_id as hospitalId,
|
|
|
+ t1.behospital_code as behospitalCode
|
|
|
+ FROM
|
|
|
+ med_lis_info t1,
|
|
|
+ med_lis_result t2,
|
|
|
+ med_behospital_info t3
|
|
|
+ WHERE
|
|
|
+ t1.is_deleted = "N"
|
|
|
+ AND t2.is_deleted = "N"
|
|
|
+ AND t3.is_deleted = "N"
|
|
|
+ AND t1.check_date IS NOT NULL
|
|
|
+ AND t2.item_name IS NOT NULL
|
|
|
+ AND t1.hospital_id = t2.hospital_id
|
|
|
+ and t1.hospital_id = t3.hospital_id
|
|
|
+ AND t1.behospital_code = t2.behospital_code
|
|
|
+ <if test="examineInfoVO.hospitalId != null and examineInfoVO.hospitalId == 1l">
|
|
|
+ and t1.behospital_code = t3.behospital_code
|
|
|
+ </if>
|
|
|
+ <if test="examineInfoVO.hospitalId != null and examineInfoVO.hospitalId == 2l">
|
|
|
+ and t1.behospital_code = t3.file_code
|
|
|
+ </if>
|
|
|
+ AND t1.rep_no = t2.rep_no
|
|
|
+ <if test="examineInfoVO.hospitalId != null">
|
|
|
+ and t1.hospital_id = #{examineInfoVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="examineInfoVO.behospitalCode != null and examineInfoVO.behospitalCode != ''">
|
|
|
+ and t1.behospital_code = #{examineInfoVO.behospitalCode}
|
|
|
+ </if>
|
|
|
+ <if test="examineInfoVO.examineItemType != null and examineInfoVO.examineItemType != ''">
|
|
|
+ and t1.rep_type_name like CONCAT('%',#{examineInfoVO.examineItemType},'%')
|
|
|
+ </if>
|
|
|
+ <if test="examineInfoVO.examineItemName != null and examineInfoVO.examineItemName != ''">
|
|
|
+ and t1.rep_name like CONCAT('%',#{examineInfoVO.examineItemName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="examineInfoVO.jyDateStart != null">
|
|
|
+ <![CDATA[ AND date_format(t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.jyDateStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="examineInfoVO.jyDateEnd != null">
|
|
|
+ <![CDATA[ AND date_format(t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.jyDateEnd}]]>
|
|
|
+ </if>
|
|
|
+ <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 1">
|
|
|
+ <if test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
|
|
|
+ <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
|
|
|
+ <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 0">
|
|
|
+ <if test="examineInfoVO.behospitalDate != null">
|
|
|
+ <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ ) b
|
|
|
+ where 1=1
|
|
|
+ <if test="infos != null and infos.size() > 0">
|
|
|
+ and b.info in
|
|
|
+ <foreach collection="infos" open="(" separator="," close=")" item="item">
|
|
|
+ '${item}'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="infos = null || infos.size() == 0">
|
|
|
+ and b.info in('000000ASDQWEZXC@#$%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
|
|
|
<!--获取检验信息-->
|
|
|
<select id="getExamineInfo" resultType="com.diagbot.dto.ExamineInfoDTO">
|
|
@@ -123,13 +202,13 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="examineInfoVO.examineType != null and examineInfoVO.examineType == 2 ">
|
|
|
- <if test="infos != null and infos.size() > 0">
|
|
|
- and b.info not in
|
|
|
- <foreach collection="infos" open="(" separator="," close=")" item="item">
|
|
|
+ <if test="badCheckInfo != null and badCheckInfo.size() > 0">
|
|
|
+ and b.repNo not in
|
|
|
+ <foreach collection="badCheckInfo" open="(" separator="," close=")" item="item">
|
|
|
'${item}'
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="infos = null || infos.size() == 0">
|
|
|
+ <if test="badCheckInfo = null || badCheckInfo.size() == 0">
|
|
|
and 1=1
|
|
|
</if>
|
|
|
</if>
|
|
@@ -161,6 +240,7 @@
|
|
|
CONCAT( t2.result, t2.unit ) AS examineItemResult,
|
|
|
DATE_FORMAT( t1.rep_date, '%Y-%m-%d %h:%i:%s' ) as reptTime,
|
|
|
DATE_FORMAT( t1.check_date, '%Y-%m-%d %h:%i:%s' ) as checkTime,
|
|
|
+ CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
|
|
|
t1.apply_doctor AS doctorName
|
|
|
FROM
|
|
|
med_lis_info t1,
|
|
@@ -181,6 +261,28 @@
|
|
|
<if test="examineSonInfoVO.repNo != null and examineSonInfoVO.repNo != ''">
|
|
|
and t1.rep_no = #{examineSonInfoVO.repNo}
|
|
|
</if>
|
|
|
+ <if test="examineSonInfoVO.examineType != null and examineSonInfoVO.examineType == 1">
|
|
|
+ <if test="infos != null and infos.size() > 0">
|
|
|
+ and info in
|
|
|
+ <foreach collection="infos" open="(" separator="," close=")" item="item">
|
|
|
+ '${item}'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="infos = null || infos.size() == 0">
|
|
|
+ and info in('000000ASDQWEZXC@#$%')
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="examineSonInfoVO.examineType != null and examineSonInfoVO.examineType == 2 ">
|
|
|
+ <if test="infos != null and infos.size() > 0">
|
|
|
+ and info not in
|
|
|
+ <foreach collection="infos" open="(" separator="," close=")" item="item">
|
|
|
+ '${item}'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="infos = null || infos.size() == 0">
|
|
|
+ and 1=1
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|