fix(transfer): reserve receipt resources with durable recovery intents
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
package com.baiyue.lastleg.transfer.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baiyue.lastleg.transfer.entity.WarehouseTransferReceiptCommand;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@Mapper
|
||||
public interface WarehouseTransferReceiptCommandMapper extends BaseMapper<WarehouseTransferReceiptCommand> {
|
||||
@Select("SELECT * FROM ll_warehouse_transfer_receipt_command WHERE customer_id=#{customerId} " +
|
||||
"AND transfer_order_id=#{transferId} AND source_inventory_position_id=#{sourceId} LIMIT 1 FOR UPDATE")
|
||||
WarehouseTransferReceiptCommand lockSource(@Param("customerId") String customerId,
|
||||
@Param("transferId") Long transferId, @Param("sourceId") Long sourceId);
|
||||
|
||||
@Select("SELECT * FROM ll_warehouse_transfer_receipt_command WHERE customer_id=#{customerId} " +
|
||||
"AND idempotency_key=#{key} LIMIT 1")
|
||||
WarehouseTransferReceiptCommand findKey(@Param("customerId") String customerId, @Param("key") String key);
|
||||
|
||||
@Select("SELECT * FROM ll_warehouse_transfer_receipt_command WHERE customer_id=#{customerId} " +
|
||||
"AND transfer_order_id=#{transferId} AND target_pallet_id=#{palletId} ORDER BY id LIMIT 1")
|
||||
WarehouseTransferReceiptCommand findTarget(@Param("customerId") String customerId,
|
||||
@Param("transferId") Long transferId, @Param("palletId") Long palletId);
|
||||
}
|
||||
Reference in New Issue
Block a user