Переглянути джерело

update: 手术患者表结构变更代码调整

wangzl 6 місяців тому
батько
коміт
4fafc502ec

+ 1 - 10
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/vo/WxDoctorClinicRoomVO.java

@@ -38,18 +38,9 @@ public class WxDoctorClinicRoomVO implements Serializable {
     private String patientName;
 
     @ApiModelProperty("患者生日")
-    @JsonIgnore
-    private Date patientBirthday;
+    private Integer patientAge;
 
     @ApiModelProperty("患者性别")
     private String patientGender;
 
-    @ApiModelProperty("患者身份证号")
-    @JsonIgnore
-    private String patientCardNo;
-
-    @ApiModelProperty("病人年龄")
-    public Integer getPatientAge(){
-        return AgeUtils.calculateAge(this.getPatientBirthday());
-    }
 }

+ 5 - 10
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/vo/WxDoctorPatientVO.java

@@ -20,7 +20,10 @@ public class WxDoctorPatientVO implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @ApiModelProperty("患者ID")
-    private String id;
+    private String patientId;
+
+    @ApiModelProperty("当前手术Id")
+    private String currentClinicId;
 
     @ApiModelProperty("住院号")
     private String patientCode;
@@ -32,18 +35,10 @@ public class WxDoctorPatientVO implements Serializable {
     private String patientName;
 
     @ApiModelProperty("患者生日")
-    @JsonIgnore
-    private Date patientBirthday;
+    private Integer patientAge;
 
     @ApiModelProperty("患者性别")
     private String patientGender;
 
-    @ApiModelProperty("患者身份证号")
-    @JsonIgnore
-    private String patientCardNo;
 
-    @ApiModelProperty("病人年龄")
-    public Integer getPatientAge(){
-        return AgeUtils.calculateAge(this.getPatientBirthday());
-    }
 }

+ 7 - 9
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizClinicRoomMapper.xml

@@ -24,10 +24,9 @@
         <result property="clinicStartTime" column="clinic_start_time"/>
         <result property="deptName" column="dept_name"/>
         <result property="patientCode" column="patient_code"/>
-        <result property="patientName" column="name"/>
-        <result property="patientBirthday" column="birthday"/>
-        <result property="patientGender" column="gender"/>
-        <result property="patientCardNo" column="card_no"/>
+        <result property="patientName" column="patient_name"/>
+        <result property="patientAge" column="patient_age"/>
+        <result property="patientGender" column="patient_gender"/>
     </resultMap>
 
     <select id="stdSelectWxAppletClinicList" resultMap="stdWxAppletResult">
@@ -59,11 +58,10 @@
         bcr.clinic_name,
         bcr.clinic_start_time,
         bcr.dept_name,
-        bcr.patient_code,
-        bp.name,
-        bp.birthday,
-        bp.gender,
-        bp.card_no
+        bcr.patient_name,
+        bcr.patient_age,
+        bcr.patient_gender,
+        bp.patient_code
         FROM biz_clinic_room bcr
         join biz_patient bp
         on bcr.patient_id = bp.id

+ 16 - 16
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizPatientMapper.xml

@@ -5,25 +5,25 @@
 <mapper namespace="cn.tr.module.smart.common.repository.BizPatientRepository">
 
     <resultMap id="PatientAndClinicResult" type="cn.tr.module.smart.app.controller.vo.WxDoctorPatientVO">
+        <result property="patientId" column="patient_id"/>
+        <result property="currentClinicId" column="current_clinic_id"/>
         <result property="patientCode" column="patient_code"/>
-        <result property="countResult" column="countResult"/>
-        <result property="patientName" column="name"/>
-        <result property="patientBirthday" column="birthday"/>
-        <result property="patientGender" column="gender"/>
-        <result property="patientCardNo" column="card_no"/>
+        <result property="countResult" column="result_count"/>
+        <result property="patientName" column="patient_name"/>
+        <result property="patientAge" column="patient_age"/>
+        <result property="patientGender" column="patient_gender"/>
     </resultMap>
     <select id="selectPatientList" resultMap="PatientAndClinicResult">
         SELECT
-        queryResult.countResult,
-        bp.id,
-        bp.name,
-        bp.birthday,
-        bp.gender,
+        query_result.result_count,
+        bp.ID AS patient_id,
+        bp.patient_code,
         bp.current_clinic_id,
-        bp.card_no,
-        bp.patient_code
+        bcr.patient_name,
+        bcr.patient_age,
+        bcr.patient_gender
         FROM
-        ( SELECT patient_id, COUNT ( 1 ) AS countResult FROM biz_clinic_room
+        ( SELECT patient_id, COUNT ( 1 ) AS result_count FROM biz_clinic_room
         <where>
             <if test="query.queryTime != null and query.queryTime.size() > 0">
                 AND clinic_start_time >= #{query.queryTime[0]}
@@ -32,9 +32,9 @@
                 AND clinic_start_time &lt;= #{query.queryTime[1]}
             </if>
         </where>
-        GROUP BY patient_id ) AS
-        queryResult
-        JOIN biz_patient AS bp ON queryResult.patient_id = bp."id"
+        GROUP BY patient_id ) query_result
+        JOIN biz_patient AS bp ON query_result.patient_id = bp.ID
+        LEFT JOIN biz_clinic_room bcr ON bp.current_clinic_id = bcr.ID
         <where>
             <if test="query.queryCondition != null and query.queryCondition != ''">
                 bp.patient_code LIKE concat('%',#{query.queryCondition,jdbcType=VARCHAR},'%')