package com.prolog.cs.biz.outbound.dao;

import com.prolog.cs.biz.outbound.model.OmsDoBillHDO;
import com.prolog.cs.biz.outbound.model.dto.BillPackageDTO;
import com.prolog.cs.biz.outbound.model.dto.LclPrintDataDto;
import com.prolog.cs.biz.outbound.model.dto.check.LclDTO;
import com.prolog.cs.biz.outbound.model.dto.check.OuterLblPkgDTO;
import com.prolog.cs.biz.outbound.model.entity.BarcodeHDO;
import com.prolog.cs.biz.outbound.model.vo.LcLSecondVO;
import com.prolog.cs.biz.outbound.model.vo.check.BarCodeDVO;
import com.prolog.framework.dao.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

@Repository
public interface BarcodeHMapper extends BaseMapper<BarcodeHDO> {
    List<BarcodeHDO> getLclNo(
                              @Param("stationCode") String stationCode,
                              @Param("billGroupId") String billGroupId,
                              @Param("status") Character status,
                              @Param("checkerNo") String checkerNo);

    List<BarcodeHDO> getLclNoV2(
        @Param("stationCode") String stationCode,
        @Param("billGroupId") String billGroupId,
        @Param("status") Character status,
        @Param("checkerNo") String checkerNo
    );

    long updateCheckStatus(@Param("billGroupId") String billGroupId,
                           @Param("stationCode") String stationCode);

    List<LcLSecondVO> query(LclDTO lclDTO);
    List<LcLSecondVO> getByIds(@Param("ids") List<String> ids);
    long updateMergedLcl(@Param("ids") List<String> ids, @Param("mergedCode") String mergedCode);

    List<String> getOmsBillIds(@Param("srcCode") String srcCode,@Param("enterpriseId") String enterpriseId);

    List<String> getOmsBillNos(@Param("srcCode") String srcCode,@Param("enterpriseId") String enterpriseId);

    long updatePickTaskHStatus(
            @Param("barcode") String barcode,
            @Param("warehouseId") String warehouseId,
            @Param("enterpriseId") String enterpriseId
    );

    List<String> getBillIdByWave(@Param("waveId") String waveId,@Param("warehouseId") String warehouseId);

    List<BarcodeHDO> findbBarcodeInfo(@Param("stationCode") String stationCode,@Param("billGroupId") String billGroupId);

    long deleteBarcodeHNoExistD(@Param("billGroupId") String billGroupId, @Param("stationCode") String stationCode);

    List<OmsDoBillHDO> listOmsBill(
            @Param("billGroupIds")List<String> billGroupIds,
            @Param("enterpriseId")String enterpriseId,
            @Param("warehouseId")String warehouseId
    );

    List<BarcodeHDO> getLclByStation(
            @Param("stationCode") String stationCode,
            @Param("billId") String billId
    );

    List<BarcodeHDO> getUsingByPickTaskId(@Param("pickTaskId") String pickTaskId);

    List<BarcodeHDO> getUnPrintByPickTaskId(@Param("pickTaskId") String pickTaskId);

    void updateStatuts(@Param("status") String status, @Param("ids") List<String> ids);

    List<LclPrintDataDto> ListDataByLclNo(@Param("ids") List<String> ids, @Param("billNo")String billNo);

    Integer getUnConfirmContainerCnt(
            @Param("containerCode") String containerCode,
            @Param("stationCode") String stationCode,
            @Param("billGroupId") String billGroupId
    );


    Integer getEndBoxContainer( @Param("containerCode") String containerCode, @Param("stationCode") String stationCode, @Param("billGroupId") String billGroupId);

    String getMaxBarcode();

    List<OuterLblPkgDTO> getlblPkgDTOS(@Param("billGroupId") String billGroupId, @Param("bldgId") String bldgId, @Param("warehouseId") String warehouseId);

    List<Map<String, Object>> queryByBillGroupIds(@Param("billGroupIds") List<String> billGroupIds);

	List<BillPackageDTO> getPushPackageList();

    void updateCheckStatus2EndByBillNo(@Param("billNo") String billNo);

    List<BarCodeDVO> selectBybillNoACancelflag(@Param("billNo") String billno);

    List<BarcodeHDO> getByBillPickComplete(@Param("billno") String billno);

    void updaPushCount(String key);
}
