Files
biji/biji-houdaun/src/main/java/com/test/bijihoudaun/mapper/ImageMapper.java
ikmkj 95393ab517 refactor(database): 更新数据库配置和实体映射
- 修改数据库连接URL地址
- 为所有实体类添加@TableField注解映射数据库字段
- 使用反引号标识符包裹表名和字段名
- 更新SQL查询语句使用明确字段列表
- 在配置文件中启用MyBatis安全模式防止SQL注入
- 添加MarkdownFileVO中groupingName字段的exist = false标识
2026-01-08 19:44:22 +08:00

23 lines
781 B
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.test.bijihoudaun.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.test.bijihoudaun.entity.Image;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface ImageMapper extends BaseMapper<Image> {
// 自定义方法根据用户ID获取图片列表
// List<Image> findByUserId(Integer userId);
// 自定义方法根据Markdown文件ID获取关联图片
// List<Image> findByMarkdownId(Integer markdownId);
/**
* 获取所有图片记录
* @return 所有图片列表
*/
@Select("SELECT id, markdown_id, original_name, stored_name, `url`, `size`, content_type, created_at FROM `image`")
List<Image> findAll();
}