package org.wcs.mapper.intf;

import com.baomidou.mybatisplus.extension.service.IService;
import org.wcs.model.bo.tuple.Tuple2;
import org.wcs.model.dto.serve.stockSingleTask.QueryStockSingleTaskReq;
import org.wcs.model.po.app.AppStockSingleTask;

import java.util.List;

public interface AppStockSingleTaskService extends IService<AppStockSingleTask> {

    AppStockSingleTask queryByTaskId(String taskId);
    List<AppStockSingleTask> queryByPlcTaskId(Integer plcTaskId);
    List<AppStockSingleTask> queryByUpperTaskId(String upperTaskId); // 查询指定任务ID的上级任务
    Tuple2<Long, List<AppStockSingleTask>> query(QueryStockSingleTaskReq queryTaskReq, Integer pageSize, Integer pageIndex);
    boolean insert(AppStockSingleTask record); // 插入一条记录
    boolean update(AppStockSingleTask record); // 更新一条记录，为 null 的不更新
    boolean updateWithUpperTaskIdAndStatusThrowEx(String upperTaskId, List<Integer> taskStatus, Integer newStatus, String msg);
    boolean updateWithPlcTaskId(Integer plcTaskId, AppStockSingleTask record); // 更新一条记录，为 null 的不更新
    boolean updateThrowException(AppStockSingleTask record);
    boolean deleteByTaskIdThrowEx(String taskId);
    List<AppStockSingleTask> queryTask(Integer taskStatus); // 查询指定状态的任务
    List<AppStockSingleTask> queryTask(List<Integer> taskTypes, Integer taskStatus); // 查询指定任务类型和状态的任务
    List<AppStockSingleTask> queryTaskRecentDays(int days, Integer taskStatus);
    List<AppStockSingleTask> queryStackerTask(Integer stackerId, String vehicleNo, Integer taskStatus, Integer taskType); // 查询指定堆垛机的任务
    List<AppStockSingleTask> queryStackerTask(Integer stackerId, Integer taskStatus, Integer taskType); // 查询指定堆垛机入库任务

}
