package org.jeecg.modules.stock.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.stock.entity.StockLog;
import org.jeecg.modules.stock.mapper.StockLogMapper;
import org.jeecg.modules.stock.service.IStockLogService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

import static kotlin.reflect.jvm.internal.impl.builtins.StandardNames.FqNames.list;

/**
 * @Description: 出入库记录
 * @Author: jeecg-boot
 * @Date:   2025-07-13
 * @Version: V1.0
 */
@Service
public class StockLogServiceImpl extends ServiceImpl<StockLogMapper, StockLog> implements IStockLogService {

    @Override
    public List<StockLog> getByItem(String itemId) {
        List<StockLog> list = baseMapper.selectList(new LambdaQueryWrapper<StockLog>()
                .eq(StockLog::getItem, itemId).orderByDesc(StockLog::getCreateTime));
        return list;
    }
}
