You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virtual-patient/virtual-patient-model/src/main/resources/mapper/ProcessMedicalMapper.xml

73 lines
4.3 KiB
XML

<?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.supervision.mapper.ProcessMedicalMapper">
<resultMap id="BaseResultMap" type="com.supervision.model.ProcessMedical">
<id property="id" column="id" jdbcType="VARCHAR"/>
<result property="medicalRecId" column="medical_rec_id" jdbcType="VARCHAR"/>
<result property="processId" column="process_id" jdbcType="VARCHAR"/>
<result property="patientId" column="patient_id" jdbcType="VARCHAR"/>
<result property="diseaseId" column="disease_id" jdbcType="VARCHAR"/>
<result property="patientSelfDesc" column="patient_self_desc" jdbcType="VARCHAR"/>
<result property="illnessHistory" column="illness_history" jdbcType="VARCHAR"/>
<result property="allergyHistoryFlag" column="allergy_history_flag" jdbcType="INTEGER"/>
<result property="personalHistory" column="personal_history" jdbcType="VARCHAR"/>
<result property="allergyHistory" column="allergy_history" jdbcType="VARCHAR"/>
<result property="previousHistory" column="previous_history" jdbcType="VARCHAR"/>
<result property="previousHistoryFlag" column="previous_history_flag" jdbcType="INTEGER"/>
<result property="familyHistory" column="family_history" jdbcType="VARCHAR"/>
<result property="familyHistoryFlag" column="family_history_flag" jdbcType="INTEGER"/>
<result property="marriageChildHistory" column="marriage_child_history" jdbcType="VARCHAR"/>
<result property="operationHistoryFlag" column="operation_history_flag" jdbcType="INTEGER"/>
<result property="operationHistory" column="operation_history" jdbcType="VARCHAR"/>
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id,medical_rec_id,process_id,
patient_id,disease_id,patient_self_desc,
illness_history,allergy_history_flag,personal_history,
allergy_history,previous_history,previous_history_flag,
family_history,family_history_flag,marriage_child_history,
operation_history_flag,operation_history,create_user_id,
create_time,update_user_id,update_time
</sql>
<select id="findByProcessId" resultType="com.supervision.vo.ask.ProcessMedicalResVo">
select pr.process_no as processNo,
pr.update_time as recentTime,
pm.process_id as processId,
pm.disease_id as diseaseId,
mr.id as medicalRecId,
mr.no as medicalRecNo,
mr.patient_name as patientName,
mr.patient_gender as patientGender,
mr.patient_age as patientAge,
mr.patient_marriage as patientMarriage,
mr.native_place as nativePlace,
mr.patient_phone as patientPhone,
mr.patient_birthplace as patientBirthplace,
mr.patient_habitation as patientHabitation,
mr.patient_postcode as patientHabitation,
mr.patient_profession as patientProfession,
mr.patient_nation as patientNation,
pm.patient_self_desc as patientNation,
pm.illness_history as illnessHistory,
pm.allergy_history_flag as allergyHistoryFlag,
pm.allergy_history as allergyHistory,
pm.personal_history as personalHistory,
pm.family_history_flag as familyHistoryFlag,
pm.family_history as familyHistory,
pm.previous_history_flag as previousHistoryFlag,
pm.previous_history as previousHistory
from vp_process_medical pm
left join vp_medical_rec mr on pm.medical_rec_id = mr.id
left join vp_process pr on pm.process_id = pr.id
where pm.process_id = #{processId}
</select>
</mapper>