This repository has been archived on 2025-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
copy-kamanote/src/main/resources/mapper/QuestionListMapper.xml
LingandRX 8150192b1b feat(model): 新增实体类和相关功能
- 新增 Category、Collection、Comment 等实体类
- 实现笔记查询、分类、收藏、评论等功能
- 添加 Markdown 解析工具类
- 新增用户点赞和收藏功能
- 实现问题查询和统计功能
2025-03-27 21:20:23 +08:00

38 lines
1.3 KiB
XML

<?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">
<mapper namespace="com.example.copykamanotes.mapper.QuestionListMapper">
<insert id="insert" useGeneratedKeys="true" keyProperty="questionListId">
INSERT INTO question_list (name, type, description)
VALUES (#{name}, #{type}, #{description})
</insert>
<update id="update">
UPDATE question_list
<set>
<if test="name != null">
name = #{name},
</if>
<if test="type != null">
type = #{type},
</if>
<if test="description != null">
description = #{description},
</if>
</set>
WHERE question_list_id = #{questionListId}
</update>
<delete id="deleteById">
DELETE FROM question_list WHERE question_list_id = #{questionListId}
</delete>
<select id="findById" resultType="com.example.copykamanotes.model.entity.QuestionList">
SELECT * FROM question_list WHERE question_list_id = #{questionListId}
</select>
<select id="findAll" resultType="com.example.copykamanotes.model.entity.QuestionList">
SELECT * FROM question_list
</select>
</mapper>