package com.sckw.contract.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sckw.contract.api.model.vo.ContractVo;
import com.sckw.contract.model.dto.req.QueryListReqDto;
import com.sckw.contract.model.dto.res.QueryListResDto;
import com.sckw.contract.model.entity.KwcContractLogistics;
import com.sckw.contract.model.vo.req.QueryListReqVo;
import com.sckw.contract.model.vo.res.ContractGoodsVo;
import com.sckw.contract.model.vo.res.LogisticsEntDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author PC
 * @description 针对表【kwc_contract_logistics(物流合同（承运合同/托运合同）)】的数据库操作Mapper
 * @createDate 2023-07-13 13:36:19
 * @Entity com.sckw.contract.model.entity.KwcContractLogistics
 */
@Mapper
public interface KwcContractLogisticsMapper extends BaseMapper<KwcContractLogistics> {

    /**
     * @return QueryListResDto
     * @desc: 查询
     * @param: reqVo
     * @author: czh
     * @date 2023/7/17
     */
    List<QueryListResDto> queryList(QueryListReqDto reqVo);

    /**
     * @param reqVo 查询
     * @return QueryListResDto
     * @desc: 运营端查物流合同
     * @author: czh
     * @date: 2023/9/13
     */
    List<QueryListResDto> queryLogisticsList(@Param("reqVo") QueryListReqVo reqVo, @Param("authEntIdList") List<Long> authEntIdList);

    /**
     * 判断合同是否唯一
     *
     * @param contractCode 合同编号
     * @param carrierEntId 承运企业id
     * @param checkedEntId 托运企业id
     * @return
     */
    List<String> checkContractIsSole(@Param("contractCode") String contractCode, @Param("carrierEntId") Long carrierEntId, @Param("checkedEntId") Long checkedEntId);

    List<KwcContractLogistics> selectIsSole(@Param("contractNo") String contractNo, @Param("acceptId") Long acceptId, @Param("consignId") Long consignId);

    Long count(@Param("ids") List<Long> ids, @Param("entId") Long entId);

    List<ContractVo> logisticsList(@Param("ids") List<Long> ids, @Param("all") Boolean all, @Param("entId") Long entId);

    Long selectSignCount(@Param("entId") Long entId, @Param("type") Integer type);

    /**
     * 查询原矿合同
     * @return
     */
    List<LogisticsEntDto> queryContract(@Param("entId") Long entId, @Param("keyword") String keyword);

    List<ContractGoodsVo> selectGoods(@Param("contractId")Long contractId,@Param("keyword") String keyword);
}




