package com.erp.dataimport.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.erp.dataimport.entity.ImportTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 导入任务 Mapper
 */
@Mapper
public interface ImportTaskRepository extends BaseMapper<ImportTask> {

    @Select("SELECT * FROM import_task WHERE id = #{id} AND deleted_at IS NULL")
    ImportTask selectById(@Param("id") Long id);

    @Select("SELECT * FROM import_task WHERE id = #{id} AND tenant_id = #{tenantId} AND deleted_at IS NULL")
    ImportTask selectByIdAndTenant(@Param("id") Long id, @Param("tenantId") Long tenantId);
}
