package com.lesingle.creation.mapper;

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

/**
 * 竞赛 Mapper 接口
 */
@Mapper
public interface ContestMapper extends BaseMapper<Contest> {

    /**
     * 根据竞赛名称查询竞赛
     *
     * @param contestName 竞赛名称
     * @return 竞赛实体
     */
    @Select("SELECT * FROM t_biz_contest WHERE contest_name = #{contestName} AND deleted = 0")
    Contest selectByContestName(@Param("contestName") String contestName);
}
