package cn.iocoder.yudao.module.system.dal.mysql.biz;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.MaterialOutboundOrderItemDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
/**
 * 兼容旧命名的 Mapper：目前作为出库明细的简单查询封装。
 * 新代码建议直接使用 MaterialOutboundOrderItemMapper。
 */
public interface MaterialIoOrderItemMapper extends BaseMapperX<MaterialOutboundOrderItemDO> {

    default List<MaterialOutboundOrderItemDO> selectListByOrderIds(List<Long> orderIds) {
        return selectList(new LambdaQueryWrapperX<MaterialOutboundOrderItemDO>()
                .in(MaterialOutboundOrderItemDO::getOutboundOrderId, orderIds));
    }

    default List<MaterialOutboundOrderItemDO> selectListByOrderId(Long orderId) {
        return selectList(new LambdaQueryWrapperX<MaterialOutboundOrderItemDO>()
                .eq(MaterialOutboundOrderItemDO::getOutboundOrderId, orderId));
    }
}

