You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.aurora.mapper;
// 导入数据传输对象(DTO),用于前台数据展示
import com.aurora.model.dto.CategoryAdminDTO;
import com.aurora.model.dto.CategoryDTO;
import com.aurora.entity.Category;// 导入与数据库表对应的实体类CategoryMapper接口操作的就是这个实体类对应的数据库表
import com.aurora.model.vo.ConditionVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;// 导入MyBatis的参数注解用于给Mapper方法参数起别名
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface CategoryMapper extends BaseMapper<Category> {
// 获取所有分类列表(通常用于前台展示)
// 返回CategoryDTO列表包含分类的基本信息如分类名称、文章数量等
List<CategoryDTO> listCategories();
// 分页获取后台分类列表(管理员功能)
// @Param注解给参数起别名在XML中可以通过#{current}、#{size}、#{conditionVO.xxx}引用
// current: 当前页码size: 每页大小conditionVO: 封装查询条件(如关键词、状态等)
// 返回分页结果包含CategoryAdminDTO列表可能比前台DTO包含更多管理字段
List<CategoryAdminDTO> listCategoriesAdmin(@Param("current") Long current, @Param("size") Long size, @Param("conditionVO") ConditionVO conditionVO);
}