package com.cf.imes.module.manage.dal.mysql.process;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.module.manage.controller.admin.process.vo.ProcessPageReqVO;
import com.cf.imes.module.manage.controller.admin.process.vo.ProcessRespVO;
import com.cf.imes.module.manage.controller.admin.query.vo.productionStatus.ProductionGroupVO;
import com.cf.imes.module.manage.controller.admin.query.vo.salary.PriceRatePageReqVO;
import com.cf.imes.module.manage.controller.admin.query.vo.salary.PriceRateReqVO;
import com.cf.imes.module.manage.dal.dataobject.process.OrderProcessStepNDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 生产单工序步骤表 order_process_step_{N} Mapper
 *
 * @author 晨丰科技
 */
@Mapper
public interface ProcessStepMapper extends BaseMapperX<OrderProcessStepNDO> {



    IPage<ProcessRespVO> selectOrder( @Param("page") IPage page, @Param("pageReqVO") ProcessPageReqVO pageReqVO,@Param("organId")  Long organId );



    void updateStatusById(@Param("id") Long id, @Param("salary")BigDecimal salary);

//    default List<OrderProcessStepNDO> selectProducitonList(Long orderNo) {
//        return selectList(new LambdaQueryWrapperX<OrderProcessStepNDO>()
//                .eqIfPresent(OrderProcessStepNDO::getOrderId, orderNo));
//
//    }


    List<ProductionGroupVO> selectProducitonList(@Param("orderNo") Long orderNo,@Param("organId") Long organId);



    IPage<PriceRateReqVO> selectSalaryList( @Param("page") IPage page, @Param("pageReqVO") PriceRatePageReqVO pageReqVO,@Param("organId")  Long organId);


    BigDecimal calculateSalary( @Param("processStepId") Long processStepId,@Param("area") BigDecimal area);
}