|
@@ -0,0 +1,64 @@
|
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
+<mapper namespace="com.diagbot.mapper.BehospitalInfoMapper">
|
|
|
|
+
|
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.diagbot.entity.BehospitalInfo">
|
|
|
|
+ <id column="behospital_code" property="behospitalCode" />
|
|
|
|
+ <result column="hospital_id" property="hospitalId" />
|
|
|
|
+ <result column="name" property="name" />
|
|
|
|
+ <result column="sex" property="sex" />
|
|
|
|
+ <result column="birthday" property="birthday" />
|
|
|
|
+ <result column="file_code" property="fileCode" />
|
|
|
|
+ <result column="ward_code" property="wardCode" />
|
|
|
|
+ <result column="ward_name" property="wardName" />
|
|
|
|
+ <result column="beh_dept_id" property="behDeptId" />
|
|
|
|
+ <result column="beh_dept_name" property="behDeptName" />
|
|
|
|
+ <result column="bed_code" property="bedCode" />
|
|
|
|
+ <result column="bed_name" property="bedName" />
|
|
|
|
+ <result column="insurance_name" property="insuranceName" />
|
|
|
|
+ <result column="job_type" property="jobType" />
|
|
|
|
+ <result column="behospital_date" property="behospitalDate" />
|
|
|
|
+ <result column="leave_hospital_date" property="leaveHospitalDate" />
|
|
|
|
+ <result column="diagnose_icd" property="diagnoseIcd" />
|
|
|
|
+ <result column="diagnose" property="diagnose" />
|
|
|
|
+ <result column="doctor_id" property="doctorId" />
|
|
|
|
+ <result column="doctor_name" property="doctorName" />
|
|
|
|
+ <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="getPage" resultType="com.diagbot.dto.BehospitalInfoDTO">
|
|
|
|
+ select * from med_behospital_info a LEFT JOIN med_qcresult_info b
|
|
|
|
+ on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
|
|
|
|
+ where a.is_deleted = 'N'
|
|
|
|
+ <if test="name != null and name != ''">
|
|
|
|
+ and a.name like CONCAT('%',#{name},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileCode != null and fileCode != ''">
|
|
|
|
+ and a.file_code like CONCAT('%',#{fileCode},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="hospitalId != null">
|
|
|
|
+ and a.hospital_id = #{hospitalId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
|
+ and a.behospitalCode like CONCAT('%',#{behospitalCode},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="behosDateStart != null and behosDateStart != ''">
|
|
|
|
+ <![CDATA[ and a.behospital_date >= #{behosDateStart}]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="behosDateEnd != null and behosDateEnd != ''">
|
|
|
|
+ <![CDATA[ and a.behospital_date <= #{behosDateEnd}]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="leaveHosDateStart != null and leaveHosDateStart != ''">
|
|
|
|
+ <![CDATA[ and a.leave_hospital_date >= #{leaveHosDateStart}]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="leaveHosDateEnd != null and leaveHosDateEnd != ''">
|
|
|
|
+ <![CDATA[ and a.leave_hospital_date <= #{leaveHosDateEnd}]]>
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+</mapper>
|