Browse Source

病人信息修改优化

lihong 1 year ago
parent
commit
e7e2bae49f

+ 1 - 1
src/main/java/cn/hnthyy/thmz/controller/zy/APatientMiController.java

@@ -128,7 +128,7 @@ public class APatientMiController {
             if(StrUtil.isNotBlank(aPatientMi.getInpatientNo())){
                 APatientMi tempAPatientMi = aPatientMiService.queryPatientMiByInPatientNo(aPatientMi.getInpatientNo());
                 if(tempAPatientMi != null){
-                    num=aPatientMiService.modifyMzPatientMi(aPatientMi);
+                    num=aPatientMiService.modifyMzPatientMiByInpatientNo(aPatientMi);
                 }else {
                     num=aPatientMiService.saveMzPatientMi(aPatientMi);
                 }

+ 78 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/zy/APatientMiMapper.java

@@ -324,4 +324,82 @@ public interface APatientMiMapper {
     int updateLastadmissTimes(APatientMi aPatientMiDb);
     @Update("  update a_patient_mi set lastadmiss_times = 0,inpatient_no=null where inpatient_no =#{inpatientNo} ")
     int clearInpatientNo(APatientMi aPatientMiDb);
+    @Update({"<script>",
+            "update a_patient_mi ",
+            "<trim prefix='set' prefixOverrides=',' suffix=' where inpatient_no =#{inpatientNo}' >",
+            "<when test='name!=null'>",
+            "name =#{name,jdbcType=CHAR}",
+            "</when>",
+            "<when test='sex!=null'>",
+            ",sex =#{sex,jdbcType=CHAR}",
+            "</when>",
+            "<when test='birthDate!=null'>",
+            ",birth_date =#{birthDate,jdbcType=TIMESTAMP}",
+            "</when>",
+            "<when test='birthDate!=null'>",
+            ",occupation_code =#{occupationCode,jdbcType=CHAR}",
+            "</when>",
+            "<when test='mzNo!=null'>",
+            ",mz_no =#{mzNo,jdbcType=CHAR}",
+            "</when>",
+            "<when test='homeTel!=null'>",
+            ",home_tel =#{homeTel,jdbcType=CHAR}",
+            "</when>",
+            "<when test='marryCode!=null'>",
+            ",marry_code =#{marryCode,jdbcType=CHAR}",
+            "</when>",
+            "<when test='country!=null'>",
+            ",country =#{country,jdbcType=CHAR}",
+            "</when>",
+            "<when test='nationCode!=null'>",
+            ",nation_code =#{nationCode,jdbcType=CHAR}",
+            "</when>",
+            "<when test='birthPlace!=null'>",
+            ",birth_place =#{birthPlace,jdbcType=CHAR}",
+            "</when>",
+            "<when test='accountStreet!=null'>",
+            ",account_street =#{accountStreet,jdbcType=CHAR}",
+            "</when>",
+            "<when test='socialNo!=null'>",
+            ",social_no =#{socialNo,jdbcType=CHAR}",
+            "</when>",
+            "<when test='homeStreet!=null'>",
+            ",home_street =#{homeStreet,jdbcType=CHAR}",
+            "</when>",
+            "<when test='inpatientNo!=null'>",
+            ",inpatient_no =#{inpatientNo,jdbcType=CHAR}",
+            "</when>",
+            "<when test='employerStreet!=null'>",
+            ",employer_street =#{employerStreet,jdbcType=CHAR}",
+            "</when>",
+            "<when test='relationName!=null'>",
+            ",relation_name =#{relationName,jdbcType=CHAR}",
+            "</when>",
+            "<when test='relationCode!=null'>",
+            ",relation_code =#{relationCode,jdbcType=CHAR}",
+            "</when>",
+            "<when test='relationTel!=null'>",
+            ",relation_tel =#{relationTel,jdbcType=CHAR}",
+            "</when>",
+            "<when test='relationStreet!=null'>",
+            ",relation_street =#{relationStreet,jdbcType=CHAR}",
+            "</when>",
+            "<when test='lastadmissTimes!=null'>",
+            ",lastadmiss_times =#{lastadmissTimes,jdbcType=SMALLINT}",
+            "</when>",
+            "<when test='psnCertType!=null'>",
+            ",psn_cert_type =#{psnCertType,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='provinceCode!=null'>",
+            ",province_code =#{provinceCode}",
+            "</when>",
+            "<when test='cityCode!=null'>",
+            ",city_code =#{cityCode}",
+            "</when>",
+            "<when test='districtCode!=null'>",
+            ",district_code =#{districtCode}",
+            "</when>",
+            "</trim>"
+            ,"</script>"})
+    int updateMzPatientMiInpatientNo(APatientMi aPatientMi);
 }

+ 8 - 0
src/main/java/cn/hnthyy/thmz/service/his/zy/APatientMiService.java

@@ -56,4 +56,12 @@ public interface APatientMiService {
      * @return
      */
     int modifyMzPatientMi(APatientMi aPatientMi);
+    /**
+     * @description: 根据住院号修改信息
+     * @author: lihong
+     * @date: 2023/12/11 8:25
+     * @param: aPatientMi
+     * @return: int
+     **/
+    int modifyMzPatientMiByInpatientNo(APatientMi aPatientMi);
 }

+ 13 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/zy/APatientMiServiceImpl.java

@@ -63,4 +63,17 @@ public class APatientMiServiceImpl implements APatientMiService {
     public int modifyMzPatientMi(APatientMi aPatientMi) {
         return aPatientMiMapper.updateMzPatientMiByMzno(aPatientMi);
     }
+
+    /**
+     * @param aPatientMi
+     * @description: 根据住院号修改信息
+     * @author: lihong
+     * @date: 2023/12/11 8:25
+     * @param: aPatientMi
+     * @return: int
+     */
+    @Override
+    public int modifyMzPatientMiByInpatientNo(APatientMi aPatientMi) {
+        return aPatientMiMapper.updateMzPatientMiInpatientNo(aPatientMi);
+    }
 }