package cn.ezhizao.project.business.mapper;

import cn.ezhizao.project.business.domain.BizDaywork;
import cn.ezhizao.project.business.domain.BizDayworkItem;
import cn.ezhizao.project.business.domain.BizProductionResourceGroupDetail;
import cn.ezhizao.project.system.domain.SysDept;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 报工记录Mapper接口
 *
 * @author ezhizao
 * @date 2023-12-04
 */
public interface BizDayworkItemMapper extends BaseMapper<BizDayworkItem>
{
    /**
     * 查询报工记录列表
     *
     * @param bizDayworkItem 报工记录
     * @return 报工记录集合
     */
    public List<BizDayworkItem> getList(BizDayworkItem bizDayworkItem);
    public List<BizDayworkItem> getListForLotTechnological(BizDayworkItem bizDayworkItem);
    public List<BizDayworkItem> getOutsourcesItemList(BizDayworkItem bizDayworkItem);


    public List<SysDept> getDeptInfo(BizDayworkItem bizDayworkItem);


    List<BizDayworkItem> selectLatestItemByDayworkIds( List<Long> ids);
    List<BizDayworkItem> selectItemByOutsourcedDetailIds(List<Long> ids);


    public List<BizDayworkItem> getListByDayworkIds(@Param("dayworkIds") List<Long> ids);
    public List<BizDayworkItem> getListInfoByDayworkIds(@Param("dayworkIds") List<Long> ids);
    public List<BizDayworkItem> getListByDayworkItemIds(@Param("dayworkItemIds") List<Long> ids);
    public List<BizDayworkItem> getListByLotIds(@Param("lotIds") List<Long> ids);
    /**
     * 查询设备信息
     * @param bizProductionResourceGroupDetail
     * @return
     */
    public BizProductionResourceGroupDetail getEquipmentInfo(BizProductionResourceGroupDetail bizProductionResourceGroupDetail);

    /**
     * 物理删除
     * @param bizDayworkItem
     * @return 删除结果
    */
    public int physicalDelete(BizDayworkItem bizDayworkItem);
    /**
     * 更新报工记录
     * @param bizDayworkItem
     */
    public void updateDayworkItem(BizDayworkItem bizDayworkItem);

    List<BizDayworkItem> getItemScreen(Long dayWorkId);
    List<BizDayworkItem> selectDayworkItemList(BizDayworkItem item);

    List<BizDayworkItem> selectBydayworkId(List<Long> dayworkIds);


    int removeSpecial(List<Long> firstDayworkIds);


    int updateTechnologicalProcessDetailId(Long dayWorkId);

    List<BizDayworkItem> getListByDayworkIdsForOutsourced(List<Long> dayworkIds);

    Long getLatestDayworkItemId(BizDayworkItem bizDayworkItem);
    BizDayworkItem getLastItem(BizDayworkItem bizDayworkItem);
    List<BizDayworkItem> getListByDayworkIdAndProcessStepNumber(BizDayworkItem dayworkItem);

    List<BizDayworkItem> getLastFinished(BizDayworkItem dayworkItem);

    List<BizDayworkItem> getSpecialList(BizDayworkItem dayworkItem);

    List<BizDayworkItem> selectListOfspecial(List<BizDaywork> dayworks);
}
