|
@@ -45,28 +45,36 @@
|
|
SELECT
|
|
SELECT
|
|
t1.rep_name as checkItemName,
|
|
t1.rep_name as checkItemName,
|
|
t1.rep_type_name as checkItemType,
|
|
t1.rep_type_name as checkItemType,
|
|
- CONCAT( t1.rep_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d'),')')as info,
|
|
|
|
|
|
+ CONCAT( t1.rep_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 reptTime,
|
|
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,
|
|
date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') as checkTime,
|
|
- t1.apply_doctor as doctorName,
|
|
|
|
|
|
+ t2.apply_doctor as doctorName,
|
|
t2.hospital_id as hospitalId,
|
|
t2.hospital_id as hospitalId,
|
|
t2.behospital_code as behospitalCode,
|
|
t2.behospital_code as behospitalCode,
|
|
t2.rept_diag as checkResult
|
|
t2.rept_diag as checkResult
|
|
FROM
|
|
FROM
|
|
- med_pacs_info t1,
|
|
|
|
- med_pacs_result t2,
|
|
|
|
|
|
+ med_pacs_info t1
|
|
|
|
+ right join
|
|
med_behospital_info t3
|
|
med_behospital_info t3
|
|
- WHERE
|
|
|
|
- t1.is_deleted = "N"
|
|
|
|
- AND t2.is_deleted = "N"
|
|
|
|
|
|
+ on t1.hospital_id = t3.hospital_id
|
|
|
|
+ AND t1.is_deleted = "N"
|
|
AND t3.is_deleted = "N"
|
|
AND t3.is_deleted = "N"
|
|
AND t1.rep_name IS NOT NULL
|
|
AND t1.rep_name IS NOT NULL
|
|
AND t1.check_date IS NOT NULL
|
|
AND t1.check_date IS NOT NULL
|
|
- and t1.hospital_id = t2.hospital_id
|
|
|
|
- and t1.hospital_id = t3.hospital_id
|
|
|
|
- and t1.behospital_code = t2.behospital_code
|
|
|
|
- and t1.behospital_code = t3.file_code
|
|
|
|
- and t1.rep_no = t2.rep_no
|
|
|
|
|
|
+ <if test="checkInfoVO.hospitalId != null and checkInfoVO.hospitalId == 1l">
|
|
|
|
+ and t1.behospital_code = t3.behospital_code
|
|
|
|
+ </if>
|
|
|
|
+ <if test="checkInfoVO.hospitalId != null and checkInfoVO.hospitalId == 2l">
|
|
|
|
+ and t1.behospital_code = t3.file_code
|
|
|
|
+ </if>
|
|
|
|
+ left join
|
|
|
|
+ med_pacs_result t2
|
|
|
|
+ on t1.hospital_id = t2.hospital_id
|
|
|
|
+ AND t2.is_deleted = "N"
|
|
|
|
+ AND t1.behospital_code = t2.behospital_code
|
|
|
|
+ AND t1.rep_no = t2.rep_no
|
|
|
|
+ WHERE
|
|
|
|
+ 1=1
|
|
<if test="checkInfoVO.hospitalId != null">
|
|
<if test="checkInfoVO.hospitalId != null">
|
|
and t1.hospital_id = #{checkInfoVO.hospitalId}
|
|
and t1.hospital_id = #{checkInfoVO.hospitalId}
|
|
</if>
|
|
</if>
|
|
@@ -77,7 +85,7 @@
|
|
and t1.rep_type_name like CONCAT('%',#{checkInfoVO.checkItemType},'%')
|
|
and t1.rep_type_name like CONCAT('%',#{checkInfoVO.checkItemType},'%')
|
|
</if>
|
|
</if>
|
|
<if test="checkInfoVO.checkItemName != null and checkInfoVO.checkItemName != ''">
|
|
<if test="checkInfoVO.checkItemName != null and checkInfoVO.checkItemName != ''">
|
|
- and t2.rept_name like CONCAT('%',#{checkInfoVO.checkItemName},'%')
|
|
|
|
|
|
+ and t1.rep_name like CONCAT('%',#{checkInfoVO.checkItemName},'%')
|
|
</if>
|
|
</if>
|
|
<if test="checkInfoVO.jxDateStart != null">
|
|
<if test="checkInfoVO.jxDateStart != null">
|
|
<![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{checkInfoVO.jxDateStart}]]>
|
|
<![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{checkInfoVO.jxDateStart}]]>
|