lighter 2 rokov pred
rodič
commit
c87a5f3f9b

+ 0 - 5
src/main/java/thyyxxk/webserver/controller/outpatient/comments/CommentsController.java

@@ -22,11 +22,6 @@ public class CommentsController {
         return service.getComments(inquiry);
     }
 
-    @GetMapping("/getPatientPhoneNo")
-    public ResultVo<String> getPatientPhoneNo(@RequestParam("patNo") String patNo) {
-        return service.getPatientPhoneNo(patNo);
-    }
-
     @GetMapping("/updateCommentStatus")
     public ResultVo<String> updateCommentStatus(@RequestParam("id") int id,
                                                 @RequestParam("deleted") int deleted) {

+ 3 - 5
src/main/java/thyyxxk/webserver/dao/his/outpatient/comments/CommentsDao.java

@@ -15,8 +15,9 @@ import java.util.List;
 public interface CommentsDao {
     @Select("select * from " +
             "(SELECT ROW_NUMBER() OVER(ORDER BY id) AS idx,*, " +
-            "department=(select rtrim(d.dept_code) from a_employee_mi d where d.code=doctor_code) " +
-            "from t_wechat_patient_comment ${ew.customSqlSegment}) t " +
+            "department=(select rtrim(d.dept_code) from a_employee_mi d where d.code=doctor_code), " +
+            "patPhoneNo=(select top 1 d.phone from t_wechat_patient_bind d where d.patient_id=a.patient_id and d.phone is not null) " +
+            "from t_wechat_patient_comment a ${ew.customSqlSegment}) t " +
             "where t.idx>(#{page}-1)*#{size} and t.idx<=#{page}*#{size}")
     List<WechatPatientComment> selectComments(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper,
                                               @Param("page") int page, @Param("size") int size);
@@ -24,9 +25,6 @@ public interface CommentsDao {
     @Select("select count(1) from t_wechat_patient_comment ${ew.customSqlSegment}")
     int selectValidCount(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
 
-    @Select("select top 1 phone from t_wechat_patient_bind where patient_id=#{patNo} and phone is not null ")
-    String selectPatientPhoneNo(String patNo);
-
     @Update("update t_wechat_patient_comment set deleted=#{val},delete_staff=#{staff},delete_time=#{date} where id=#{id}")
     int updateCommentStatus(int id, int val, String staff, Date date);
 }

+ 1 - 1
src/main/java/thyyxxk/webserver/entity/outpatient/comments/response/WechatPatientComment.java

@@ -21,6 +21,6 @@ public class WechatPatientComment {
   private Date commentTime;
   private Integer commentLevel;
   private String commentContent;
-  private String hisOrdNum;
+  private String patPhoneNo;
   private Integer deleted;
 }

+ 0 - 8
src/main/java/thyyxxk/webserver/service/outpatient/comments/CommentsService.java

@@ -54,14 +54,6 @@ public class CommentsService {
         return ResultVoUtil.success(response);
     }
 
-    public ResultVo<String> getPatientPhoneNo(String patNo) {
-        String phone = dao.selectPatientPhoneNo(patNo);
-        if (StringUtil.isBlank(phone)) {
-            return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "患者未留存联系方式。");
-        }
-        return ResultVoUtil.success(phone);
-    }
-
     public ResultVo<String> updateCommentStatus(int id, int deleted) {
         String staff = null;
         Date date = null;