package com.wms_main.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wms_main.dao.ITAppOrderOutService;
import com.wms_main.mapper.AppOrderOutMapper;
import com.wms_main.model.po.TAppOrderOut;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TAppOrderOutServiceImpl extends ServiceImpl<AppOrderOutMapper, TAppOrderOut> implements ITAppOrderOutService {


    @Override
    public List<TAppOrderOut> getWithTaskId(String taskId)
    {
        try{
            LambdaQueryWrapper<TAppOrderOut> queryWrapper = new LambdaQueryWrapper<>();
            queryWrapper.eq(TAppOrderOut::getOrderId, taskId);
            return list(queryWrapper);
        } catch (Exception e) {
            return null;
        }
    }

    @Override
    public List<TAppOrderOut> getWithStatus(Integer status) {
        try {
            LambdaQueryWrapper<TAppOrderOut> queryWrapper = new LambdaQueryWrapper<>();
            queryWrapper.eq(TAppOrderOut::getOrderStatus, status);
            queryWrapper.orderByAsc(TAppOrderOut::getCreateTime);
            return list(queryWrapper);
        } catch (Exception e) {
            return null;
        }
    }

}
