package com.lesingle.creation.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lesingle.creation.entity.ContestAttachment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 竞赛附件 Mapper 接口
 */
@Mapper
public interface ContestAttachmentMapper extends BaseMapper<ContestAttachment> {

    /**
     * 根据竞赛 ID 查询附件列表
     *
     * @param contestId 竞赛 ID
     * @return 附件列表
     */
    @Select("SELECT * FROM t_biz_contest_attachment WHERE contest_id = #{contestId} AND deleted = 0 ORDER BY sort ASC")
    List<ContestAttachment> selectByContestId(@Param("contestId") Long contestId);
}
