package cn.com.taiji.beidou.ship.focus.mapper;

import cn.com.taiji.beidou.ship.focus.domain.FocusShipData;
import cn.com.taiji.beidou.ship.focus.domain.FocusShipReq;
import cn.com.taiji.beidou.ship.focus.domain.FocusShipResult;
import cn.com.taiji.beidou.ship.focus.domain.SimpleFocusShipResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author CHEN
 * @Date 2022/11/9 18:03
 */
@Mapper
public interface FocusShipMapper {

    int insertFocusShip(FocusShipData focusShipData);

    /**
     * 移除关注船舶
     * @param focusId
     * @return
     */
    int deleteFocusShip(Long focusId);

    /**
     * 获取详情
     * @param focusId
     * @param devideNo
     * @return
     */
    FocusShipResult selectById(@Param("devideNo") Long devideNo,@Param("focusId") Long focusId);

    /**
     * 列表
     * @param focusShipReq
     * @return
     */
    List<FocusShipResult> selectList(FocusShipReq focusShipReq);

    /**
     * 查看是否已关注
     * @param devideNo
     * @param userId
     * @return
     */
    int selectByDevideNoUserId(@Param("devideNo") String devideNo,@Param("userId")String userId);

    /**
     * 根据关注人员获取关注船舶id 和 关注类型
     * @param userId
     * @return
     */
    List<SimpleFocusShipResult> getShipByUserId(@Param("userId") String userId);

    /**
     * 获取北斗ID
     * @param focusId
     * @return
     */
    Long getDeviceByFocusId(Long focusId);
}
