package com.ltgk.crew.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltgk.crew.domain.dto.AddDsCrewCheckAndBindBoatReq;
import com.ltgk.crew.domain.entity.DsCrewEnterCheck;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.Map;

/**
 * 进港船员报备信息Mapper接口
 *
 * @author Qi ChengBin
 * @date 2024-12-07
 */
@Mapper
public interface DsCrewEnterCheckMapper extends BaseMapper<DsCrewEnterCheck> {

    /**
     * 根据船员id 获取船员绑定数据
     *
     * @param crewId: 船员id
     * @return com.ltgk.crew.domain.dto.AddDsCrewCheckAndBindBoatReq
     * @author Qi ChengBin
     * @date 2025/1/6 10:59
     */
    AddDsCrewCheckAndBindBoatReq getDsBoatBindCrewByCrewId(@Param("crewId") String crewId);

    /**
     * 保存渔船绑定船员数据
     *
     * @param dsBoatBindCrew: 在渔船进出港审核时新增船员时进行渔船跟船员绑定的数据传输参数
     * @return boolean
     * @author Qi ChengBin
     * @date 2025/1/6 11:00
     */
    boolean saveBoatBindCrew(@Param("dsBoatBindCrew") AddDsCrewCheckAndBindBoatReq dsBoatBindCrew);

    Long selectCount(@Param("date") Date date);

    /**
     * 根据渔船进港主键，修改渔船船员id信息
     *
     * @param dsEnterPortMap:
     * @return boolean
     * @author Qi ChengBin
     * @date 2025/4/16
     */
    boolean updateDsEnterPort(@Param("dsEnterPortMap") Map<String, Object> dsEnterPortMap);
}
