Files
his/openhis-server-new/openhis-application/src/main/resources/mapper/patientmanage/PatientManageMapper.xml
2025-12-27 15:30:25 +08:00

99 lines
3.4 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.openhis.web.patientmanage.mapper.PatientManageMapper">
<!-- 病人信息相关查询-->
<select id="getPatientPage" resultType="com.openhis.web.patientmanage.dto.PatientBaseInfoDto">
SELECT T1.tenant_id,
T1.id,
T1.active_flag,
T1.temp_flag,
T1.name,
T1.name_json,
T1.bus_no,
T1.gender_enum,
T1.birth_date,
T1.deceased_date,
T1.marital_status_enum,
T1.prfs_enum,
T1.phone,
T1.address,
T1.address_province,
T1.address_city,
T1.address_district,
T1.address_street,
T1.address_json,
T1.nationality_code,
T1.id_card,
T1.py_str,
T1.wb_str,
T1.blood_abo,
T1.blood_rh,
T1.work_company,
T1.native_place,
T1.country_code,
T1.link_name,
T1.link_relation_code,
T1.link_telcom,
T1.link_jsons,
T1.organization_id,
T1.create_time
FROM (
SELECT pt.tenant_id,
pt.id,
pt.active_flag,
pt.temp_flag,
pt.name,
pt.name_json,
pt.bus_no,
pt.gender_enum,
pt.birth_date,
pt.deceased_date,
pt.marital_status_enum,
pt.prfs_enum,
pt.phone,
pt.address,
pt.address_province,
pt.address_city,
pt.address_district,
pt.address_street,
pt.address_json,
pt.nationality_code,
pt.id_card,
pt.py_str,
pt.wb_str,
pt.blood_abo,
pt.blood_rh,
pt.work_company,
pt.native_place,
pt.country_code,
pt.link_name,
pt.link_relation_code,
pt.link_telcom,
pt.link_jsons,
pt.organization_id,
pt.create_time
FROM adm_patient pt
where pt.delete_flag = '0'
ORDER BY pt.bus_no DESC
) AS T1
${ew.customSqlSegment}
</select>
<select id="getPatientIdInfo" resultType="com.openhis.web.patientmanage.dto.PatientIdInfoDto">
SELECT patient_id,
type_code,
identifier_no,
start_time,
end_time
FROM adm_patient_identifier
WHERE delete_flag = '0'
<if test="patientIdList != null and !patientIdList.isEmpty()">
AND patient_id IN
<foreach collection="patientIdList" item="itemId" open="(" separator="," close=")">
#{itemId}
</foreach>
</if>
</select>
</mapper>