1
0
This commit is contained in:
2024-03-28 04:24:35 +08:00
commit 28ae65b3d2
110 changed files with 45386 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
package xyz.fortern.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import xyz.fortern.pojo.News;
import java.util.List;
@Mapper
public interface NewsMapper extends BaseMapper<News> {
//1. 分页查询动态
/**
* 分页查询动态
*
* @param offset 偏移量
* @param rows 查询数量
*/
@Select("select * from news limit #{offset}, #{rows}")
@Results({
@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true),
@Result(column = "uid", property = "uid", jdbcType = JdbcType.INTEGER),
@Result(column = "uid", property = "simpleUser", one = @One(select = "xyz.fortern.dao.UserMapper.selectSimpleInfoById")),
@Result(column = "aid", property = "aid", jdbcType = JdbcType.INTEGER),
@Result(column = "aid", property = "SimpleArticle", one = @One(select = "xyz.fortern.dao.ArticleMapper.selectSimpleInfoById")),
@Result(column = "time", property = "time", jdbcType = JdbcType.DATE),
})
List<News> getNews(@Param("offset") int offset, @Param("rows") int rows);
}