blob: 1a8e7e032790593586f8c1bd9968a08c81e063d1 [file] [log] [blame]
晓瑞223cae85b72025-05-30 01:09:40 +08001<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
3 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
4<!-- 修改1:使用全限定类名 -->
5<mapper namespace="edu.bjtu.groupone.backend.mapper.CategoryMybatisMapper">
6
7 <!-- 查询所有分类 -->
8 <select id="findAll"
9 resultType="edu.bjtu.groupone.backend.domain.entity.Category">
10 SELECT * FROM categories
11 </select>
12
13 <!-- 根据父分类ID查询 -->
14 <select id="findByParentId" parameterType="Long"
15 resultType="edu.bjtu.groupone.backend.domain.entity.Category">
16 SELECT * FROM categories WHERE parent_id = #{parentId}
17 </select>
18
19</mapper>