package com.yaoai.domain.mapper;

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

@Mapper
public interface AssemblyTaskMapper extends BaseMapper<AssemblyTask> {

    @Select("SELECT * FROM assembly_tasks WHERE episode_id=#{episodeId} AND tenant_id=#{tenantId} ORDER BY created_at DESC LIMIT 1")
    AssemblyTask findLatestByEpisode(Long episodeId, Long tenantId);
}
