diff --git a/src/modules/crontask/processor/backup_export_cdr/backup_export_cdr.go b/src/modules/crontask/processor/backup_export_cdr/backup_export_cdr.go index 1c038703..98d2ca06 100644 --- a/src/modules/crontask/processor/backup_export_cdr/backup_export_cdr.go +++ b/src/modules/crontask/processor/backup_export_cdr/backup_export_cdr.go @@ -111,6 +111,7 @@ func (s BackupExportCDRProcessor) exportIMS(hour int, rmUID, fileType string) st StartTime: start.UnixMilli(), EndTime: end.UnixMilli(), PageNum: 1, + PageSize: 1000_0000, } rows, total := s.imsCDREventService.SelectPage(query) if total == 0 { @@ -403,6 +404,7 @@ func (s BackupExportCDRProcessor) exportSMSC(hour int, rmUID, fileType string) s StartTime: start.UnixMilli(), EndTime: end.UnixMilli(), PageNum: 1, + PageSize: 1000_0000, } rows, total := s.smscCDREventService.SelectPage(query) if total == 0 { @@ -622,6 +624,7 @@ func (s BackupExportCDRProcessor) exportSMF(hour int, rmUID, fileType string) st StartTime: start.UnixMilli(), EndTime: end.UnixMilli(), PageNum: 1, + PageSize: 1000_0000, } rows, total := s.smfCDREventService.SelectPage(query) if total == 0 { @@ -1033,6 +1036,7 @@ func (s BackupExportCDRProcessor) exportSGWC(hour int, rmUID, fileType string) s StartTime: start.UnixMilli(), EndTime: end.UnixMilli(), PageNum: 1, + PageSize: 1000_0000, } rows, total := s.sgwcCDREventService.SelectPage(query) if total == 0 { diff --git a/src/modules/network_data/repository/cdr_event_ims.go b/src/modules/network_data/repository/cdr_event_ims.go index a068b5a8..f7d92716 100644 --- a/src/modules/network_data/repository/cdr_event_ims.go +++ b/src/modules/network_data/repository/cdr_event_ims.go @@ -254,11 +254,11 @@ func (r CDREventIMS) SelectByPage(querys model.CDREventIMSQuery) ([]model.CDREve tx = tx.Order(sortField) } - if querys.PageSize == 0 { - querys.PageSize = total - } // 查询数据分页 pageNum, pageSize := datasource.PageNumSize(querys.PageNum, querys.PageSize) + if pageNum == 0 && pageSize > int(total) { + pageSize = int(total) + } tx = tx.Limit(pageSize).Offset(pageSize * pageNum) err := tx.Find(&rows).Error if err != nil { diff --git a/src/modules/network_data/repository/cdr_event_sgwc.go b/src/modules/network_data/repository/cdr_event_sgwc.go index 388b7e72..49e7f7eb 100644 --- a/src/modules/network_data/repository/cdr_event_sgwc.go +++ b/src/modules/network_data/repository/cdr_event_sgwc.go @@ -63,11 +63,11 @@ func (r CDREventSGWC) SelectByPage(querys model.CDREventSGWCQuery) ([]model.CDRE tx = tx.Order(sortField) } - if querys.PageSize == 0 { - querys.PageSize = total - } // 查询数据分页 pageNum, pageSize := datasource.PageNumSize(querys.PageNum, querys.PageSize) + if pageNum == 0 && pageSize > int(total) { + pageSize = int(total) + } tx = tx.Limit(pageSize).Offset(pageSize * pageNum) err := tx.Find(&rows).Error if err != nil { diff --git a/src/modules/network_data/repository/cdr_event_smf.go b/src/modules/network_data/repository/cdr_event_smf.go index 0c133af7..56db1f26 100644 --- a/src/modules/network_data/repository/cdr_event_smf.go +++ b/src/modules/network_data/repository/cdr_event_smf.go @@ -235,11 +235,11 @@ func (r CDREventSMF) SelectByPage(querys model.CDREventSMFQuery) ([]model.CDREve tx = tx.Order(sortField) } - if querys.PageSize == 0 { - querys.PageSize = total - } // 查询数据分页 pageNum, pageSize := datasource.PageNumSize(querys.PageNum, querys.PageSize) + if pageNum == 0 && pageSize > int(total) { + pageSize = int(total) + } tx = tx.Limit(pageSize).Offset(pageSize * pageNum) err := tx.Find(&rows).Error if err != nil { diff --git a/src/modules/network_data/repository/cdr_event_smsc.go b/src/modules/network_data/repository/cdr_event_smsc.go index 568cfddb..30bc27af 100644 --- a/src/modules/network_data/repository/cdr_event_smsc.go +++ b/src/modules/network_data/repository/cdr_event_smsc.go @@ -255,11 +255,11 @@ func (r CDREventSMSC) SelectByPage(querys model.CDREventSMSCQuery) ([]model.CDRE tx = tx.Order(sortField) } - if querys.PageSize == 0 { - querys.PageSize = total - } // 查询数据分页 pageNum, pageSize := datasource.PageNumSize(querys.PageNum, querys.PageSize) + if pageNum == 0 && pageSize > int(total) { + pageSize = int(total) + } tx = tx.Limit(pageSize).Offset(pageSize * pageNum) err := tx.Find(&rows).Error if err != nil {