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

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.voyagestockdetail.VoyageStockDetailLogDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 航次库存详情Log Mapper
 *
 * @author 管理员
 */
@Mapper
public interface VoyageStockDetailLogMapper extends BaseMapperX<VoyageStockDetailLogDO> {

    @TenantIgnore
    default List<VoyageStockDetailLogDO> selectListByOrder(Long orderId) {
        return selectList(new LambdaQueryWrapperX<VoyageStockDetailLogDO>()
                .eq(VoyageStockDetailLogDO::getOrderId, orderId));
    }

    @TenantIgnore
    default void deleteByOrder(Long orderId) {
        delete(new LambdaQueryWrapperX<VoyageStockDetailLogDO>()
                .eq(VoyageStockDetailLogDO::getOrderId, orderId));
    }
}