1. 获取所有分区 2. 根据分区获得作品列表
增加了分区以及作品的swagger接口描述,并调整到正确的项目结构中
Change-Id: I36850cd93eeb93992cad7d342f2688dd8e50e6bc
diff --git a/src/main/resources/mapper/CategoryMybatisMapper.xml b/src/main/resources/mapper/CategoryMybatisMapper.xml
new file mode 100644
index 0000000..1a8e7e0
--- /dev/null
+++ b/src/main/resources/mapper/CategoryMybatisMapper.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 修改1:使用全限定类名 -->
+<mapper namespace="edu.bjtu.groupone.backend.mapper.CategoryMybatisMapper">
+
+ <!-- 查询所有分类 -->
+ <select id="findAll"
+ resultType="edu.bjtu.groupone.backend.domain.entity.Category">
+ SELECT * FROM categories
+ </select>
+
+ <!-- 根据父分类ID查询 -->
+ <select id="findByParentId" parameterType="Long"
+ resultType="edu.bjtu.groupone.backend.domain.entity.Category">
+ SELECT * FROM categories WHERE parent_id = #{parentId}
+ </select>
+
+</mapper>
\ No newline at end of file