Quellcode durchsuchen

住院病人列表的receponceType从yb_zy_review_record里取

lighter vor 4 Jahren
Ursprung
Commit
50e25e378c
1 geänderte Dateien mit 11 neuen und 10 gelöschten Zeilen
  1. 11 10
      src/main/java/thyyxxk/webserver/dao/his/yibao/PatientDao.java

+ 11 - 10
src/main/java/thyyxxk/webserver/dao/his/yibao/PatientDao.java

@@ -13,17 +13,18 @@ import java.util.List;
 public interface PatientDao {
 
     @Select("select " +
-            "RTRIM(a.bed_no) bedNo," +
-            "RTRIM(a.inpatient_no) inpatientNo," +
-            "a.admiss_times," +
-            "RTRIM(a.name) name," +
+            "RTRIM(a.bed_no) bedNo, " +
+            "RTRIM(a.inpatient_no) inpatientNo, " +
+            "a.admiss_times, " +
+            "RTRIM(a.name) as name, " +
             "sex=isnull(a.sex, 9), " +
-            "status=RTRIM((select status_flag from yb_zy_review_record b " +
-            "where b.inpatient_no= a.inpatient_no and b.admiss_times=a.admiss_times " +
-            "and b.ledger_sn=(select MAX(ledger_sn) from yb_zy_review_record " +
-            "where inpatient_no=b.inpatient_no and admiss_times=b.admiss_times))), " +
-            "RTRIM(a.responce_type) responceType " +
-            "from zy_actpatient a where ward like #{ward} and charindex('$',a.inpatient_no)=0 " +
+            "status=(select rtrim(b.status_flag) from yb_zy_review_record b where b.inpatient_no=a.inpatient_no " +
+            "and b.admiss_times=a.admiss_times and b.ledger_sn=(select MAX(c.ledger_sn) from yb_zy_review_record c " +
+            "where c.inpatient_no=b.inpatient_no and c.admiss_times=b.admiss_times)), " +
+            "responceType=(select rtrim(b.responce_type) from yb_zy_review_record b where b.inpatient_no=a.inpatient_no " +
+            "and b.admiss_times=a.admiss_times and b.ledger_sn=(select MAX(c.ledger_sn) from yb_zy_review_record c " +
+            "where c.inpatient_no=b.inpatient_no and c.admiss_times=b.admiss_times)) " +
+            "from zy_actpatient a where a.ward like #{ward} and charindex('$',a.inpatient_no)=0 " +
             "ORDER BY cast(a.bed_no AS int)")
     List<Overview> getOverView(@Param("ward") String ward);