Ver código fonte

创智DRG&DIP抽取费用添加分页

lighter 2 anos atrás
pai
commit
467ae476ea

+ 8 - 1
src/main/java/thyyxxk/webserver/controller/api/forpowersi/DrgDipController.java

@@ -263,7 +263,14 @@ public class DrgDipController {
         if (null == params.getVisitId()) {
             return DrgDipResponseFactory.wrongParameters("visitId不能为空。");
         }
-        List<HisHsptzdCharge> list = dao.selectHisHsptzdCharge(params.getPatNo(), params.getTimes(), params.getLedgerSn());
+        if (null == params.getPageNumber() || null == params.getPageSize()) {
+            return DrgDipResponseFactory.wrongParameters("pageNumber、pageSize不能为空。");
+        }
+        if (params.getPageSize() > 300) {
+            return DrgDipResponseFactory.wrongParameters("pageSize允许的最大值为【300】。");
+        }
+        List<HisHsptzdCharge> list = dao.selectHisHsptzdCharge(params.getPatNo(), params.getTimes(),
+                params.getLedgerSn(), params.getPageNumber(), params.getPageSize());
         if (list.isEmpty()) {
             return DrgDipResponseFactory.noCorrespondingDataFound();
         }

+ 6 - 5
src/main/java/thyyxxk/webserver/dao/his/api/forpowersi/drgdip/DrgDipDao.java

@@ -167,7 +167,8 @@ public interface DrgDipDao {
             "from zy_inactpatient a, a_patient_mi b where a.inpatient_no=#{patNo} and a.admiss_times=#{times} and a.inpatient_no=b.inpatient_no ")
     List<HisHsptzdPatientBase> selectHisHsptzdPatientBaseOutHosp(String patNo, int times);
 
-    @Select("select " +
+    @Select("select * from " +
+            "(SELECT ROW_NUMBER() OVER(ORDER BY a.detail_sn) AS idx, " +
             "chargeDetailId=rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar)+'_'+cast(a.ledger_sn as varchar)+'_'+ " +
             "cast(a.detail_sn as varchar), " +
             "visitId=rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar)+'_'+cast(a.ledger_sn as varchar), " +
@@ -207,10 +208,10 @@ public interface DrgDipDao {
             "hospSend=case when trans_flag_yb=1 then 'Y' else 'N' end, " +
             "insurSettlId=(select d.setl_id from t_si_setlinfo d where d.pat_no=a.inpatient_no and d.times=a.admiss_times " +
             "and d.ledger_sn=a.ledger_sn and d.revoked=0) " +
-            "from zy_detail_charge a with(nolock) " +
-            "where a.inpatient_no=#{patNo} and a.admiss_times=#{times} " +
-            "and a.ledger_sn=#{ledgerSn} and a.trans_flag_yb!=2 and a.charge_status!='1'")
-    List<HisHsptzdCharge> selectHisHsptzdCharge(String patNo, int times, int ledgerSn);
+            "from zy_detail_charge a with(nolock) where a.inpatient_no=#{patNo} and a.admiss_times=#{times} " +
+            "and a.ledger_sn=#{ledgerSn} and a.trans_flag_yb!=2 and a.charge_status!='1') t " +
+            "where t.idx>#{page}*#{size} and t.idx<=(#{page}+1)*#{size}")
+    List<HisHsptzdCharge> selectHisHsptzdCharge(String patNo, int times, int ledgerSn, int page, int size);
 
     @Select("select visitId=b.pat_no+'_'+cast(b.times as varchar)+'_'+cast(b.ledger_sn as varchar), " +
             "rtrim(a.inpatient_no) as babyId,rtrim(a.name) as babyName " +