package org.ta.pddserver.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.ta.pddserver.entity.LogOrderEntity;
import org.ta.pddserver.mapper.LogOrderMapper;
import org.ta.pddserver.model.api.request.LogOrderListRequest;
import org.ta.pddserver.model.api.response.LogOrderListResponse;
import org.ta.pddserver.service.LogOrderService;

import java.util.List;

@Service
public class LogOrderImpl extends ServiceImpl<LogOrderMapper, LogOrderEntity> implements LogOrderService {

    public Boolean savePackageQuantity(String logisticsOrderCode, Long packageQuantity) {

       Boolean result =  baseMapper.savePackageQuantity(logisticsOrderCode, packageQuantity);

       return result;
    }

    public LogOrderEntity getByOrderCode(String orderCode) {
        return baseMapper.selectByOrderCode(orderCode);
    }

    public int updateOrderStatus(int status, String uid) {
        return baseMapper.updateOrderStatusById(status, uid);
    }


    public List<LogOrderListResponse> getListByRequest(String logisticsOrderCode) {
        List<LogOrderListResponse> list = baseMapper.getListByRequest(logisticsOrderCode);
        return list;
    }
}