package com.yc.ship.module.product.dal.mysql.voyagestock;

import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.framework.tenant.core.aop.TenantIgnore;
import com.yc.ship.module.product.dal.dataobject.voyagestock.VoyageStockLogDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 航次库存Log Mapper
 *
 * @author 管理员
 */
@Mapper
public interface VoyageStockLogMapper extends BaseMapperX<VoyageStockLogDO> {

    @TenantIgnore
    default VoyageStockLogDO selectByOrder(Long orderId) {
        return selectOne( new LambdaQueryWrapperX<VoyageStockLogDO>().eq(VoyageStockLogDO::getOrderId, orderId)
                .last("limit 1"));

    }
}