|
|
@@ -3554,7 +3554,12 @@ public class HkLeaveAuthServ extends Serv {
|
|
|
+ " item.CONFIG_TASK_ID configTaskId,item.PLATFORM_CONFIG_CONFIRMED platformConfigConfirmed,item.CONFIG_SEARCH_MATCHED configSearchMatched,"
|
|
|
+ " item.RETRY_COUNT retryCount,item.NEXT_RETRY_TIME nextRetryTime,item.FIRST_ACCEPT_TIME firstAcceptTime,item.PLATFORM_CONFIRM_TIME platformConfirmTime,"
|
|
|
+ " item.LAST_ERROR lastError,item.TOTAL_COST_MS totalCostMs,item.DELETE_TIME deleteTime,item.DELETE_CONFIRMED deleteConfirmed,"
|
|
|
- + " item.DELETE_TASK_ID deleteTaskId,item.DELETE_SKIP_REASON deleteSkipReason,item.DELETE_CONFIRM_SOURCE deleteConfirmSource,item.UPDATED_AT updatedAt"
|
|
|
+ + " item.DELETE_TASK_ID deleteTaskId,item.DELETE_SKIP_REASON deleteSkipReason,item.DELETE_CONFIRM_SOURCE deleteConfirmSource,item.UPDATED_AT updatedAt,"
|
|
|
+ + " case"
|
|
|
+ + " when nvl(item.SYNC_STAGE,'pending')='pending' then 0"
|
|
|
+ + " when item.NEXT_RETRY_TIME is null then 1"
|
|
|
+ + " when item.NEXT_RETRY_TIME<=:nowTs then 2"
|
|
|
+ + " else 9 end pendingPriority"
|
|
|
+ " from RCHKLA_ITEM item"
|
|
|
+ " join RC rc on rc.RCID=item.RCID"
|
|
|
+ " where item.AUTH_END>:nowTs and item.AUTH_BEG<=:windowEndTs"
|
|
|
@@ -3562,7 +3567,8 @@ public class HkLeaveAuthServ extends Serv {
|
|
|
+ " and nvl(item.DELETE_CONFIRMED,0)=0"
|
|
|
+ " and (nvl(item.PLATFORM_CONFIG_CONFIRMED,0)=0 or nvl(item.CONFIG_SEARCH_MATCHED,0)=0)"
|
|
|
+ " and nvl(item.SYNC_STAGE,'pending') in ('pending','accepted','retrying')"
|
|
|
- + " order by item.AUTH_BEG asc,item.ITEM_ID asc"
|
|
|
+ + " and (nvl(item.SYNC_STAGE,'pending')='pending' or item.NEXT_RETRY_TIME is null or item.NEXT_RETRY_TIME<=:nowTs)"
|
|
|
+ + " order by pendingPriority asc,item.AUTH_BEG asc,item.ITEM_ID asc"
|
|
|
+ " ) where rownum<=:limit";
|
|
|
SqlCmd sqlCmd = new SqlCmd(sql);
|
|
|
sqlCmd.wrTimeParm("nowTs", now);
|