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.dispatch.LabelBindDTO;
import com.casic.missiles.dto.business.labExecutive.SampleHandOutDetailResponse;
import com.casic.missiles.dto.business.labExecutive.SampleHandOutListRequest;
import com.casic.missiles.dto.business.labExecutive.SampleHandOutListResponse;
import com.casic.missiles.dto.business.dispatch.DeviceDispatchDTO;
import com.casic.missiles.dto.business.dispatch.DeviceDispatchVO;
import com.casic.missiles.dto.business.outsource.OrderSampleDTO;
import com.casic.missiles.dto.business.workbench.SampleMonitorResponse;
import com.casic.missiles.dto.cockpit.TrafficStatisticsResponse;
import com.casic.missiles.dto.cockpit.BusTrendResponse;
import com.casic.missiles.dto.cockpit.WorkRatioResponse;
import com.casic.missiles.dto.customer.sample.CustomerSampleListVO;
import com.casic.missiles.dto.finance.SamplePriceDTO;
import com.casic.missiles.dto.finance.SettlementSampleDTO;
import com.casic.missiles.model.business.BusinessOrderSampleRelation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 委托书-样品库关联表 Mapper 接口
 * </p>
 *
 * @author wangpeng
 * @since 2023-02-02
 */
public interface BusinessOrderSampleRelationMapper extends BaseMapper<BusinessOrderSampleRelation> {

    Page<SampleHandOutListResponse> selectSampleListByStatus(Page<SampleHandOutListResponse> page, @Param("request") SampleHandOutListRequest request);

    Page<DeviceDispatchVO> getSampleListByStatus(@Param("page") Page<DeviceDispatchVO> page, @Param("request") DeviceDispatchDTO request);

    Long  isBindLabel(@Param("label") String  label);

    Integer  bindLabel(@Param("request") LabelBindDTO labelBindDTO);

    SampleHandOutDetailResponse selectSampleDetail(@Param("orderId") Long orderId, @Param("sampleId") Long sampleId);

    int updateByOrderIdAndSampleId(@Param("orderId") Long orderId, @Param("sampleId") Long sampleId, @Param("status") String status);

    CustomerSampleListVO getInterChangeSampleList(@Param("orderId") Long orderId, @Param("sampleId") Long sampleId);

    int updateTypeBatchByOrderAndSample(@Param("orderSampleDTOS") List<OrderSampleDTO> orderSampleDTOS);

    int updateStatusBatchByOrderAndSample(@Param("orderSampleDTOS") List<OrderSampleDTO> orderSampleDTOS);

    int updatePriceBatchById(@Param("samplePriceList") List<SamplePriceDTO> samplePriceList);

    List<SettlementSampleDTO> selectSampleListForSettlement(@Param("orderId") Long orderId);

    OrderSampleDTO selectIdBySampleNo(@Param("sampleNo") String sampleNo);

    Page<SampleMonitorResponse> selectSampleMonitorListByStatus(Page<SampleMonitorResponse> page, @Param("status") String status);

    Page<DeviceDispatchVO> getSampleListByStatusMonth(Page<DeviceDispatchVO> page, @Param("request") DeviceDispatchDTO request);

    Page<SampleHandOutListResponse> selectSampleListByStatusMonth(Page<SampleHandOutListResponse> handOutPage, @Param("request") SampleHandOutListRequest request);

    Integer selectCountThisMonthForMeasureWork();

    Integer selectCountLastMonthForMeasureWork();

    List<TrafficStatisticsResponse> selectCountForTrafficStatisticsByMonths(@Param("months") Integer months);

    Integer selectCountForCockpit(@Param("type") int type, @Param("dimension") String dimension);

    List<BusTrendResponse> selectPreMonthCountByYear();

    WorkRatioResponse selectCountByMonth(@Param("date") String date);
}
