|
@@ -1183,20 +1183,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="id != null and id != ''">
|
|
|
AND id = #{id}
|
|
|
</if>
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">
|
|
|
- AND patient_archive_id = #{patient_archive_id}
|
|
|
+ <if test="archiveId != null and archiveId != ''">
|
|
|
+ AND archiveId = #{archiveId}
|
|
|
</if>
|
|
|
- <if test="contact_phone != null and contact_phone != ''">
|
|
|
- AND contact_phone = #{contact_phone}
|
|
|
+ <if test="contactPhone != null and contactPhone != ''">
|
|
|
+ AND contactPhone = #{contactPhone}
|
|
|
</if>
|
|
|
- <if test="contact_name != null and contact_name != ''">
|
|
|
- AND contact_name = #{contact_name}
|
|
|
+ <if test="contactName != null and contactName != ''">
|
|
|
+ AND contactName = #{contactName}
|
|
|
</if>
|
|
|
- <if test="contact_relationship != null and contact_relationship != ''">
|
|
|
- AND contact_relationship = #{contact_relationship}
|
|
|
+ <if test="contactRelationship != null and contactRelationship != ''">
|
|
|
+ AND contactRelationship = #{contactRelationship}
|
|
|
</if>
|
|
|
- <if test="created_by != null and created_by != ''">
|
|
|
- AND created_by = #{created_by}
|
|
|
+ <if test="createdBy != null and createdBy != ''">
|
|
|
+ AND createdBy = #{createdBy}
|
|
|
</if>
|
|
|
<if test="status != null and status != ''">
|
|
|
AND status = #{status}
|
|
@@ -1207,26 +1207,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<insert id="insertContact" parameterType="pd">
|
|
|
INSERT INTO s_dtp_ysfw_contacts
|
|
|
<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
- <if test="id != null and id != ''">id,</if>
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">patient_archive_id,</if>
|
|
|
- <if test="contact_phone != null and contact_phone != ''">contact_phone,</if>
|
|
|
- <if test="contact_name != null and contact_name != ''">contact_name,</if>
|
|
|
- <if test="contact_relationship != null and contact_relationship != ''">contact_relationship,</if>
|
|
|
- <if test="created_by != null and created_by != ''">created_by,</if>
|
|
|
- <if test="created_at != null and created_at != ''">created_at,</if>
|
|
|
- <if test="updated_at != null and updated_at != ''">updated_at,</if>
|
|
|
+ <if test="archiveId != null and archiveId != ''">archiveId,</if>
|
|
|
+ <if test="contactPhone != null and contactPhone != ''">contactPhone,</if>
|
|
|
+ <if test="contactName != null and contactNamecontactName != ''">contactName,</if>
|
|
|
+ <if test="contactRelationship != null and contactRelationship != ''">contactRelationship,</if>
|
|
|
+ <if test="createdBy != null and createdBy != ''">createdBy,</if>
|
|
|
+ <if test="createdAt != null and createdAt != ''">createdAt,</if>
|
|
|
+ <if test="updatedAt != null and updatedAt != ''">updatedAt,</if>
|
|
|
<if test="status != null and status != ''">status</if>
|
|
|
</trim>
|
|
|
|
|
|
<trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
- <if test="id != null and id != ''">#{id},</if>
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">#{patient_archive_id},</if>
|
|
|
- <if test="contact_phone != null and contact_phone != ''">#{contact_phone},</if>
|
|
|
- <if test="contact_name != null and contact_name != ''">#{contact_name},</if>
|
|
|
- <if test="contact_relationship != null and contact_relationship != ''">#{contact_relationship},</if>
|
|
|
- <if test="created_by != null and created_by != ''">#{created_by},</if>
|
|
|
- <if test="created_at != null and created_at != ''">#{created_at},</if>
|
|
|
- <if test="updated_at != null and updated_at != ''">#{updated_at},</if>
|
|
|
+ <if test="archiveId != null and archiveId != ''">#{archiveId},</if>
|
|
|
+ <if test="contactPhone != null and contactPhone != ''">#{contactPhone},</if>
|
|
|
+ <if test="contactName != null and contactName != ''">#{contactName},</if>
|
|
|
+ <if test="contactRelationship != null and contactRelationship != ''">#{contactRelationship},</if>
|
|
|
+ <if test="createdBy != null and createdBy != ''">#{createdBy},</if>
|
|
|
+ <if test="createdAt != null and createdAt != ''">#{createdAt},</if>
|
|
|
+ <if test="updatedAt != null and updatedAt != ''">#{updatedAt},</if>
|
|
|
<if test="status != null and status != ''">#{status}</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
@@ -1234,20 +1232,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<update id="updateContact" parameterType="pd">
|
|
|
UPDATE s_dtp_ysfw_contacts SET
|
|
|
<trim prefix="" suffixOverrides="," prefixOverrides=",">
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">
|
|
|
- patient_archive_id = #{patient_archive_id},
|
|
|
+ <if test="archiveId != null and archiveId != ''">
|
|
|
+ archiveId = #{archiveId},
|
|
|
</if>
|
|
|
- <if test="contact_phone != null and contact_phone != ''">
|
|
|
- contact_phone = #{contact_phone},
|
|
|
+ <if test="contactPhone != null and contactPhone != ''">
|
|
|
+ contactPhone = #{contactPhone},
|
|
|
</if>
|
|
|
- <if test="contact_name != null and contact_name != ''">
|
|
|
- contact_name = #{contact_name},
|
|
|
+ <if test="contactName != null and contactName != ''">
|
|
|
+ contactName = #{contactName},
|
|
|
</if>
|
|
|
- <if test="contact_relationship != null and contact_relationship != ''">
|
|
|
- contact_relationship = #{contact_relationship},
|
|
|
+ <if test="contactRelationship != null and contactRelationship != ''">
|
|
|
+ contactRelationship = #{contactRelationship},
|
|
|
</if>
|
|
|
- <if test="created_by != null and created_by != ''">
|
|
|
- created_by = #{created_by},
|
|
|
+ <if test="createdBy != null and createdBy != ''">
|
|
|
+ createdBy = #{createdBy},
|
|
|
</if>
|
|
|
<if test="status != null and status != ''">
|
|
|
status = #{status}
|
|
@@ -1262,8 +1260,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="id != null and id != ''">
|
|
|
AND id = #{id}
|
|
|
</if>
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">
|
|
|
- AND patient_archive_id = #{patient_archive_id}
|
|
|
+ <if test="archiveId != null and archiveId != ''">
|
|
|
+ AND archiveId = #{archiveId}
|
|
|
</if>
|
|
|
<if test="disease != null and disease != ''">
|
|
|
AND disease = #{disease}
|
|
@@ -1271,8 +1269,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="member != null and member != ''">
|
|
|
AND member = #{member}
|
|
|
</if>
|
|
|
- <if test="created_by != null and created_by != ''">
|
|
|
- AND created_by = #{created_by}
|
|
|
+ <if test="createdBy != null and createdBy != ''">
|
|
|
+ AND createdBy = #{createdBy}
|
|
|
</if>
|
|
|
<if test="status != null and status != ''">
|
|
|
AND status = #{status}
|
|
@@ -1283,24 +1281,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<insert id="insertFamilyHistory" parameterType="pd">
|
|
|
INSERT INTO s_dtp_ysfw_family_history
|
|
|
<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
- <if test="id != null and id != ''">id,</if>
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">patient_archive_id,</if>
|
|
|
+ <if test="archiveId != null and archiveId != ''">archiveId,</if>
|
|
|
<if test="disease != null and disease != ''">disease,</if>
|
|
|
<if test="member != null and member != ''">member,</if>
|
|
|
- <if test="created_by != null and created_by != ''">created_by,</if>
|
|
|
- <if test="created_at != null and created_at != ''">created_at,</if>
|
|
|
- <if test="updated_at != null and updated_at != ''">updated_at,</if>
|
|
|
+ <if test="createdBy != null and createdBy != ''">createdBy,</if>
|
|
|
+ <if test="createdAt != null and createdAt != ''">createdAt,</if>
|
|
|
+ <if test="updatedAt != null and updatedAt != ''">updatedAt,</if>
|
|
|
<if test="status != null and status != ''">status</if>
|
|
|
</trim>
|
|
|
|
|
|
<trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
- <if test="id != null and id != ''">#{id},</if>
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">#{patient_archive_id},</if>
|
|
|
+ <if test="archiveId != null and archiveId != ''">#{archiveId},</if>
|
|
|
<if test="disease != null and disease != ''">#{disease},</if>
|
|
|
<if test="member != null and member != ''">#{member},</if>
|
|
|
- <if test="created_by != null and created_by != ''">#{created_by},</if>
|
|
|
- <if test="created_at != null and created_at != ''">#{created_at},</if>
|
|
|
- <if test="updated_at != null and updated_at != ''">#{updated_at},</if>
|
|
|
+ <if test="createdBy != null and createdBy != ''">#{createdBy},</if>
|
|
|
+ <if test="createdAt != null and createdAt != ''">#{createdAt},</if>
|
|
|
+ <if test="updatedAt != null and updatedAt != ''">#{updatedAt},</if>
|
|
|
<if test="status != null and status != ''">#{status}</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
@@ -1308,8 +1304,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<update id="updateFamilyHistory" parameterType="pd">
|
|
|
UPDATE s_dtp_ysfw_family_history SET
|
|
|
<trim prefix="" suffixOverrides="," prefixOverrides=",">
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">
|
|
|
- patient_archive_id = #{patient_archive_id},
|
|
|
+ <if test="archiveId != null and archiveId != ''">
|
|
|
+ archiveId = #{archiveId},
|
|
|
</if>
|
|
|
<if test="disease != null and disease != ''">
|
|
|
disease = #{disease},
|
|
@@ -1317,8 +1313,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="member != null and member != ''">
|
|
|
member = #{member},
|
|
|
</if>
|
|
|
- <if test="created_by != null and created_by != ''">
|
|
|
- created_by = #{created_by},
|
|
|
+ <if test="createdBy != null and createdBy != ''">
|
|
|
+ createdBy = #{createdBy},
|
|
|
</if>
|
|
|
<if test="status != null and status != ''">
|
|
|
status = #{status}
|
|
@@ -1332,17 +1328,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="id != null and id != ''">
|
|
|
AND id = #{id}
|
|
|
</if>
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">
|
|
|
- AND patient_archive_id = #{patient_archive_id}
|
|
|
+ <if test="archiveId != null and archiveId != ''">
|
|
|
+ AND archiveId = #{archiveId}
|
|
|
</if>
|
|
|
- <if test="medication_description != null and medication_description != ''">
|
|
|
- AND medication_description = #{medication_description}
|
|
|
+ <if test="medicationDescription != null and medicationDescription != ''">
|
|
|
+ AND medicationDescription = #{medicationDescription}
|
|
|
</if>
|
|
|
- <if test="medication_type != null and medication_type != ''">
|
|
|
- AND medication_type = #{medication_type}
|
|
|
+ <if test="medicationType != null and medicationType != ''">
|
|
|
+ AND medicationType = #{medicationType}
|
|
|
</if>
|
|
|
- <if test="created_by != null and created_by != ''">
|
|
|
- AND created_by = #{created_by}
|
|
|
+ <if test="createdBy != null and createdBy != ''">
|
|
|
+ AND createdBy = #{createdBy}
|
|
|
</if>
|
|
|
<if test="status != null and status != ''">
|
|
|
AND status = #{status}
|
|
@@ -1352,24 +1348,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<insert id="insertMedicationRecord" parameterType="pd">
|
|
|
INSERT INTO s_dtp_ysfw_medication_records
|
|
|
<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
- <if test="id != null and id != ''">id,</if>
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">patient_archive_id,</if>
|
|
|
- <if test="medication_description != null and medication_description != ''">medication_description,</if>
|
|
|
- <if test="medication_type != null and medication_type != ''">medication_type,</if>
|
|
|
- <if test="created_by != null and created_by != ''">created_by,</if>
|
|
|
- <if test="created_at != null and created_at != ''">created_at,</if>
|
|
|
- <if test="updated_at != null and updated_at != ''">updated_at,</if>
|
|
|
+ <if test="archiveId != null and archiveId != ''">archiveId,</if>
|
|
|
+ <if test="medicationDescription != null and medicationDescription != ''">medicationDescription,</if>
|
|
|
+ <if test="medicationType != null and medicationType != ''">medicationType,</if>
|
|
|
+ <if test="createdBy != null and createdBy != ''">createdBy,</if>
|
|
|
+ <if test="createdAt != null and createdAt != ''">createdAt,</if>
|
|
|
+ <if test="updatedAt != null and updatedAt != ''">updatedAt,</if>
|
|
|
<if test="status != null and status != ''">status</if>
|
|
|
</trim>
|
|
|
|
|
|
<trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
|
|
|
- <if test="id != null and id != ''">#{id},</if>
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">#{patient_archive_id},</if>
|
|
|
- <if test="medication_description != null and medication_description != ''">#{medication_description},</if>
|
|
|
- <if test="medication_type != null and medication_type != ''">#{medication_type},</if>
|
|
|
- <if test="created_by != null and created_by != ''">#{created_by},</if>
|
|
|
- <if test="created_at != null and created_at != ''">#{created_at},</if>
|
|
|
- <if test="updated_at != null and updated_at != ''">#{updated_at},</if>
|
|
|
+ <if test="archiveId != null and archiveId != ''">#{archiveId},</if>
|
|
|
+ <if test="medicationDescription != null and medicationDescription != ''">#{medicationDescription},</if>
|
|
|
+ <if test="medicationType != null and medicationType != ''">#{medicationType},</if>
|
|
|
+ <if test="createdBy != null and createdBy != ''">#{createdBy},</if>
|
|
|
+ <if test="createdAt != null and createdAt != ''">#{createdAt},</if>
|
|
|
+ <if test="updatedAt != null and updatedAt != ''">#{updatedAt},</if>
|
|
|
<if test="status != null and status != ''">#{status}</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
@@ -1378,17 +1372,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<update id="updateMedicationRecord" parameterType="pd">
|
|
|
UPDATE s_dtp_ysfw_medication_records SET
|
|
|
<trim prefix="" suffixOverrides="," prefixOverrides=",">
|
|
|
- <if test="patient_archive_id != null and patient_archive_id != ''">
|
|
|
- patient_archive_id = #{patient_archive_id},
|
|
|
+ <if test="archiveId != null and archiveId != ''">
|
|
|
+ archiveId = #{archiveId},
|
|
|
</if>
|
|
|
- <if test="medication_description != null and medication_description != ''">
|
|
|
- medication_description = #{medication_description},
|
|
|
+ <if test="medicationDescription != null and medicationDescription != ''">
|
|
|
+ medicationDescription = #{medicationDescription},
|
|
|
</if>
|
|
|
- <if test="medication_type != null and medication_type != ''">
|
|
|
- medication_type = #{medication_type},
|
|
|
+ <if test="medicationType != null and medicationType != ''">
|
|
|
+ medicationType = #{medicationType},
|
|
|
</if>
|
|
|
<if test="created_by != null and created_by != ''">
|
|
|
- created_by = #{created_by},
|
|
|
+ createdBy = #{createdBy},
|
|
|
</if>
|
|
|
<if test="status != null and status != ''">
|
|
|
status = #{status}
|
|
@@ -1411,4 +1405,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
DELETE FROM s_dtp_ysfw_medication_records WHERE id = #{id}
|
|
|
</update>
|
|
|
|
|
|
+
|
|
|
+ <!--物理删除家 联系人表,族病史表,用药情况表根据档案 archiveId 删除-->
|
|
|
+ <update id="DeleteContact" parameterType="pd">
|
|
|
+ DELETE FROM s_dtp_ysfw_contacts WHERE archiveId = #{archiveId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="DeleteFamilyHistory" parameterType="pd">
|
|
|
+ DELETE FROM s_dtp_ysfw_family_history WHERE archiveId = #{archiveId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="DeleteMedicationRecord" parameterType="pd">
|
|
|
+ DELETE FROM s_dtp_ysfw_medication_records WHERE archiveId = #{archiveId}
|
|
|
+ </update>
|
|
|
</mapper>
|