Your Name 4 年 前
コミット
a02c06240c

+ 6
- 1
src/main/java/com/yunzhi/demo/controller/TaMedicalLogController.java ファイルの表示

@@ -134,7 +134,12 @@ public class TaMedicalLogController extends BaseController {
134 134
     @ApiOperation(value="就诊详情", notes = "就诊详情", httpMethod = "GET", response = ResponseBean.class)
135 135
     public ResponseBean taMedicalLogGet(@ApiParam(value = "客户端", allowableValues = "admin,ma") @PathVariable String client,
136 136
                                         @ApiParam("就诊ID") @PathVariable Integer id) throws Exception{
137
-        return ResponseBean.success(iTaMedicalLogService.getById(id));
137
+        TaMedicalLog medicalLog = iTaMedicalLogService.getProfileBy(id);
138
+        if (null == medicalLog) {
139
+            throw new Exception("无效的就诊记录");
140
+        }
141
+
142
+        return ResponseBean.success(medicalLog);
138 143
     }
139 144
 
140 145
 

+ 0
- 1
src/main/java/com/yunzhi/demo/entity/TaMedicalLog.java ファイルの表示

@@ -87,5 +87,4 @@ public class TaMedicalLog implements Serializable {
87 87
     @ApiModelProperty(value = "手机号")
88 88
     @TableField(exist = false)
89 89
     private String phone;
90
-
91 90
 }

+ 2
- 0
src/main/java/com/yunzhi/demo/mapper/TaMedicalLogMapper.java ファイルの表示

@@ -22,4 +22,6 @@ public interface TaMedicalLogMapper extends BaseMapper<TaMedicalLog> {
22 22
                                           @Param("schoolId") String schoolId,
23 23
                                           @Param("specialtyId") String specialtyId,
24 24
                                           @Param("studentNo") String studentNo);
25
+
26
+    TaMedicalLog getMedicalLogDetail(Integer id);
25 27
 }

+ 2
- 0
src/main/java/com/yunzhi/demo/service/ITaMedicalLogService.java ファイルの表示

@@ -16,4 +16,6 @@ import com.yunzhi.demo.entity.TaPerson;
16 16
 public interface ITaMedicalLogService extends IService<TaMedicalLog> {
17 17
 
18 18
     IPage<TaMedicalLog> getMedicalLogPagedBy(IPage<TaMedicalLog> pg, String schoolId, String specialtyId, String studentNo);
19
+
20
+    TaMedicalLog getProfileBy(Integer id);
19 21
 }

+ 5
- 0
src/main/java/com/yunzhi/demo/service/impl/TaMedicalLogServiceImpl.java ファイルの表示

@@ -28,4 +28,9 @@ public class TaMedicalLogServiceImpl extends ServiceImpl<TaMedicalLogMapper, TaM
28 28
     public IPage<TaMedicalLog> getMedicalLogPagedBy(IPage<TaMedicalLog> pg, String schoolId, String specialtyId, String studentNo) {
29 29
         return taMedicalLogMapper.getMedicalLogPagedBy(pg, schoolId, specialtyId, studentNo);
30 30
     }
31
+
32
+    @Override
33
+    public TaMedicalLog getProfileBy(Integer id) {
34
+        return taMedicalLogMapper.getMedicalLogDetail(id);
35
+    }
31 36
 }

+ 20
- 0
src/main/resources/mapper/TaMedicalLogMapper.xml ファイルの表示

@@ -33,4 +33,24 @@
33 33
         ORDER BY
34 34
         a.create_date DESC
35 35
     </select>
36
+    <select id="getMedicalLogDetail" resultType="com.yunzhi.demo.entity.TaMedicalLog">
37
+        SELECT
38
+            a.*,
39
+            b.`name`,
40
+            b.sex,
41
+            b.school_id,
42
+            b.specialty_id,
43
+            b.student_id,
44
+            c.`name` as school_name,
45
+            d.`name` as specialty_name,
46
+            e.user_name as doctor_name
47
+        FROM
48
+            ta_medical_log a
49
+                LEFT JOIN ta_student b on a.student_id = b.student_id
50
+                LEFT JOIN td_school c on b.school_id = c.school_id
51
+                LEFT JOIN td_specialty d on b.specialty_id = d.specialty_id
52
+                LEFT JOIN sys_user e on a.doctor_id = e.user_id
53
+        WHERE a.serial_no = #{id}
54
+            AND a.`status` > - 1
55
+    </select>
36 56
 </mapper>