正在加油的(ง •̀_•́)ง 2022-04-09 14:08 采纳率: 100%
浏览 605
已结题

java使用mybatis-plus自带方法时,一直出现报错【insert插入方法】

问题遇到的现象和发生背景

使用postman测试接口,在到使用框架自带的方法insert时,插入报错

问题相关代码,请勿粘贴截图

这些事报错信息

Error updating database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order,

sub_order,
family,
sub_family,
genus,
sub_genus,
species,
sub_species,
di' at line 8

The error may exist in com/ljk/commons/mapper/InformationMapper.java (best guess)

The error may involve com.ljk.commons.mapper.InformationMapper.insert-Inline

The error occurred while setting parameters

SQL: INSERT INTO information ( name, b_name, kingdom, phylum, sub_phylum, g_class, sub_class, order, sub_order, family, sub_family, genus, sub_genus, species, sub_species, distribution_area, protection_level, binomial_nomenclature, food, life_time, breed, affect, colour, past_records, natural_enemy, life_habit, population_status, feature, growth_reproduction, pathophoresis, author_id, operating_time, valid_state ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )

运行结果及报错内容

img

我的解答思路和尝试过的方法
我想要达到的结果

可以正确的存储到数据库

  • 写回答

2条回答 默认 最新

  • 未聞花名丶 2022-04-09 20:40
    关注

    order是关键字,加反引号

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 4月18日
  • 已采纳回答 4月10日
  • 创建了问题 4月9日

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图