|
@@ -4,47 +4,55 @@
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.diagbot.entity.MedLisResult">
|
|
|
- <result column="rep_no" property="repNo" />
|
|
|
- <result column="hospital_id" property="hospitalId" />
|
|
|
- <result column="behospital_code" property="behospitalCode" />
|
|
|
- <result column="item_code" property="itemCode" />
|
|
|
- <result column="item_name" property="itemName" />
|
|
|
- <result column="result" property="result" />
|
|
|
- <result column="reference" property="reference" />
|
|
|
- <result column="reference_min" property="referenceMin" />
|
|
|
- <result column="reference_max" property="referenceMax" />
|
|
|
- <result column="unit" property="unit" />
|
|
|
- <result column="abnormal" property="abnormal" />
|
|
|
- <result column="color" property="color" />
|
|
|
- <result column="is_deleted" property="isDeleted" />
|
|
|
- <result column="gmt_create" property="gmtCreate" />
|
|
|
- <result column="gmt_modified" property="gmtModified" />
|
|
|
- <result column="creator" property="creator" />
|
|
|
- <result column="modifier" property="modifier" />
|
|
|
+ <result column="rep_no" property="repNo"/>
|
|
|
+ <result column="hospital_id" property="hospitalId"/>
|
|
|
+ <result column="behospital_code" property="behospitalCode"/>
|
|
|
+ <result column="item_code" property="itemCode"/>
|
|
|
+ <result column="item_name" property="itemName"/>
|
|
|
+ <result column="result" property="result"/>
|
|
|
+ <result column="reference" property="reference"/>
|
|
|
+ <result column="reference_min" property="referenceMin"/>
|
|
|
+ <result column="reference_max" property="referenceMax"/>
|
|
|
+ <result column="unit" property="unit"/>
|
|
|
+ <result column="abnormal" property="abnormal"/>
|
|
|
+ <result column="color" property="color"/>
|
|
|
+ <result column="is_deleted" property="isDeleted"/>
|
|
|
+ <result column="gmt_create" property="gmtCreate"/>
|
|
|
+ <result column="gmt_modified" property="gmtModified"/>
|
|
|
+ <result column="creator" property="creator"/>
|
|
|
+ <result column="modifier" property="modifier"/>
|
|
|
</resultMap>
|
|
|
- <select id="getMedLisResults" parameterType="com.diagbot.entity.BehospitalInfo" resultType="com.diagbot.dto.MedLisResultDTO">
|
|
|
+ <select id="getMedLisResults" parameterType="com.diagbot.entity.BehospitalInfo"
|
|
|
+ resultType="com.diagbot.dto.MedLisResultDTO">
|
|
|
SELECT
|
|
|
- t1.rep_no,t1.rep_name repName,t2.behospital_code,t2.hospital_id,t2.item_code,t2.item_name reportName,t2.result,t2.reference,t2.reference_max,t2.reference_min,
|
|
|
+ t1.rep_no,t1.rep_name repName,t2.behospital_code,t2.hospital_id,t2.item_code,t2.item_name
|
|
|
+ reportName,t2.result,t2.reference,t2.reference_max,t2.reference_min,
|
|
|
t2.unit,t2.abnormal,t2.color,t2.is_deleted,t2.gmt_create,t2.gmt_modified,t2.creator,t2.modifier
|
|
|
FROM
|
|
|
- med_lis_info t1,
|
|
|
- med_lis_result t2
|
|
|
+ med_lis_info t1,
|
|
|
+ med_lis_result t2
|
|
|
WHERE
|
|
|
- t1.is_deleted = "N"
|
|
|
+ t1.is_deleted = "N"
|
|
|
and t2.is_deleted = "N"
|
|
|
AND t1.rep_name IS NOT NULL
|
|
|
AND t1.check_date IS NOT NULL
|
|
|
AND t2.item_name IS NOT NULL
|
|
|
- and t1.hospital_id = #{hospitalId}
|
|
|
and t1.hospital_id = t2.hospital_id
|
|
|
and t1.behospital_code = t2.behospital_code
|
|
|
- and t1.behospital_code = #{behospitalCode}
|
|
|
- and t2.rep_no in(t1.rep_no)
|
|
|
+ <if test="fileCode != null and fileCode != ''">
|
|
|
+ and t1.behospital_code like CONCAT('%',#{fileCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ and t1.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ and t1.rep_no = t2.rep_no
|
|
|
<if test="behospitalDate != null">
|
|
|
- <![CDATA[ AND t1.check_date >= #{behospitalDate}]]>
|
|
|
+ <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{behospitalDate}]]>
|
|
|
</if>
|
|
|
- <if test="leaveHospitalDate != null">
|
|
|
- <![CDATA[ AND t1.check_date <= #{leaveHospitalDate}]]>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <if test="leaveHospitalDate != null">
|
|
|
+ <![CDATA[AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{leaveHospitalDate}]]>
|
|
|
+ </if>
|
|
|
</if>
|
|
|
</select>
|
|
|
|