package com.ssj.mapper.teacher.app;

import com.ssj.bean.sys.teacher.domain.FamousSaying;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author yrf
 * @date 2020/6/30 14:26
 */
@Mapper
public interface TeacherAppMapper {

    /**
     * 查询名人名言表中最小id和最大id
     *
     * @return 最小id和最大id的map
     */
    @Select("SELECT count(*) FROM tb_famous_saying")
    int countFamousSaying();

    /**
     * 根据id查询名人名言
     *
     * @param offset 偏移量
     *
     * @return 名人名言
     */
    @Select("select famous_saying, author from tb_famous_saying limit #{offset}, 1 ")
    FamousSaying findRandomFamousSaying(@Param("offset") int offset);
}
