package com.ruoyi.jarvis.mapper;

import com.ruoyi.jarvis.domain.WeComInboundTrace;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface WeComInboundTraceMapper {

    int insertWeComInboundTrace(WeComInboundTrace trace);

    WeComInboundTrace selectWeComInboundTraceById(Long id);

    List<WeComInboundTrace> selectWeComInboundTraceList(WeComInboundTrace query);

    int deleteWeComInboundTraceByIds(Long[] ids);

    int deleteAllWeComInboundTrace();

    /**
     * reply 中含「已加入查询队列」的消息（企微分享链备注提交成功后的被动回复）
     */
    List<WeComInboundTrace> selectTracesShareLinkRemarkDone(@Param("replyMark") String replyMark);

    /**
     * 同一用户、更早的一条含 3.cn 的消息（用于与备注消息配对出短链）
     */
    WeComInboundTrace selectLatestPriorTraceWith3cnLink(@Param("fromUserName") String fromUserName,
                                                        @Param("beforeId") long beforeId);
}
