Browse Source

账页号最大值。

xiaochan 3 years ago
parent
commit
9deb0f0f03

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/PublicDao.java

@@ -99,7 +99,7 @@ public interface PublicDao {
     @Select("select rtrim(inpatient_no) inpatient_no,admiss_times,admiss_date,dis_date,name, " +
             "responce_name = (select rtrim(name) name from zy_zd_responce_type where code = responce_type), " +
             "ward,ward_name = (select rtrim(name) name from zd_unit_code where code = ward), " +
-            "ledger_sn = (select ledger_sn from zy_ledger_file where a.inpatient_no = zy_ledger_file.inpatient_no and a.admiss_times = zy_ledger_file.admiss_times), " +
+            "ledger_sn = (select max(ledger_sn) from zy_ledger_file where a.inpatient_no = zy_ledger_file.inpatient_no and a.admiss_times = zy_ledger_file.admiss_times), " +
             "chu_yuan_yi_zhu = (case when (select count(1) from yz_act_order where inpatient_no= a.inpatient_no and admiss_times= a.admiss_times " +
             "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')) > 0 " +
             "then 1 " +

+ 1 - 3
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -228,13 +228,11 @@ public class PublicServer {
      */
     public ZyActpatient huoQuHuanZheXinXi(String inpatientNo) {
         if (StringUtil.isBlank(inpatientNo)) {
-            log.error("住院号为空。");
             throw new BizException(ExceptionEnum.NULL_POINTER, "住院号为空。");
         }
         Integer admissTimes = dao.getAdmissTimes(inpatientNo);
-
         ZyActpatient zyActpatient = dao.getHuanZheJiBenXinXi(inpatientNo, admissTimes);
-
+        log.info("查询患者的信息:住院号{},次数:{}", inpatientNo, admissTimes);
         if (zyActpatient == null) {
             throw new BizException(ExceptionEnum.NULL_POINTER, "没有查询到患者的基本信息。");
         }