package com.op.mes.mapper;

import com.op.mes.domain.ProOrderWorkorder;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * 生产工单Mapper接口
 *
 * @author Open Platform
 * @date 2023-07-18
 */
public interface ProOrderWorkorderMapper {
    /**
     * 查询生产工单
     *
     * @param workorderId 生产工单主键
     * @return 生产工单
     */
    public ProOrderWorkorder selectProOrderWorkorderByWorkorderId(String workorderId);

    /**
     * 查询生产工单列表
     *
     * @param proOrderWorkorder 生产工单
     * @return 生产工单集合
     */
    public List<ProOrderWorkorder> selectProOrderWorkorderList(ProOrderWorkorder proOrderWorkorder);

    /**
     * 新增生产工单
     *
     * @param proOrderWorkorder 生产工单
     * @return 结果
     */
    public int insertProOrderWorkorder(ProOrderWorkorder proOrderWorkorder);

    /**
     * 修改生产工单
     *
     * @param proOrderWorkorder 生产工单
     * @return 结果
     */
    public int updateProOrderWorkorder(ProOrderWorkorder proOrderWorkorder);

    /**
     * 删除生产工单
     *
     * @param workorderId 生产工单主键
     * @return 结果
     */
    public int deleteProOrderWorkorderByWorkorderId(String workorderId);

    /**
     * 批量删除生产工单
     *
     * @param workorderIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteProOrderWorkorderByWorkorderIds(String[] workorderIds);

    /**
     * 通过订单id查询工单信息
     *
     * @param id
     * @return
     */
    List<ProOrderWorkorder> selectFirWorkOrder(String id);

    /**
     * 通过code查询子工单
     *
     * @param workorderCode
     * @return
     */
    List<ProOrderWorkorder> selectChildWorkOrder(String workorderCode);

    /**
     * 通过工单生产日期查询没有被分配的所有子工单
     *
     * @param productDate
     * @return
     */
    List<ProOrderWorkorder> selectWorkOrderByTime(Date productDate);
}