Your Name 4 years ago
parent
commit
a02c06240c

+ 6
- 1
src/main/java/com/yunzhi/demo/controller/TaMedicalLogController.java View File

134
     @ApiOperation(value="就诊详情", notes = "就诊详情", httpMethod = "GET", response = ResponseBean.class)
134
     @ApiOperation(value="就诊详情", notes = "就诊详情", httpMethod = "GET", response = ResponseBean.class)
135
     public ResponseBean taMedicalLogGet(@ApiParam(value = "客户端", allowableValues = "admin,ma") @PathVariable String client,
135
     public ResponseBean taMedicalLogGet(@ApiParam(value = "客户端", allowableValues = "admin,ma") @PathVariable String client,
136
                                         @ApiParam("就诊ID") @PathVariable Integer id) throws Exception{
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 View File

87
     @ApiModelProperty(value = "手机号")
87
     @ApiModelProperty(value = "手机号")
88
     @TableField(exist = false)
88
     @TableField(exist = false)
89
     private String phone;
89
     private String phone;
90
-
91
 }
90
 }

+ 2
- 0
src/main/java/com/yunzhi/demo/mapper/TaMedicalLogMapper.java View File

22
                                           @Param("schoolId") String schoolId,
22
                                           @Param("schoolId") String schoolId,
23
                                           @Param("specialtyId") String specialtyId,
23
                                           @Param("specialtyId") String specialtyId,
24
                                           @Param("studentNo") String studentNo);
24
                                           @Param("studentNo") String studentNo);
25
+
26
+    TaMedicalLog getMedicalLogDetail(Integer id);
25
 }
27
 }

+ 2
- 0
src/main/java/com/yunzhi/demo/service/ITaMedicalLogService.java View File

16
 public interface ITaMedicalLogService extends IService<TaMedicalLog> {
16
 public interface ITaMedicalLogService extends IService<TaMedicalLog> {
17
 
17
 
18
     IPage<TaMedicalLog> getMedicalLogPagedBy(IPage<TaMedicalLog> pg, String schoolId, String specialtyId, String studentNo);
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 View File

28
     public IPage<TaMedicalLog> getMedicalLogPagedBy(IPage<TaMedicalLog> pg, String schoolId, String specialtyId, String studentNo) {
28
     public IPage<TaMedicalLog> getMedicalLogPagedBy(IPage<TaMedicalLog> pg, String schoolId, String specialtyId, String studentNo) {
29
         return taMedicalLogMapper.getMedicalLogPagedBy(pg, schoolId, specialtyId, studentNo);
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 View File

33
         ORDER BY
33
         ORDER BY
34
         a.create_date DESC
34
         a.create_date DESC
35
     </select>
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
 </mapper>
56
 </mapper>