ArticleMapper.java 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. package com.cyksj.mapper.mini;
  2. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  3. import com.cyksj.model.entity.Article;
  4. import com.cyksj.model.views.ArticleDetailView;
  5. import org.apache.ibatis.annotations.Param;
  6. import org.apache.ibatis.annotations.Select;
  7. import org.apache.ibatis.annotations.Update;
  8. import java.util.List;
  9. /*
  10. *项目名: netflix
  11. *文件名: ArticleMapper
  12. *创建者: JavaZou
  13. *创建时间:2023/6/27 13:49
  14. */
  15. public interface ArticleMapper extends BaseMapper<Article> {
  16. ArticleDetailView getArticleDetailById(Long articleId);
  17. Article getArticleDetail(Long articleId);
  18. @Update("update article set dz_num = dz_num + #{offset} where id = #{articleId} and dz_num = #{dzNum}")
  19. Integer updateDzNum(@Param("articleId") Long articleId, @Param("dzNum") Integer dzNum, @Param("offset") Integer offset);
  20. @Update("update article set col_num = col_num + #{offset} where id = #{articleId} and col_num = #{colNum}")
  21. Integer updateColNum(@Param("articleId") Long articleId, @Param("colNum") Integer colNum, @Param("offset") Integer offset);
  22. @Select("select id from article")
  23. List<Long> selectAll();
  24. }