package com.cf.imes.module.executor.dal.mysql.planItem;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
import com.cf.imes.module.executor.controller.admin.order.vo.order.LabelOrderPlateData;
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
import com.cf.imes.module.executor.dal.dataobject.planitem.PlanItemDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 生产单开料排单明细 Mapper
 *
 * @author 晨丰科技
 */
@Mapper
public interface PlanItemMapper extends BaseMapperX<PlanItemDO> {



    IPage<OrderRespVOCopy> selectOrderList(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<OrderDO> wrapper,@Param("type")int type);

    List<PlateDetailRespVO> selectPlanPlateDetailList(@Param("planId") Long planId, @Param("organId")  Long organId);


    List<PlateInfoVO> selectOrderPlanPlateList(@Param("planIds") List<Long> planIds, @Param("organId")  Long organId);

    List<PlateResList> selectPlateListByPlateIds(@Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper,@Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize);

    List<PlateResList> selectPlateListByPlanId(@Param("planId") Long planId, @Param("organId")  Long organId);

    Long selectPlateCountByPlateIds(@Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper);


    IPage<OrderGoodsResp> selectNoPlanGoodsByRoomAndBodyIds(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper,@Param("organId") Long organId);

    IPage<OrderGoodsResp> selectNoPlanGoodsList(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper,@Param("organId") Long organId);

    List<OrderGoodsResp> selectNoOrderGoodsIdList(@Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper, @Param("organId") Long organId, @Param("type") int type);

    Long selectIsCuttingPlate(@Param("planId") Long planId,@Param("organId") Long organId);

    List<LabelOrderPlateData> selectLabelOrderPlateDataByPlanId(@Param("planId") Long planId, @Param("organId") Long organId);


    List<SavePlanPlateList.GoodsItemList> selectPlanGoodsList(@Param("planId") Long planId, @Param("organId") Long organId);

}