zhangshiyu_branch
parent
c3f0356195
commit
13dac81762
@ -0,0 +1,70 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.ArticleCategoryRef;
|
||||
import com.liuyanzhao.ssm.blog.entity.Category;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章分类关联表Mapper
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
@Mapper
|
||||
public interface ArticleCategoryRefMapper {
|
||||
|
||||
/**
|
||||
* 添加文章和分类关联记录
|
||||
* @param record 关联对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(ArticleCategoryRef record);
|
||||
|
||||
/**
|
||||
* 根据分类ID删除记录
|
||||
* @param categoryId 分类ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteByCategoryId(Integer categoryId);
|
||||
|
||||
/**
|
||||
* 根据文章ID删除记录
|
||||
* @param articleId 文章ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteByArticleId(Integer articleId);
|
||||
|
||||
/**
|
||||
* 根据分类ID统计文章数
|
||||
* @param categoryId 分类ID
|
||||
* @return 文章数量
|
||||
*/
|
||||
int countArticleByCategoryId(Integer categoryId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据文章ID查询分类ID
|
||||
*
|
||||
* @param articleId 文章ID
|
||||
* @return 分类ID列表
|
||||
*/
|
||||
List<Integer> selectCategoryIdByArticleId(Integer articleId);
|
||||
|
||||
/**
|
||||
* 根据分类ID查询文章ID
|
||||
*
|
||||
* @param categoryId 分类ID
|
||||
* @return 文章ID列表
|
||||
*/
|
||||
List<Integer> selectArticleIdByCategoryId(Integer categoryId);
|
||||
|
||||
/**
|
||||
* 根据文章ID获得分类列表
|
||||
*
|
||||
* @param articleId 文章ID
|
||||
* @return 分类列表
|
||||
*/
|
||||
List<Category> listCategoryByArticleId(Integer articleId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,223 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.Article;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章Mapper
|
||||
*
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
@Mapper
|
||||
public interface ArticleMapper {
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*
|
||||
* @param articleId 文章ID
|
||||
* @return 影响函数
|
||||
*/
|
||||
Integer deleteById(Integer articleId);
|
||||
|
||||
/**
|
||||
* 根据用户ID删除
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 影响函数
|
||||
*/
|
||||
Integer deleteByUserId(Integer userId);
|
||||
|
||||
/**
|
||||
* 添加文章
|
||||
*
|
||||
* @param article 文章
|
||||
* @return 文章
|
||||
*/
|
||||
Integer insert(Article article);
|
||||
|
||||
/**
|
||||
* 更新文章
|
||||
*
|
||||
* @param article 文章
|
||||
* @return 影响行数
|
||||
*/
|
||||
Integer update(Article article);
|
||||
|
||||
/**
|
||||
* 获得所有的文章
|
||||
*
|
||||
* @param criteria 查询条件
|
||||
* @return 文章列表
|
||||
*/
|
||||
List<Article> findAll(HashMap<String, Object> criteria);
|
||||
|
||||
/**
|
||||
* 文章归档
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Article> listAllNotWithContent();
|
||||
|
||||
/**
|
||||
* 获取文章总数
|
||||
*
|
||||
* @param status 状态
|
||||
* @return 数量
|
||||
*/
|
||||
Integer countArticle(@Param(value = "status") Integer status);
|
||||
|
||||
/**
|
||||
* 获得留言总数
|
||||
*
|
||||
* @return 数量
|
||||
*/
|
||||
Integer countArticleComment();
|
||||
|
||||
/**
|
||||
* 获得浏览量总数
|
||||
*
|
||||
* @return 文章数量
|
||||
*/
|
||||
Integer countArticleView();
|
||||
|
||||
/**
|
||||
* 获得所有文章(文章归档)
|
||||
*
|
||||
* @return 文章列表
|
||||
*/
|
||||
List<Article> listArticle();
|
||||
|
||||
/**
|
||||
* 根据id查询用户信息
|
||||
*
|
||||
* @param status 状态
|
||||
* @param id 文章ID
|
||||
* @return 文章
|
||||
*/
|
||||
Article getArticleByStatusAndId(@Param(value = "status") Integer status, @Param(value = "id") Integer id);
|
||||
|
||||
/**
|
||||
* 分页操作
|
||||
*
|
||||
* @param status 状态
|
||||
* @param pageIndex 从第几页开始
|
||||
* @param pageSize 数量
|
||||
* @return 文章列表
|
||||
*/
|
||||
@Deprecated
|
||||
List<Article> pageArticle(@Param(value = "status") Integer status,
|
||||
@Param(value = "pageIndex") Integer pageIndex,
|
||||
@Param(value = "pageSize") Integer pageSize);
|
||||
|
||||
|
||||
/**
|
||||
* 获得访问最多的文章(猜你喜欢)
|
||||
*
|
||||
* @param limit 查询数量
|
||||
* @return 文章列表
|
||||
*/
|
||||
List<Article> listArticleByViewCount(@Param(value = "limit") Integer limit);
|
||||
|
||||
/**
|
||||
* 获得上一篇文章
|
||||
*
|
||||
* @param id 文章ID
|
||||
* @return 文章
|
||||
*/
|
||||
Article getAfterArticle(@Param(value = "id") Integer id);
|
||||
|
||||
/**
|
||||
* 获得下一篇文章
|
||||
*
|
||||
* @param id 文章ID
|
||||
* @return 文章
|
||||
*/
|
||||
Article getPreArticle(@Param(value = "id") Integer id);
|
||||
|
||||
/**
|
||||
* 获得随机文章
|
||||
*
|
||||
* @param limit 查询数量
|
||||
* @return 文章列表
|
||||
*/
|
||||
List<Article> listRandomArticle(@Param(value = "limit") Integer limit);
|
||||
|
||||
/**
|
||||
* 热评文章
|
||||
*
|
||||
* @param limit 查询数量
|
||||
* @return 文章列表
|
||||
*/
|
||||
List<Article> listArticleByCommentCount(@Param(value = "limit") Integer limit);
|
||||
|
||||
|
||||
/**
|
||||
* 更新文章的评论数
|
||||
*
|
||||
* @param articleId 文章ID
|
||||
*/
|
||||
void updateCommentCount(@Param(value = "articleId") Integer articleId);
|
||||
|
||||
/**
|
||||
* 获得最后更新的记录
|
||||
*
|
||||
* @return 文章
|
||||
*/
|
||||
Article getLastUpdateArticle();
|
||||
|
||||
/**
|
||||
* 用户的文章数
|
||||
*
|
||||
* @param id 用户ID
|
||||
* @return 数量
|
||||
*/
|
||||
Integer countArticleByUser(@Param(value = "id") Integer id);
|
||||
|
||||
/**
|
||||
* 根据分类ID
|
||||
*
|
||||
* @param categoryId 分类ID
|
||||
* @param limit 查询数量
|
||||
* @return 文章列表
|
||||
*/
|
||||
List<Article> findArticleByCategoryId(@Param("categoryId") Integer categoryId,
|
||||
@Param("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* 根据分类ID
|
||||
*
|
||||
* @param categoryIds 分类ID集合
|
||||
* @param limit 查询数量
|
||||
* @return 文章列表
|
||||
*/
|
||||
List<Article> findArticleByCategoryIds(@Param("categoryIds") List<Integer> categoryIds,
|
||||
@Param("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* 获得最新文章
|
||||
*
|
||||
* @param limit 查询数量
|
||||
* @return 列表
|
||||
*/
|
||||
List<Article> listArticleByLimit(@Param("userId") Integer userId, @Param("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* 批量删除文章
|
||||
*
|
||||
* @param ids 文章Id列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
Integer deleteBatch(@Param("ids") List<Integer> ids);
|
||||
|
||||
/**
|
||||
* 获得一个用户的文章id集合
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<Integer> listArticleIdsByUserId(Integer userId);
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.ArticleTagRef;
|
||||
import com.liuyanzhao.ssm.blog.entity.Tag;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章标签关联表Mapper
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
@Mapper
|
||||
public interface ArticleTagRefMapper {
|
||||
|
||||
/**
|
||||
* 添加文章和标签关联记录
|
||||
* @param record 关联对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(ArticleTagRef record);
|
||||
|
||||
/**
|
||||
* 根据标签ID删除记录
|
||||
* @param tagId 标签ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteByTagId(Integer tagId);
|
||||
|
||||
/**
|
||||
* 根据文章ID删除记录
|
||||
* @param articleId 文章ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteByArticleId(Integer articleId);
|
||||
|
||||
/**
|
||||
* 根据标签ID统计文章数
|
||||
* @param tagId 标签ID
|
||||
* @return 文章数量
|
||||
*/
|
||||
int countArticleByTagId(Integer tagId);
|
||||
|
||||
/**
|
||||
* 根据文章获得标签列表
|
||||
*
|
||||
* @param articleId 文章ID
|
||||
* @return 标签列表
|
||||
*/
|
||||
List<Tag> listTagByArticleId(Integer articleId);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.Category;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
@Mapper
|
||||
public interface CategoryMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param category 分类
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Category category);
|
||||
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param category 分类
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Category category);
|
||||
|
||||
/**
|
||||
* 根据分类id获得分类信息
|
||||
*
|
||||
* @param id ID
|
||||
* @return 分类
|
||||
*/
|
||||
Category getCategoryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 删除分类
|
||||
*
|
||||
* @param id 文章ID
|
||||
*/
|
||||
int deleteCategory(Integer id);
|
||||
|
||||
/**
|
||||
* 查询分类总数
|
||||
*
|
||||
* @return 数量
|
||||
*/
|
||||
Integer countCategory();
|
||||
|
||||
/**
|
||||
* 获得分类列表
|
||||
*
|
||||
* @return 列表
|
||||
*/
|
||||
List<Category> listCategory();
|
||||
|
||||
/**
|
||||
* 根据父分类找子分类
|
||||
*
|
||||
* @param id 分类ID
|
||||
* @return 列表
|
||||
*/
|
||||
List<Category> findChildCategory(@Param(value = "id") Integer id);
|
||||
|
||||
/**
|
||||
* 根据标签名获取标签
|
||||
*
|
||||
* @param name 名称
|
||||
* @return 分类
|
||||
*/
|
||||
Category getCategoryByName(String name);
|
||||
}
|
||||
@ -0,0 +1,111 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.Comment;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CommentMapper {
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*
|
||||
* @param commentId 评论ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer commentId);
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param comment 评论
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Comment comment);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param commentId 评论ID
|
||||
* @return 评论
|
||||
*/
|
||||
Comment getCommentById(Integer commentId);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param comment 评论
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Comment comment);
|
||||
|
||||
/**
|
||||
* 根据文章id获取评论列表
|
||||
*
|
||||
* @param id ID
|
||||
* @return 列表
|
||||
*/
|
||||
List<Comment> listCommentByArticleId(@Param(value = "id") Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 获得评论列表
|
||||
*
|
||||
* @return 列表
|
||||
*/
|
||||
List<Comment> listComment(HashMap<String, Object> criteria);
|
||||
|
||||
|
||||
/**
|
||||
* 获得某个用户收到的评论
|
||||
*
|
||||
* @return 列表
|
||||
*/
|
||||
List<Comment> getReceiveComment(List<Integer> articleIds);
|
||||
|
||||
|
||||
/**
|
||||
* 统计评论数
|
||||
*
|
||||
* @return 数量
|
||||
*/
|
||||
Integer countComment();
|
||||
|
||||
/**
|
||||
* 获得最近评论
|
||||
*
|
||||
* @param limit 查询数量
|
||||
* @return 列表
|
||||
*/
|
||||
List<Comment> listRecentComment(@Param(value = "userId") Integer userId,
|
||||
@Param(value = "limit") Integer limit);
|
||||
|
||||
/**
|
||||
* 获得评论的子评论
|
||||
*
|
||||
* @param id 评论ID
|
||||
* @return 列表
|
||||
*/
|
||||
List<Comment> listChildComment(@Param(value = "id") Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID删除
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 影响函数
|
||||
*/
|
||||
Integer deleteByUserId(Integer userId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据文章ID删除
|
||||
*
|
||||
* @param articleId 文章ID
|
||||
* @return 影响函数
|
||||
*/
|
||||
Integer deleteByArticleId(Integer articleId);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.Link;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
@Mapper
|
||||
public interface LinkMapper {
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param linkId 链接ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer linkId);
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param link 链接
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Link link);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param linkId 链接ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
Link getLinkById(Integer linkId);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param link 链接ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Link link);
|
||||
|
||||
/**
|
||||
* 获得链接总数
|
||||
*
|
||||
* @param status 状态
|
||||
* @return 数量
|
||||
*/
|
||||
Integer countLink(@Param(value = "status") Integer status);
|
||||
|
||||
/**
|
||||
* 获得链接列表
|
||||
*
|
||||
* @param status 状态
|
||||
* @return 列表
|
||||
*/
|
||||
List<Link> listLink(@Param(value = "status") Integer status);
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.Menu;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
public interface MenuMapper {
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer menuId);
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param menu 菜单
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Menu menu);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 菜单
|
||||
*/
|
||||
Menu getMenuById(Integer menuId);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param menu 菜单
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Menu menu);
|
||||
|
||||
/**
|
||||
* 获得菜单列表
|
||||
*
|
||||
* @return 列表
|
||||
*/
|
||||
List<Menu> listMenu() ;
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.Notice;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
@Mapper
|
||||
public interface NoticeMapper {
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer noticeId);
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param notice 公告
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Notice notice);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @return 公告
|
||||
*/
|
||||
Notice getNoticeById(Integer noticeId);
|
||||
|
||||
/**
|
||||
* 获得公告列表
|
||||
*
|
||||
* @param notice 公告
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Notice notice);
|
||||
|
||||
/**
|
||||
* 获得公告列表
|
||||
*
|
||||
* @param notice 公告
|
||||
* @return 影响行数
|
||||
*/
|
||||
int updateByPrimaryKey(Notice notice);
|
||||
|
||||
/**
|
||||
* 获得公告总数
|
||||
*
|
||||
* @param status 状态
|
||||
* @return 影响行数
|
||||
*/
|
||||
Integer countNotice(@Param(value = "status") Integer status);
|
||||
|
||||
/**
|
||||
* 获得公告列表
|
||||
*
|
||||
* @param status 状态
|
||||
* @return 公告列表
|
||||
*/
|
||||
List<Notice> listNotice(@Param(value = "status") Integer status);
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.Options;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
@Mapper
|
||||
public interface OptionsMapper {
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
* @param optionId 系统设置ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer optionId);
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param options 系统设置
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Options options);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param optionId 系统设置ID
|
||||
* @return 系统设置
|
||||
*/
|
||||
Options getOptionsById(Integer optionId);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param options 系统信息
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Options options);
|
||||
|
||||
/**
|
||||
* 获得记录
|
||||
*
|
||||
* @return 系统信息
|
||||
*/
|
||||
Options getOptions();
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
@Mapper
|
||||
public interface PageMapper {
|
||||
/**
|
||||
* 根据ID删除
|
||||
*
|
||||
* @param pageId 页面ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer pageId);
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param page 页面
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Page page);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param pageId 页面ID
|
||||
* @return 页面
|
||||
*/
|
||||
Page getPageById(Integer pageId);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param page 页面
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Page page);
|
||||
|
||||
/**
|
||||
* 获得页面列表
|
||||
*
|
||||
* @param status 状态
|
||||
* @return 页面列表
|
||||
*/
|
||||
List<Page> listPage(@Param(value = "status") Integer status);
|
||||
|
||||
/**
|
||||
* 根据key获得页面
|
||||
*
|
||||
* @param status 状态
|
||||
* @param key 别名
|
||||
* @return 页面
|
||||
*/
|
||||
Page getPageByKey(@Param(value = "status") Integer status,
|
||||
@Param(value = "key") String key);
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.Tag;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
@Mapper
|
||||
public interface TagMapper {
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*
|
||||
* @param tagId 标签ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer tagId);
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param tag 标签
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Tag tag);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param tagId 标签ID
|
||||
* @return 标签
|
||||
*/
|
||||
Tag getTagById(Integer tagId);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param tag 标签
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Tag tag);
|
||||
|
||||
/**
|
||||
* 获得标签总数
|
||||
*
|
||||
* @return 数量
|
||||
*/
|
||||
Integer countTag() ;
|
||||
|
||||
/**
|
||||
* 获得标签列表
|
||||
*
|
||||
* @return 列表
|
||||
*/
|
||||
List<Tag> listTag() ;
|
||||
|
||||
|
||||
/**
|
||||
* 根据标签名获取标签
|
||||
*
|
||||
* @param name 名称
|
||||
* @return 标签
|
||||
*/
|
||||
Tag getTagByName(String name) ;
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package com.liuyanzhao.ssm.blog.mapper;
|
||||
|
||||
import com.liuyanzhao.ssm.blog.entity.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liuyanzhao
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserMapper {
|
||||
|
||||
/**
|
||||
* 根据ID删除
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer userId);
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param user 用户
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(User user);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 用户
|
||||
*/
|
||||
User getUserById(Integer userId);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param user 用户
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(User user);
|
||||
|
||||
|
||||
/**
|
||||
* 获得用户列表
|
||||
*
|
||||
* @return 用户列表
|
||||
*/
|
||||
List<User> listUser() ;
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户名或Email获得用户
|
||||
*
|
||||
* @param str 用户名或Email
|
||||
* @return 用户
|
||||
*/
|
||||
User getUserByNameOrEmail(String str) ;
|
||||
|
||||
/**
|
||||
* 根据用户名查用户
|
||||
*
|
||||
* @param name 用户名
|
||||
* @return 用户
|
||||
*/
|
||||
User getUserByName(String name) ;
|
||||
|
||||
/**
|
||||
* 根据Email查询用户
|
||||
*
|
||||
* @param email 邮箱
|
||||
* @return 用户
|
||||
*/
|
||||
User getUserByEmail(String email) ;
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue