|
|
@@ -41,9 +41,6 @@ public interface OrderDonTicketRecordMapper extends BaseMapper<OrderDonTicketRec
|
|
|
@Update("update order_don_ticket_record set status = 'failed', worker_token = null, processing_time = null, error_msg = #{errorMsg}, update_time = now() where id = #{id} and status = 'processing' and worker_token = #{workerToken}")
|
|
|
int markFailed(@Param("id") Long id, @Param("workerToken") String workerToken, @Param("errorMsg") String errorMsg);
|
|
|
|
|
|
- @Update("update order_don_ticket_record set status = 'failed', worker_token = null, processing_time = null, error_msg = 'delivery lease expired', update_time = now() where status = 'processing' and processing_time < date_sub(now(), interval #{minutes} minute)")
|
|
|
- int recoverExpired(@Param("minutes") int minutes);
|
|
|
-
|
|
|
@Select("select * from order_don_ticket_record where order_id = #{orderId} order by item_index for update")
|
|
|
List<OrderDonTicketRecord> lockByOrderId(@Param("orderId") Long orderId);
|
|
|
|
|
|
@@ -74,13 +71,6 @@ public interface OrderDonTicketRecordMapper extends BaseMapper<OrderDonTicketRec
|
|
|
@Param("newWorkerToken") String newWorkerToken,
|
|
|
@Param("minutes") int minutes);
|
|
|
|
|
|
- @Select("select distinct r.order_id from order_don_ticket_record r inner join order_don o on o.id = r.order_id " +
|
|
|
- "where o.status in ('hasPayment', 'complete') and r.status in ('pending', 'failed') and not exists " +
|
|
|
- "(select 1 from order_don_business_event e where e.order_id = r.order_id and e.event_type = 'refund' and e.status in ('processing', 'success')) " +
|
|
|
- "and r.retry_num < #{maxRetries} order by r.order_id limit #{limit}")
|
|
|
- List<Long> selectPendingOrderIds(@Param("limit") int limit,
|
|
|
- @Param("maxRetries") int maxRetries);
|
|
|
-
|
|
|
@Select("select count(*) from order_don_ticket_record where order_id = #{orderId} and status = 'success'")
|
|
|
int countSuccess(@Param("orderId") Long orderId);
|
|
|
|