package com.casic.missiles.mapper.business;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.casic.missiles.dto.business.labExecutive.*;
import com.casic.missiles.dto.business.workbench.SampleMeasureChartResponse;
import com.casic.missiles.dto.business.workbench.SampleMeasureResponse;
import com.casic.missiles.model.business.BusinessLabExecutiveInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 业务管理-实验室检定信息记录表（用于流程中的实验室分配及后续检定过程查询） Mapper 接口
 * </p>
 *
 * @author wangpeng
 * @since 2023-02-02
 */
public interface BusinessLabExecutiveInfoMapper extends BaseMapper<BusinessLabExecutiveInfo> {

    List<HandOutLabExecutiveDTO> selectListByInMeasureStatus(@Param("orderId") Long orderId, @Param("sampleId") Long sampleId);

    Integer getMeasureNumberStatus(@Param("orderId") Long orderId, @Param("sampleId") Long sampleId);

    List<MeasureProcessDTO> selectExecutiveList(@Param("orderId") Long orderId, @Param("sampleId") Long sampleId);

    Page<SampleLabExecutiveListResponse> selectListByDeptIdAndStatus(Page<SampleLabExecutiveListResponse> page, @Param("request") SampleLabExecutiveListRequest request, @Param("deptId") Long deptId, @Param("status") String status, @Param("statusList") List<String> statusList);

    Page<SampleLabExecutiveListResponse> selectListByUserIdAndStatus(Page<SampleLabExecutiveListResponse> page, @Param("request") SampleLabExecutiveListRequest request, @Param("userId") Long userId, @Param("status") String status);

    int updateForSampleInMeasureOperate(@Param("list") List<SampleOperateRequest> list, @Param("userId") Long userId, @Param("status") String status);

    int updateForSampleMeasureCompleteOperate(@Param("list") List<SampleOperateRequest> list, @Param("userId") Long userId, @Param("status") String status);

    List<SampleOperateRequest> selectListForSampleOperate(@Param("list") List<SampleOperateRequest> requestList, @Param("userId") Long userId, @Param("status") String status);

    int updateForSendBack(@Param("orderId") Long orderId, @Param("sampleId") Long sampleId);

    Long selectMinSeq(@Param("orderId") Long orderId, @Param("sampleId") Long sampleId);

    Page<SampleMeasureResponse> selectListByDeptId(Page<SampleMeasureResponse> page, @Param("deptId") Long deptId);

    Page<SampleMeasureResponse>  selectListByUserId(Page<SampleMeasureResponse> page, @Param("userId") Long userId);

    Page<SampleMeasureResponse> selectAllList(Page<SampleMeasureResponse> page);

    List<SampleMeasureChartResponse> selectListGroupByStatus();
}
