refactor(database): 更新数据库配置和实体映射

- 修改数据库连接URL地址
- 为所有实体类添加@TableField注解映射数据库字段
- 使用反引号标识符包裹表名和字段名
- 更新SQL查询语句使用明确字段列表
- 在配置文件中启用MyBatis安全模式防止SQL注入
- 添加MarkdownFileVO中groupingName字段的exist = false标识
This commit is contained in:
ikmkj
2026-01-08 19:44:22 +08:00
parent 363918b3f7
commit 95393ab517
14 changed files with 93 additions and 38 deletions

View File

@@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.test.bijihoudaun.entity.Grouping;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
@@ -15,14 +13,14 @@ import java.util.List;
@Mapper
public interface GroupingMapper extends BaseMapper<Grouping> {
@Select("SELECT * FROM grouping WHERE is_deleted = 1")
@Select("SELECT id, parentId, `grouping`, is_deleted, deleted_at, deleted_by FROM `grouping` WHERE is_deleted = 1")
List<Grouping> selectDeleted();
@Delete("DELETE FROM grouping WHERE id = #{id}")
@Delete("DELETE FROM `grouping` WHERE id = #{id}")
void physicalDeleteById(@Param("id") Long id);
@Update("UPDATE grouping SET is_deleted = 0, deleted_at = NULL, deleted_by = NULL WHERE id = #{id}")
@Update("UPDATE `grouping` SET is_deleted = 0, deleted_at = NULL, deleted_by = NULL WHERE id = #{id}")
void restoreById(@Param("id") Long id);
@Delete("DELETE FROM grouping WHERE is_deleted = 1")
@Delete("DELETE FROM `grouping` WHERE is_deleted = 1")
void physicalDeleteByIsDeleted();
}
}