package com.yaoai.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yaoai.domain.entity.Episode;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EpisodeMapper extends BaseMapper<Episode> {

    @Select("SELECT * FROM episodes WHERE outline_id=#{outlineId} ORDER BY episode_number ASC")
    List<Episode> findByOutline(Long outlineId);

    @Select("SELECT * FROM episodes WHERE project_id=#{projectId} AND tenant_id=#{tenantId} ORDER BY episode_number ASC")
    List<Episode> findByProject(Long projectId, Long tenantId);
}
