|
@@ -65,13 +65,15 @@
|
|
|
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
|
|
|
+ <choose>
|
|
|
+ <when test="examineInfoVO.hospitalId != null and examineInfoVO.hospitalId == 2l">
|
|
|
+ and t1.behospital_code = t3.file_code
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and t1.behospital_code = t3.behospital_code
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
<if test="examineInfoVO.hospitalId != null">
|
|
|
and t1.hospital_id = #{examineInfoVO.hospitalId}
|
|
|
</if>
|
|
@@ -91,7 +93,8 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 0">
|
|
|
- <if test="examineInfoVO.behospitalDate != null">
|
|
|
+ <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>
|
|
@@ -110,7 +113,7 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="infos = null || infos.size() == 0">
|
|
|
- and b.info in('000000ASDQWEZXC@#$%')
|
|
|
+ and 1 = 2
|
|
|
</if>
|
|
|
|
|
|
</select>
|
|
@@ -147,12 +150,6 @@
|
|
|
and t1.is_deleted = "N"
|
|
|
AND t3.is_deleted = "N"
|
|
|
AND t1.check_date IS NOT NULL
|
|
|
- <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>
|
|
|
left join
|
|
|
med_lis_result t2
|
|
|
on t1.hospital_id = t2.hospital_id
|
|
@@ -160,8 +157,14 @@
|
|
|
AND t2.item_name IS NOT NULL
|
|
|
AND t1.behospital_code = t2.behospital_code
|
|
|
AND t1.rep_no = t2.rep_no
|
|
|
- WHERE
|
|
|
- 1=1
|
|
|
+ <choose>
|
|
|
+ <when test="examineInfoVO.hospitalId != null and examineInfoVO.hospitalId == 2l">
|
|
|
+ and t1.behospital_code = t3.file_code
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and t1.behospital_code = t3.behospital_code
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
<if test="examineInfoVO.hospitalId != null">
|
|
|
and t1.hospital_id = #{examineInfoVO.hospitalId}
|
|
|
</if>
|
|
@@ -182,8 +185,9 @@
|
|
|
</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 test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
|
|
|
+ <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
|
|
|
+ <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
|
|
|
</if>
|
|
|
</if>
|
|
|
) b
|
|
@@ -202,7 +206,7 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="infos = null || infos.size() == 0">
|
|
|
- and b.info in('000000ASDQWEZXC@#$%')
|
|
|
+ and 1 = 2
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="examineInfoVO.examineType != null and examineInfoVO.examineType == 2 ">
|
|
@@ -213,7 +217,7 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="badCheckInfo = null || badCheckInfo.size() == 0">
|
|
|
- and 1=1
|
|
|
+ and 1 = 1
|
|
|
</if>
|
|
|
</if>
|
|
|
</select>
|
|
@@ -275,7 +279,7 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="infos = null || infos.size() == 0">
|
|
|
- and t.info in('000000ASDQWEZXC@#$%')
|
|
|
+ and 1 = 2
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="examineSonInfoVO.examineType != null and examineSonInfoVO.examineType == 2 ">
|
|
@@ -286,7 +290,7 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="infos = null || infos.size() == 0">
|
|
|
- and 1=1
|
|
|
+ and 1 = 1
|
|
|
</if>
|
|
|
</if>
|
|
|
</select>
|