package com.qmth.sop.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qmth.sop.business.bean.result.TBDeviceDeliveryResult;
import com.qmth.sop.business.entity.TBDeviceDelivery;
import com.qmth.sop.common.enums.DeviceDeliveryStatusEnum;
import com.qmth.sop.common.enums.DeviceUsageTypeEnum;
import com.qmth.sop.common.enums.InOutTypeEnum;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 设备发货表 Mapper 接口
 * </p>
 *
 * @author wangliang
 * @since 2023-11-28
 */
public interface TBDeviceDeliveryMapper extends BaseMapper<TBDeviceDelivery> {

    /**
     * 设备发货分页查询
     *
     * @param iPage            iPage
     * @param serviceId        serviceId
     * @param usageType        usageType
     * @param crmNo            crmNo
     * @param status           status
     * @param deliverUserId    deliverUserId
     * @param deliverStartTime deliverStartTime
     * @param deliverEndTime   deliverEndTime
     * @param serialNo         serialNo
     * @param deviceNo         deviceNo
     * @param supplierId       supplierId
     * @param receiveStartTime receiveStartTime
     * @param receiveEndTime   receiveEndTime
     * @param consignee        consignee
     * @param mailingAddress   mailingAddress
     * @param deliveryType     deliveryType
     * @param brand            brand
     * @param model            model
     * @param expressNo        expressNo
     * @return 查询结果
     */
    IPage<TBDeviceDeliveryResult> page(IPage<TBDeviceDeliveryResult> iPage, @Param("serviceId") Long serviceId, @Param("usageType") DeviceUsageTypeEnum usageType,
            @Param("crmNo") String crmNo, @Param("status") DeviceDeliveryStatusEnum status, @Param("deliverUserId") Long deliverUserId,
            @Param("deliverStartTime") Long deliverStartTime, @Param("deliverEndTime") Long deliverEndTime, @Param("serialNo") String serialNo,
            @Param("deviceNo") String deviceNo, @Param("supplierId") Long supplierId, @Param("receiveStartTime") Long receiveStartTime,
            @Param("receiveEndTime") Long receiveEndTime, @Param("consignee") String consignee, @Param("mailingAddress") String mailingAddress,
            @Param("deliveryType") InOutTypeEnum deliveryType, @Param("brand") String brand, @Param("model") String model,
            @Param("expressNo") String expressNo);

    /**
     * 设备发货列表查询
     *
     * @param serviceId        serviceId
     * @param usageType        usageType
     * @param crmNo            crmNo
     * @param status           status
     * @param deliverUserId    deliverUserId
     * @param deliverStartTime deliverStartTime
     * @param deliverEndTime   deliverEndTime
     * @param serialNo         serialNo
     * @param deviceNo         deviceNo
     * @param supplierId       supplierId
     * @param consignee        consignee
     * @param mailingAddress   mailingAddress
     * @param deliveryType     deliveryType
     * @param brand            brand
     * @param model            model
     * @param expressNo        expressNo
     * @return 查询结果
     */
    List<TBDeviceDeliveryResult> list(@Param("serviceId") Long serviceId, @Param("usageType") DeviceUsageTypeEnum usageType,
            @Param("crmNo") String crmNo, @Param("status") DeviceDeliveryStatusEnum status, @Param("deliverUserId") Long deliverUserId,
            @Param("deliverStartTime") Long deliverStartTime, @Param("deliverEndTime") Long deliverEndTime, @Param("serialNo") String serialNo,
            @Param("deviceNo") String deviceNo, @Param("supplierId") Long supplierId, @Param("receiveStartTime") Long receiveStartTime,
            @Param("receiveEndTime") Long receiveEndTime, @Param("consignee") String consignee, @Param("mailingAddress") String mailingAddress,
            @Param("deliveryType") InOutTypeEnum deliveryType, @Param("brand") String brand, @Param("model") String model,
            @Param("expressNo") String expressNo);
}
