package com.tourism.webadmin.back.dao;

import com.tourism.common.core.base.dao.BaseDaoMapper;
import com.tourism.webadmin.back.model.TourismProjectTravelNotesWrite;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.*;

/**
 * 发布游记数据操作访问接口。
 *
 * @author 吃饭睡觉
 * @date 2024-09-06
 */
public interface TourismProjectTravelNotesWriteMapper extends BaseDaoMapper<TourismProjectTravelNotesWrite> {

    /**
     * 批量插入对象列表。
     *
     * @param tourismProjectTravelNotesWriteList 新增对象列表。
     */
    void insertList(List<TourismProjectTravelNotesWrite> tourismProjectTravelNotesWriteList);

    /**
     * 获取过滤后的对象列表。
     *
     * @param tourismProjectTravelNotesWriteFilter 主表过滤对象。
     * @param orderBy 排序字符串，order by从句的参数。
     * @return 对象列表。
     */
    List<TourismProjectTravelNotesWrite> getTourismProjectTravelNotesWriteList(
            @Param("tourismProjectTravelNotesWriteFilter") TourismProjectTravelNotesWrite tourismProjectTravelNotesWriteFilter, @Param("orderBy") String orderBy);

    Integer auditTravelNote(@Param("tourismProjectTravelNotesWriteFilter") TourismProjectTravelNotesWrite entity);

    @Select("select id from tour_tourism_project_travel_notes_writer where create_user_id = #{userId}")
    List<Long> getTravelNoteIds(@Param("userId") Long userId);
}
