前台页面上不管分页选第几页,返回的结果都是相同的
为了避免这些问题,您可以尝试以下方法:
sqlSELECT *
FROM (SELECT TMP.*, ROWNUM ROW_ID
FROM (SELECT m1.CODER,
m3.CODER_NAME,
m1.MR_HOME_NO,
m1.PATIENT_ID,
m1.VISIT_ID,
m1.VISIT_NO,
m1.FULL_NAME,
m1.SEX,
m1.NAGE,
m1.INHOSP_INDEX_NO,
m1.DEPT_CODE_OUT,
m1.DEPT_NAME_OUT,
m1.IN_CHARGE_DOCTOR_ID,
m1.DOCTOR_IN_CHARGE,
m1.DOCTOR_IN_DIAG,
m1.ADMISSION_DATE_TIME,
m1.DISCHARGE_DATE_TIME,
m1.CHARGE_TYPE_CODE,
m1.CHARGE_TYPE,
m1.OUT_MAIN_DIAGNOSIS,
m2.CATALOG_TIME,
m1.SUBMIT_DATE,
m2.REWORK_FLAG,
m2.HOSPITAL_CODE,
m2.RETURN_FLAG,
m2.recall_state,
m2.keep_state,
m1.PATHOLOGICAL_NO,
m2.return_catalog_flag,
m2.PATHOLOGICAL_FAILURE_FLAG,
m1.FORTH_DOCTOR,
m1.FORTH_DOCTOR_NAME,
m1.MEDICAL_PAY_WAY,
m1.DISCHARGE_DISPOSITION_NAME,
m1.DISCHARGE_WARD_NAME,
case
when m1.DISCHARGE_DATE_TIME is not null then
to_date(to_char(sysdate, 'yyyy-mm-dd'), 'yyyy-mm-dd') -
to_date(to_char(m1.DISCHARGE_DATE_TIME, 'yyyy-mm-dd'),
'yyyy-mm-dd') + 1 -
(select count(1)
from ARCHIVE_HOLIDAY k
where k.data_group = 'holiday'
and k.data_value is not null
and to_date(k.data_value, 'yyyy-MM-dd') >
to_date(to_char(m1.DISCHARGE_DATE_TIME,
'yyyy-mm-dd'),
'yyyy-mm-dd') + 1
and to_date(k.data_value, 'yyyy-MM-dd') <
to_date(to_char(sysdate, 'yyyy-mm-dd'),
'yyyy-mm-dd'))
else
0
end discharged_days
FROM HOME m1,
SUBMIT m2,
task_alloc m3
WHERE 1 = 1
AND m1.PATIENT_ID = m2.PATIENT_ID(+)
AND m1.VISIT_ID = m2.VISIT_ID(+)
AND m1.PATIENT_ID = m3.PATIENT_ID(+)
AND m1.VISIT_ID = m3.visit_no(+)
AND m1.DISCHARGE_DATE_TIME is not null
AND (m1.ARCHIVE_INDICATOR = '3' or
m1.ARCHIVE_INDICATOR = '1')
AND (m2.MR_STATUS in ('0', '4') or m2.mr_status is null)
order by m2.CATALOG_TIME desc) TMP
WHERE ROWNUM <= 80)
WHERE ROW_ID > 60
排查sql发现,在这个sql的条件状态下,catalogTime为空,导致分页异常
本文作者:Weee
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!