package com.ltgk.port.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.common.core.domain.BaseEntity;
import com.ltgk.port.domain.dto.GetOutEnterPortListReq;
import com.ltgk.port.domain.dto.GetOutEnterPortSortReq;
import com.ltgk.port.domain.entity.DsPort;
import com.ltgk.port.domain.vo.BoatEnterOutVo;
import com.ltgk.port.domain.vo.EnterOutVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 渔港信息Mapper接口
 *
 * @author Qi ChengBin
 * @date 2024-12-09
 */
@Mapper
public interface DsPortMapper extends BaseMapper<DsPort> {
    /**
     * 获取渔船数量
     *
     * @param portId
     * @return
     */
    Long getBoatCount(String portId);

    /**
     * 获取进出港渔船数量
     *
     * @param enterOrOut
     * @return
     */
    Long getEnterOrOutPortCount(@Param("enterOrOut") Integer enterOrOut, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("portId") String portId);

    List<EnterOutVo> getEnterOutPortGroupBYPortId(GetOutEnterPortSortReq getOutEnterPortSortReq);

    Long getBerthCount(@Param("portId") Long portId);

    List<BoatEnterOutVo> getEnterOrOutPortList(@Param("req") GetOutEnterPortListReq getOutEnterPortListReq, @Param("enterOrOut") Integer enterOrOut, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<DsPort> getBusinessIndexPortStatistics(BaseEntity baseEntity);
}
